-
Notifications
You must be signed in to change notification settings - Fork 29
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
Player: Implement PlayerPowerGlove
and PlayerSword
#246
base: master
Are you sure you want to change the base?
Player: Implement PlayerPowerGlove
and PlayerSword
#246
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 2 of 6 files at r1, all commit messages.
Reviewable status: 2 of 6 files reviewed, 9 unresolved discussions (waiting on @GRAnimated)
src/Player/PlayerSword.h
line 20 at r1 (raw file):
al::HitSensor* mBodySensor = nullptr; const sead::Matrix34f* mMtx = nullptr; bool field_120 = false;
Suggestion:
al::LiveActor* mPlayer = nullptr;
al::HitSensor* mPlayerBodySensor = nullptr;
const sead::Matrix34f* mPlayerBaseMtx = nullptr;
bool mIsInvisible = false;
src/Player/PlayerPowerGlove.cpp
line 36 at r1 (raw file):
} void PlayerPowerGlove::updatePose() {
Given
https://decomp.me/scratch/NESlb
and
void WorldMapParts::updatePose() { |
... you should be able to come up with something better here.
src/Player/PlayerPowerGlove.cpp
line 53 at r1 (raw file):
void PlayerPowerGlove::control() { if (al::updateSyncHostVisible(&field_120, this, mOther, 0)) {
Suggestion:
if (al::updateSyncHostVisible(&field_120, this, mOther, false)) {
src/Player/PlayerSword.cpp
line 44 at r1 (raw file):
} void PlayerSword::updatePose() {
Same, that's probably improvable
src/Player/PlayerSword.cpp
line 61 at r1 (raw file):
void PlayerSword::control() { if (al::updateSyncHostVisible(&field_120, this, mOther, 0)) {
Suggestion:
if (al::updateSyncHostVisible(&field_120, this, mOther, false)) {
src/Player/PlayerPowerGlove.h
line 18 at r1 (raw file):
private: al::LiveActor* mOther = nullptr;
We have almost no information about it, only that the visibility of the power glove is copied from the "other one" - so I would assume that it was intended to be the player itself.
Suggestion:
al::LiveActor* mPlayer = nullptr;
src/Player/PlayerPowerGlove.h
line 19 at r1 (raw file):
private: al::LiveActor* mOther = nullptr; al::HitSensor* mBodySensor = nullptr;
Suggestion:
al::HitSensor* mPlayerBodySensor = nullptr;
src/Player/PlayerPowerGlove.h
line 20 at r1 (raw file):
al::LiveActor* mOther = nullptr; al::HitSensor* mBodySensor = nullptr; const sead::Matrix34f* mMtx = nullptr;
Suggestion:
const sead::Matrix34f* mPlayerBaseMtx = nullptr;
src/Player/PlayerPowerGlove.h
line 21 at r1 (raw file):
al::HitSensor* mBodySensor = nullptr; const sead::Matrix34f* mMtx = nullptr; bool field_120 = false;
updateSyncHostVisible
always updates it to the opposite of the return type, so it's true
when both should be invisible
Suggestion:
bool mIsInvisible = false;
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.
I also renamed weaponTypes
to sWeaponTypes
for consistency since its static
Reviewable status: 2 of 6 files reviewed, 9 unresolved discussions (waiting on @MonsterDruide1)
src/Player/PlayerPowerGlove.h
line 18 at r1 (raw file):
Previously, MonsterDruide1 wrote…
We have almost no information about it, only that the visibility of the power glove is copied from the "other one" - so I would assume that it was intended to be the player itself.
Done.
src/Player/PlayerPowerGlove.h
line 21 at r1 (raw file):
Previously, MonsterDruide1 wrote…
updateSyncHostVisible
always updates it to the opposite of the return type, so it'strue
when both should be invisible
Done.
src/Player/PlayerPowerGlove.cpp
line 36 at r1 (raw file):
Previously, MonsterDruide1 wrote…
Given
https://decomp.me/scratch/NESlb
and
void WorldMapParts::updatePose() { ... you should be able to come up with something better here.
I don't think it's actually an inlined function here. Making a local function in both PlayerPowerGlove and PlayerSword with the same name causes a linker error from a duplicate symbol. I also don't think there's enough evidence that the two matrices get multiplied together.
src/Player/PlayerSword.cpp
line 44 at r1 (raw file):
Previously, MonsterDruide1 wrote…
Same, that's probably improvable
Same answer as in PlayerPowerGlove
src/Player/PlayerSword.h
line 20 at r1 (raw file):
al::HitSensor* mBodySensor = nullptr; const sead::Matrix34f* mMtx = nullptr; bool field_120 = false;
Done.
src/Player/PlayerSword.cpp
line 61 at r1 (raw file):
void PlayerSword::control() { if (al::updateSyncHostVisible(&field_120, this, mOther, 0)) {
Done.
src/Player/PlayerPowerGlove.h
line 19 at r1 (raw file):
private: al::LiveActor* mOther = nullptr; al::HitSensor* mBodySensor = nullptr;
Done.
src/Player/PlayerPowerGlove.h
line 20 at r1 (raw file):
al::LiveActor* mOther = nullptr; al::HitSensor* mBodySensor = nullptr; const sead::Matrix34f* mMtx = nullptr;
Done.
src/Player/PlayerPowerGlove.cpp
line 53 at r1 (raw file):
void PlayerPowerGlove::control() { if (al::updateSyncHostVisible(&field_120, this, mOther, 0)) {
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.
Good catch, thanks!
Reviewed all commit messages.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @GRAnimated)
src/Player/PlayerPowerGlove.cpp
line 36 at r1 (raw file):
Previously, GRAnimated wrote…
I don't think it's actually an inlined function here. Making a local function in both PlayerPowerGlove and PlayerSword with the same name causes a linker error from a duplicate symbol. I also don't think there's enough evidence that the two matrices get multiplied together.
If that removes the "magic matrix" given here, that's a good improvement. If an inline function is not necessary, you should avoid it, do the calculations in the function itself then.
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: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @MonsterDruide1)
src/Player/PlayerPowerGlove.cpp
line 36 at r1 (raw file):
Previously, MonsterDruide1 wrote…
If that removes the "magic matrix" given here, that's a good improvement. If an inline function is not necessary, you should avoid it, do the calculations in the function itself then.
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 all commit messages.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @GRAnimated)
src/Player/PlayerPowerGlove.cpp
line 36 at r1 (raw file):
Previously, GRAnimated wrote…
Done.
No, there's still the magic matrix around here.
Requires rebase |
…d-PlayerPowerGlove
These are unused classes with very similar code. Neither of them seem particularly interesting tbh
This change is