diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e87d5709..296dcd27 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,3 +10,18 @@ jobs: source: 'src lib' exclude: 'lib/NintendoSDK lib/aarch64 lib/agl lib/eui lib/sead' clangFormatVersion: 12 + custom-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + cache: 'pip' + - name: Set up python package dependencies + run: pip install capstone colorama cxxfilt pyelftools ansiwrap watchdog python-Levenshtein toml + - name: Run custom code styling checks + run: tools/check-format.py diff --git a/Contributing.md b/Contributing.md index 8d81313d..2360d448 100644 --- a/Contributing.md +++ b/Contributing.md @@ -123,7 +123,7 @@ Before opening a PR, please format your code with clang-format 12 and ensure the ### Includes * Use `#include "..."` when including `al` and `rs` (SMO) header files. - * Include paths should be relative to lib/. + * Include paths should be relative to `lib/al` or `src`. * OK: `#include "Library/LiveActor/LiveActor.h"` * Not OK: `#include "LiveActor.h"` @@ -132,6 +132,12 @@ Before opening a PR, please format your code with clang-format 12 and ensure the * sead (e.g. ``) * Other Nintendo libraries like agl, eui, ... +* Format `#include`s in three blocks, separating them by one empty line. + * First up, all includes with angle brackets (`<>`) + * Then, all includes from `al`, starting with `Library` and `Project` (`""`) + * Finally, all game headers with no common prefix (`""`) + * For ordering within the blocks, run `clang-format` + ### Naming * Type names (classes/structs, enums, typedefs/alias declarations) and compile-time constants should be in UpperCamelCase. diff --git a/README.md b/README.md index 7f89fcfb..65cde030 100755 --- a/README.md +++ b/README.md @@ -79,7 +79,6 @@ Anyone is welcome to contribute to this project, just send a pull request! - Find proper place for Factories (+Placement of ActorFactory?) - Graph in Rails misordered - LiveActorGroup vs. Kit are in the wrong order -- Merge LiveActor/-flag - Split files/functions in Library/Resource - Library/Stage: Proper place for StageInfo - Library/Math: Split up into multiple files diff --git a/data/odyssey_functions.csv b/data/odyssey_functions.csv index d67215de..cec1ef45 100644 --- a/data/odyssey_functions.csv +++ b/data/odyssey_functions.csv @@ -29988,7 +29988,7 @@ Address,Quality,Size,Name 0x00000071004b5dc0,U,000008,_ZNK2al7FactoryIPFP15PlayerActorBasePKcEE11convertNameES4_ 0x00000071004b5dc8,U,000052,_Z20createPlayerFunctionI19PlayerActorHakoniwaEP15PlayerActorBasePKc 0x00000071004b5dfc,U,000052,_Z20createPlayerFunctionI18YukimaruRacePlayerEP15PlayerActorBasePKc -0x00000071004b5e30,O,000076,_ZN2al19ProjectActorFactoryC1Ev +0x00000071004b5e30,O,000076,_ZN19ProjectActorFactoryC2Ev 0x00000071004b5e7c,O,000008,_ZNK2al7FactoryIPFPNS_9LiveActorEPKcEE11convertNameES4_ 0x00000071004b5e84,U,000052,_ZN2al19createActorFunctionI14AchievementNpcEEPNS_9LiveActorEPKc 0x00000071004b5eb8,U,000056,_ZN2al19createActorFunctionI9AirBubbleEEPNS_9LiveActorEPKc @@ -30551,7 +30551,7 @@ Address,Quality,Size,Name 0x00000071004be198,U,000164,_ZN2al12PrePassLightINS_12LppSpotParamEE14trySetupShadowEiPN3agl4lght12LightPrePassEPNS_14ShadowDirectorE 0x00000071004be23c,U,000008,_ZNK2al12PrePassLightINS_12LppSpotParamEE12getLightTypeEv 0x00000071004be244,U,000036,_ZN2al12PrePassLightINS_12LppSpotParamEED0Ev -0x00000071004be268,O,000076,_ZN2al26ProjectAppearSwitchFactoryC1Ev +0x00000071004be268,O,000076,_ZN26ProjectAppearSwitchFactoryC1Ev 0x00000071004be2b4,U,000052,_ZN2al19createActorFunctionI23AppearSwitchFixMapPartsEEPNS_9LiveActorEPKc 0x00000071004be2e8,U,000052,_ZN2al19createActorFunctionI24AppearSwitchFallMapPartsEEPNS_9LiveActorEPKc 0x00000071004be31c,U,000096,_ZN18ProjectAreaFactoryC2Ev diff --git a/lib/al/include/Library/Area/AreaInitInfo.h b/lib/al/include/Library/Area/AreaInitInfo.h index 969f6605..63c17752 100644 --- a/lib/al/include/Library/Area/AreaInitInfo.h +++ b/lib/al/include/Library/Area/AreaInitInfo.h @@ -9,20 +9,20 @@ class SceneObjHolder; class AreaInitInfo { public: AreaInitInfo(); - AreaInitInfo(const al::PlacementInfo& placementInfo, - al::StageSwitchDirector* stageSwitchDirector, al::SceneObjHolder* sceneObjHolder); - AreaInitInfo(const al::PlacementInfo& placementInfo, const al::AreaInitInfo& initInfo); + AreaInitInfo(const PlacementInfo& placementInfo, StageSwitchDirector* stageSwitchDirector, + SceneObjHolder* sceneObjHolder); + AreaInitInfo(const PlacementInfo& placementInfo, const AreaInitInfo& initInfo); - void set(const al::PlacementInfo& placementInfo, al::StageSwitchDirector* stageSwitchDirector, - al::SceneObjHolder* sceneObjHolder); + void set(const PlacementInfo& placementInfo, StageSwitchDirector* stageSwitchDirector, + SceneObjHolder* sceneObjHolder); - const al::PlacementInfo& getPlacementInfo() const { return mPlacementInfo; } - al::StageSwitchDirector* getStageSwitchDirector() const { return mStageSwitchDirector; } - al::SceneObjHolder* getSceneObjHolder() const { return mSceneObjHolder; } + const PlacementInfo& getPlacementInfo() const { return mPlacementInfo; } + StageSwitchDirector* getStageSwitchDirector() const { return mStageSwitchDirector; } + SceneObjHolder* getSceneObjHolder() const { return mSceneObjHolder; } private: - al::PlacementInfo mPlacementInfo; - al::StageSwitchDirector* mStageSwitchDirector; - al::SceneObjHolder* mSceneObjHolder; + PlacementInfo mPlacementInfo; + StageSwitchDirector* mStageSwitchDirector; + SceneObjHolder* mSceneObjHolder; }; } // namespace al diff --git a/lib/al/include/Library/Area/AreaShape.h b/lib/al/include/Library/Area/AreaShape.h index ee00e876..8ee99421 100644 --- a/lib/al/include/Library/Area/AreaShape.h +++ b/lib/al/include/Library/Area/AreaShape.h @@ -3,6 +3,7 @@ #include #include #include + #include "Library/Factory/Factory.h" #include "Library/HostIO/HioNode.h" diff --git a/lib/al/include/Library/Audio/AudioDirector.h b/lib/al/include/Library/Audio/AudioDirector.h index 93c4d41e..65ce76af 100644 --- a/lib/al/include/Library/Audio/AudioDirector.h +++ b/lib/al/include/Library/Audio/AudioDirector.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Area/IUseAreaObj.h" #include "Library/Audio/IAudioSystemPause.h" #include "Library/HostIO/HioNode.h" @@ -33,11 +34,11 @@ class AudioDirector : public IUseAreaObj, public HioNode, public IAudioSystemPau }; AudioDirector(); - void init(const al::AudioDirectorInitInfo& info); - void init3D(const al::AudioDirectorInitInfo& info); + void init(const AudioDirectorInitInfo& info); + void init3D(const AudioDirectorInitInfo& info); void initAfterInitPlacement(); - void initMic(al::AudioMic* mic); - void setDependentModule(al::AudioDirector* director); + void initMic(AudioMic* mic); + void setDependentModule(AudioDirector* director); void updatePre(); void updatePost(); void startFinalizeUnsafeModuleInParallelThread(); @@ -45,7 +46,7 @@ class AudioDirector : public IUseAreaObj, public HioNode, public IAudioSystemPau bool isFinalizedUnsafeModuleInParallelThread(); void finalize(); bool isSystemPauseNow() const; - void setPlayerHolder(const al::PlayerHolder* player_holder); + void setPlayerHolder(const PlayerHolder* player_holder); void addAudiioFrameProccess(aal::IAudioFrameProcess* process); void removeAudiioFrameProccess(aal::IAudioFrameProcess* process); void* getAudioMaximizer() const; // unknown return type diff --git a/lib/al/include/Library/Audio/AudioKeeper.h b/lib/al/include/Library/Audio/AudioKeeper.h index a2946fec..b775fec8 100644 --- a/lib/al/include/Library/Audio/AudioKeeper.h +++ b/lib/al/include/Library/Audio/AudioKeeper.h @@ -2,6 +2,7 @@ #include #include + #include "Library/HostIO/HioNode.h" namespace al { diff --git a/lib/al/include/Library/Camera/CameraDirector.h b/lib/al/include/Library/Camera/CameraDirector.h index bfed8b7a..42b57f34 100644 --- a/lib/al/include/Library/Camera/CameraDirector.h +++ b/lib/al/include/Library/Camera/CameraDirector.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Execute/IUseExecutor.h" #include "Library/HostIO/HioNode.h" diff --git a/lib/al/include/Library/Camera/CameraPoserFunction.h b/lib/al/include/Library/Camera/CameraPoserFunction.h index 558ea2f0..e8fdb007 100644 --- a/lib/al/include/Library/Camera/CameraPoserFunction.h +++ b/lib/al/include/Library/Camera/CameraPoserFunction.h @@ -195,9 +195,8 @@ bool isInvalidEndEntranceCamera(const al::CameraPoser*); bool isPause(const al::CameraPoser*); void checkFirstCameraCollisionArrow(sead::Vector3f*, sead::Vector3f*, const al::IUseCollision*, const sead::Vector3f&, const sead::Vector3f&); -void checkFirstCameraCollisionArrow(alCameraPoserFunction::CameraCollisionHitResult*, - const al::IUseCollision*, const sead::Vector3f&, - const sead::Vector3f&); +void checkFirstCameraCollisionArrow(CameraCollisionHitResult*, const al::IUseCollision*, + const sead::Vector3f&, const sead::Vector3f&); void checkFirstCameraCollisionArrowOnlyCeiling(sead::Vector3f*, sead::Vector3f*, const al::IUseCollision*, const sead::Vector3f&, const sead::Vector3f&); diff --git a/lib/al/include/Library/Camera/SnapShotCameraCtrl.h b/lib/al/include/Library/Camera/SnapShotCameraCtrl.h index 5c486f09..452e0fd8 100644 --- a/lib/al/include/Library/Camera/SnapShotCameraCtrl.h +++ b/lib/al/include/Library/Camera/SnapShotCameraCtrl.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Audio/IUseAudioKeeper.h" #include "Library/Nerve/NerveExecutor.h" #include "Library/Yaml/ByamlIter.h" diff --git a/lib/al/include/Library/Collision/CollisionDirector.h b/lib/al/include/Library/Collision/CollisionDirector.h index 99debbb5..f047ebde 100644 --- a/lib/al/include/Library/Collision/CollisionDirector.h +++ b/lib/al/include/Library/Collision/CollisionDirector.h @@ -3,6 +3,7 @@ #include #include #include + #include "Library/Execute/IUseExecutor.h" namespace al { diff --git a/lib/al/include/Library/Controller/JoyPadAccelPoseAnalyzer.h b/lib/al/include/Library/Controller/JoyPadAccelPoseAnalyzer.h index 3965de9d..73bf6424 100644 --- a/lib/al/include/Library/Controller/JoyPadAccelPoseAnalyzer.h +++ b/lib/al/include/Library/Controller/JoyPadAccelPoseAnalyzer.h @@ -10,10 +10,10 @@ class JoyPadAccelPoseAnalyzer { public: void calcHistory(sead::Vector3f const&, sead::Vector3f const&, f32); - unsigned char padding_0[0x60]; // 0x0 - 0x60 - f32 hist0; // 0x60 + unsigned char padding_0[0x60]; + f32 hist0; unsigned char padding_1[0x70 - 0x64]; - f32 hist1; // 0x70 + f32 hist1; unsigned char padding_2[0x1c]; }; @@ -22,7 +22,7 @@ class JoyPadAccelPoseAnalyzer { void calcHistory(sead::Vector3f const&, sead::Vector3f const&); unsigned char padding_1[0x88]; - sead::Vector2f unkVec0; // 0x18 + sead::Vector2f unkVec0; unsigned char padding_0[0x98 - (0x88 + 0x8)]; }; @@ -38,27 +38,27 @@ class JoyPadAccelPoseAnalyzer { void update(); JoyPadAccelPoseAnalyzer getSwingDirDoubleHandSameDir() const; - s32 mControllerPort; // 0x0 port of the controller - s32 mAccelDeviceNum; // 0x4 number of accelerometers - bool gap00; // 0x8 unknown - bool mSwingLeft; // 0x9 shaking the left joycon - bool mSwingRight; // 0xa shaking the right joycon - bool mSwingAny; // 0xb shaking anything - sead::Vector2f mSwingBorder; // 0xc Border to trigger a motion shake - sead::Vector2f mAccelLeftVel; // 0x14 Accelerometer of the Left Joycon - sead::Vector2f mAccelRightVel; // 0x1c Accelerometer of the Right Joycon - sead::Vector2f mAccelCombinedVel; // 0x24 Combined vectors of the left and right joycons - sead::Vector2f mAccelLeftAccel; // 0x2c Acceleration of the left joycon - sead::Vector2f mAccelRightAccel; // 0x34 Acceleration of the right joycon - sead::Vector2f mGyroRoll; // 0x3c Roll of the gyroscope, each component is left/right joycon. - unsigned char padding_0[0x4]; // 0x44 padding because there is nothing here - HistoryInfo mHistoryLeft; // 0x48 History info of the left joycon - HistoryInfo mHistoryRight; // 0xd8 History info of the right joycon - bool gap01; // 0x168 unknown bool - unsigned char padding_1[0x7]; // 0x16a padding because there is nothing here - PoseAxisDir unknown0; // 0x170 - PoseAxisDir unknown1; // 0x208 - PoseAxisDir unknown2; // 0x2a0 + s32 mControllerPort; // port of the controller + s32 mAccelDeviceNum; // number of accelerometers + bool gap00; // unknown + bool mSwingLeft; // shaking the left joycon + bool mSwingRight; // shaking the right joycon + bool mSwingAny; // shaking anything + sead::Vector2f mSwingBorder; // Border to trigger a motion shake + sead::Vector2f mAccelLeftVel; // Accelerometer of the Left Joycon + sead::Vector2f mAccelRightVel; // Accelerometer of the Right Joycon + sead::Vector2f mAccelCombinedVel; // Combined vectors of the left and right joycons + sead::Vector2f mAccelLeftAccel; // Acceleration of the left joycon + sead::Vector2f mAccelRightAccel; // Acceleration of the right joycon + sead::Vector2f mGyroRoll; // Roll of the gyroscope, each component is left/right joycon. + unsigned char padding_0[0x4]; // padding because there is nothing here + HistoryInfo mHistoryLeft; // History info of the left joycon + HistoryInfo mHistoryRight; // History info of the right joycon + bool gap01; // unknown bool + unsigned char padding_1[0x7]; // padding because there is nothing here + PoseAxisDir unknown0; + PoseAxisDir unknown1; + PoseAxisDir unknown2; }; } // namespace al diff --git a/lib/al/include/Library/Execute/ExecuteTablesImpl.h b/lib/al/include/Library/Execute/ExecuteTablesImpl.h index 91ed9031..50824d68 100644 --- a/lib/al/include/Library/Execute/ExecuteTablesImpl.h +++ b/lib/al/include/Library/Execute/ExecuteTablesImpl.h @@ -1,6 +1,7 @@ +#pragma once + #include "Library/Execute/ExecuteOrder.h" #include "Library/Execute/ExecuteTable.h" - #include "Library/Execute/ExecuteTableHolderDraw.h" #include "Library/Execute/ExecuteTableHolderUpdate.h" diff --git a/lib/al/include/Library/HitSensor/HitSensorKeeper.h b/lib/al/include/Library/HitSensor/HitSensorKeeper.h index eb86074f..ea52e715 100755 --- a/lib/al/include/Library/HitSensor/HitSensorKeeper.h +++ b/lib/al/include/Library/HitSensor/HitSensorKeeper.h @@ -16,4 +16,4 @@ class HitSensorKeeper { s32 mSensorCount; HitSensor** mSensors; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/HostIO/HioNode.h b/lib/al/include/Library/HostIO/HioNode.h index eddb12ea..8bed679c 100755 --- a/lib/al/include/Library/HostIO/HioNode.h +++ b/lib/al/include/Library/HostIO/HioNode.h @@ -10,4 +10,4 @@ class HioNode : public IUseHioNode { public: // ?? }; -}; // namespace al \ No newline at end of file +} // namespace al diff --git a/lib/al/include/Library/HostIO/IUseName.h b/lib/al/include/Library/HostIO/IUseName.h index b144475e..8b88ea22 100644 --- a/lib/al/include/Library/HostIO/IUseName.h +++ b/lib/al/include/Library/HostIO/IUseName.h @@ -5,4 +5,4 @@ class IUseName { public: virtual const char* getName() const = 0; }; -}; // namespace al \ No newline at end of file +} // namespace al diff --git a/lib/al/include/Library/Layout/LayoutActor.h b/lib/al/include/Library/Layout/LayoutActor.h index 1b4b020f..dca1c2b0 100644 --- a/lib/al/include/Library/Layout/LayoutActor.h +++ b/lib/al/include/Library/Layout/LayoutActor.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Audio/IUseAudioKeeper.h" #include "Library/Camera/IUseCamera.h" #include "Library/Effect/IUseEffectKeeper.h" diff --git a/lib/al/include/Library/LiveActor/ActorInitInfo.h b/lib/al/include/Library/LiveActor/ActorInitInfo.h index b100854f..6261c7eb 100644 --- a/lib/al/include/Library/LiveActor/ActorInitInfo.h +++ b/lib/al/include/Library/LiveActor/ActorInitInfo.h @@ -7,6 +7,7 @@ #include #include #include + #include "Library/LiveActor/ActorSceneInfo.h" #include "Library/Nerve/NerveUtil.h" #include "Library/Placement/PlacementInfo.h" @@ -95,8 +96,8 @@ class ActorInitInfo { void initActor(LiveActor* actor, const ActorInitInfo& initInfo); void initActorSuffix(LiveActor* actor, const ActorInitInfo& initInfo, const char* suffix); -void initActorChangeModel(al::LiveActor* actor, const al::ActorInitInfo& initInfo); -void initActorChangeModelSuffix(al::LiveActor* actor, const al::ActorInitInfo& initInfo, +void initActorChangeModel(LiveActor* actor, const ActorInitInfo& initInfo); +void initActorChangeModelSuffix(LiveActor* actor, const ActorInitInfo& initInfo, const char* suffix); void initActorWithArchiveName(LiveActor* actor, const ActorInitInfo& initInfo, const sead::SafeString& archiveName, const char* suffix); diff --git a/lib/al/include/Library/LiveActor/ActorPoseKeeper.h b/lib/al/include/Library/LiveActor/ActorPoseKeeper.h index de5ceee9..a3bb62cc 100644 --- a/lib/al/include/Library/LiveActor/ActorPoseKeeper.h +++ b/lib/al/include/Library/LiveActor/ActorPoseKeeper.h @@ -3,7 +3,6 @@ #include #include #include -#include "math/seadVectorFwd.h" namespace al { @@ -255,9 +254,9 @@ void makeMtxSRT(sead::Matrix34f*, const LiveActor* actor); void makeMtxRT(sead::Matrix34f*, const LiveActor* actor); void makeMtxR(sead::Matrix34f*, const LiveActor* actor); void calcAnimFrontGravityPos(LiveActor* actor, const sead::Vector3f&); -const sead::Vector3f& getGravity(const al::LiveActor* actor); -const sead::Vector3f& getTrans(const al::LiveActor* actor); -const sead::Vector3f& getScale(const al::LiveActor* actor); +const sead::Vector3f& getGravity(const LiveActor* actor); +const sead::Vector3f& getTrans(const LiveActor* actor); +const sead::Vector3f& getScale(const LiveActor* actor); void copyPose(LiveActor* actor, const LiveActor* target); void updatePoseTrans(LiveActor* actor, const sead::Vector3f&); void updatePoseRotate(LiveActor* actor, const sead::Vector3f&); @@ -278,7 +277,7 @@ void calcDistanceSignLocalZDir(const LiveActor* actor, const sead::Vector3f&); void calcDistanceLocalXDir(const LiveActor* actor, const sead::Vector3f&); void calcDistanceLocalYDir(const LiveActor* actor, const sead::Vector3f&); void calcDistanceLocalZDir(const LiveActor* actor, const sead::Vector3f&); -sead::Vector3f* getTransPtr(al::LiveActor* actor); +sead::Vector3f* getTransPtr(LiveActor* actor); void setTrans(LiveActor* actor, f32, f32, f32); void setTransX(LiveActor* actor, f32); void setTransY(LiveActor* actor, f32); @@ -291,9 +290,9 @@ void setRotateY(LiveActor* actor, f32); void setRotateZ(LiveActor* actor, f32); void getScalePtr(LiveActor* actor); bool tryGetScalePtr(LiveActor* actor); -f32 getScaleX(const al::LiveActor* actor); -f32 getScaleY(const al::LiveActor* actor); -f32 getScaleZ(const al::LiveActor* actor); +f32 getScaleX(const LiveActor* actor); +f32 getScaleY(const LiveActor* actor); +f32 getScaleZ(const LiveActor* actor); void setScale(LiveActor* actor, const sead::Vector3f&); void setScale(LiveActor* actor, f32, f32, f32); void setScaleAll(LiveActor* actor, f32); @@ -312,17 +311,17 @@ bool isUpTarget(const LiveActor* actor, const sead::Vector3f&); bool isUpDir(const LiveActor* actor, const sead::Vector3f&); bool isDownTarget(const LiveActor* actor, const sead::Vector3f&); bool isDownDir(const LiveActor* actor, const sead::Vector3f&); -const sead::Quatf& getQuat(const al::LiveActor* actor); -sead::Quatf* getQuatPtr(al::LiveActor* actor); +const sead::Quatf& getQuat(const LiveActor* actor); +sead::Quatf* getQuatPtr(LiveActor* actor); bool tryGetQuatPtr(LiveActor* actor); void setQuat(LiveActor* actor, const sead::Quatf&); void getGravityPtr(const LiveActor* actor); void setGravity(const LiveActor* actor, const sead::Vector3f&); -const sead::Vector3f& getFront(const al::LiveActor* actor); -sead::Vector3f* getFrontPtr(al::LiveActor* actor); +const sead::Vector3f& getFront(const LiveActor* actor); +sead::Vector3f* getFrontPtr(LiveActor* actor); void setFront(LiveActor* actor, const sead::Vector3f&); -const sead::Vector3f& getUp(const al::LiveActor* actor); -sead::Vector3f* getUpPtr(al::LiveActor* actor); +const sead::Vector3f& getUp(const LiveActor* actor); +sead::Vector3f* getUpPtr(LiveActor* actor); void setUp(LiveActor* actor, const sead::Vector3f&); void multVecPoseNoTrans(sead::Vector3f*, const LiveActor* actor, const sead::Vector3f&); void multVecPose(sead::Vector3f*, const LiveActor* actor, const sead::Vector3f&); diff --git a/lib/al/include/Library/LiveActor/LiveActor.h b/lib/al/include/Library/LiveActor/LiveActor.h index 6e5f6545..c13e1bb0 100755 --- a/lib/al/include/Library/LiveActor/LiveActor.h +++ b/lib/al/include/Library/LiveActor/LiveActor.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Area/IUseAreaObj.h" #include "Library/Audio/IUseAudioKeeper.h" #include "Library/Camera/IUseCamera.h" @@ -152,23 +153,4 @@ class LiveActor : public IUseNerve, ActorSceneInfo* mSceneInfo; LiveActorFlag* mFlags; }; - -struct LiveActorFlag { - bool isDead = true; - bool isClipped = false; - bool isClippingInvalid = true; - bool isDrawClipped = false; - bool isCalcAnim = false; - bool isModelVisible = false; - bool isCollideOff = true; - bool field_07 = false; - bool isMaterialCodeValid = false; - bool isPuddleMaterialValid = false; - bool isAreaTargetOn = true; - bool isUpdateOn = true; - - LiveActorFlag(); -}; -static_assert(sizeof(LiveActorFlag) == 0xC); - } // namespace al diff --git a/lib/al/include/Library/LiveActor/LiveActorFlag.h b/lib/al/include/Library/LiveActor/LiveActorFlag.h new file mode 100644 index 00000000..cc83f6d4 --- /dev/null +++ b/lib/al/include/Library/LiveActor/LiveActorFlag.h @@ -0,0 +1,23 @@ +#pragma once + +namespace al { + +struct LiveActorFlag { + bool isDead = true; + bool isClipped = false; + bool isClippingInvalid = true; + bool isDrawClipped = false; + bool isCalcAnim = false; + bool isModelVisible = false; + bool isCollideOff = true; + bool field_07 = false; + bool isMaterialCodeValid = false; + bool isPuddleMaterialValid = false; + bool isAreaTargetOn = true; + bool isUpdateOn = true; + + LiveActorFlag(); +}; +static_assert(sizeof(LiveActorFlag) == 0xC); + +} // namespace al diff --git a/lib/al/include/Library/LiveActor/LiveActorGroup.h b/lib/al/include/Library/LiveActor/LiveActorGroup.h index 36c22291..220f78ad 100755 --- a/lib/al/include/Library/LiveActor/LiveActorGroup.h +++ b/lib/al/include/Library/LiveActor/LiveActorGroup.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/HostIO/HioNode.h" namespace al { @@ -47,4 +48,4 @@ class DeriveActorGroup : LiveActorGroup { void makeActorAliveAll() { LiveActorGroup::makeActorAliveAll(); } void makeActorDeadAll() { LiveActorGroup::makeActorDeadAll(); } }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/LiveActor/LiveActorUtil.h b/lib/al/include/Library/LiveActor/LiveActorUtil.h index e23c1e2d..6450bd0d 100644 --- a/lib/al/include/Library/LiveActor/LiveActorUtil.h +++ b/lib/al/include/Library/LiveActor/LiveActorUtil.h @@ -4,52 +4,53 @@ #include #include #include + #include "Library/LiveActor/LiveActor.h" #include "Library/Nerve/Nerve.h" namespace al { template -al::LiveActor* createActorFunction(const char* actorName); +LiveActor* createActorFunction(const char* actorName); -const sead::Vector3f& getCameraUp(const al::LiveActor*, s32); +const sead::Vector3f& getCameraUp(const LiveActor*, s32); -const sead::Vector3f& getVelocity(const al::LiveActor* actor); -sead::Vector3f* getVelocityPtr(al::LiveActor* actor); -sead::Vector3f* getGravityPtr(al::LiveActor* actor); +const sead::Vector3f& getVelocity(const LiveActor* actor); +sead::Vector3f* getVelocityPtr(LiveActor* actor); +sead::Vector3f* getGravityPtr(LiveActor* actor); bool isClipped(const LiveActor*); void tryInitFixedModelGpuBuffer(const LiveActor*); bool isDead(const LiveActor*); bool isAlive(const LiveActor*); bool isHideModel(const LiveActor*); -void hideModelIfShow(al::LiveActor*); -void showModelIfHide(al::LiveActor*); +void hideModelIfShow(LiveActor*); +void showModelIfHide(LiveActor*); void setModelAlphaMask(const LiveActor*, f32); void onSyncClippingSubActor(LiveActor*, const LiveActor*); void onSyncHideSubActor(LiveActor*, const LiveActor*); void onSyncAlphaMaskSubActor(LiveActor*, const LiveActor*); -void setMaterialProgrammable(al::LiveActor*); -bool isExistModel(const al::LiveActor*); -bool isViewDependentModel(const al::LiveActor*); -void calcViewModel(const al::LiveActor*); -void calcQuat(sead::Quatf*, const al::LiveActor*); -void calcJointFrontDir(sead::Vector3f*, const al::LiveActor*, const char*); +void setMaterialProgrammable(LiveActor*); +bool isExistModel(const LiveActor*); +bool isViewDependentModel(const LiveActor*); +void calcViewModel(const LiveActor*); +void calcQuat(sead::Quatf*, const LiveActor*); +void calcJointFrontDir(sead::Vector3f*, const LiveActor*, const char*); -f32* findActorParamF32(const al::LiveActor*, const char*); -s32* findActorParamS32(const al::LiveActor*, const char*); +f32* findActorParamF32(const LiveActor*, const char*); +s32* findActorParamS32(const LiveActor*, const char*); -void setNerveAtActionEnd(al::LiveActor*, const al::Nerve*); -void initActorWithArchiveName(al::LiveActor* actor, const al::ActorInitInfo& info, - const sead::SafeString&, const char* suffix); -void initMapPartsActor(al::LiveActor* actor, const al::ActorInitInfo& info, const char* suffix); +void setNerveAtActionEnd(LiveActor*, const Nerve*); +void initActorWithArchiveName(LiveActor* actor, const ActorInitInfo& info, const sead::SafeString&, + const char* suffix); +void initMapPartsActor(LiveActor* actor, const ActorInitInfo& info, const char* suffix); -void initJointControllerKeeper(const al::LiveActor*, s32); -void initJointGlobalQuatController(const al::LiveActor*, const sead::Quatf*, const char*); +void initJointControllerKeeper(const LiveActor*, s32); +void initJointGlobalQuatController(const LiveActor*, const sead::Quatf*, const char*); bool isEffectEmitting(const IUseEffectKeeper*, const char*); -void registActorToDemoInfo(al::LiveActor* actor, const al::ActorInitInfo& info); +void registActorToDemoInfo(LiveActor* actor, const ActorInitInfo& info); } // namespace al diff --git a/lib/al/include/Library/LiveActor/SubActorKeeper.h b/lib/al/include/Library/LiveActor/SubActorKeeper.h index c1f7446e..52ccabe7 100644 --- a/lib/al/include/Library/LiveActor/SubActorKeeper.h +++ b/lib/al/include/Library/LiveActor/SubActorKeeper.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/LiveActor/ActorInitInfo.h" // TODO: bring this up to sanae diff --git a/lib/al/include/Library/Model/ModelDrawerBase.h b/lib/al/include/Library/Model/ModelDrawerBase.h index ed5f04a7..9322939d 100644 --- a/lib/al/include/Library/Model/ModelDrawerBase.h +++ b/lib/al/include/Library/Model/ModelDrawerBase.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/HostIO/HioNode.h" namespace agl { diff --git a/lib/al/include/Library/Nerve/IUseNerve.h b/lib/al/include/Library/Nerve/IUseNerve.h index 366afd10..3cb5e484 100644 --- a/lib/al/include/Library/Nerve/IUseNerve.h +++ b/lib/al/include/Library/Nerve/IUseNerve.h @@ -9,4 +9,4 @@ class IUseNerve { virtual NerveKeeper* getNerveKeeper() const = 0; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Nerve/NerveExecutor.h b/lib/al/include/Library/Nerve/NerveExecutor.h index e0677b60..700e0e84 100755 --- a/lib/al/include/Library/Nerve/NerveExecutor.h +++ b/lib/al/include/Library/Nerve/NerveExecutor.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/HostIO/HioNode.h" #include "Library/Nerve/IUseNerve.h" @@ -21,4 +22,4 @@ class NerveExecutor : public IUseNerve, public HioNode { private: NerveKeeper* mKeeper = nullptr; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Nerve/NerveStateCtrl.h b/lib/al/include/Library/Nerve/NerveStateCtrl.h index 29d8a663..20d815f3 100755 --- a/lib/al/include/Library/Nerve/NerveStateCtrl.h +++ b/lib/al/include/Library/Nerve/NerveStateCtrl.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Nerve/Nerve.h" #include "Library/Nerve/NerveStateBase.h" @@ -31,4 +32,4 @@ class NerveStateCtrl { State* mStates; State* mCurrentState; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Nerve/NerveUtil.h b/lib/al/include/Library/Nerve/NerveUtil.h index 3dfece42..61fa475b 100644 --- a/lib/al/include/Library/Nerve/NerveUtil.h +++ b/lib/al/include/Library/Nerve/NerveUtil.h @@ -97,7 +97,7 @@ class NerveActionCollector { al::NerveAction* mHead = nullptr; al::NerveAction* mTail = nullptr; - static alNerveFunction::NerveActionCollector* sCurrentCollector; + static NerveActionCollector* sCurrentCollector; }; } // namespace alNerveFunction diff --git a/lib/al/include/Library/Network/HtmlViewer.h b/lib/al/include/Library/Network/HtmlViewer.h index e4fed607..07b12b38 100644 --- a/lib/al/include/Library/Network/HtmlViewer.h +++ b/lib/al/include/Library/Network/HtmlViewer.h @@ -7,4 +7,4 @@ class HtmlViewer { public: void call(const char*, sead::BufferedSafeStringBase*) const; }; -}; // namespace al \ No newline at end of file +} // namespace al diff --git a/lib/al/include/Library/Obj/PartsModel.h b/lib/al/include/Library/Obj/PartsModel.h index 27f4001e..d17c2c67 100644 --- a/lib/al/include/Library/Obj/PartsModel.h +++ b/lib/al/include/Library/Obj/PartsModel.h @@ -2,6 +2,7 @@ #include #include + #include "Library/LiveActor/LiveActor.h" namespace al { diff --git a/lib/al/include/Library/Placement/PlacementInfo.h b/lib/al/include/Library/Placement/PlacementInfo.h index 9c1f4760..87a61779 100755 --- a/lib/al/include/Library/Placement/PlacementInfo.h +++ b/lib/al/include/Library/Placement/PlacementInfo.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Yaml/ByamlIter.h" namespace al { diff --git a/lib/al/include/Library/Rail/IUseRail.h b/lib/al/include/Library/Rail/IUseRail.h index 5bccc3a9..b5c408e2 100755 --- a/lib/al/include/Library/Rail/IUseRail.h +++ b/lib/al/include/Library/Rail/IUseRail.h @@ -5,6 +5,6 @@ class RailRider; class IUseRail { public: - virtual al::RailRider* getRailRider() const = 0; + virtual RailRider* getRailRider() const = 0; }; -}; // namespace al \ No newline at end of file +} // namespace al diff --git a/lib/al/include/Library/Rail/Rail.h b/lib/al/include/Library/Rail/Rail.h index b75fdcd3..046b358a 100644 --- a/lib/al/include/Library/Rail/Rail.h +++ b/lib/al/include/Library/Rail/Rail.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Rail/RailPart.h" namespace al { diff --git a/lib/al/include/Library/Resource/ResourceUtil.h b/lib/al/include/Library/Resource/ResourceUtil.h index b67ce16d..e9dc9342 100644 --- a/lib/al/include/Library/Resource/ResourceUtil.h +++ b/lib/al/include/Library/Resource/ResourceUtil.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Resource/Resource.h" namespace al { diff --git a/lib/al/include/Library/Scene/Scene.h b/lib/al/include/Library/Scene/Scene.h index c7ff7eb9..40c6574d 100755 --- a/lib/al/include/Library/Scene/Scene.h +++ b/lib/al/include/Library/Scene/Scene.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/Audio/IUseAudioKeeper.h" #include "Library/Camera/IUseCamera.h" #include "Library/LiveActor/ActorInitInfo.h" diff --git a/lib/al/include/Library/Screen/ScreenFunction.h b/lib/al/include/Library/Screen/ScreenFunction.h index 343d9bed..fdbe498f 100644 --- a/lib/al/include/Library/Screen/ScreenFunction.h +++ b/lib/al/include/Library/Screen/ScreenFunction.h @@ -16,10 +16,6 @@ class SceneCameraInfo; class ScreenCapture; class ScreenCaptureExecutor : IUseHioNode { -private: - sead::PtrArray mArray; - bool mIsCaptured; - public: ScreenCaptureExecutor(s32); ~ScreenCaptureExecutor(); @@ -35,17 +31,21 @@ class ScreenCaptureExecutor : IUseHioNode { void offDraw(); bool isDraw(s32) const; -}; -class ScreenCoverCtrl { private: - s32 mFrameTimer; - bool mIsActive; + sead::PtrArray mArray; + bool mIsCaptured; +}; +class ScreenCoverCtrl { public: ScreenCoverCtrl(); void requestCaptureScreenCover(s32 totalFrames); void update(); + +private: + s32 mFrameTimer; + bool mIsActive; }; u32 getDisplayWidth(); diff --git a/lib/al/include/Library/Shadow/DepthShadowMapCtrl.h b/lib/al/include/Library/Shadow/DepthShadowMapCtrl.h index e36a6743..7cfaae9b 100644 --- a/lib/al/include/Library/Shadow/DepthShadowMapCtrl.h +++ b/lib/al/include/Library/Shadow/DepthShadowMapCtrl.h @@ -15,7 +15,7 @@ class ModelDrawerMask; class DepthShadowMapCtrl { public: - DepthShadowMapCtrl(const al::Resource* resource); + DepthShadowMapCtrl(const Resource* resource); ~DepthShadowMapCtrl(); void actorModelDrawDepth(); @@ -27,16 +27,16 @@ class DepthShadowMapCtrl { DepthShadowMapInfo* getDepthShadowMapInfo(s32 index); u32 getDepthShadowMapNum(); void hide(); - void init(al::LiveActor* actor, const al::ByamlIter& iter); - void initAfterPlacement(al::GraphicsSystemInfo* graphicsSystemInfo); - void initWithoutIter(al::LiveActor* actor, s32); + void init(LiveActor* actor, const ByamlIter& iter); + void initAfterPlacement(GraphicsSystemInfo* graphicsSystemInfo); + void initWithoutIter(LiveActor* actor, s32); void show(); DepthShadowMapInfo* tryFindDepthShadowMapInfo(const char*); void update(); - void updateShapeVisible(const al::LiveActor* actor); + void updateShapeVisible(const LiveActor* actor); private: - al::LiveActor* mLiveActor; + LiveActor* mLiveActor; sead::Vector3f lightDir; bool mIsAppendSubActor; sead::PtrArray mDepthShadowMaps; diff --git a/lib/al/include/Library/Shadow/ShadowKeeper.h b/lib/al/include/Library/Shadow/ShadowKeeper.h index 322a436e..fc785771 100644 --- a/lib/al/include/Library/Shadow/ShadowKeeper.h +++ b/lib/al/include/Library/Shadow/ShadowKeeper.h @@ -9,7 +9,7 @@ class DepthShadowMapCtrl; class ShadowKeeper { public: ShadowKeeper(); - void initAfterPlacement(al::GraphicsSystemInfo*); + void initAfterPlacement(GraphicsSystemInfo*); void update(); bool isHide() const; void hide(); @@ -21,4 +21,4 @@ class ShadowKeeper { }; static_assert(sizeof(ShadowKeeper) == 0x10); -} // namespace al \ No newline at end of file +} // namespace al diff --git a/lib/al/include/Library/Stage/StageSwitchKeeper.h b/lib/al/include/Library/Stage/StageSwitchKeeper.h index 4c525c1a..97a9b7bc 100755 --- a/lib/al/include/Library/Stage/StageSwitchKeeper.h +++ b/lib/al/include/Library/Stage/StageSwitchKeeper.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/HostIO/IUseName.h" namespace al { diff --git a/lib/al/include/Library/Stage/StageSwitchUtil.h b/lib/al/include/Library/Stage/StageSwitchUtil.h index 79e62711..08f5da59 100644 --- a/lib/al/include/Library/Stage/StageSwitchUtil.h +++ b/lib/al/include/Library/Stage/StageSwitchUtil.h @@ -5,24 +5,24 @@ class IUseStageSwitch; class StageSwitchDirector; class PlacementInfo; -void initStageSwitch(al::IUseStageSwitch* user, al::StageSwitchDirector* stageSwitchDirector, - const al::PlacementInfo& placementInfo); -bool isValidStageSwitch(const al::IUseStageSwitch* user, const char* linkName); -bool isOnStageSwitch(const al::IUseStageSwitch* user, const char* linkName); -void onStageSwitch(al::IUseStageSwitch* user, const char* linkName); -void offStageSwitch(al::IUseStageSwitch* user, const char* linkName); -bool isOnStageSwitch(al::IUseStageSwitch* user, const char* linkName); -bool isOffStageSwitch(al::IUseStageSwitch* user, const char* linkName); -bool isSameStageSwitch(const al::IUseStageSwitch* user, const al::IUseStageSwitch* otherUser, +void initStageSwitch(IUseStageSwitch* user, StageSwitchDirector* stageSwitchDirector, + const PlacementInfo& placementInfo); +bool isValidStageSwitch(const IUseStageSwitch* user, const char* linkName); +bool isOnStageSwitch(const IUseStageSwitch* user, const char* linkName); +void onStageSwitch(IUseStageSwitch* user, const char* linkName); +void offStageSwitch(IUseStageSwitch* user, const char* linkName); +bool isOnStageSwitch(IUseStageSwitch* user, const char* linkName); +bool isOffStageSwitch(IUseStageSwitch* user, const char* linkName); +bool isSameStageSwitch(const IUseStageSwitch* user, const IUseStageSwitch* otherUser, const char* linkName); -bool isValidSwitchAppear(const al::IUseStageSwitch* user); -bool isOnSwitchAppear(const al::IUseStageSwitch* user); -bool isValidSwitchKill(const al::IUseStageSwitch* user); -bool isValidSwitchDeadOn(const al::IUseStageSwitch* user); -void onSwitchDeadOn(al::IUseStageSwitch* user); -void offSwitchDeadOn(al::IUseStageSwitch* user); -bool isOnSwitchDeadOn(al::IUseStageSwitch* user); -bool isOffSwitchDeadOn(al::IUseStageSwitch* user); -bool isValidSwitchStart(const al::IUseStageSwitch* user); -bool isOnSwitchStart(const al::IUseStageSwitch* user); +bool isValidSwitchAppear(const IUseStageSwitch* user); +bool isOnSwitchAppear(const IUseStageSwitch* user); +bool isValidSwitchKill(const IUseStageSwitch* user); +bool isValidSwitchDeadOn(const IUseStageSwitch* user); +void onSwitchDeadOn(IUseStageSwitch* user); +void offSwitchDeadOn(IUseStageSwitch* user); +bool isOnSwitchDeadOn(IUseStageSwitch* user); +bool isOffSwitchDeadOn(IUseStageSwitch* user); +bool isValidSwitchStart(const IUseStageSwitch* user); +bool isOnSwitchStart(const IUseStageSwitch* user); } // namespace al diff --git a/lib/al/include/Library/System/SystemKit.h b/lib/al/include/Library/System/SystemKit.h index 8bf17601..017ae9ef 100644 --- a/lib/al/include/Library/System/SystemKit.h +++ b/lib/al/include/Library/System/SystemKit.h @@ -31,7 +31,3 @@ class SystemKit { SaveDataDirector* mSaveDataDirector; }; } // namespace al - -class alProjectInterface { - static al::SystemKit* getSystemKit(); -}; diff --git a/lib/al/include/Library/Thread/AsyncFunctorThread.h b/lib/al/include/Library/Thread/AsyncFunctorThread.h index e760fe91..d39033aa 100644 --- a/lib/al/include/Library/Thread/AsyncFunctorThread.h +++ b/lib/al/include/Library/Thread/AsyncFunctorThread.h @@ -3,6 +3,7 @@ #include #include #include + #include "Library/Thread/FunctorV0M.h" namespace sead { diff --git a/lib/al/include/Library/Yaml/ByamlData.h b/lib/al/include/Library/Yaml/ByamlData.h index f548709e..165ed1f1 100755 --- a/lib/al/include/Library/Yaml/ByamlData.h +++ b/lib/al/include/Library/Yaml/ByamlData.h @@ -1,7 +1,6 @@ #pragma once #include -#include "byteswap.h" namespace al { class ByamlHashPair; diff --git a/lib/al/include/Library/Yaml/ByamlIter.h b/lib/al/include/Library/Yaml/ByamlIter.h index 56ceb61b..a9eddffb 100755 --- a/lib/al/include/Library/Yaml/ByamlIter.h +++ b/lib/al/include/Library/Yaml/ByamlIter.h @@ -19,11 +19,11 @@ class ByamlIter { bool isInvertOrder() const; s32 getSize() const; ByamlIter getIterByIndex(s32 index) const; - bool getByamlDataByIndex(al::ByamlData* data, s32 index) const; + bool getByamlDataByIndex(ByamlData* data, s32 index) const; ByamlIter getIterByKey(const char* key) const; - bool getByamlDataByKey(al::ByamlData* data, const char* key) const; - bool getByamlDataByKeyIndex(al::ByamlData* data, s32 index) const; - bool getByamlDataAndKeyName(al::ByamlData* data, const char** key, s32 index) const; + bool getByamlDataByKey(ByamlData* data, const char* key) const; + bool getByamlDataByKeyIndex(ByamlData* data, s32 index) const; + bool getByamlDataAndKeyName(ByamlData* data, const char** key, s32 index) const; bool getKeyName(const char** key, s32 index) const; bool tryGetIterByIndex(ByamlIter* iter, s32 index) const; bool tryGetIterAndKeyNameByIndex(ByamlIter* iter, const char** key, s32 index) const; diff --git a/lib/al/include/Library/Yaml/ByamlUtil.h b/lib/al/include/Library/Yaml/ByamlUtil.h index 42e9e084..cc14e525 100755 --- a/lib/al/include/Library/Yaml/ByamlUtil.h +++ b/lib/al/include/Library/Yaml/ByamlUtil.h @@ -3,6 +3,7 @@ #include #include #include + #include "Library/Yaml/ByamlData.h" #include "Library/Yaml/ByamlIter.h" @@ -92,4 +93,4 @@ struct PrintParams { void printByamlIter(const u8*); void printByamlIter(const ByamlIter&); void printByamlIter_(const ByamlIter&, PrintParams*); -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Yaml/Writer/ByamlWriterBigDataList.h b/lib/al/include/Library/Yaml/Writer/ByamlWriterBigDataList.h index a81d9484..f4e9bb6d 100644 --- a/lib/al/include/Library/Yaml/Writer/ByamlWriterBigDataList.h +++ b/lib/al/include/Library/Yaml/Writer/ByamlWriterBigDataList.h @@ -16,7 +16,7 @@ class ByamlWriterBigDataList { ByamlWriterBigDataList(); virtual ~ByamlWriterBigDataList(); u32 calcPackSize() const; - void addData(al::ByamlWriterBigData*); + void addData(ByamlWriterBigData*); s32 setOffset(s32); void write(sead::WriteStream*); diff --git a/lib/al/include/Library/Yaml/Writer/ByamlWriterData.h b/lib/al/include/Library/Yaml/Writer/ByamlWriterData.h index 633cfd46..bd49b419 100644 --- a/lib/al/include/Library/Yaml/Writer/ByamlWriterData.h +++ b/lib/al/include/Library/Yaml/Writer/ByamlWriterData.h @@ -90,7 +90,7 @@ class ByamlWriterBigDataList; class ByamlWriterBigData : public ByamlWriterData { public: - ByamlWriterBigData(al::ByamlWriterBigDataList*); + ByamlWriterBigData(ByamlWriterBigDataList*); ~ByamlWriterBigData(); void write(sead::WriteStream*) const override; virtual u32 calcBigDataSize() const; @@ -99,7 +99,7 @@ class ByamlWriterBigData : public ByamlWriterData { void setOffset(s32 offset) { mOffset = offset; } private: - al::ByamlWriterBigDataList* mList; + ByamlWriterBigDataList* mList; s32 mOffset = 0; }; @@ -191,7 +191,7 @@ class ByamlWriterArray : public ByamlWriterContainer { void deleteData() override; u32 calcPackSize() const override; - void addData(al::ByamlWriterData*); + void addData(ByamlWriterData*); void addBool(bool) override; void addInt(s32) override; void addUInt(u32) override; @@ -212,7 +212,7 @@ class ByamlWriterArray : public ByamlWriterContainer { private: sead::TList mList; - al::ByamlWriterStringTable* mStringTable; + ByamlWriterStringTable* mStringTable; }; static_assert(sizeof(ByamlWriterArray) == 0x30); @@ -221,13 +221,13 @@ class ByamlWriterHashPair : public sead::ListNode { ByamlWriterHashPair(const char*, ByamlWriterData*); const char* getKey() { return mKey; } - al::ByamlWriterData* getValue() { return mValue; } + ByamlWriterData* getValue() { return mValue; } private: void* selfReference = this; void* test2 = nullptr; const char* mKey; - al::ByamlWriterData* mValue; + ByamlWriterData* mValue; }; static_assert(sizeof(ByamlWriterHashPair) == 0x30); @@ -239,7 +239,7 @@ class ByamlWriterHash : public ByamlWriterContainer { void deleteData() override; // TODO implementation missing u32 calcPackSize() const override; - void addData(const char*, al::ByamlWriterData*); // TODO implementation missing + void addData(const char*, ByamlWriterData*); // TODO implementation missing void addBool(const char*, bool) override; void addInt(const char*, s32) override; void addUInt(const char*, u32) override; @@ -260,8 +260,8 @@ class ByamlWriterHash : public ByamlWriterContainer { private: sead::TList mList; // TODO not really... it's something different here. - al::ByamlWriterStringTable* mStringTable1; - al::ByamlWriterStringTable* mStringTable2; + ByamlWriterStringTable* mStringTable1; + ByamlWriterStringTable* mStringTable2; }; static_assert(sizeof(ByamlWriterHash) == 0x38); diff --git a/lib/al/include/Project/HitSensor/HitSensor.h b/lib/al/include/Project/HitSensor/HitSensor.h index 480b75e0..5f2cd502 100644 --- a/lib/al/include/Project/HitSensor/HitSensor.h +++ b/lib/al/include/Project/HitSensor/HitSensor.h @@ -2,6 +2,7 @@ #include #include + #include "Project/HitSensor/SensorHitGroup.h" namespace al { @@ -9,7 +10,7 @@ class LiveActor; class HitSensor { public: - HitSensor(al::LiveActor*, const char*, u32, f32, unsigned short, const sead::Vector3*, + HitSensor(LiveActor*, const char*, u32, f32, unsigned short, const sead::Vector3*, const sead::Matrix34*, const sead::Vector3&); bool trySensorSort(); @@ -20,7 +21,7 @@ class HitSensor { void validateBySystem(); void invalidateBySystem(); void update(); - void addHitSensor(al::HitSensor*); + void addHitSensor(HitSensor*); const char* mName; // _0 s32 _8; @@ -30,15 +31,15 @@ class HitSensor { f32 _18; unsigned short mMaxSensorCount; // _1C unsigned short mSensorCount; // _1E - al::HitSensor** mSensors; // _20 + HitSensor** mSensors; // _20 unsigned long _28; - al::SensorHitGroup* mHitGroup; // _30 - bool mIsValidBySystem; // _38 - bool mIsValid; // _39 - bool _3A[4]; // unknown type + SensorHitGroup* mHitGroup; // _30 + bool mIsValidBySystem; // _38 + bool mIsValid; // _39 + bool _3A[4]; // unknown type unsigned short _3E; - al::LiveActor* mParentActor; // _40 + LiveActor* mParentActor; // _40 const sead::Vector3* mFollowPos; // _48 const sead::Matrix34* mFollowMtx; // _50 }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Project/HitSensor/SensorHitGroup.h b/lib/al/include/Project/HitSensor/SensorHitGroup.h index d82ef63c..db011c79 100755 --- a/lib/al/include/Project/HitSensor/SensorHitGroup.h +++ b/lib/al/include/Project/HitSensor/SensorHitGroup.h @@ -18,4 +18,4 @@ class SensorHitGroup { s32 mSensorCount = 0; HitSensor** mSensors; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Project/Item/ActorScoreKeeper.h b/lib/al/include/Project/Item/ActorScoreKeeper.h index b1729649..b54d7aa6 100644 --- a/lib/al/include/Project/Item/ActorScoreKeeper.h +++ b/lib/al/include/Project/Item/ActorScoreKeeper.h @@ -25,4 +25,4 @@ class ActorScoreKeeper { Entry* array; s32 size; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Project/Play/Graphics/IUseGridMesh.h b/lib/al/include/Project/Play/Graphics/IUseGridMesh.h index 8175e21a..b70c391f 100644 --- a/lib/al/include/Project/Play/Graphics/IUseGridMesh.h +++ b/lib/al/include/Project/Play/Graphics/IUseGridMesh.h @@ -2,6 +2,7 @@ #include #include + #include "Library/HostIO/HioNode.h" namespace agl { diff --git a/lib/al/include/Project/Scene/SceneCreator.h b/lib/al/include/Project/Scene/SceneCreator.h index 29fb8887..9db4745a 100644 --- a/lib/al/include/Project/Scene/SceneCreator.h +++ b/lib/al/include/Project/Scene/SceneCreator.h @@ -15,14 +15,6 @@ class AudioDirector; class Scene; class SceneCreator { -private: - GameSystemInfo* mGameSystemInfo; - GameDataHolderBase* mGameDataHolder; - ScreenCaptureExecutor* mScreenCaptureExecutor; - alSceneFunction::SceneFactory* mSceneFactory; - InitializeThread* mInitializeThread; - AudioDirector* mAudioDirector; - public: SceneCreator(const GameSystemInfo*, GameDataHolderBase*, ScreenCaptureExecutor*, alSceneFunction::SceneFactory*, AudioDirector*); @@ -31,6 +23,14 @@ class SceneCreator { void setSceneAndInit(Scene*, const char*, s32, const char*); bool tryEndInitThread(); bool isExistInitThread(); + +private: + GameSystemInfo* mGameSystemInfo; + GameDataHolderBase* mGameDataHolder; + ScreenCaptureExecutor* mScreenCaptureExecutor; + alSceneFunction::SceneFactory* mSceneFactory; + InitializeThread* mInitializeThread; + AudioDirector* mAudioDirector; }; } // namespace al diff --git a/lib/al/include/Project/Scene/SceneInitInfo.h b/lib/al/include/Project/Scene/SceneInitInfo.h index 8f177f37..577efd99 100644 --- a/lib/al/include/Project/Scene/SceneInitInfo.h +++ b/lib/al/include/Project/Scene/SceneInitInfo.h @@ -1,6 +1,7 @@ #pragma once #include + #include "System/GameDataHolderAccessor.h" namespace al { diff --git a/lib/al/src/Library/Area/AreaShape.cpp b/lib/al/src/Library/Area/AreaShape.cpp index a4079c80..568ad42c 100644 --- a/lib/al/src/Library/Area/AreaShape.cpp +++ b/lib/al/src/Library/Area/AreaShape.cpp @@ -1,6 +1,7 @@ #include "Library/Area/AreaShape.h" #include + #include "Library/Area/AreaShapeCube.h" #include "Library/Area/AreaShapeCylinder.h" #include "Library/Area/AreaShapeInfinite.h" diff --git a/lib/al/src/Library/Base/String.cpp b/lib/al/src/Library/Base/String.cpp index b86e4fe3..4dfaa61f 100755 --- a/lib/al/src/Library/Base/String.cpp +++ b/lib/al/src/Library/Base/String.cpp @@ -1,6 +1,5 @@ #include "Library/Base/String.h" -#include #include namespace al { @@ -67,4 +66,4 @@ bool isEndWithString(const char* pString_0, const char* pString_1) { return isEqualString(&pString_0[pString0_Len - pString1_Len], pString_1); } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Camera/SnapShotCameraCtrl.cpp b/lib/al/src/Library/Camera/SnapShotCameraCtrl.cpp index 80fc7e5f..81005417 100644 --- a/lib/al/src/Library/Camera/SnapShotCameraCtrl.cpp +++ b/lib/al/src/Library/Camera/SnapShotCameraCtrl.cpp @@ -1,4 +1,5 @@ #include "Library/Camera/SnapShotCameraCtrl.h" + #include "Library/Yaml/ByamlUtil.h" namespace al { diff --git a/lib/al/src/Library/Clipping/ViewIdHolder.cpp b/lib/al/src/Library/Clipping/ViewIdHolder.cpp index 24f41dbe..0d5e3ec8 100644 --- a/lib/al/src/Library/Clipping/ViewIdHolder.cpp +++ b/lib/al/src/Library/Clipping/ViewIdHolder.cpp @@ -1,4 +1,5 @@ #include "Library/Clipping/ViewIdHolder.h" + #include "Library/Placement/PlacementFunction.h" #include "Library/Placement/PlacementId.h" #include "Library/Placement/PlacementInfo.h" diff --git a/lib/al/src/Library/Controller/InputFunction.cpp b/lib/al/src/Library/Controller/InputFunction.cpp index eaabad72..8d8165b5 100644 --- a/lib/al/src/Library/Controller/InputFunction.cpp +++ b/lib/al/src/Library/Controller/InputFunction.cpp @@ -3,8 +3,8 @@ namespace al { sead::ControllerBase* getController_(s32 port) { - return al::isValidReplayController(port) ? getReplayController(port) : - sead::ControllerMgr::instance()->getController(port); + return isValidReplayController(port) ? getReplayController(port) : + sead::ControllerMgr::instance()->getController(port); } sead::ControllerBase* getController(s32 port) { diff --git a/lib/al/src/Library/Layout/LayoutActor.cpp b/lib/al/src/Library/Layout/LayoutActor.cpp index 8d048b7b..0847dc4d 100644 --- a/lib/al/src/Library/Layout/LayoutActor.cpp +++ b/lib/al/src/Library/Layout/LayoutActor.cpp @@ -1,4 +1,5 @@ #include "Library/Layout/LayoutActor.h" + #include "Library/Audio/AudioKeeper.h" #include "Library/Layout/LayoutActorUtil.h" #include "Library/Layout/LayoutPartsActorKeeper.h" diff --git a/lib/al/src/Library/Layout/LayoutPartsActorKeeper.cpp b/lib/al/src/Library/Layout/LayoutPartsActorKeeper.cpp index be69545b..be355332 100644 --- a/lib/al/src/Library/Layout/LayoutPartsActorKeeper.cpp +++ b/lib/al/src/Library/Layout/LayoutPartsActorKeeper.cpp @@ -1,4 +1,5 @@ #include "Library/Layout/LayoutPartsActorKeeper.h" + #include "Library/Layout/LayoutActor.h" namespace al { diff --git a/lib/al/src/Library/LiveActor/ActorClippingFunction.cpp b/lib/al/src/Library/LiveActor/ActorClippingFunction.cpp index 64db2aff..846ce9ee 100644 --- a/lib/al/src/Library/LiveActor/ActorClippingFunction.cpp +++ b/lib/al/src/Library/LiveActor/ActorClippingFunction.cpp @@ -1,6 +1,7 @@ #include "Library/LiveActor/ActorClippingFunction.h" #include "Library/LiveActor/LiveActor.h" +#include "Library/LiveActor/LiveActorFlag.h" namespace al { bool isClipped(const LiveActor* actor) { diff --git a/lib/al/src/Library/LiveActor/ActorFlagFunction.cpp b/lib/al/src/Library/LiveActor/ActorFlagFunction.cpp index 6653461d..98a3764a 100644 --- a/lib/al/src/Library/LiveActor/ActorFlagFunction.cpp +++ b/lib/al/src/Library/LiveActor/ActorFlagFunction.cpp @@ -1,5 +1,7 @@ #include "Library/LiveActor/ActorFlagFunction.h" + #include "Library/LiveActor/LiveActor.h" +#include "Library/LiveActor/LiveActorFlag.h" namespace al { bool isAlive(const LiveActor* actor) { diff --git a/lib/al/src/Library/LiveActor/ActorInitInfo.cpp b/lib/al/src/Library/LiveActor/ActorInitInfo.cpp index 27cf03ab..694bdd13 100644 --- a/lib/al/src/Library/LiveActor/ActorInitInfo.cpp +++ b/lib/al/src/Library/LiveActor/ActorInitInfo.cpp @@ -1,4 +1,5 @@ #include "Library/LiveActor/ActorInitInfo.h" + #include "Library/Clipping/ViewIdHolder.h" namespace al { diff --git a/lib/al/src/Library/LiveActor/ActorMovementFunction.cpp b/lib/al/src/Library/LiveActor/ActorMovementFunction.cpp index 987c9e80..66523f57 100644 --- a/lib/al/src/Library/LiveActor/ActorMovementFunction.cpp +++ b/lib/al/src/Library/LiveActor/ActorMovementFunction.cpp @@ -1,5 +1,7 @@ #include "Library/LiveActor/ActorMovementFunction.h" + #include + #include "Library/Audio/AudioKeeper.h" #include "Library/Collision/Collider.h" #include "Library/HitSensor/SensorFunction.h" @@ -95,29 +97,29 @@ sead::Vector3f* getVelocityPtr(LiveActor* actor) { // separateVelocityHV -void addVelocity(al::LiveActor* actor, const sead::Vector3f& vel) { +void addVelocity(LiveActor* actor, const sead::Vector3f& vel) { sead::Vector3f* currentVelocity = actor->getPoseKeeper()->getVelocityPtr(); *currentVelocity += vel; } -void addVelocity(al::LiveActor* actor, f32 x, f32 y, f32 z) { +void addVelocity(LiveActor* actor, f32 x, f32 y, f32 z) { sead::Vector3f* currentVelocity = actor->getPoseKeeper()->getVelocityPtr(); currentVelocity->x += x; currentVelocity->y += y; currentVelocity->z += z; } -void addVelocityX(al::LiveActor* actor, f32 x) { +void addVelocityX(LiveActor* actor, f32 x) { sead::Vector3f* currentVelocity = actor->getPoseKeeper()->getVelocityPtr(); currentVelocity->x += x; } -void addVelocityY(al::LiveActor* actor, f32 y) { +void addVelocityY(LiveActor* actor, f32 y) { sead::Vector3f* currentVelocity = actor->getPoseKeeper()->getVelocityPtr(); currentVelocity->y += y; } -void addVelocityZ(al::LiveActor* actor, f32 z) { +void addVelocityZ(LiveActor* actor, f32 z) { sead::Vector3f* currentVelocity = actor->getPoseKeeper()->getVelocityPtr(); currentVelocity->z += z; } diff --git a/lib/al/src/Library/LiveActor/ActorPoseKeeper.cpp b/lib/al/src/Library/LiveActor/ActorPoseKeeper.cpp index 186ae164..14d69010 100644 --- a/lib/al/src/Library/LiveActor/ActorPoseKeeper.cpp +++ b/lib/al/src/Library/LiveActor/ActorPoseKeeper.cpp @@ -363,7 +363,7 @@ void ActorPoseKeeperTRSV::updatePoseMtx(const sead::Matrix34f* mtx) { rotationAndTranslationFromMatrix(mTrans, mRotate, mtx); } void ActorPoseKeeperTRSV::calcBaseMtx(sead::Matrix34f* mtx) const { - al::makeMtxRotateTrans(mtx, getRotate(), mTrans); + makeMtxRotateTrans(mtx, getRotate(), mTrans); } ActorPoseKeeperTRMSV::ActorPoseKeeperTRMSV() { diff --git a/lib/al/src/Library/LiveActor/LiveActor.cpp b/lib/al/src/Library/LiveActor/LiveActor.cpp index 586a16c9..96af0065 100755 --- a/lib/al/src/Library/LiveActor/LiveActor.cpp +++ b/lib/al/src/Library/LiveActor/LiveActor.cpp @@ -1,7 +1,7 @@ #include "Library/LiveActor/LiveActor.h" -#include #include "Library/LiveActor/ActorFlagFunction.h" +#include "Library/LiveActor/LiveActorFlag.h" #include "Library/LiveActor/LiveActorUtil.h" #include "Library/Rail/RailKeeper.h" #include "Library/Shadow/ShadowKeeper.h" diff --git a/lib/al/src/Library/LiveActor/LiveActorFlag.cpp b/lib/al/src/Library/LiveActor/LiveActorFlag.cpp index 35c0d384..b929d2cf 100644 --- a/lib/al/src/Library/LiveActor/LiveActorFlag.cpp +++ b/lib/al/src/Library/LiveActor/LiveActorFlag.cpp @@ -1,4 +1,4 @@ -#include "Library/LiveActor/LiveActor.h" +#include "Library/LiveActor/LiveActorFlag.h" namespace al { LiveActorFlag::LiveActorFlag() = default; diff --git a/lib/al/src/Library/LiveActor/LiveActorGroup.cpp b/lib/al/src/Library/LiveActor/LiveActorGroup.cpp index f5f8b228..f592df87 100755 --- a/lib/al/src/Library/LiveActor/LiveActorGroup.cpp +++ b/lib/al/src/Library/LiveActor/LiveActorGroup.cpp @@ -1,4 +1,5 @@ #include "Library/LiveActor/LiveActorGroup.h" + #include "Library/LiveActor/LiveActorUtil.h" namespace al { @@ -106,4 +107,4 @@ void LiveActorGroup::makeActorDeadAll() { mActors[i]->makeActorDead(); } } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/LiveActor/SubActorKeeper.cpp b/lib/al/src/Library/LiveActor/SubActorKeeper.cpp index 7bf08d43..48bbe4a7 100644 --- a/lib/al/src/Library/LiveActor/SubActorKeeper.cpp +++ b/lib/al/src/Library/LiveActor/SubActorKeeper.cpp @@ -1,4 +1,5 @@ #include "Library/LiveActor/SubActorKeeper.h" + #include "Library/Base/String.h" #include "Library/LiveActor/ActorModelFunction.h" #include "Library/LiveActor/ActorResourceFunction.h" diff --git a/lib/al/src/Library/MapObj/FixMapParts.cpp b/lib/al/src/Library/MapObj/FixMapParts.cpp index 101051c9..15c8acd2 100644 --- a/lib/al/src/Library/MapObj/FixMapParts.cpp +++ b/lib/al/src/Library/MapObj/FixMapParts.cpp @@ -1,4 +1,5 @@ #include "Library/MapObj/FixMapParts.h" + #include "Library/LiveActor/ActorActionFunction.h" #include "Library/LiveActor/ActorInitInfo.h" #include "Library/LiveActor/ActorSensorMsgFunction.h" diff --git a/lib/al/src/Library/Math/MathUtil.cpp b/lib/al/src/Library/Math/MathUtil.cpp index 8a6ffa21..718746fe 100755 --- a/lib/al/src/Library/Math/MathUtil.cpp +++ b/lib/al/src/Library/Math/MathUtil.cpp @@ -1,5 +1,5 @@ #include "Library/Math/MathUtil.h" -#include + #include namespace al { @@ -97,4 +97,4 @@ f32 lerpValue(f32 x, f32 y, f32 time) { time = 1.0f; return (x * (1.0f - time)) + (time * y); } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Nerve/NerveKeeper.cpp b/lib/al/src/Library/Nerve/NerveKeeper.cpp index 9c5581d6..c44110fa 100644 --- a/lib/al/src/Library/Nerve/NerveKeeper.cpp +++ b/lib/al/src/Library/Nerve/NerveKeeper.cpp @@ -1,4 +1,5 @@ #include "Library/Nerve/NerveKeeper.h" + #include "Library/Nerve/Nerve.h" #include "Library/Nerve/NerveStateCtrl.h" diff --git a/lib/al/src/Library/Nerve/NerveStateCtrl.cpp b/lib/al/src/Library/Nerve/NerveStateCtrl.cpp index a5d64a74..899b2bca 100644 --- a/lib/al/src/Library/Nerve/NerveStateCtrl.cpp +++ b/lib/al/src/Library/Nerve/NerveStateCtrl.cpp @@ -63,4 +63,4 @@ void NerveStateCtrl::tryEndCurrentState() { mCurrentState = nullptr; } } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Nerve/NerveUtil.cpp b/lib/al/src/Library/Nerve/NerveUtil.cpp index 166eb71b..d939cf55 100644 --- a/lib/al/src/Library/Nerve/NerveUtil.cpp +++ b/lib/al/src/Library/Nerve/NerveUtil.cpp @@ -1,5 +1,5 @@ #include "Library/Nerve/NerveUtil.h" -#include + #include "Library/Nerve/IUseNerve.h" #include "Library/Nerve/NerveKeeper.h" #include "Library/Nerve/NerveStateCtrl.h" @@ -63,8 +63,8 @@ bool isNewNerve(const IUseNerve* user) { return user->getNerveKeeper()->isNewNerve(); } -s32 calcNerveInterval(const al::IUseNerve* pKeeper, s32 start, s32 end) { - al::NerveKeeper* keeper = pKeeper->getNerveKeeper(); +s32 calcNerveInterval(const IUseNerve* pKeeper, s32 start, s32 end) { + NerveKeeper* keeper = pKeeper->getNerveKeeper(); s32 dist = keeper->getCurrentStep() - end; diff --git a/lib/al/src/Library/Obj/BreakModel.cpp b/lib/al/src/Library/Obj/BreakModel.cpp index ca0e811b..6aa69d42 100644 --- a/lib/al/src/Library/Obj/BreakModel.cpp +++ b/lib/al/src/Library/Obj/BreakModel.cpp @@ -1,4 +1,5 @@ #include "Library/Obj/BreakModel.h" + #include "Library/LiveActor/ActorActionFunction.h" #include "Library/LiveActor/ActorClippingFunction.h" #include "Library/LiveActor/ActorInitInfo.h" diff --git a/lib/al/src/Library/Obj/SilhouetteModel.cpp b/lib/al/src/Library/Obj/SilhouetteModel.cpp index 55ad0efc..81435ca1 100644 --- a/lib/al/src/Library/Obj/SilhouetteModel.cpp +++ b/lib/al/src/Library/Obj/SilhouetteModel.cpp @@ -1,4 +1,5 @@ #include "Library/Obj/SilhouetteModel.h" + #include "Library/LiveActor/ActorClippingFunction.h" #include "Library/LiveActor/ActorInitInfo.h" diff --git a/lib/al/src/Library/Placement/PlacementFunction.cpp b/lib/al/src/Library/Placement/PlacementFunction.cpp index 692c0411..ba2d5a25 100755 --- a/lib/al/src/Library/Placement/PlacementFunction.cpp +++ b/lib/al/src/Library/Placement/PlacementFunction.cpp @@ -6,13 +6,12 @@ #include "Library/Yaml/ByamlIter.h" namespace al { -s32 getCountPlacementInfo(const al::PlacementInfo& rInfo) { +s32 getCountPlacementInfo(const PlacementInfo& rInfo) { return rInfo.getPlacementIter().getSize(); } -void getPlacementInfoByKey(al::PlacementInfo* pOutInfo, const al::PlacementInfo& rInfo, - const char* pKey) { - al::ByamlIter iterator; +void getPlacementInfoByKey(PlacementInfo* pOutInfo, const PlacementInfo& rInfo, const char* pKey) { + ByamlIter iterator; bool ret = rInfo.getPlacementIter().tryGetIterByKey(&iterator, pKey); if (ret) { @@ -20,8 +19,8 @@ void getPlacementInfoByKey(al::PlacementInfo* pOutInfo, const al::PlacementInfo& } } -void getPlacementInfoByIndex(al::PlacementInfo* pOutInfo, const al::PlacementInfo& rInfo, s32 idx) { - al::ByamlIter iterator; +void getPlacementInfoByIndex(PlacementInfo* pOutInfo, const PlacementInfo& rInfo, s32 idx) { + ByamlIter iterator; bool ret = rInfo.getPlacementIter().tryGetIterByIndex(&iterator, idx); if (ret) { @@ -29,11 +28,10 @@ void getPlacementInfoByIndex(al::PlacementInfo* pOutInfo, const al::PlacementInf } } -bool tryGetPlacementInfoByIndex(al::PlacementInfo* pOutInfo, const al::PlacementInfo& rInfo, - s32 idx) { +bool tryGetPlacementInfoByIndex(PlacementInfo* pOutInfo, const PlacementInfo& rInfo, s32 idx) { bool result; - al::ByamlIter iterator; + ByamlIter iterator; bool ret = rInfo.getPlacementIter().tryGetIterByIndex(&iterator, idx); if (ret) { @@ -46,9 +44,9 @@ bool tryGetPlacementInfoByIndex(al::PlacementInfo* pOutInfo, const al::Placement return result; } -void getPlacementInfoAndKeyNameByIndex(al::PlacementInfo* pOutInfo, const char** pOutKeyName, - const al::PlacementInfo& rInfo, s32 idx) { - al::ByamlIter iterator; +void getPlacementInfoAndKeyNameByIndex(PlacementInfo* pOutInfo, const char** pOutKeyName, + const PlacementInfo& rInfo, s32 idx) { + ByamlIter iterator; bool ret = rInfo.getPlacementIter().tryGetIterAndKeyNameByIndex(&iterator, pOutKeyName, idx); @@ -57,11 +55,11 @@ void getPlacementInfoAndKeyNameByIndex(al::PlacementInfo* pOutInfo, const char** } } -bool tryGetPlacementInfoAndKeyNameByIndex(al::PlacementInfo* pOutInfo, const char** pOutKeyName, - const al::PlacementInfo& rInfo, s32 idx) { +bool tryGetPlacementInfoAndKeyNameByIndex(PlacementInfo* pOutInfo, const char** pOutKeyName, + const PlacementInfo& rInfo, s32 idx) { bool result; - al::ByamlIter iterator; + ByamlIter iterator; bool ret = rInfo.getPlacementIter().tryGetIterAndKeyNameByIndex(&iterator, pOutKeyName, idx); if (ret) { @@ -74,45 +72,45 @@ bool tryGetPlacementInfoAndKeyNameByIndex(al::PlacementInfo* pOutInfo, const cha return result; } -al::PlacementId* createPlacementId(const al::ActorInitInfo& rInfo) { - const al::PlacementInfo& info = rInfo.getPlacementInfo(); - al::PlacementId* id = new al::PlacementId(); +PlacementId* createPlacementId(const ActorInitInfo& rInfo) { + const PlacementInfo& info = rInfo.getPlacementInfo(); + PlacementId* id = new PlacementId(); id->init(info); return id; } -al::PlacementId* createPlacementId(const al::PlacementInfo& rInfo) { - al::PlacementId* id = new al::PlacementId(); +PlacementId* createPlacementId(const PlacementInfo& rInfo) { + PlacementId* id = new PlacementId(); id->init(rInfo); return id; } -bool tryGetPlacementId(al::PlacementId* pOut, const al::ActorInitInfo& rInfo) { +bool tryGetPlacementId(PlacementId* pOut, const ActorInitInfo& rInfo) { return pOut->init(rInfo.getPlacementInfo()); } -bool tryGetPlacementId(al::PlacementId* pOut, const al::PlacementInfo& rInfo) { +bool tryGetPlacementId(PlacementId* pOut, const PlacementInfo& rInfo) { return pOut->init(rInfo); } -void getPlacementId(al::PlacementId* pOut, const al::ActorInitInfo& rInfo) { +void getPlacementId(PlacementId* pOut, const ActorInitInfo& rInfo) { pOut->init(rInfo.getPlacementInfo()); } -void getPlacementId(al::PlacementId* pOut, const al::PlacementInfo& rInfo) { +void getPlacementId(PlacementId* pOut, const PlacementInfo& rInfo) { pOut->init(rInfo); } -bool isEqualPlacementId(const al::PlacementId& rLhs, const al::PlacementId& rRhs) { +bool isEqualPlacementId(const PlacementId& rLhs, const PlacementId& rRhs) { return rLhs.isEqual(rRhs); } -bool isEqualPlacementId(const al::PlacementInfo& rLhs, const al::PlacementInfo& rRhs) { +bool isEqualPlacementId(const PlacementInfo& rLhs, const PlacementInfo& rRhs) { bool res; - al::PlacementId id_lhs; + PlacementId id_lhs; if (id_lhs.init(rLhs)) { - al::PlacementId id_rhs; + PlacementId id_rhs; if (id_rhs.init(rRhs)) { res = id_lhs.isEqual(id_rhs); diff --git a/lib/al/src/Library/Placement/PlacementInfo.cpp b/lib/al/src/Library/Placement/PlacementInfo.cpp index 597f40f3..3c921991 100755 --- a/lib/al/src/Library/Placement/PlacementInfo.cpp +++ b/lib/al/src/Library/Placement/PlacementInfo.cpp @@ -7,4 +7,4 @@ void PlacementInfo::set(const ByamlIter& placement_iter, const ByamlIter& zone_i mPlacementIter = placement_iter; mZoneIter = zone_iter; } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Rail/Rail.cpp b/lib/al/src/Library/Rail/Rail.cpp index 5dfcdcc9..90d67902 100644 --- a/lib/al/src/Library/Rail/Rail.cpp +++ b/lib/al/src/Library/Rail/Rail.cpp @@ -1,12 +1,9 @@ #include "Library/Rail/Rail.h" -#include #include "Library/Math/MathUtil.h" #include "Library/Placement/PlacementFunction.h" #include "Library/Placement/PlacementInfo.h" #include "Library/Rail/RailPart.h" -#include "math/seadMathCalcCommon.h" -#include "math/seadVector.h" namespace al { diff --git a/lib/al/src/Library/Rail/RailKeeper.cpp b/lib/al/src/Library/Rail/RailKeeper.cpp index f691a4b4..6e0d9e18 100644 --- a/lib/al/src/Library/Rail/RailKeeper.cpp +++ b/lib/al/src/Library/Rail/RailKeeper.cpp @@ -1,4 +1,5 @@ #include "Library/Rail/RailKeeper.h" + #include "Library/Rail/Rail.h" #include "Library/Rail/RailRider.h" diff --git a/lib/al/src/Library/Rail/RailPart.cpp b/lib/al/src/Library/Rail/RailPart.cpp index bc011b39..c9d56aa5 100644 --- a/lib/al/src/Library/Rail/RailPart.cpp +++ b/lib/al/src/Library/Rail/RailPart.cpp @@ -5,7 +5,6 @@ #include "Library/Math/VectorUtil.h" #include "Project/Rail/BezierCurve.h" #include "Project/Rail/LinearCurve.h" -#include "math/seadVector.h" namespace al { diff --git a/lib/al/src/Library/Resource/Resource.cpp b/lib/al/src/Library/Resource/Resource.cpp index 4918cf47..f3c8957b 100755 --- a/lib/al/src/Library/Resource/Resource.cpp +++ b/lib/al/src/Library/Resource/Resource.cpp @@ -1,9 +1,11 @@ #include "Library/Resource/Resource.h" + #include #include #include #include #include + #include "Library/File/FileUtil.h" namespace al { @@ -47,4 +49,4 @@ void Resource::cleanupResGraphicsFile() { agl::g3d::ResFile::Cleanup(mResFile); mResFile = nullptr; } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Scene/SceneObjHolder.cpp b/lib/al/src/Library/Scene/SceneObjHolder.cpp index 7646d1ad..4841a71d 100644 --- a/lib/al/src/Library/Scene/SceneObjHolder.cpp +++ b/lib/al/src/Library/Scene/SceneObjHolder.cpp @@ -4,7 +4,7 @@ namespace al { -SceneObjHolder::SceneObjHolder(al::ISceneObj* (*creator)(s32), s32 size) +SceneObjHolder::SceneObjHolder(ISceneObj* (*creator)(s32), s32 size) : mCreator(creator), mArraySize(size) { mSceneObjArray = new ISceneObj*[size]; @@ -32,11 +32,11 @@ bool SceneObjHolder::isExist(s32 index) const { return mSceneObjArray[index] != nullptr; } -void SceneObjHolder::setSceneObj(al::ISceneObj* obj, s32 index) { +void SceneObjHolder::setSceneObj(ISceneObj* obj, s32 index) { mSceneObjArray[index] = obj; } -void SceneObjHolder::initAfterPlacementSceneObj(const al::ActorInitInfo& info) { +void SceneObjHolder::initAfterPlacementSceneObj(const ActorInitInfo& info) { for (s32 i = 0; i < mArraySize; i++) { if (mSceneObjArray[i]) mSceneObjArray[i]->initAfterPlacementSceneObj(info); diff --git a/lib/al/src/Library/Shadow/DepthShadowMapCtrl.cpp b/lib/al/src/Library/Shadow/DepthShadowMapCtrl.cpp deleted file mode 100644 index 844f8557..00000000 --- a/lib/al/src/Library/Shadow/DepthShadowMapCtrl.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "Library/Shadow/DepthShadowMapCtrl.h" - -namespace al {} diff --git a/lib/al/src/Library/Shadow/ShadowKeeper.cpp b/lib/al/src/Library/Shadow/ShadowKeeper.cpp index 0642a04b..b9166b0c 100644 --- a/lib/al/src/Library/Shadow/ShadowKeeper.cpp +++ b/lib/al/src/Library/Shadow/ShadowKeeper.cpp @@ -7,7 +7,7 @@ namespace al { ShadowKeeper::ShadowKeeper() = default; -void ShadowKeeper::initAfterPlacement(al::GraphicsSystemInfo* info) { +void ShadowKeeper::initAfterPlacement(GraphicsSystemInfo* info) { if (mShadowMaskCtrl) mShadowMaskCtrl->initAfterPlacement(); if (mDepthShadowMapCtrl) diff --git a/lib/al/src/Library/Shadow/ShadowMaskCtrl.cpp b/lib/al/src/Library/Shadow/ShadowMaskCtrl.cpp deleted file mode 100644 index 4f064909..00000000 --- a/lib/al/src/Library/Shadow/ShadowMaskCtrl.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "Library/Shadow/ShadowMaskCtrl.h" - -namespace al {} diff --git a/lib/al/src/Library/Thread/AsyncFunctorThread.cpp b/lib/al/src/Library/Thread/AsyncFunctorThread.cpp index df3032cd..3ac7d275 100644 --- a/lib/al/src/Library/Thread/AsyncFunctorThread.cpp +++ b/lib/al/src/Library/Thread/AsyncFunctorThread.cpp @@ -8,7 +8,7 @@ namespace al { AsyncFunctorThread::AsyncFunctorThread(const sead::SafeString& functor_name, - const al::FunctorBase& functor, s32 priority, s32 stack_size, + const FunctorBase& functor, s32 priority, s32 stack_size, sead::CoreId id) { s32 size = stack_size < 0 ? 4096 : stack_size; mDelegateThread = new sead::DelegateThread( diff --git a/lib/al/src/Library/Yaml/ByamlData.cpp b/lib/al/src/Library/Yaml/ByamlData.cpp index 79f04147..4400df26 100755 --- a/lib/al/src/Library/Yaml/ByamlData.cpp +++ b/lib/al/src/Library/Yaml/ByamlData.cpp @@ -1,5 +1,7 @@ #include "Library/Yaml/ByamlData.h" +#include + namespace al { ByamlData::ByamlData() = default; diff --git a/lib/al/src/Library/Yaml/ByamlHeader.cpp b/lib/al/src/Library/Yaml/ByamlHeader.cpp index 384f0e9d..e33f42a0 100755 --- a/lib/al/src/Library/Yaml/ByamlHeader.cpp +++ b/lib/al/src/Library/Yaml/ByamlHeader.cpp @@ -1,9 +1,9 @@ #include "Library/Yaml/ByamlHeader.h" #include -#include #include #include + #include "Library/Yaml/ByamlData.h" #define BYAML_LE_TAG 'YB' diff --git a/lib/al/src/Library/Yaml/ByamlIter.cpp b/lib/al/src/Library/Yaml/ByamlIter.cpp index 2e4b9f2c..21e79581 100644 --- a/lib/al/src/Library/Yaml/ByamlIter.cpp +++ b/lib/al/src/Library/Yaml/ByamlIter.cpp @@ -80,7 +80,7 @@ ByamlIter ByamlIter::getIterByIndex(s32 index) const { } return {mData, &mData[data.getValue()]}; } -bool ByamlIter::getByamlDataByIndex(al::ByamlData* data, s32 index) const { +bool ByamlIter::getByamlDataByIndex(ByamlData* data, s32 index) const { if (!mRootNode) return false; if (*mRootNode == ByamlDataType::TYPE_ARRAY) { @@ -104,7 +104,7 @@ ByamlIter ByamlIter::getIterByKey(const char* key) const { } return {mData, &mData[data.getValue()]}; } -bool ByamlIter::getByamlDataByKey(al::ByamlData* data, const char* key) const { +bool ByamlIter::getByamlDataByKey(ByamlData* data, const char* key) const { if (!mRootNode || *mRootNode != ByamlDataType::TYPE_HASH) return false; ByamlStringTableIter hash_table = alByamlLocalUtil::getHashKeyTable(mData); @@ -131,14 +131,14 @@ bool ByamlIter::getByamlDataByKey(al::ByamlData* data, const char* key) const { } return false; } -bool ByamlIter::getByamlDataByKeyIndex(al::ByamlData* data, s32 index) const { +bool ByamlIter::getByamlDataByKeyIndex(ByamlData* data, s32 index) const { if (!mRootNode || *mRootNode != ByamlDataType::TYPE_HASH) return false; ByamlHashIter iter = {mRootNode, isInvertOrder()}; return iter.getDataByKey(data, index); } -bool ByamlIter::getByamlDataAndKeyName(al::ByamlData* data, const char** key, s32 index) const { +bool ByamlIter::getByamlDataAndKeyName(ByamlData* data, const char** key, s32 index) const { if (!mRootNode || *mRootNode != ByamlDataType::TYPE_HASH) return false; diff --git a/lib/al/src/Library/Yaml/ByamlUtil.cpp b/lib/al/src/Library/Yaml/ByamlUtil.cpp index 55390ceb..82db3a56 100755 --- a/lib/al/src/Library/Yaml/ByamlUtil.cpp +++ b/lib/al/src/Library/Yaml/ByamlUtil.cpp @@ -1,7 +1,7 @@ #include "Library/Yaml/ByamlUtil.h" + #include "Library/Yaml/ByamlData.h" #include "Library/Yaml/ByamlIter.h" -#include "math/seadBoundBox.h" namespace al { bool tryGetByamlU8(u8* pOut, const ByamlIter& rIter, const char* pKey) { diff --git a/lib/al/src/Library/Yaml/Writer/ByamlWriter.cpp b/lib/al/src/Library/Yaml/Writer/ByamlWriter.cpp index f05bf39b..c481ffea 100644 --- a/lib/al/src/Library/Yaml/Writer/ByamlWriter.cpp +++ b/lib/al/src/Library/Yaml/Writer/ByamlWriter.cpp @@ -2,6 +2,7 @@ #include #include + #include "Library/Yaml/ByamlIter.h" #include "Library/Yaml/Writer/ByamlWriterBigDataList.h" #include "Library/Yaml/Writer/ByamlWriterData.h" @@ -156,13 +157,13 @@ void ByamlWriter::pushArray(const char* key) { pushContainer(array); } -void ByamlWriter::pushIter(const al::ByamlIter& iter) { +void ByamlWriter::pushIter(const ByamlIter& iter) { pushLocalIter(iter, nullptr); } -void ByamlWriter::pushIter(const char* key, const al::ByamlIter& iter) { +void ByamlWriter::pushIter(const char* key, const ByamlIter& iter) { pushLocalIter(iter, key); } -void ByamlWriter::pushLocalIter(const al::ByamlIter& iter, const char* iterKey) { +void ByamlWriter::pushLocalIter(const ByamlIter& iter, const char* iterKey) { if (!iter.isValid()) return; diff --git a/lib/al/src/Library/Yaml/Writer/ByamlWriterBigDataList.cpp b/lib/al/src/Library/Yaml/Writer/ByamlWriterBigDataList.cpp index 2d92abfd..40ab6f48 100644 --- a/lib/al/src/Library/Yaml/Writer/ByamlWriterBigDataList.cpp +++ b/lib/al/src/Library/Yaml/Writer/ByamlWriterBigDataList.cpp @@ -10,7 +10,7 @@ ByamlWriterBigDataList::~ByamlWriterBigDataList() { delete node; } } -void ByamlWriterBigDataList::addData(al::ByamlWriterBigData* data) { +void ByamlWriterBigDataList::addData(ByamlWriterBigData* data) { mList.pushBack(new sead::TListNode(data)); } u32 ByamlWriterBigDataList::calcPackSize() const { diff --git a/lib/al/src/Library/Yaml/Writer/ByamlWriterData.cpp b/lib/al/src/Library/Yaml/Writer/ByamlWriterData.cpp index d5a6235d..a9331b90 100644 --- a/lib/al/src/Library/Yaml/Writer/ByamlWriterData.cpp +++ b/lib/al/src/Library/Yaml/Writer/ByamlWriterData.cpp @@ -1,6 +1,7 @@ #include "Library/Yaml/Writer/ByamlWriterData.h" #include + #include "Library/Yaml/ByamlUtil.h" #include "Library/Yaml/Writer/ByamlWriterBigDataList.h" #include "Library/Yaml/Writer/ByamlWriterStringTable.h" @@ -78,7 +79,7 @@ void ByamlWriterString::write(sead::WriteStream* stream) const { stream->writeU32(mStringTable->calcIndex(mString)); } -ByamlWriterBigData::ByamlWriterBigData(al::ByamlWriterBigDataList* list) : mList(list) { +ByamlWriterBigData::ByamlWriterBigData(ByamlWriterBigDataList* list) : mList(list) { mList->addData(this); } ByamlWriterBigData::~ByamlWriterBigData() = default; diff --git a/lib/al/src/Library/Yaml/Writer/ByamlWriterStringTable.cpp b/lib/al/src/Library/Yaml/Writer/ByamlWriterStringTable.cpp index cda5b7a2..1ff7b943 100644 --- a/lib/al/src/Library/Yaml/Writer/ByamlWriterStringTable.cpp +++ b/lib/al/src/Library/Yaml/Writer/ByamlWriterStringTable.cpp @@ -1,7 +1,7 @@ #include "Library/Yaml/Writer/ByamlWriterStringTable.h" -#include #include + #include "Library/Yaml/ByamlUtil.h" namespace al { diff --git a/lib/al/src/Project/HitSensor/HitSensor.cpp b/lib/al/src/Project/HitSensor/HitSensor.cpp index 306a6344..7c03591e 100755 --- a/lib/al/src/Project/HitSensor/HitSensor.cpp +++ b/lib/al/src/Project/HitSensor/HitSensor.cpp @@ -42,11 +42,11 @@ void HitSensor::invalidate() { // HitSensor::invalidateBySystem // HitSensor::update (requires some more LiveActor research) -void HitSensor::addHitSensor(al::HitSensor* pSensor) { +void HitSensor::addHitSensor(HitSensor* pSensor) { // todo -- registers are different if (mSensorCount < mMaxSensorCount) { mSensors[mSensorCount] = pSensor; ++mSensorCount; } } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Project/HitSensor/SensorHitGroup.cpp b/lib/al/src/Project/HitSensor/SensorHitGroup.cpp index db95133a..fdfab14c 100644 --- a/lib/al/src/Project/HitSensor/SensorHitGroup.cpp +++ b/lib/al/src/Project/HitSensor/SensorHitGroup.cpp @@ -8,12 +8,12 @@ SensorHitGroup::SensorHitGroup(s32 maxSensors, const char* groupName) mSensors[i] = nullptr; } -void SensorHitGroup::add(al::HitSensor* pSensor) { +void SensorHitGroup::add(HitSensor* pSensor) { mSensors[mSensorCount] = pSensor; mSensorCount++; } -al::HitSensor* SensorHitGroup::getSensor(s32 idx) const { +HitSensor* SensorHitGroup::getSensor(s32 idx) const { return mSensors[idx]; } diff --git a/lib/al/src/Project/Rail/BezierCurve.cpp b/lib/al/src/Project/Rail/BezierCurve.cpp index c9a25a7e..d77b28db 100644 --- a/lib/al/src/Project/Rail/BezierCurve.cpp +++ b/lib/al/src/Project/Rail/BezierCurve.cpp @@ -1,5 +1,4 @@ #include "Project/Rail/BezierCurve.h" -#include "math/seadVector.h" namespace al { diff --git a/lib/al/src/Project/Rail/LinearCurve.cpp b/lib/al/src/Project/Rail/LinearCurve.cpp index 87f91d57..32b3d452 100644 --- a/lib/al/src/Project/Rail/LinearCurve.cpp +++ b/lib/al/src/Project/Rail/LinearCurve.cpp @@ -26,14 +26,14 @@ f32 LinearCurve::calcLength(f32 param_start, f32 param_end) const { return mDistance * sead::Mathf::abs(param_end - param_start); } f32 LinearCurve::calcCurveParam(f32 param) const { - if (al::isNearZero(mDistance, 0.001)) + if (isNearZero(mDistance, 0.001)) return 0; return sead::Mathf::clamp(param, 0, mDistance) / mDistance; } f32 LinearCurve::calcNearestParam(const sead::Vector3f& pos) const { - if (al::isNearZero(mDistance, 0.001)) + if (isNearZero(mDistance, 0.001)) return 0; f32 dot = (pos - mStart).dot(mDiff); diff --git a/src/Boss/Mofumofu/MofumofuWarpHole.cpp b/src/Boss/Mofumofu/MofumofuWarpHole.cpp index 1a23e17d..443a3cf5 100644 --- a/src/Boss/Mofumofu/MofumofuWarpHole.cpp +++ b/src/Boss/Mofumofu/MofumofuWarpHole.cpp @@ -2,6 +2,7 @@ #include #include + #include "Library/LiveActor/ActorActionFunction.h" #include "Library/LiveActor/ActorInitInfo.h" #include "Library/LiveActor/ActorPoseKeeper.h" diff --git a/src/Boss/Mofumofu/MofumofuWarpHole.h b/src/Boss/Mofumofu/MofumofuWarpHole.h index ffe91792..f9510684 100644 --- a/src/Boss/Mofumofu/MofumofuWarpHole.h +++ b/src/Boss/Mofumofu/MofumofuWarpHole.h @@ -2,6 +2,7 @@ #include #include + #include "Library/LiveActor/LiveActor.h" #include "Library/Nerve/NerveUtil.h" diff --git a/src/Layout/CoinCounter.h b/src/Layout/CoinCounter.h index 308c4695..650f2e70 100644 --- a/src/Layout/CoinCounter.h +++ b/src/Layout/CoinCounter.h @@ -1,9 +1,5 @@ #pragma once -/* - * VTable Loc: 1CC3170 - */ - #include "Library/Layout/LayoutActor.h" class CoinCounter : public al::LayoutActor {}; diff --git a/src/MapObj/AnagramAlphabetCharacter.cpp b/src/MapObj/AnagramAlphabetCharacter.cpp index 624018b9..91f606fa 100644 --- a/src/MapObj/AnagramAlphabetCharacter.cpp +++ b/src/MapObj/AnagramAlphabetCharacter.cpp @@ -13,6 +13,7 @@ #include "Library/Math/MathUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Nerve/NerveUtil.h" + #include "MapObj/AnagramAlphabet.h" #include "MapObj/CapTargetParts.h" #include "Player/HackerJudge.h" diff --git a/src/MapObj/FireDrum2D.cpp b/src/MapObj/FireDrum2D.cpp index 8b83426f..07b1c172 100644 --- a/src/MapObj/FireDrum2D.cpp +++ b/src/MapObj/FireDrum2D.cpp @@ -6,6 +6,7 @@ #include "Library/LiveActor/LiveActorUtil.h" #include "Library/Nerve/NerveSetupUtil.h" #include "Library/Nerve/NerveUtil.h" + #include "Util/ActorDimensionKeeper.h" #include "Util/Sensor.h" diff --git a/src/MapObj/FireDrum2D.h b/src/MapObj/FireDrum2D.h index 597ce97b..16b07e85 100644 --- a/src/MapObj/FireDrum2D.h +++ b/src/MapObj/FireDrum2D.h @@ -2,6 +2,7 @@ #include "Library/LiveActor/LiveActor.h" #include "Library/Nerve/NerveUtil.h" + #include "Util/IUseDimension.h" namespace al { diff --git a/src/MapObj/WorldMapParts.h b/src/MapObj/WorldMapParts.h index 77ed1403..43077f47 100644 --- a/src/MapObj/WorldMapParts.h +++ b/src/MapObj/WorldMapParts.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Library/LiveActor/LiveActor.h" class WorldMapParts : public al::LiveActor { diff --git a/src/Npc/AchievementHolder.cpp b/src/Npc/AchievementHolder.cpp index 8cf7d646..3e45cf57 100644 --- a/src/Npc/AchievementHolder.cpp +++ b/src/Npc/AchievementHolder.cpp @@ -2,6 +2,7 @@ #include "Library/Base/String.h" #include "Library/Resource/ResourceUtil.h" + #include "Npc/Achievement.h" #include "Npc/AchievementInfoReader.h" #include "System/GameDataFunction.h" diff --git a/src/Npc/AchievementHolder.h b/src/Npc/AchievementHolder.h index a1819249..25bbf8cd 100644 --- a/src/Npc/AchievementHolder.h +++ b/src/Npc/AchievementHolder.h @@ -2,6 +2,7 @@ #include #include + #include "System/GameDataHolderAccessor.h" namespace al { diff --git a/src/Player/HackCap.h b/src/Player/HackCap.h index 4c67e758..33a1c92b 100644 --- a/src/Player/HackCap.h +++ b/src/Player/HackCap.h @@ -1,14 +1,7 @@ #pragma once -/** - * @file HackCap.h - * @brief Main Class for HackCap (Cappy) - * Vtable loc: 1D75520 - */ #include "Library/LiveActor/LiveActor.h" -#define HACKSIZE sizeof(al::LiveActor) - class HackCap : public al::LiveActor { public: void calcReturnTargetPos(sead::Vector3f*); @@ -20,8 +13,8 @@ class HackCap : public al::LiveActor { bool isThrowTypeSpiral(void) const; - unsigned char padding_118[0x118 - HACKSIZE]; - al::LiveActor* mActorA; // 0x118 + unsigned char padding_to_118[0x10]; + al::LiveActor* mActorA; unsigned char padding_08[0x08]; - al::LiveActor* mPlayerActor; // 0x128 + al::LiveActor* mPlayerActor; }; diff --git a/src/Player/HackerJudge.h b/src/Player/HackerJudge.h index 27f222f1..7ed0363d 100644 --- a/src/Player/HackerJudge.h +++ b/src/Player/HackerJudge.h @@ -1,6 +1,7 @@ #pragma once #include "Library/HostIO/HioNode.h" + #include "Player/IJudge.h" class IUsePlayerHack; diff --git a/src/Player/Player.cpp b/src/Player/Player.cpp index d1aa1486..17322437 100644 --- a/src/Player/Player.cpp +++ b/src/Player/Player.cpp @@ -1,4 +1,5 @@ #include "Player/Player.h" + #include "Library/Controller/InputFunction.h" #include "Library/LiveActor/ActorActionFunction.h" #include "Library/LiveActor/ActorClippingFunction.h" diff --git a/src/Player/PlayerActorBase.h b/src/Player/PlayerActorBase.h index c8fc2522..ca3341aa 100644 --- a/src/Player/PlayerActorBase.h +++ b/src/Player/PlayerActorBase.h @@ -1,6 +1,7 @@ #pragma once #include "Library/LiveActor/LiveActor.h" + #include "Player/IUsePlayerHack.h" class IUsePlayerCollision; diff --git a/src/Player/PlayerAnimFrameCtrl.h b/src/Player/PlayerAnimFrameCtrl.h index 464df4b8..a2eb68ef 100644 --- a/src/Player/PlayerAnimFrameCtrl.h +++ b/src/Player/PlayerAnimFrameCtrl.h @@ -3,4 +3,4 @@ class PlayerAnimFrameCtrl { public: const char* getActionName(void) const; -}; \ No newline at end of file +}; diff --git a/src/Player/PlayerAnimator.h b/src/Player/PlayerAnimator.h index f528293f..9b5db593 100644 --- a/src/Player/PlayerAnimator.h +++ b/src/Player/PlayerAnimator.h @@ -1,7 +1,8 @@ #pragma once #include -#include "PlayerAnimFrameCtrl.h" + +#include "Player/PlayerAnimFrameCtrl.h" class PlayerAnimator { public: diff --git a/src/Player/PlayerEquipmentUser.cpp b/src/Player/PlayerEquipmentUser.cpp index 57be842d..4c67d1d3 100644 --- a/src/Player/PlayerEquipmentUser.cpp +++ b/src/Player/PlayerEquipmentUser.cpp @@ -1,6 +1,7 @@ #include "Player/PlayerEquipmentUser.h" #include "Library/LiveActor/ActorSensorMsgFunction.h" + #include "Util/Sensor.h" PlayerEquipmentUser::PlayerEquipmentUser(const PlayerInput* input, diff --git a/src/Player/PlayerInput.cpp b/src/Player/PlayerInput.cpp index e743c566..be153726 100644 --- a/src/Player/PlayerInput.cpp +++ b/src/Player/PlayerInput.cpp @@ -7,6 +7,7 @@ #include "Library/Math/MathLengthUtil.h" #include "Library/Math/MathUtil.h" #include "Library/Math/VectorUtil.h" + #include "Player/PlayerFunction.h" #include "Player/PlayerInputFunction.h" #include "Util/ActorDimensionKeeper.h" diff --git a/src/Player/PlayerInput.h b/src/Player/PlayerInput.h index 3e50d03f..3fa7dbcb 100644 --- a/src/Player/PlayerInput.h +++ b/src/Player/PlayerInput.h @@ -1,6 +1,7 @@ #pragma once #include + #include "Player/IUsePlayerCollision.h" #include "Util/IUseDimension.h" diff --git a/src/Player/PlayerModelChangerHakoniwa.h b/src/Player/PlayerModelChangerHakoniwa.h index 2910ee18..195825b1 100644 --- a/src/Player/PlayerModelChangerHakoniwa.h +++ b/src/Player/PlayerModelChangerHakoniwa.h @@ -1,6 +1,7 @@ #pragma once #include "Library/HostIO/HioNode.h" + #include "Player/IPlayerModelChanger.h" namespace al { diff --git a/src/Player/PlayerPainPartsKeeper.cpp b/src/Player/PlayerPainPartsKeeper.cpp index 5914321e..80cb8ad6 100644 --- a/src/Player/PlayerPainPartsKeeper.cpp +++ b/src/Player/PlayerPainPartsKeeper.cpp @@ -6,6 +6,7 @@ #include "Library/LiveActor/LiveActorUtil.h" #include "Library/LiveActor/SubActorKeeper.h" #include "Library/Obj/PartsModel.h" + #include "Player/Player.h" #include "Player/PlayerCostumeInfo.h" #include "Player/PlayerModelHolder.h" diff --git a/src/Player/PlayerRecoverySafetyPoint.h b/src/Player/PlayerRecoverySafetyPoint.h index 480fe4b6..bb0f3d32 100644 --- a/src/Player/PlayerRecoverySafetyPoint.h +++ b/src/Player/PlayerRecoverySafetyPoint.h @@ -7,4 +7,4 @@ class PlayerRecoverySafetyPoint { sead::Vector3f* getSafetyPoint(void) const; sead::Vector3f* getSafetyPointGravity(void) const; sead::Vector3f* getSafetyPointArea(void) const; -}; \ No newline at end of file +}; diff --git a/src/Scene/ProjectActorFactory.cpp b/src/Scene/ProjectActorFactory.cpp index 5cf27360..41129d7d 100644 --- a/src/Scene/ProjectActorFactory.cpp +++ b/src/Scene/ProjectActorFactory.cpp @@ -1,9 +1,8 @@ #include "Scene/ProjectActorFactory.h" -#include "Library/Factory/Factory.h" -namespace al { +#include "Library/Factory/Factory.h" -static NameToCreator sProjectActorFactoryEntries[] = { +static al::NameToCreator sProjectActorFactoryEntries[] = { {"AchievementNpc", nullptr}, {"AirBubble", nullptr}, {"AirBubbleGenerator", nullptr}, @@ -581,5 +580,3 @@ static NameToCreator sProjectActorFactoryEntries[] = { ProjectActorFactory::ProjectActorFactory() : ActorFactory("アクター生成") { //("繧「繧ッ繧ソ繝シ逕滓") initFactory(sProjectActorFactoryEntries); } - -} // namespace al diff --git a/src/Scene/ProjectActorFactory.h b/src/Scene/ProjectActorFactory.h index db52377c..76182f32 100644 --- a/src/Scene/ProjectActorFactory.h +++ b/src/Scene/ProjectActorFactory.h @@ -2,12 +2,8 @@ #include "Library/LiveActor/ActorFactory.h" -namespace al { - class ProjectActorFactory : public al::ActorFactory { public: ProjectActorFactory(); const char* convertName(const char* name) const override; }; - -} // namespace al diff --git a/src/Scene/ProjectAppearSwitchFactory.cpp b/src/Scene/ProjectAppearSwitchFactory.cpp index 6309a140..f4edb199 100644 --- a/src/Scene/ProjectAppearSwitchFactory.cpp +++ b/src/Scene/ProjectAppearSwitchFactory.cpp @@ -1,10 +1,7 @@ #include "Scene/ProjectAppearSwitchFactory.h" -#include - -namespace al { // FIXME fill in method references: (1.0) off_7101D89F18 -static NameToCreator sProjectAppearSwitchFactoryEntries[] = { +static al::NameToCreator sProjectAppearSwitchFactoryEntries[] = { {"FixMapParts", nullptr}, {"FallMapParts", nullptr}, {"CapHanger", nullptr}, @@ -28,5 +25,3 @@ static NameToCreator sProjectAppearSwitchFactoryEntries[] ProjectAppearSwitchFactory::ProjectAppearSwitchFactory() : ActorFactory("アクター生成") { initFactory(sProjectAppearSwitchFactoryEntries); } - -} // namespace al diff --git a/src/Scene/ProjectAppearSwitchFactory.h b/src/Scene/ProjectAppearSwitchFactory.h index 9b73da80..dd191278 100644 --- a/src/Scene/ProjectAppearSwitchFactory.h +++ b/src/Scene/ProjectAppearSwitchFactory.h @@ -2,12 +2,8 @@ #include "Library/LiveActor/ActorFactory.h" -namespace al { - class ProjectAppearSwitchFactory : public al::ActorFactory { public: ProjectAppearSwitchFactory(); const char* convertName(const char* name) const override; }; - -} // namespace al diff --git a/src/Scene/StageScene.h b/src/Scene/StageScene.h index 7abb80ec..b1112ad9 100644 --- a/src/Scene/StageScene.h +++ b/src/Scene/StageScene.h @@ -1,9 +1,8 @@ #pragma once -#include "Layout/StageSceneLayout.h" #include "Library/Scene/Scene.h" -#define INHERITSIZE sizeof(al::Scene) +#include "Layout/StageSceneLayout.h" class PlayerActorHakoniwa; @@ -21,12 +20,12 @@ class StageScene : public al::Scene { bool isEnableSave(void) const; - // 0xE0 stageName + // somewhere here at 0xE0: stageName - unsigned char padding_2D0[0x2D0 - INHERITSIZE]; - GameDataHolderAccessor* mHolder; // 0x2D0 + unsigned char padding_to_2D0[0x1F8]; + GameDataHolderAccessor* mHolder; unsigned char padding_2F8[0x20]; - StageSceneLayout* stageSceneLayout; // 0x2F8 + StageSceneLayout* stageSceneLayout; }; namespace rs { diff --git a/src/Sequence/WorldResourceLoader.cpp b/src/Sequence/WorldResourceLoader.cpp index d77e014f..c1826601 100644 --- a/src/Sequence/WorldResourceLoader.cpp +++ b/src/Sequence/WorldResourceLoader.cpp @@ -1,6 +1,7 @@ #include "Sequence/WorldResourceLoader.h" #include + #include "Library/Base/String.h" #include "Library/File/FileUtil.h" #include "Library/Memory/HeapUtil.h" diff --git a/src/Sequence/WorldResourceLoader.h b/src/Sequence/WorldResourceLoader.h index cc7ea42b..30144ad9 100644 --- a/src/Sequence/WorldResourceLoader.h +++ b/src/Sequence/WorldResourceLoader.h @@ -1,8 +1,10 @@ #pragma once #include + #include "Library/Resource/Resource.h" #include "Library/Thread/AsyncFunctorThread.h" + #include "System/GameDataHolder.h" class WorldResourceLoader { diff --git a/src/System/GameConfigData.h b/src/System/GameConfigData.h index f1ba1c1f..89ad1741 100644 --- a/src/System/GameConfigData.h +++ b/src/System/GameConfigData.h @@ -1,6 +1,7 @@ #pragma once #include + #include "System/ByamlSave.h" namespace al { diff --git a/src/System/GameDataFile.cpp b/src/System/GameDataFile.cpp index 500b85de..2390ee98 100644 --- a/src/System/GameDataFile.cpp +++ b/src/System/GameDataFile.cpp @@ -1,6 +1,7 @@ #include "System/GameDataFile.h" #include "Library/Base/String.h" + #include "System/GameDataFunction.h" void GameDataFile::HintInfo::clear() { diff --git a/src/System/GameDataFile.h b/src/System/GameDataFile.h index fd4a1d10..9d2a12d0 100644 --- a/src/System/GameDataFile.h +++ b/src/System/GameDataFile.h @@ -3,6 +3,7 @@ #include #include #include + #include "System/GameProgressData.h" class GameProgressData; diff --git a/src/System/GameDataFunction.h b/src/System/GameDataFunction.h index 0aab69cd..34d07789 100644 --- a/src/System/GameDataFunction.h +++ b/src/System/GameDataFunction.h @@ -1,6 +1,7 @@ #pragma once #include "Library/LiveActor/LiveActor.h" + #include "System/GameDataHolder.h" #include "System/GameDataHolderAccessor.h" #include "System/GameDataHolderWriter.h" diff --git a/src/System/GameDataHolder.h b/src/System/GameDataHolder.h index 98df436e..5404d9bf 100644 --- a/src/System/GameDataHolder.h +++ b/src/System/GameDataHolder.h @@ -1,13 +1,10 @@ -/** - * @file GameDataHolder.h - * @brief Holds scenario / game data. - */ - #pragma once #include + #include "Library/Message/MessageSystem.h" #include "Library/Scene/GameDataHolderBase.h" + #include "System/GameDataFile.h" #include "System/WorldList.h" diff --git a/src/System/GameDataHolderWriter.h b/src/System/GameDataHolderWriter.h index 9891814d..c69cd0e8 100644 --- a/src/System/GameDataHolderWriter.h +++ b/src/System/GameDataHolderWriter.h @@ -1,7 +1,7 @@ #pragma once -#include "GameDataHolder.h" +#include "System/GameDataHolder.h" class GameDataHolderWriter : public GameDataHolder { // ima be real i dont think theres anything in this class -}; \ No newline at end of file +}; diff --git a/src/System/Init.cpp b/src/System/Init.cpp index 0000cb16..d860d746 100644 --- a/src/System/Init.cpp +++ b/src/System/Init.cpp @@ -2,6 +2,7 @@ #include #include #include + #include "System/Application.h" #include "System/ApplicationFunction.h" diff --git a/src/System/ProjectInterface.cpp b/src/System/ProjectInterface.cpp index 31746c2a..68ec7c9d 100644 --- a/src/System/ProjectInterface.cpp +++ b/src/System/ProjectInterface.cpp @@ -1,4 +1,5 @@ -#include "Library/System/SystemKit.h" +#include "System/ProjectInterface.h" + #include "System/Application.h" al::SystemKit* alProjectInterface::getSystemKit() { diff --git a/src/System/ProjectInterface.h b/src/System/ProjectInterface.h new file mode 100644 index 00000000..5f853ad2 --- /dev/null +++ b/src/System/ProjectInterface.h @@ -0,0 +1,9 @@ +#pragma once + +namespace al { +class SystemKit; +} + +class alProjectInterface { + static al::SystemKit* getSystemKit(); +}; diff --git a/src/System/RootTask.cpp b/src/System/RootTask.cpp index 1ceb6796..6450d835 100644 --- a/src/System/RootTask.cpp +++ b/src/System/RootTask.cpp @@ -1,7 +1,9 @@ #include "System/RootTask.h" #include + #include "Library/Memory/HeapUtil.h" + #include "System/GameSystem.h" RootTask::RootTask(const sead::TaskConstructArg& constructArg) diff --git a/src/Util/ActorDimensionKeeper.cpp b/src/Util/ActorDimensionKeeper.cpp index f2b31a07..4458c530 100644 --- a/src/Util/ActorDimensionKeeper.cpp +++ b/src/Util/ActorDimensionKeeper.cpp @@ -1,4 +1,5 @@ #include "Util/ActorDimensionKeeper.h" + #include "Util/IUseDimension.h" void ActorDimensionKeeper::validate() { diff --git a/tools/check-format.py b/tools/check-format.py new file mode 100755 index 00000000..fb4c8ac8 --- /dev/null +++ b/tools/check-format.py @@ -0,0 +1,256 @@ +#!/usr/bin/env python3 + +import argparse +from setup import get_build_dir +import subprocess +import os +import re +from functools import cache +from common import setup_common as setup + +# ------ +# CHECKS +# ------ + +issueFound = False + +def FAIL(message, line, path): + print("Offending file:", path) + print("Line:", line) + print(message) + print() + global issueFound + issueFound = True + +def CHECK(cond, line, message, path): + if not cond(line): + FAIL(message, line, path) + return True + return False + + +# Common + +def common_no_namespace_qualifiers(c, path): + nest_level = [] + for line in c.splitlines(): + line = line[0:line.find("//")] if "//" in line else line + if line.startswith("using namespace"): + match = re.search("^using namespace ([^;\s]+);$", line) + if CHECK(lambda a:match, line, "Unexpected \"using namespace\" line: should follow format \"using namespace xy;\"", path): return + continue + if CHECK(lambda a:a.rfind("namespace") in [-1, 0], line, "\"namespace\" must only be listed at the start of a line!", path): return + + if line.startswith("namespace"): + match = re.search("^namespace ([^{\s]*) ?{$", line) + if CHECK(lambda a:match, line, "Unexpected namespace line: should follow format \"namespace xy {\"", path): return + nest_level.append(match.group(1)) + # can be "" for "namespace {" and "nn::g3d" for double/triple/... namespaces + continue + + allowed_namespaces = [] + for l in nest_level: + if l != "" and l != None: + if "::" not in l: + allowed_namespaces.append(l) + else: + allowed_namespaces += l.split("::") + + parts = re.split("([{}])", line) + for x in parts: + if x == "{": + nest_level.append(None) + continue + if x == "}": + if nest_level[-1] != None: # is closing namespace + if CHECK(lambda a:a=="}", line.rstrip(), "Closing namespace expects only \"}\" in line!", path): return + del nest_level[-1] + continue + + matches = re.findall("[\(,\s]([^\(,\s]+::)+[^\(,\s]+", x) + for match in matches: + match = match[0:-2] + # examples: "sead", "al", "nn::g3d" + if CHECK(lambda a:match not in allowed_namespaces, line, match+" should be omitted here!", path): return + + if len(nest_level) != 0: + print("ERROR: nest_level not empty at end of the file!") + print("nest_level", nest_level) + exit(1) + +@cache +def get_includes(): + def get_files(path): + fs = [] + for root, _, files in os.walk(path): + for file in files: + file_path = os.path.join(root, file) + fs.append(os.path.relpath(file_path, path)) + return fs + cpp_files = ["concepts","coroutine","any","bitset","chrono","compare","csetjmp","csignal","cstdarg","cstddef","cstdlib","ctime","expected","functional","initializer_list","optional","source_location","tuple","type_traits","typeindex","typeinfo","utility","variant","version","memory","memory_resource","new","scoped_allocator","cfloat","cinttypes","climits","cstdint","limits","stdfloat","cassert","cerrno","exception","stacktrace","stdexcept","system_error","cctype","charconv","cstring","cuchar","cwchar","cwctype","format","string","string_view","array","deque","flat_map","flat_set","forward_list","list","map","mdspan","queue","set","span","stack","unordered_map","unordered_set","vector","iterator","generator","ranges","algorithm","execution","bit","cfenv","cmath","complex","numbers","numeric","random","ratio","valarray","clocale","codecvt","locale","text_encoding","cstdio","fstream","iomanip","ios","iosfwd","iostream","istream","ostream","print","spanstream","sstream","streambuf","strstream","syncstream","filesystem","regex","atomic","barrier","condition_variable","future","hazard_pointer","latch","mutex","rcu","semaphore","shared_mutex","stop_token","thread","stdatomic.h"] + sead_files = get_files(project_root/'lib'/'sead'/'include') + nintendo_sdk_files = get_files(project_root/'lib'/'NintendoSDK'/'include') + agl_files = get_files(project_root/'lib'/'agl'/'include') + aarch_files = get_files(project_root/'lib'/'aarch64') + eui_files = get_files(project_root/'lib'/'eui'/'include') + al_files = get_files(project_root/'lib'/'al'/'include') + game_files = [a for a in get_files(project_root/'src') if a.endswith(".h")] + + angled_includes = cpp_files + aarch_files + nintendo_sdk_files + sead_files + agl_files + eui_files + al_includes = al_files + game_includes = game_files + + return angled_includes, al_includes, game_includes + +def common_include_order(c, path, is_header): + lines = c.split("\n") + if is_header: + if CHECK(lambda a:a=="#pragma once", lines[0], "Headers must start with \"#pragma once\"!", path): return + del lines[0] + if CHECK(lambda a:a=="", lines[0], "\"#pragma once\" must be followed by exactly one empty line!", path): return + del lines[0] + elif not path.endswith("src/System/Init.cpp"): + # hardcoded exception: Init.cpp contains C functions and no header to relate to + rel_path = path.split("src/")[-1] if "src/" in path else path.split("include/")[-1] + header_line = "#include \""+rel_path[0:-3]+"h\"" + if CHECK(lambda a:a==header_line, lines[0], "Source files must start with including respective header in double quotes (here: "+header_line+")!", path): return + del lines[0] + if CHECK(lambda a:a=="", lines[0], "\""+header_line+"\" must be followed by exactly one empty line!", path): return + del lines[0] + + include_lines = [] + end_of_includes = False + for line in lines: + if line.startswith("#include"): + if CHECK(lambda a:not end_of_includes, line, "Includes have to be listed at the very top of the file!", path): return + include_lines.append(line) + elif line == "" and not end_of_includes: + include_lines.append(line) + else: + end_of_includes = True + + angled_includes, al_includes, game_includes = get_includes() + + order = -1 # -1=none (after initial newline) ; 0=angled (sead, agl, nn, eui) ; 1=al ; 2=game ; -2,-3,-4=newline after respective section (angled, al, game) + for line in include_lines: + if line=="": + if CHECK(lambda a:order in [0,1,2], line, "Unexpected newline in includes! Please re-read the contribution guide and format accordingly.", path): return + order = -order-2 + continue + + if line.startswith("#include <") and line.endswith(">"): + file = line[10:-1] + if CHECK(lambda a:order in [-1,0], line, "Angled \"#includes <...>\" can only appear in the first block of includes!", path): return + if CHECK(lambda a:file in angled_includes, line, "This file is not allowed to be included with <>!", path): return + order = 0 + elif line.startswith("#include \"") and line.endswith("\""): + file = line[10:-1] + if file in al_includes: + if CHECK(lambda a:order in [-1,-2,1], line, "Wrong order for includes: Found \"al\"-include outside of expected block!", path): return + order=1 + elif file in game_includes: + if CHECK(lambda a:order in [-1,-2,-3,2], line, "Wrong order for includes: Found \"game\"-include outside of expected block!", path): return + order=2 + else: + FAIL("This file is not allowed to be included with <>!", line, path) + return + else: + FAIL("Unknown include format", line, path) + return + + CHECK(lambda a:order in [-1,-2,-3,-4], "not applicable", "Empty line expected after includes!", path) + +def common_newline_eof(c, path): + CHECK(lambda a:a=="", c.split("\n")[-1], "Files should end with a newline!", path) + + +# Header files + +def header_sorted_visibility(c, path): + visibilities_ordered = ["public:", "protected:", "private:"] + nest_level = [-1] # outermost for macro definitions + for line in c.splitlines(): + line = line[0:line.find("//")] if "//" in line else line + if line.endswith("\\"): line = line[0:-1].rstrip() + if "{" in line and "}" in line: + if CHECK(lambda a:a.count("{")==a.count("}") or (a.lstrip().startswith("{") and a.endswith("}};")), line, "Unbalanced \"{\" and \"}\" in the same line! (exception: end of brace-initialized array)", path): return + if line.lstrip().startswith("{") and line.endswith("}};"): + del nest_level[-1] + continue + + if CHECK(lambda a:[b for b in visibilities_ordered if b in a and a!=b]==[], line.strip(), "visibility modificator must be its own line!", path): return + if CHECK(lambda a:a.count("{")+a.count("}")<=1, line, "Only one \"{\" and \"}\" is allowed per line!", path): return + + 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 + nest_level[-1] = i + continue + elif "{" in line: + nest_level.append(-1) + elif "}" in line: + del nest_level[-1] + + if len(nest_level) != 1: + print("ERROR: nest_level not empty at end of the file!") + print("nest_level", nest_level) + exit(1) + +def header_no_offset_comments(c, path): + for line in c.splitlines(): + CHECK(lambda a:"// 0x" not in a, line, "Offset comments are not allowed in headers!", path) + +# Source files + +# ----- +# UTILS +# ----- + +def check_source(c, path): + common_newline_eof(c, path) + common_no_namespace_qualifiers(c, path) + common_include_order(c, path, False) + +def check_header(c, path): + common_newline_eof(c, path) + common_no_namespace_qualifiers(c, path) + common_include_order(c, path, True) + header_sorted_visibility(c, path) + header_no_offset_comments(c, path) + +def check_file(file_str): + file = open(file_str, mode="r") + content = file.read() + file.close() + + if file_str.endswith('.h'): + check_header(content, file_str) + elif file_str.endswith('.cpp'): + check_source(content, file_str) + else: + FAIL("Must only contain .h and .cpp files!", "NOT APPLICABLE", file_str) + + +project_root = setup.ROOT + +def main(): + parser = argparse.ArgumentParser( + 'check-format.py', description="Verify additional formatting options next to clang-format and clang-tidy") + parser.add_argument('--verbose', action='store_true', + help="Give verbose output") + args = parser.parse_args() + + for dir in [project_root/'lib'/'al', project_root/'src']: + for root, _, files in os.walk(dir): + for file in files: + file_path = os.path.join(root, file) + file_str = str(file_path) + check_file(file_str) + + if issueFound: + exit(1) + else: + print("No issues found!") + +if __name__ == "__main__": + main()