Match Kabokuri - #1982
Conversation
Report for RMGK01 (7dfccae - b3db674)📈 Matched code: 66.29% (+0.09%, +5068 bytes) ✅ 54 new matches
...and 24 more new matches 📈 6 improvements in unmatched items
|
| TVec3f* gravity = &mGravity; | ||
| mFrontVec.scaleAdd(-gravity->dot(mFrontVec), *gravity, mFrontVec); |
There was a problem hiding this comment.
This pattern should be mFrontVec.orthogonalize(mGravity); ignore if not matching.
| MR::initDefaultPos(this, rIter); | ||
| initRailRider(rIter); | ||
| MR::moveCoordAndTransToNearestRailPos(this); | ||
| MR::makeQuatAndFrontFromRotate(&_9C, &mFrontVec, this); |
There was a problem hiding this comment.
_9C can be named mRotationQuat or similar
| mKuribo->makeActorDead(); | ||
|
|
||
| // "Broken model" | ||
| _90 = MR::createModelObjMapObjStrongLight("壊れモデル", "KabokuriBreak", getBaseMtx()); |
There was a problem hiding this comment.
_90 can be named mBreakModel
| TVec3f* upVec; | ||
| if (MR::isBindedGround(this)) { | ||
| upVec = const_cast< TVec3f* >(MR::getGroundNormal(this)); | ||
| } else { | ||
| TVec3f v2 = -mGravity; | ||
| upVec = &v2; | ||
| } | ||
|
|
||
| MR::blendQuatUpFront(&_9C, *upVec, mFrontVec, ::sUpVecBlendRate, ::sFrontVecBlendRate); |
There was a problem hiding this comment.
Can this logic be rewritten with an inline ternary? instead of *upVec, MR::isBindedGround(this) ? MR::getGroundNormal(this) : -mGravity
| /* 0xAC */ TVec3f mFrontVec; | ||
| /* 0xB8 */ u32 _B8; | ||
| /* 0xBC */ bool mIsFloating; | ||
| /* 0xBD */ u8 _BD; |
There was a problem hiding this comment.
This is a bool, and can be named mIsAttachedToRail or something similar. Make sure to update assignments to use boolean values
| #include "Game/Util/RailUtil.hpp" | ||
| #include "Game/Util/SoundUtil.hpp" | ||
| #include "Game/Util/StarPointerUtil.hpp" | ||
| #include "revolution/types.h" |
|
|
||
| Kabokuri::Kabokuri(const char* pName) | ||
| : LiveActor(pName), mKuribo(nullptr), _90(nullptr), mAnimeScale(nullptr), _98(nullptr), _9C(0.0f, 0.0f, 0.0f, 1.0f), mFrontVec(0.0f, 0.0f, 1.0f), | ||
| _B8(-1), _BD(0) { |
There was a problem hiding this comment.
Default value arguments can be left blank (in this case _BD())
There was a problem hiding this comment.
Is this necessary, considering _BD (now mWillGenerateFire) is a bool (initialized to false)? Isn't being explicit better in ctors?
There was a problem hiding this comment.
Think of it like invoking the default constructor for a class or struct. It's the same notation.
| mAnimeScale = new AnimScaleController(nullptr); | ||
| mAnimeScale->setParamTight(); | ||
|
|
||
| _98 = new WalkerStateBindStarPointer(this, mAnimeScale); |
There was a problem hiding this comment.
_98 can be renamed to mStateBindStartPointer for consistency with other Kuribo files
| /* 0x98 */ WalkerStateBindStarPointer* mStateBindStartPointer; | ||
| /* 0x9C */ TQuat4f mRotationQuat; | ||
| /* 0xAC */ TVec3f mFrontVec; | ||
| /* 0xB8 */ u32 _B8; |
There was a problem hiding this comment.
Type should be s32 considering ctor default is -1
|
Requested changes should be addressed. |
| class Kabokuri : public LiveActor { | ||
| public: | ||
| Kabokuri(const char*); | ||
| virtual ~Kabokuri(); |
There was a problem hiding this comment.
You can probably remove the declaration and definition of the destructor in favor of the compiler-generated destructor, assuming the new order of the function matches the target object file.
| return; | ||
| } | ||
|
|
||
| makeActorAppeared(); |
There was a problem hiding this comment.
It's fine to just use an else if statement here.
| MR::reboundVelocityFromCollision(this, 0.0f, 0.0f, 1.0f); | ||
| } | ||
|
|
||
| void Kabokuri::addVelocityToRailPoint(f32 vel) { |
There was a problem hiding this comment.
It might be clearer to name the parameter speed, since speed is a scalar, but velocity is a vector. The function uses speed to add to velocity.
|
|
||
| Kabokuri::Kabokuri(const char* pName) | ||
| : LiveActor(pName), mKuribo(nullptr), _90(nullptr), mAnimeScale(nullptr), _98(nullptr), _9C(0.0f, 0.0f, 0.0f, 1.0f), mFrontVec(0.0f, 0.0f, 1.0f), | ||
| _B8(-1), _BD(0) { |
There was a problem hiding this comment.
Think of it like invoking the default constructor for a class or struct. It's the same notation.
| /* 0xBC */ bool mIsFloating; | ||
|
|
||
| /// @brief Generates fire on every point of the rail reached, except the first one. | ||
| /* 0xBD */ bool mWillGenerateFire; |
There was a problem hiding this comment.
mIsValidDropFire might be more in line with developer verbiage.
|
Requested changes should be addressed. |
ThatNintendoNerd
left a comment
There was a problem hiding this comment.
Very minor oversights from my initial pass. After correcting these two things, should be ready to merge.
| static const f32 sNormalFreq = 0.9f; | ||
| static const f32 sNormalGravity = 0.2f; | ||
| static const f32 sRailCoordStepInterval = 50.0f; | ||
| static const u32 sWaitTime = 60; |
| class AnimScaleController; | ||
| class WalkerStateBindStarPointer; | ||
| class Kuribo; | ||
| class ModelObj; |
There was a problem hiding this comment.
Organize alphabetically.
|
Should be good to go! |
Draft PR to indicate I'm working on it. Currently matched but has a data swap.
PR includes incompatible changes inpf_entry, I assume it's due to an unfortunate pull during GitHub's outage today? I wouldn't know how to fix it.Conflict has been resolved.