Skip to content

Commit

Permalink
Format: No "// 0x" offset comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsterDruide1 committed Jan 4, 2024
1 parent cfb133d commit e6b8fde
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 31 deletions.
50 changes: 25 additions & 25 deletions lib/al/include/Library/Controller/JoyPadAccelPoseAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
};

Expand All @@ -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)];
};

Expand All @@ -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
4 changes: 2 additions & 2 deletions src/Player/HackCap.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class HackCap : public al::LiveActor {
bool isThrowTypeSpiral(void) const;

unsigned char padding_118[0x118 - HACKSIZE];
al::LiveActor* mActorA; // 0x118
al::LiveActor* mActorA;
unsigned char padding_08[0x08];
al::LiveActor* mPlayerActor; // 0x128
al::LiveActor* mPlayerActor;
};
6 changes: 3 additions & 3 deletions src/Scene/StageScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,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
GameDataHolderAccessor* mHolder;
unsigned char padding_2F8[0x20];
StageSceneLayout* stageSceneLayout; // 0x2F8
StageSceneLayout* stageSceneLayout;
};

namespace rs {
Expand Down
6 changes: 5 additions & 1 deletion tools/check-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def common_include_order(c, path, is_header):
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):
Expand Down Expand Up @@ -195,7 +196,9 @@ def header_sorted_visibility(c, path):
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

Expand All @@ -213,6 +216,7 @@ def check_header(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")
Expand Down

0 comments on commit e6b8fde

Please sign in to comment.