diff --git a/lib/al/include/Library/Camera/CameraDirector.h b/lib/al/include/Library/Camera/CameraDirector.h index 1bb2cfe0..b0ad6404 100644 --- a/lib/al/include/Library/Camera/CameraDirector.h +++ b/lib/al/include/Library/Camera/CameraDirector.h @@ -98,8 +98,8 @@ private: CameraParamTransfer* mParamTransfer; const CameraResourceHolder* mCameraResourceHolder; CameraFlagCtrl* mFlagCtrl; - void* customThing; + void* unk; CameraInSwitchOnAreaDirector* mInSwitchOnAreaDirector; - void* anotherCustomThing; + void* unk2; }; } // namespace al diff --git a/lib/al/include/Library/Camera/SnapShotCameraCtrl.h b/lib/al/include/Library/Camera/SnapShotCameraCtrl.h index a48243c4..604339e6 100644 --- a/lib/al/include/Library/Camera/SnapShotCameraCtrl.h +++ b/lib/al/include/Library/Camera/SnapShotCameraCtrl.h @@ -7,8 +7,8 @@ #include "Library/Yaml/ByamlIter.h" struct CameraParam { - bool gotMin; - bool gotMax; + bool mHasMin; + bool mHasMax; f32 mMinFovyDegree; f32 mMaxFovyDegree; }; @@ -37,16 +37,16 @@ private: CameraParam* mParam; bool mIsValidLookAtOffset; sead::Vector3f mLookAtOffset; - sead::Vector3f vVar1; + sead::Vector3f unk1; bool mIsValidZoomFovy; f32 mFovyDegree; - f32 fVar2; - f32 fVar3; + f32 unk2; + f32 unk3; f32 mMaxZoomOutFovyDegree; bool mIsValidRoll; f32 mRollDegree; f32 mRollTarget; - u32 uVar2; - bool bVar1; + u32 unk4; + bool unk5; }; } // namespace al diff --git a/lib/al/include/Library/LiveActor/ActorPoseKeeper.h b/lib/al/include/Library/LiveActor/ActorPoseKeeper.h index 6a1c7fed..31213ed6 100644 --- a/lib/al/include/Library/LiveActor/ActorPoseKeeper.h +++ b/lib/al/include/Library/LiveActor/ActorPoseKeeper.h @@ -34,7 +34,7 @@ public: virtual void calcBaseMtx(sead::Matrix34f* mtx) const = 0; protected: // protected so it's visible to all sub-classes (TFSV, TFGSV, ...) - sead::Vector3f mTrans{0, 0, 0}; + sead::Vector3f mTrans = {0, 0, 0}; static sead::Vector3f sDefaultVelocity; }; @@ -57,8 +57,8 @@ public: protected: // protected so it's visible to all sub-classes (TFGSV, TFUSV) sead::Vector3f mFront = sead::Vector3f::ez; - sead::Vector3f mScale{1.0, 1.0, 1.0}; - sead::Vector3f mVelocity{0.0, 0.0, 0.0}; + sead::Vector3f mScale = {1.0, 1.0, 1.0}; + sead::Vector3f mVelocity = {0.0, 0.0, 0.0}; }; class ActorPoseKeeperTFGSV : public ActorPoseKeeperTFSV { @@ -74,7 +74,7 @@ public: void calcBaseMtx(sead::Matrix34f* mtx) const override; private: - sead::Vector3f mGravity{0.0, -1.0, 0.0}; + sead::Vector3f mGravity = {0.0, -1.0, 0.0}; }; class ActorPoseKeeperTFUSV : public ActorPoseKeeperTFSV { @@ -112,8 +112,8 @@ public: private: sead::Quatf mQuat = sead::Quatf::unit; - sead::Vector3f mScale{1.0, 1.0, 1.0}; - sead::Vector3f mVelocity{0.0, 0.0, 0.0}; + sead::Vector3f mScale = {1.0, 1.0, 1.0}; + sead::Vector3f mVelocity = {0.0, 0.0, 0.0}; }; class ActorPoseKeeperTQGSV : public ActorPoseKeeperBase { @@ -136,9 +136,9 @@ public: private: sead::Quatf mQuat = sead::Quatf::unit; - sead::Vector3f mGravity{0.0, -1.0, 0.0}; - sead::Vector3f mScale{1.0, 1.0, 1.0}; - sead::Vector3f mVelocity{0.0, 0.0, 0.0}; + sead::Vector3f mGravity = {0.0, -1.0, 0.0}; + sead::Vector3f mScale = {1.0, 1.0, 1.0}; + sead::Vector3f mVelocity = {0.0, 0.0, 0.0}; }; class ActorPoseKeeperTQGMSV : public ActorPoseKeeperBase { @@ -163,9 +163,9 @@ public: private: sead::Quatf mQuat = sead::Quatf::unit; - sead::Vector3f mGravity{0.0, -1.0, 0.0}; - sead::Vector3f mScale{1.0, 1.0, 1.0}; - sead::Vector3f mVelocity{0.0, 0.0, 0.0}; + sead::Vector3f mGravity = {0.0, -1.0, 0.0}; + sead::Vector3f mScale = {1.0, 1.0, 1.0}; + sead::Vector3f mVelocity = {0.0, 0.0, 0.0}; sead::Matrix34f mMtx = sead::Matrix34f::ident; }; @@ -186,9 +186,9 @@ public: void calcBaseMtx(sead::Matrix34f* mtx) const override; private: - sead::Vector3f mRotate{0.0, 0.0, 0.0}; - sead::Vector3f mScale{1.0, 1.0, 1.0}; - sead::Vector3f mVelocity{0.0, 0.0, 0.0}; + sead::Vector3f mRotate = {0.0, 0.0, 0.0}; + sead::Vector3f mScale = {1.0, 1.0, 1.0}; + sead::Vector3f mVelocity = {0.0, 0.0, 0.0}; }; class ActorPoseKeeperTRMSV : public ActorPoseKeeperBase { @@ -210,9 +210,9 @@ public: void calcBaseMtx(sead::Matrix34f* mtx) const override; private: - sead::Vector3f mRotate{0.0, 0.0, 0.0}; - sead::Vector3f mScale{1.0, 1.0, 1.0}; - sead::Vector3f mVelocity{0.0, 0.0, 0.0}; + sead::Vector3f mRotate = {0.0, 0.0, 0.0}; + sead::Vector3f mScale = {1.0, 1.0, 1.0}; + sead::Vector3f mVelocity = {0.0, 0.0, 0.0}; sead::Matrix34f mMtx; // manually set in the ctor }; @@ -237,10 +237,10 @@ public: void calcBaseMtx(sead::Matrix34f* mtx) const override; private: - sead::Vector3f mRotate{0.0, 0.0, 0.0}; - sead::Vector3f mGravity{0.0, -1.0, 0.0}; - sead::Vector3f mScale{1.0, 1.0, 1.0}; - sead::Vector3f mVelocity{0.0, 0.0, 0.0}; + sead::Vector3f mRotate = {0.0, 0.0, 0.0}; + sead::Vector3f mGravity = {0.0, -1.0, 0.0}; + sead::Vector3f mScale = {1.0, 1.0, 1.0}; + sead::Vector3f mVelocity = {0.0, 0.0, 0.0}; sead::Matrix34f mMtx; }; diff --git a/lib/al/include/Library/Play/Camera/CameraVerticalAbsorber.h b/lib/al/include/Library/Play/Camera/CameraVerticalAbsorber.h index e4c7acb0..c4dd50e1 100644 --- a/lib/al/include/Library/Play/Camera/CameraVerticalAbsorber.h +++ b/lib/al/include/Library/Play/Camera/CameraVerticalAbsorber.h @@ -44,7 +44,7 @@ private: f32 mAbsorbScreenPosDown; bool mAdvanceAbsorbUp; f32 mAdvanceAbsorbScreenPosUp; - bool isExistCollisionUnderTarget; + bool mIsExistCollisionUnderTarget; sead::Vector3f mUnderTargetCollisionPos; sead::Vector3f mUnderTargetCollisionNormal; f32 mLerp2; @@ -54,11 +54,11 @@ private: sead::Vector3f mPrevTargetTrans; sead::Vector3f mTargetFront; sead::Vector3f mPrevTargetFront; - bool isNoCameraPosAbsorb; - bool isInvalidated; - bool unusedBool; - bool isStopUpdate; - bool isKeepInFrame; + bool mIsNoCameraPosAbsorb; + bool mIsInvalidated; + bool mUnusedBool; + bool mIsStopUpdate; + bool mIsKeepInFrame; }; static_assert(sizeof(CameraVerticalAbsorber) == 0x1B0); diff --git a/lib/al/include/Library/Rail/Rail.h b/lib/al/include/Library/Rail/Rail.h index 046b358a..4ee392c5 100644 --- a/lib/al/include/Library/Rail/Rail.h +++ b/lib/al/include/Library/Rail/Rail.h @@ -39,7 +39,7 @@ private: RailPart* mRailPart = nullptr; s32 mRailPartCount = 0; s32 mRailPointsCount = 0; - bool isClosed = false; + bool mIsClosed = false; }; } // namespace al diff --git a/lib/al/include/Library/Shadow/DepthShadowMapCtrl.h b/lib/al/include/Library/Shadow/DepthShadowMapCtrl.h index 7cfaae9b..d4ba99a3 100644 --- a/lib/al/include/Library/Shadow/DepthShadowMapCtrl.h +++ b/lib/al/include/Library/Shadow/DepthShadowMapCtrl.h @@ -37,7 +37,7 @@ public: private: LiveActor* mLiveActor; - sead::Vector3f lightDir; + sead::Vector3f mLightDir; bool mIsAppendSubActor; sead::PtrArray mDepthShadowMaps; sead::PtrArray mModelDrawerDepthShadowMaps; diff --git a/lib/al/include/Library/Yaml/ByamlData.h b/lib/al/include/Library/Yaml/ByamlData.h index 165ed1f1..4b78f83a 100755 --- a/lib/al/include/Library/Yaml/ByamlData.h +++ b/lib/al/include/Library/Yaml/ByamlData.h @@ -68,7 +68,7 @@ public: private: const u8* mData; - bool isRev; + bool mIsRev; }; class ByamlArrayIter { @@ -84,6 +84,6 @@ public: private: const u8* mData; - bool isRev; + bool mIsRev; }; } // namespace al diff --git a/lib/al/include/Library/Yaml/ByamlHeader.h b/lib/al/include/Library/Yaml/ByamlHeader.h index 78078117..12bdc0a3 100755 --- a/lib/al/include/Library/Yaml/ByamlHeader.h +++ b/lib/al/include/Library/Yaml/ByamlHeader.h @@ -40,7 +40,7 @@ public: private: const u8* mData = nullptr; - bool isRev = false; + bool mIsRev = false; }; } // namespace al diff --git a/lib/al/include/Library/Yaml/Writer/ByamlWriterData.h b/lib/al/include/Library/Yaml/Writer/ByamlWriterData.h index d25085bb..305ecf40 100644 --- a/lib/al/include/Library/Yaml/Writer/ByamlWriterData.h +++ b/lib/al/include/Library/Yaml/Writer/ByamlWriterData.h @@ -224,8 +224,8 @@ public: ByamlWriterData* getValue() { return mValue; } private: - void* selfReference = this; - void* test2 = nullptr; + void* mSelfReference = this; + void* unk = nullptr; const char* mKey; ByamlWriterData* mValue; }; diff --git a/lib/al/include/Project/Item/ActorScoreKeeper.h b/lib/al/include/Project/Item/ActorScoreKeeper.h index b54d7aa6..12a6d3fe 100644 --- a/lib/al/include/Project/Item/ActorScoreKeeper.h +++ b/lib/al/include/Project/Item/ActorScoreKeeper.h @@ -22,7 +22,7 @@ private: inline void allocArray(); inline void putEntry(s32 index, const ByamlIter& iter); - Entry* array; - s32 size; + Entry* mArray; + s32 mSize; }; } // namespace al diff --git a/lib/al/src/Library/Camera/SnapShotCameraCtrl.cpp b/lib/al/src/Library/Camera/SnapShotCameraCtrl.cpp index 81005417..028581ec 100644 --- a/lib/al/src/Library/Camera/SnapShotCameraCtrl.cpp +++ b/lib/al/src/Library/Camera/SnapShotCameraCtrl.cpp @@ -10,9 +10,9 @@ void SnapShotCameraCtrl::load(ByamlIter const& iter) { if (!tryGetByamlIterByKey(¶m, iter, "SnapShotParam")) return; if (tryGetByamlF32(&mParam->mMinFovyDegree, param, "MinFovyDegree")) - mParam->gotMin = true; + mParam->mHasMin = true; if (tryGetByamlF32(&mParam->mMinFovyDegree, param, "MinFovyDegree")) - mParam->gotMax = true; + mParam->mHasMax = true; } } // namespace al diff --git a/lib/al/src/Library/Play/Camera/CameraVerticalAbsorber.cpp b/lib/al/src/Library/Play/Camera/CameraVerticalAbsorber.cpp index 84b83f29..3a9a3959 100644 --- a/lib/al/src/Library/Play/Camera/CameraVerticalAbsorber.cpp +++ b/lib/al/src/Library/Play/Camera/CameraVerticalAbsorber.cpp @@ -38,7 +38,7 @@ void CameraVerticalAbsorber::exeFollowAbsolute() { } void CameraVerticalAbsorber::invalidate() { - isInvalidated = true; + mIsInvalidated = true; if (!isNerve(this, &NrvCameraVerticalAbsorber.FollowAbsolute)) setNerve(this, &NrvCameraVerticalAbsorber.FollowAbsolute); } @@ -53,7 +53,7 @@ void CameraVerticalAbsorber::start(const sead::Vector3f& pos, const CameraStartI mPrevTargetTrans = pos; - if (unusedBool || isInvalidated || + if (mUnusedBool || mIsInvalidated || alCameraPoserFunction::isPlayerTypeNotTouchGround(mCameraPoser)) return setNerve(this, &NrvCameraVerticalAbsorber.FollowAbsolute); if (alCameraPoserFunction::isTargetClimbPole(mCameraPoser)) @@ -91,7 +91,7 @@ void CameraVerticalAbsorber::load(const ByamlIter& data) { // NON_MATCHING void CameraVerticalAbsorber::update() { - if (isStopUpdate) + if (mIsStopUpdate) return; sead::Vector3f gravity{}; alCameraPoserFunction::calcTargetGravity(&gravity, mCameraPoser); @@ -102,9 +102,9 @@ void CameraVerticalAbsorber::update() { mLookAtCamera.getUp() = mCameraPoser->getCameraUp(); if (mLookAtCamera.getUp().length() > 0.f) mLookAtCamera.getUp().normalize(); - if (!unusedBool && !isInvalidated) { + if (!mUnusedBool && !mIsInvalidated) { mLookAtCamera.getAt() -= mTargetInterp; - if (!isNoCameraPosAbsorb) { + if (!mIsNoCameraPosAbsorb) { mLookAtCamera.getPos() -= mTargetInterp; } } @@ -124,7 +124,7 @@ void CameraVerticalAbsorber::update() { } updateNerve(); sead::Vector3f prevTargetTrans = sead::Vector3f::zero; - if (!isKeepInFrame) { + if (!mIsKeepInFrame) { prevTargetTrans = mTargetInterp; } else { sead::Vector3f offsetTrans = sead::Vector3f::zero; diff --git a/lib/al/src/Library/Rail/Rail.cpp b/lib/al/src/Library/Rail/Rail.cpp index 4ecd0f68..94b75074 100644 --- a/lib/al/src/Library/Rail/Rail.cpp +++ b/lib/al/src/Library/Rail/Rail.cpp @@ -10,8 +10,8 @@ namespace al { Rail::Rail() = default; // NON_MATCHING: mismatch during `mRailPart`-array creation void Rail::init(const PlacementInfo& info) { - isClosed = false; - tryGetArg(&isClosed, info, "IsClosed"); + mIsClosed = false; + tryGetArg(&mIsClosed, info, "IsClosed"); PlacementInfo railPointsInfo; tryGetPlacementInfoByKey(&railPointsInfo, info, "RailPoints"); mRailPointsCount = getCountPlacementInfo(railPointsInfo); @@ -35,7 +35,7 @@ void Rail::init(const PlacementInfo& info) { return; } - mRailPartCount = (isClosed ? 1 : 0) + mRailPointsCount - 1; + mRailPartCount = (mIsClosed ? 1 : 0) + mRailPointsCount - 1; mRailPart = new RailPart[mRailPartCount]; f32 totalLength = 0; @@ -116,7 +116,7 @@ f32 Rail::getLengthToPoint(s32 index) const { return mRailPart[index - 1].getTotalDistance(); } void Rail::calcRailPointPos(sead::Vector3f* pos, s32 index) const { - if (isClosed || index != mRailPointsCount - 1) + if (mIsClosed || index != mRailPointsCount - 1) return mRailPart[index].calcStartPos(pos); return mRailPart[index - 1].calcEndPos(pos); @@ -178,7 +178,7 @@ void Rail::calcNearestRailPointPos(sead::Vector3f* rail_pos, const sead::Vector3 } } f32 Rail::normalizeLength(f32 distance) const { - if (isClosed) { + if (mIsClosed) { f32 distanceOnRail = modf(distance, getTotalLength()); if (distanceOnRail < 0.0) distanceOnRail += getTotalLength(); diff --git a/lib/al/src/Library/Yaml/ByamlData.cpp b/lib/al/src/Library/Yaml/ByamlData.cpp index 1b6c77ad..c6703245 100755 --- a/lib/al/src/Library/Yaml/ByamlData.cpp +++ b/lib/al/src/Library/Yaml/ByamlData.cpp @@ -36,8 +36,8 @@ s32 ByamlHashPair::getValue(bool isRev) const { return isRev ? bswap_32(mValue) : mValue; } -ByamlHashIter::ByamlHashIter(const u8* data, bool isRev_) : mData(data), isRev(isRev_) {} -ByamlHashIter::ByamlHashIter() : mData(nullptr), isRev(false) {} +ByamlHashIter::ByamlHashIter(const u8* data, bool isRev_) : mData(data), mIsRev(isRev_) {} +ByamlHashIter::ByamlHashIter() : mData(nullptr), mIsRev(false) {} const ByamlHashPair* ByamlHashIter::findPair(s32 key) const { const ByamlHashPair* pairTable = getPairTable(); @@ -50,7 +50,7 @@ const ByamlHashPair* ByamlHashIter::findPair(s32 key) const { while (lowerBound < upperBound) { s32 avg = (lowerBound + upperBound) / 2; const ByamlHashPair* pair = &pairTable[avg]; - s32 result = key - pair->getKey(isRev); + s32 result = key - pair->getKey(mIsRev); if (result == 0) { return pair; } @@ -68,7 +68,7 @@ bool ByamlHashIter::getDataByIndex(ByamlData* data, s32 index) const { if (((s32)getSize()) < 1) return false; - data->set(&getPairTable()[index], isRev); + data->set(&getPairTable()[index], mIsRev); return true; } // NON_MATCHING: minor additional instructions, probably not inlined @@ -91,7 +91,7 @@ bool ByamlHashIter::getDataByKey(ByamlData* data, s32 key) const { while (true) { s32 avg = (lowerBound + upperBound) / 2; pair = &pairTable[avg]; - s32 result = key - pair->getKey(isRev); + s32 result = key - pair->getKey(mIsRev); if (result == 0) { break; } @@ -105,7 +105,7 @@ bool ByamlHashIter::getDataByKey(ByamlData* data, s32 key) const { } if (pair == nullptr) return false; - data->set(pair, isRev); + data->set(pair, mIsRev); return true; } const u8* ByamlHashIter::getOffsetData(u32 off) const { @@ -128,11 +128,11 @@ u32 ByamlHashIter::getSize() const { if (!mData) return 0; u32 val = *reinterpret_cast(mData); - return isRev ? bswap_24(val >> 8) : val >> 8; + return mIsRev ? bswap_24(val >> 8) : val >> 8; } -ByamlArrayIter::ByamlArrayIter(const u8* data, bool isRev_) : mData(data), isRev(isRev_) {} -ByamlArrayIter::ByamlArrayIter() : mData(nullptr), isRev(false) {} +ByamlArrayIter::ByamlArrayIter(const u8* data, bool isRev_) : mData(data), mIsRev(isRev_) {} +ByamlArrayIter::ByamlArrayIter() : mData(nullptr), mIsRev(false) {} bool ByamlArrayIter::getDataByIndex(ByamlData* data, s32 index) const { if (index < 0) @@ -140,7 +140,7 @@ bool ByamlArrayIter::getDataByIndex(ByamlData* data, s32 index) const { if (((s32)getSize()) <= index) return false; - data->set(getTypeTable()[index], getDataTable()[index], isRev); + data->set(getTypeTable()[index], getDataTable()[index], mIsRev); return true; } // NON_MATCHING: regalloc @@ -152,7 +152,7 @@ const u8* ByamlArrayIter::getOffsetData(u32 off) const { } u32 ByamlArrayIter::getSize() const { u32 val = *reinterpret_cast(mData); - return isRev ? bswap_24(val >> 8) : val >> 8; + return mIsRev ? bswap_24(val >> 8) : val >> 8; } const u8* ByamlArrayIter::getTypeTable() const { return mData + 4; diff --git a/lib/al/src/Library/Yaml/ByamlHeader.cpp b/lib/al/src/Library/Yaml/ByamlHeader.cpp index 3ab2123b..ff80751f 100755 --- a/lib/al/src/Library/Yaml/ByamlHeader.cpp +++ b/lib/al/src/Library/Yaml/ByamlHeader.cpp @@ -38,11 +38,11 @@ u32 ByamlHeader::getDataOffset() const { ByamlStringTableIter::ByamlStringTableIter() = default; ByamlStringTableIter::ByamlStringTableIter(const u8* data, bool isRev) - : mData(data), isRev(isRev) {} + : mData(data), mIsRev(isRev) {} s32 ByamlStringTableIter::getSize() const { u32 type_and_size = *reinterpret_cast(mData); - return isRev ? bswap_24(type_and_size >> 8) : type_and_size >> 8; + return mIsRev ? bswap_24(type_and_size >> 8) : type_and_size >> 8; } const u32* ByamlStringTableIter::getAddressTable() const { @@ -52,7 +52,7 @@ const u32* ByamlStringTableIter::getAddressTable() const { } u32 ByamlStringTableIter::getStringAddress(s32 idx) const { - if (isRev) + if (mIsRev) return bswap_32(getAddressTable()[idx]); return getAddressTable()[idx]; @@ -61,7 +61,7 @@ u32 ByamlStringTableIter::getStringAddress(s32 idx) const { // NON_MATCHING: regalloc u32 ByamlStringTableIter::getEndAddress() const { u32 val = getAddressTable()[getSize()]; - return isRev ? bswap_32(val) : val; + return mIsRev ? bswap_32(val) : val; } const char* ByamlStringTableIter::getString(s32 index) const { return reinterpret_cast(&mData[getStringAddress(index)]); diff --git a/lib/al/src/Project/Item/ActorScoreKeeper.cpp b/lib/al/src/Project/Item/ActorScoreKeeper.cpp index d285d702..3841cab1 100644 --- a/lib/al/src/Project/Item/ActorScoreKeeper.cpp +++ b/lib/al/src/Project/Item/ActorScoreKeeper.cpp @@ -7,29 +7,29 @@ ActorScoreKeeper::ActorScoreKeeper() = default; void ActorScoreKeeper::init(const ByamlIter& iter) { if (iter.isTypeArray()) { - size = iter.getSize(); + mSize = iter.getSize(); allocArray(); - for (s32 i = 0; i < size; i++) { + for (s32 i = 0; i < mSize; i++) { ByamlIter subIter; iter.tryGetIterByIndex(&subIter, i); putEntry(i, subIter); } } else { - size = 1; + mSize = 1; allocArray(); putEntry(0, iter); } } inline void ActorScoreKeeper::allocArray() { - Entry* local_array = new Entry[size]; - if (size) - memset(local_array, 0, sizeof(Entry) * size); - array = local_array; + Entry* local_array = new Entry[mSize]; + if (mSize) + memset(local_array, 0, sizeof(Entry) * mSize); + mArray = local_array; } inline void ActorScoreKeeper::putEntry(s32 index, const ByamlIter& iter) { - auto& entry = array[index]; + auto& entry = mArray[index]; iter.tryGetStringByKey(&entry.factorName, "FactorName"); iter.tryGetStringByKey(&entry.categoryName, "CategoryName"); } diff --git a/src/Npc/AchievementInfoReader.cpp b/src/Npc/AchievementInfoReader.cpp index 85522592..e75d4b89 100644 --- a/src/Npc/AchievementInfoReader.cpp +++ b/src/Npc/AchievementInfoReader.cpp @@ -18,7 +18,7 @@ void AchievementInfoReader::init() { // TODO minor mismatches during loop al::ByamlIter achievementInfoArray; if (achievementInfo.tryGetIterByKey(&achievementInfoArray, "AchievementInfoArray")) { auto size = achievementInfoArray.getSize(); - array.allocBuffer(size, nullptr); + mAchievements.allocBuffer(size, nullptr); for (u32 i = 0; i < size; i++) { al::ByamlIter iter; @@ -32,15 +32,15 @@ void AchievementInfoReader::init() { // TODO minor mismatches during loop s32 level = -1; iter.tryGetIntByKey(&level, "Level"); - array.pushBack(new AchievementInfo(name, num, level, note)); + mAchievements.pushBack(new AchievementInfo(name, num, level, note)); } } } } s32 AchievementInfoReader::tryFindIndexByName(const char* name) const { - for (s32 i = 0; i < array.size(); i++) { - if (al::isEqualString(name, array[i]->mName)) + for (s32 i = 0; i < mAchievements.size(); i++) { + if (al::isEqualString(name, mAchievements[i]->mName)) return i; } return -1; diff --git a/src/Npc/AchievementInfoReader.h b/src/Npc/AchievementInfoReader.h index 99b25190..f5728f42 100644 --- a/src/Npc/AchievementInfoReader.h +++ b/src/Npc/AchievementInfoReader.h @@ -21,10 +21,10 @@ public: void init(); s32 tryFindIndexByName(const char*) const; - AchievementInfo* get(s32 index) { return array[index]; } - s32 size() { return array.size(); } - s32 capacity() { return array.capacity(); } + AchievementInfo* get(s32 index) { return mAchievements[index]; } + s32 size() { return mAchievements.size(); } + s32 capacity() { return mAchievements.capacity(); } private: - sead::PtrArray array; + sead::PtrArray mAchievements; }; diff --git a/src/Player/PlayerHackKeeper.h b/src/Player/PlayerHackKeeper.h index e36a8382..b772d229 100644 --- a/src/Player/PlayerHackKeeper.h +++ b/src/Player/PlayerHackKeeper.h @@ -18,5 +18,5 @@ public: private: char padding[0x68]; - al::LiveActor* currentHackActor; + al::LiveActor* mCurrentHackActor; }; diff --git a/src/Player/PlayerInput.h b/src/Player/PlayerInput.h index 3fa7dbcb..736c2e3f 100644 --- a/src/Player/PlayerInput.h +++ b/src/Player/PlayerInput.h @@ -85,6 +85,6 @@ private: s32 _88; void* gap2[1]; bool mDisableInput; - void* fillToSize[20]; + void* gap3[20]; }; static_assert(sizeof(PlayerInput) == 0x140); diff --git a/src/Player/PlayerModelHolder.cpp b/src/Player/PlayerModelHolder.cpp index ae504de1..f5810368 100644 --- a/src/Player/PlayerModelHolder.cpp +++ b/src/Player/PlayerModelHolder.cpp @@ -13,7 +13,7 @@ void PlayerModelHolder::registerModel(al::LiveActor* liveActor, const char* name void PlayerModelHolder::changeModel(const char* name) { for (auto it = mBuffer.begin(), end = mBuffer.end(); it != end; ++it) { if (al::isEqualString(it->mName, sead::SafeString(name))) { - currentModel = &*it; + mCurrentModel = &*it; return; } } @@ -25,7 +25,7 @@ al::LiveActor* PlayerModelHolder::findModelActor(const char* name) const { return it->mLiveActor; } } - return currentModel->mLiveActor; + return mCurrentModel->mLiveActor; } al::LiveActor* PlayerModelHolder::tryFindModelActor(const char* name) const { @@ -38,9 +38,9 @@ al::LiveActor* PlayerModelHolder::tryFindModelActor(const char* name) const { } bool PlayerModelHolder::isCurrentModelLabel(const char* name) const { - return al::isEqualString(currentModel->mName.cstr(), name); + return al::isEqualString(mCurrentModel->mName.cstr(), name); } bool PlayerModelHolder::isCurrentModelLabelSubString(const char* name) const { - return al::isEqualSubString(currentModel->mName.cstr(), name); + return al::isEqualSubString(mCurrentModel->mName.cstr(), name); } diff --git a/src/Player/PlayerModelHolder.h b/src/Player/PlayerModelHolder.h index 81d42e15..376168ff 100644 --- a/src/Player/PlayerModelHolder.h +++ b/src/Player/PlayerModelHolder.h @@ -24,6 +24,6 @@ public: private: sead::PtrArray mBuffer; - Entry* currentModel = nullptr; + Entry* mCurrentModel = nullptr; sead::FixedSafeString<128> _10 = sead::FixedSafeString<128>(""); }; diff --git a/src/System/GameDataFile.h b/src/System/GameDataFile.h index 9d2a12d0..52c4a3ee 100644 --- a/src/System/GameDataFile.h +++ b/src/System/GameDataFile.h @@ -63,5 +63,5 @@ private: unsigned char padding_6A8[0x6A8]; GameProgressData* mGameProgressData; char padding_9F0[0x340]; - s32 curWorldId; + s32 mCurWorldId; }; diff --git a/src/Util/ActorDimensionKeeper.cpp b/src/Util/ActorDimensionKeeper.cpp index 4458c530..242368d7 100644 --- a/src/Util/ActorDimensionKeeper.cpp +++ b/src/Util/ActorDimensionKeeper.cpp @@ -3,17 +3,17 @@ #include "Util/IUseDimension.h" void ActorDimensionKeeper::validate() { - isValid = true; + mIsValid = true; } void ActorDimensionKeeper::invalidate() { - isValid = false; + mIsValid = false; - if (is2D) { - is2D = false; - isIn2DArea = false; - isCurrently2D = false; - isCanChange3D = true; + if (mIs2D) { + mIs2D = false; + mIsIn2DArea = false; + mIsCurrently2D = false; + mIsCanChange3D = true; } } diff --git a/src/Util/ActorDimensionKeeper.h b/src/Util/ActorDimensionKeeper.h index 164a304d..49776ede 100644 --- a/src/Util/ActorDimensionKeeper.h +++ b/src/Util/ActorDimensionKeeper.h @@ -17,20 +17,20 @@ public: void forceEndChange2DKeep(); bool update(); - bool getIs2D() const { return is2D; } - bool getIsIn2DArea() const { return isIn2DArea; } - bool getIsCurrently2D() const { return isCurrently2D; } - bool getIsCanChange2D() const { return isCanChange2D; } - bool getIsCanChange3D() const { return isCanChange3D; } + bool getIs2D() const { return mIs2D; } + bool getIsIn2DArea() const { return mIsIn2DArea; } + bool getIsCurrently2D() const { return mIsCurrently2D; } + bool getIsCanChange2D() const { return mIsCanChange2D; } + bool getIsCanChange3D() const { return mIsCanChange3D; } private: const al::LiveActor* mLiveActor; - bool isValid = true; - bool is2D = false; - bool isIn2DArea = false; - bool isCurrently2D = false; - bool isCanChange2D = false; - bool isCanChange3D = false; + bool mIsValid = true; + bool mIs2D = false; + bool mIsIn2DArea = false; + bool mIsCurrently2D = false; + bool mIsCanChange2D = false; + bool mIsCanChange3D = false; In2DAreaMoveControl* mIn2DAreaMoveControl = nullptr; }; static_assert(sizeof(ActorDimensionKeeper) == 0x18); diff --git a/tools/check-format.py b/tools/check-format.py index fa8ee791..223c3017 100755 --- a/tools/check-format.py +++ b/tools/check-format.py @@ -209,6 +209,8 @@ def header_sorted_visibility(c, path): if line in visibilities_ordered: i = visibilities_ordered.index(line) if CHECK(lambda a:i>nest_level[-1], line, "Wrong order of visibilities: Must be public, protected, private!", path): return + if nest_level[-1] == -2: # outside of class, only seen in SubActorKeeper.h in a macro definition - ignore then + continue nest_level[-1] = i continue elif "{" in line: @@ -245,6 +247,30 @@ def header_check_line(line, path, visibility, should_start_class): if "(" in line: # function function_name = line.split("(")[-2].split(" ")[-1] CHECK(lambda a:not function_name.endswith("_"), line, "Functions ending with an underscore are either protected or private!", path) + elif visibility == 2: # private + if line == "};" or line == "" or line == "union {" or line.startswith("struct"): return + if "(" in line and ")" in line: return + newline = line + if "=" in line: + newline = line.split("=")[0].strip() + elif line.endswith(";"): + newline = line.split(";")[0].strip() + else: + FAIL("Unknown private line!", line, path) + + if newline.endswith("]"): + newline = newline.split("[")[0].strip() + + var_name = newline.split(" ")[-1] + var_type = " ".join(newline.split(" ")[0:-1]) + + PREFIXES = ["padding", "field", "unk", "gap", "_", "filler"] + + if var_type.startswith("static"): + CHECK(lambda a:var_name.startswith("s") and var_name[1].isupper(), line, "Static member variables must be prefixed with `s`!", path) + else: + allowed_name = (var_name.startswith("m") and var_name[1].isupper()) or any([var_name.startswith(p) for p in PREFIXES]) + CHECK(lambda a:allowed_name, line, "Member variables must be prefixed with `m`!", path) def header_no_offset_comments(c, path): for line in c.splitlines():