Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Util: Implement SequentialUtil #301

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

Naii-the-Baf
Copy link
Contributor

@Naii-the-Baf Naii-the-Baf commented Jan 23, 2025

Most likely utility functions for koopa freerunning and timers.


This change is Reviewable

@Naii-the-Baf Naii-the-Baf force-pushed the SequentialUtil branch 2 times, most recently from 2c3f9c2 to 700c411 Compare January 23, 2025 23:32
Copy link
Owner

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Naii-the-Baf)


src/Util/SequentialUtil.h line 4 at r1 (raw file):

#include <basis/seadTypes.h>
#include <math/seadVector.h>

Useless include


src/Util/SequentialUtil.cpp line 7 at r1 (raw file):

void rs::convertCsecTo(s32* minutes, s32* seconds, s32* csec, s32 time) {
    *minutes = time / 6000;
    *seconds = (time - (time / 6000) * 6000) / 100;

Suggestion:

*seconds = (time % 6000) / 100;

src/Util/SequentialUtil.cpp line 20 at r1 (raw file):

s32 RaceTimeFunction::clampRaceRecordCsec(s32 csec) {
    return sead::Mathi::clamp(csec, 0, 359999);

Avoid magic numbers that are already defined once

Suggestion:

return sead::Mathi::clamp(csec, 0, getRaceTimeMaxCsec());

Copy link
Owner

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Naii-the-Baf)


src/Util/SequentialUtil.cpp line 7 at r1 (raw file):

void rs::convertCsecTo(s32* minutes, s32* seconds, s32* csec, s32 time) {
    *minutes = time / 6000;
    *seconds = (time - (time / 6000) * 6000) / 100;

Nevermind, saw the decomp.me on that now - rather keep the match.

Copy link
Contributor Author

@Naii-the-Baf Naii-the-Baf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @MonsterDruide1)


src/Util/SequentialUtil.h line 4 at r1 (raw file):

Previously, MonsterDruide1 wrote…

Useless include

Done.


src/Util/SequentialUtil.cpp line 20 at r1 (raw file):

Previously, MonsterDruide1 wrote…

Avoid magic numbers that are already defined once

Done.

Copy link
Owner

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Naii-the-Baf)


-- commits line 0 at r2:
Requires rebase.

Copy link
Contributor Author

@Naii-the-Baf Naii-the-Baf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @MonsterDruide1)


-- commits line at r2:

Previously, MonsterDruide1 wrote…

Requires rebase.

Done.

Copy link
Owner

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Naii-the-Baf)

@MonsterDruide1 MonsterDruide1 merged commit 4dab118 into MonsterDruide1:master Jan 29, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants