-
Notifications
You must be signed in to change notification settings - Fork 27
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
Library/MapObj: Implement ConveyerStep
#208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Fuzzy2319)
lib/al/Library/MapObj/ConveyerStep.cpp
line 56 at r1 (raw file):
__attribute__((noinline)) void ConveyerStep::setTransByCoord(f32 coord, bool isBackwards, bool isForceReset) {
Suggestion:
void ConveyerStep::setTransByCoord(f32 coord, bool isBackwards, bool isForceReset) {
lib/al/Library/MapObj/ConveyerStep.cpp
line 84 at r1 (raw file):
if ((isBackwards && newCoord < mCurrentCoord) || (!isBackwards && newCoord > mCurrentCoord) || isForceReset) resetPosition(this);
I'm not sure if the isBackwards
name is a good match for the logic here? Should it always resetPosition
when moving in the "right" direction?
Code quote:
if ((isBackwards && newCoord < mCurrentCoord) || (!isBackwards && newCoord > mCurrentCoord) ||
isForceReset)
resetPosition(this);
lib/al/Library/MapObj/ConveyerStep.h
line 18 at r1 (raw file):
void setConveyerKeyKeeper(const ConveyerKeyKeeper* conveyerKeyKeeper, f32 coord); void setTransByCoord(f32 coord, bool isBackwards); __attribute__((noinline)) void setTransByCoord(f32 coord, bool isBackwards, bool isForceReset);
Should not be necessary, because the function is large enough to not be inlined by default
Suggestion:
void setTransByCoord(f32 coord, bool isBackwards, bool isForceReset);
lib/al/Library/MapObj/ConveyerStep.h
line 29 at r1 (raw file):
const char* mActionName = nullptr; f32 mCurrentCoord = 0.0f; f32 mInitialCoord = 0.0f;
Suggestion:
f32 mMaxCoord = 0.0f;
There was a problem hiding this 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, 4 unresolved discussions (waiting on @MonsterDruide1)
lib/al/Library/MapObj/ConveyerStep.h
line 18 at r1 (raw file):
Previously, MonsterDruide1 wrote…
Should not be necessary, because the function is large enough to not be inlined by default
Done.
lib/al/Library/MapObj/ConveyerStep.cpp
line 84 at r1 (raw file):
Previously, MonsterDruide1 wrote…
I'm not sure if the
isBackwards
name is a good match for the logic here? Should it alwaysresetPosition
when moving in the "right" direction?
Yes, I've inverted the comparison. I read mMoveSpeed <= 0.0f
instead of mMoveSpeed >= 0.0f
Done.
lib/al/Library/MapObj/ConveyerStep.cpp
line 56 at r1 (raw file):
__attribute__((noinline)) void ConveyerStep::setTransByCoord(f32 coord, bool isBackwards, bool isForceReset) {
Done.
lib/al/Library/MapObj/ConveyerStep.h
line 29 at r1 (raw file):
const char* mActionName = nullptr; f32 mCurrentCoord = 0.0f; f32 mInitialCoord = 0.0f;
Done.
There was a problem hiding this 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: complete! all files reviewed, all discussions resolved (waiting on @Fuzzy2319)
This PR adds
ConveyerStep
functions.This change is