Skip to content

Commit 470a6ae

Browse files
MegaMechgithub-actions[bot]
authored andcommitted
Clang Format
1 parent 4f63d17 commit 470a6ae

38 files changed

+681
-548
lines changed

include/PR/abi.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,13 @@ typedef short ENVMIX_STATE[40];
822822
/*
823823
* See aEnvMixer for more info.
824824
*/
825-
#define aEnvSetup1Alt(pkt,initialVolReverb,rampReverbL,rampReverbR,rampLeft,rampRight) { Acmd *_a = (Acmd *)pkt; _a->words.w0 = (_SHIFTL(A_ENVSETUP1, 24, 8) | _SHIFTL(initialVolReverb, 16, 8) | (_SHIFTL(rampReverbL, 8, 8)) | _SHIFTL(rampReverbR, 0, 8)); _a->words.w1 = _SHIFTL(rampLeft, 16, 16) | _SHIFTL(rampRight, 0, 16); }
825+
#define aEnvSetup1Alt(pkt, initialVolReverb, rampReverbL, rampReverbR, rampLeft, rampRight) \
826+
{ \
827+
Acmd* _a = (Acmd*) pkt; \
828+
_a->words.w0 = (_SHIFTL(A_ENVSETUP1, 24, 8) | _SHIFTL(initialVolReverb, 16, 8) | \
829+
(_SHIFTL(rampReverbL, 8, 8)) | _SHIFTL(rampReverbR, 0, 8)); \
830+
_a->words.w1 = _SHIFTL(rampLeft, 16, 16) | _SHIFTL(rampRight, 0, 16); \
831+
}
826832

827833
/*
828834
* See aEnvMixer for more info.

include/common_structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ typedef struct {
253253
/* 0x0006 */ u16 unk_006;
254254
/* 0x0008 */ s16 lapCount;
255255
/* 0x000A */ char unk_00A[0x2];
256-
/* 0x000C */ s32 triggers; // Bitflag.
256+
/* 0x000C */ s32 triggers; // Bitflag.
257257
/* 0x0010 */ s16 currentItemCopy; // Has no effect on what item the players has, It is just a synced copy
258258
/* 0x0012 */ s16 unk_012;
259259
/* 0x0014 */ Vec3f pos;

include/defines.h

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@
7373

7474
// Float version required for matching
7575
#ifdef VERSION_EU
76-
#define COURSE_TIMER_ITER 0.020041665999999999 // 1 / 50
77-
#ifdef AVOID_UB
78-
#define COURSE_TIMER_ITER_f 0.020041665999999999f // 1 / 50
79-
#else
80-
#define COURSE_TIMER_ITER_f 0.01666666f //! 1 / 60 - Float unchanged in EU
81-
#endif
76+
#define COURSE_TIMER_ITER 0.020041665999999999 // 1 / 50
77+
#ifdef AVOID_UB
78+
#define COURSE_TIMER_ITER_f 0.020041665999999999f // 1 / 50
79+
#else
80+
#define COURSE_TIMER_ITER_f 0.01666666f //! 1 / 60 - Float unchanged in EU
81+
#endif
8282
#else
8383
#define COURSE_TIMER_ITER 0.01666666 // 1 / 60
8484
#define COURSE_TIMER_ITER_f 0.01666666f // 1 / 60
@@ -331,37 +331,39 @@ enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE };
331331
/*
332332
* @brief triggers indicating that an effect should be applied to a kart
333333
*/
334-
#define HIT_BANANA_TRIGGER 0x1 // hits a banana
335-
#define HIGH_TUMBLE_TRIGGER 0x2 // hit by a red shell, blue shell, or hit a mole
336-
#define LOW_TUMBLE_TRIGGER 0x4 // hit by a green shell
337-
#define DRIVING_SPINOUT_TRIGGER 0x80 // spinning out from erratic driving
338-
#define THWOMP_SQUISH_TRIGGER 0x100 // stomped by thwomp
339-
#define SHROOM_TRIGGER 0x200 // being boosted by trigger a mushroom
340-
#define BOO_TRIGGER 0x800 // being a boo
341-
#define UNUSED_TRIGGER_0x1000 0x1000 // Unused
342-
#define STAR_TRIGGER 0x2000 // Starting a star
343-
#define LIGHTNING_STRIKE_TRIGGER 0x4000 // Struck by lightning
344-
#define BOOST_RAMP_WOOD_TRIGGER 0x8000 // being boosted by a ramp
345-
#define UNUSED_TRIGGER_0x20000 0x20000 // Unused
346-
#define DRAG_ITEM_EFFECT 0x40000 // holding a non-shell item behind you
347-
#define HIT_PADDLE_BOAT_TRIGGER 0x80000 // hit paddle boat
348-
#define UNUSED_TRIGGER_0x10000 0x100000 // Unused
349-
#define SPINOUT_TRIGGER 0x200000 // hit crab or spiny spinout or losing versus race
350-
#define VERTICAL_TUMBLE_TRIGGER 0x400000 // hitting a fake item / bomb / snowman / car / train
334+
#define HIT_BANANA_TRIGGER 0x1 // hits a banana
335+
#define HIGH_TUMBLE_TRIGGER 0x2 // hit by a red shell, blue shell, or hit a mole
336+
#define LOW_TUMBLE_TRIGGER 0x4 // hit by a green shell
337+
#define DRIVING_SPINOUT_TRIGGER 0x80 // spinning out from erratic driving
338+
#define THWOMP_SQUISH_TRIGGER 0x100 // stomped by thwomp
339+
#define SHROOM_TRIGGER 0x200 // being boosted by trigger a mushroom
340+
#define BOO_TRIGGER 0x800 // being a boo
341+
#define UNUSED_TRIGGER_0x1000 0x1000 // Unused
342+
#define STAR_TRIGGER 0x2000 // Starting a star
343+
#define LIGHTNING_STRIKE_TRIGGER 0x4000 // Struck by lightning
344+
#define BOOST_RAMP_WOOD_TRIGGER 0x8000 // being boosted by a ramp
345+
#define UNUSED_TRIGGER_0x20000 0x20000 // Unused
346+
#define DRAG_ITEM_EFFECT 0x40000 // holding a non-shell item behind you
347+
#define HIT_PADDLE_BOAT_TRIGGER 0x80000 // hit paddle boat
348+
#define UNUSED_TRIGGER_0x10000 0x100000 // Unused
349+
#define SPINOUT_TRIGGER 0x200000 // hit crab or spiny spinout or losing versus race
350+
#define VERTICAL_TUMBLE_TRIGGER 0x400000 // hitting a fake item / bomb / snowman / car / train
351351
#define BOOST_RAMP_ASPHALT_TRIGGER 0x800000 // being boosted by a boost pad
352-
#define HIT_BY_STAR_TRIGGER 0x1000000 // being hit by a star
353-
#define START_BOOST_TRIGGER 0x2000000 // Start boost
354-
#define LOSE_BATTLE_EFFECT 0x4000000 // When losing battle mode
355-
#define BECOME_BOMB_EFFECT 0x8000000 // When becoming a bomb in battle mode
356-
#define START_SPINOUT_TRIGGER 0x10000000 // Spinning out by holding gas at start of race
352+
#define HIT_BY_STAR_TRIGGER 0x1000000 // being hit by a star
353+
#define START_BOOST_TRIGGER 0x2000000 // Start boost
354+
#define LOSE_BATTLE_EFFECT 0x4000000 // When losing battle mode
355+
#define BECOME_BOMB_EFFECT 0x8000000 // When becoming a bomb in battle mode
356+
#define START_SPINOUT_TRIGGER 0x10000000 // Spinning out by holding gas at start of race
357357

358358
#define ALL_TRIGGERS (0xFFFFFFFF)
359359
#define RACING_SPINOUT_TRIGGERS (SPINOUT_TRIGGER | DRIVING_SPINOUT_TRIGGER | HIT_BANANA_TRIGGER) // 0x200081
360-
#define RAMP_BOOST_TRIGGERS (BOOST_RAMP_ASPHALT_TRIGGER | BOOST_RAMP_WOOD_TRIGGER) // 0x00808000
361-
#define ANY_BOOST_TRIGGERS (RAMP_BOOST_TRIGGERS | SHROOM_TRIGGER) // 0x00808200
362-
#define STATE_TRANSITION_TRIGGERS (STAR_TRIGGER | BOO_TRIGGER | UNUSED_TRIGGER_0x1000 | UNUSED_TRIGGER_0x20000)// 0x00023800
363-
#define HIT_TRIGGERS (HIT_BY_STAR_TRIGGER | VERTICAL_TUMBLE_TRIGGER | \
364-
LIGHTNING_STRIKE_TRIGGER | LOW_TUMBLE_TRIGGER | HIGH_TUMBLE_TRIGGER | THWOMP_SQUISH_TRIGGER) // 0x01404106
360+
#define RAMP_BOOST_TRIGGERS (BOOST_RAMP_ASPHALT_TRIGGER | BOOST_RAMP_WOOD_TRIGGER) // 0x00808000
361+
#define ANY_BOOST_TRIGGERS (RAMP_BOOST_TRIGGERS | SHROOM_TRIGGER) // 0x00808200
362+
#define STATE_TRANSITION_TRIGGERS \
363+
(STAR_TRIGGER | BOO_TRIGGER | UNUSED_TRIGGER_0x1000 | UNUSED_TRIGGER_0x20000) // 0x00023800
364+
#define HIT_TRIGGERS \
365+
(HIT_BY_STAR_TRIGGER | VERTICAL_TUMBLE_TRIGGER | LIGHTNING_STRIKE_TRIGGER | LOW_TUMBLE_TRIGGER | \
366+
HIGH_TUMBLE_TRIGGER | THWOMP_SQUISH_TRIGGER) // 0x01404106
365367

366368
/**
367369
* @brief effect of player's

include/seq_ids.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ enum SeqId {
3232
SEQ_EVENT_CEREMONY_PRESENTATION_PART2_WIN, // 0x1B (27)
3333
SEQ_EVENT_CEREMONY_TROPHY_CREDITS, // 0x1C (28)
3434
SEQ_EVENT_CEREMONY_PRESENTATION_PART2_LOSE, // 0x1D (29)
35-
SEQ_COUNT
35+
SEQ_COUNT
3636
};
3737

3838
#endif // SEQ_IDS_H

src/actors/blue_and_red_shells/update.inc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ s16 func_802B3FD0(Player* owner, struct ShellActor* shell) {
172172
if (gPlayerBalloonCount[playerIndex] < 0) {
173173
continue;
174174
}
175-
// dist_squared_bugged is not quite a 3D distance function, it doubles (rather than squares) the Z difference of the
176-
// positions
175+
// dist_squared_bugged is not quite a 3D distance function, it doubles (rather than squares) the Z difference of
176+
// the positions
177177
playerToShellDistance = dist_squared_bugged(player->pos, shell->pos);
178178
if (playerToShellDistance < smallestDistance) {
179179
smallestDistance = playerToShellDistance;

src/actors/cow/render.inc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
* @param arg2
1414
*/
1515
void render_actor_cow(Camera* camera, Mat4 arg1, struct Actor* arg2) {
16-
if (distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1],
17-
4000000.0f) < 0) {
16+
if (distance_if_visible(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f) < 0) {
1817
return;
1918
}
2019

src/actors/fake_item_box/render.inc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void render_actor_fake_item_box(Camera* camera, struct FakeItemBox* fakeItemBox)
2525
f32 someMultiplier;
2626

2727
if (distance_if_visible(camera->pos, fakeItemBox->pos, camera->rot[1], 2500.0f, gCameraZoom[camera - camera1],
28-
1000000.0f) < 0) {
28+
1000000.0f) < 0) {
2929
actor_not_rendered(camera, (struct Actor*) fakeItemBox);
3030
return;
3131
}

src/actors/falling_rock/render.inc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ void render_actor_falling_rock(Camera* camera, struct FallingRock* rock) {
2020
return;
2121
}
2222

23-
height = distance_if_visible(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraZoom[camera - camera1],
24-
4000000.0f);
23+
height =
24+
distance_if_visible(camera->pos, rock->pos, camera->rot[1], 400.0f, gCameraZoom[camera - camera1], 4000000.0f);
2525

2626
if (height < 0.0f) {
2727
return;

src/actors/item_box/render.inc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void render_actor_item_box(Camera* camera, struct ItemBox* item_box) {
2727
f32 someMultiplier;
2828

2929
temp_f0 = distance_if_visible(camera->pos, item_box->pos, camera->rot[1], 0.0f, gCameraZoom[camera - camera1],
30-
4000000.0f);
30+
4000000.0f);
3131
if (!(temp_f0 < 0.0f) && !(600000.0f < temp_f0)) {
3232
if ((item_box->state == 2) && (temp_f0 < 100000.0f)) {
3333
someRot[0] = 0;

src/actors/paddle_boat/render.inc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ void render_actor_paddle_boat(Camera* arg0, struct PaddleWheelBoat* boat, UNUSED
2828
return;
2929
}
3030

31-
temp =
32-
distance_if_visible(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
31+
temp = distance_if_visible(arg0->pos, boat->pos, arg0->rot[1], 90000.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
3332

3433
if (temp < 0.0f) {
3534
return;

0 commit comments

Comments
 (0)