Skip to content

Commit b618f77

Browse files
MegaMechgithub-actions[bot]
authored andcommitted
Clang Format
1 parent 2e7ba09 commit b618f77

38 files changed

+626
-530
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: 64 additions & 60 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
@@ -334,7 +334,7 @@ enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE };
334334
// player->unk_046
335335

336336
/* The first time you touch a penguin or bat, and anytime you touch a thwomp during a
337-
race will set a flag which will cause your next spinout to be instant (i.e. no
337+
race will set a flag which will cause your next spinout to be instant (i.e. no
338338
sliding forward). Probably half-implemented code to prevent sliding through enemies,
339339
but causes this bug */
340340
#define CRITTER_TOUCH 0x2 // Touched a penguin, bat or thwomp
@@ -344,19 +344,21 @@ enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE };
344344
// player->oobProps
345345
/* Deals with the lower out of bounds (OOB) plane on levels. Represented by fluids (water / lava)
346346
or nothing for Rainbow Road and Skyscraper. */
347-
#define UNDER_OOB_OR_FLUID_LEVEL 0x1 // Set while mostly under the plane. Does not necessarily trigger Lakitu on Koopa Troopa Beach.
347+
#define UNDER_OOB_OR_FLUID_LEVEL \
348+
0x1 // Set while mostly under the plane. Does not necessarily trigger Lakitu on Koopa Troopa Beach.
348349
#define PASS_OOB_OR_FLUID_LEVEL 0x2 // Set when passing through the lower plane in either direction
349350
// The next two are also activated when passing through the lower plane.
350351
#define UNDER_FLUID_LEVEL 0x4 // Stays active until Lakitu places back on track
351-
#define UNDER_OOB_LEVEL 0x8 // Active while under a non-fluid OOB plane. Is momentarily active when passing through fluids.
352-
352+
#define UNDER_OOB_LEVEL \
353+
0x8 // Active while under a non-fluid OOB plane. Is momentarily active when passing through fluids.
353354

354355
/* UNK_002 has something to do with player animations. Each player has a 32-bit
355356
flag broken into 8 groups of 4 bits. Those 4 bits affect how each of the 8 players
356357
appear to the specified player */
357358
#define CHANGING_ANIMATION 0x1 // Seems to be set when the kart animation has to change.
358-
#define UNK_002_UNKNOWN_0x2 0x2
359-
#define UNK_002_UNKNOWN_0x4 0x4 /* Unclear, but has to do with viewing the side of player. At least tends to change if target
359+
#define UNK_002_UNKNOWN_0x2 0x2
360+
#define UNK_002_UNKNOWN_0x4 \
361+
0x4 /* Unclear, but has to do with viewing the side of player. At least tends to change if target \
360362
player spins. Something with avoding rollover of aniamation frame data? */
361363
#define SIDE_OF_KART 0x8 // Seems to be whether you are in a rectangle shooting out from both sides of target player
362364

@@ -368,62 +370,64 @@ player spins. Something with avoding rollover of aniamation frame data? */
368370
#define EXPLOSION 0x1000 // Big shock looking graphic when starting tumble
369371

370372
// player->lakituProps
371-
#define LAKITU_RETRIEVAL 0x1 // While lakitu is grabbing you, but before the scene transition of being placed on the track
372-
#define HELD_BY_LAKITU 0x2
373-
#define LAKITU_FIZZLE 0x4 // Disintegration and reintegration effect when transitioning from retrieval to placement
374-
#define LAKITU_SCENE 0x8 // the whole segment from when lakitu is called to when you regain control
375-
#define FRIGID_EFFECT 0x10 // Cold colors on Sherbet Land after in frigid water
376-
#define THAWING_EFFECT 0x20 // Regaining usual colors post frigid effect
377-
#define FROZEN_EFFECT 0x80 // In the ice cube
378-
#define WENT_OVER_OOB 0x100 // Player went over (or is on) an OOB area. Cancelled if touch back in bounds
379-
#define LAKITU_LAVA 0x1000 // smoky effect when retrieved from lava
380-
#define LAKITU_WATER 0x2000 // dripping effect when retreived from water
373+
#define LAKITU_RETRIEVAL \
374+
0x1 // While lakitu is grabbing you, but before the scene transition of being placed on the track
375+
#define HELD_BY_LAKITU 0x2
376+
#define LAKITU_FIZZLE 0x4 // Disintegration and reintegration effect when transitioning from retrieval to placement
377+
#define LAKITU_SCENE 0x8 // the whole segment from when lakitu is called to when you regain control
378+
#define FRIGID_EFFECT 0x10 // Cold colors on Sherbet Land after in frigid water
379+
#define THAWING_EFFECT 0x20 // Regaining usual colors post frigid effect
380+
#define FROZEN_EFFECT 0x80 // In the ice cube
381+
#define WENT_OVER_OOB 0x100 // Player went over (or is on) an OOB area. Cancelled if touch back in bounds
382+
#define LAKITU_LAVA 0x1000 // smoky effect when retrieved from lava
383+
#define LAKITU_WATER 0x2000 // dripping effect when retreived from water
381384

382385
// player->kartProps
383-
#define BACK_UP 0x1
384-
#define RIGHT_TURN 0x2 // non-drifting (more than 5 degrees)
385-
#define LEFT_TURN 0x4 // non-drifting (more than 5 degrees)
386-
#define MOVE_BACKWARDS 0x8 // includes lakitu
387-
#define LOSE_GP_RACE 0x10 // pointless, only unsets itself
388-
#define THROTTLE 0x20 // Closely tied to just pressing A. Possible exception for AB-spins
389-
#define EARLY_SPINOUT_RIGHT 0x40 // Spinning out while facing right (not actually used for anything)
390-
#define EARLY_SPINOUT_LEFT 0x80 // Spinning out while facing left
391-
#define POST_TUMBLE_GAS 0x100 // Causes particles after a vertical tumble, I think
392-
#define BECOME_INVISIBLE 0x200
393-
#define UNUSED_0x400 0x400 // locked behind 0x800 (func_80091440)
394-
#define UNUSED_0x800 0x800 // locked behind 0x400 (func_8002B830 -> func_800911B4)
395-
#define UNUSED_0x1000 0x1000 // 0x1000 locked behind 0x400 (func_8002B830 -> func_800911B4)
396-
#define UNUSED_0x2000 0x2000 // 0x2000 locked behind 0x400 and 0x800 (func_8002B830 -> func_800911B4, apply_effect -> func_80091298,
397-
// func_80091440)
398-
#define DRIVING_SPINOUT 0x4000
386+
#define BACK_UP 0x1
387+
#define RIGHT_TURN 0x2 // non-drifting (more than 5 degrees)
388+
#define LEFT_TURN 0x4 // non-drifting (more than 5 degrees)
389+
#define MOVE_BACKWARDS 0x8 // includes lakitu
390+
#define LOSE_GP_RACE 0x10 // pointless, only unsets itself
391+
#define THROTTLE 0x20 // Closely tied to just pressing A. Possible exception for AB-spins
392+
#define EARLY_SPINOUT_RIGHT 0x40 // Spinning out while facing right (not actually used for anything)
393+
#define EARLY_SPINOUT_LEFT 0x80 // Spinning out while facing left
394+
#define POST_TUMBLE_GAS 0x100 // Causes particles after a vertical tumble, I think
395+
#define BECOME_INVISIBLE 0x200
396+
#define UNUSED_0x400 0x400 // locked behind 0x800 (func_80091440)
397+
#define UNUSED_0x800 0x800 // locked behind 0x400 (func_8002B830 -> func_800911B4)
398+
#define UNUSED_0x1000 0x1000 // 0x1000 locked behind 0x400 (func_8002B830 -> func_800911B4)
399+
#define UNUSED_0x2000 \
400+
0x2000 // 0x2000 locked behind 0x400 and 0x800 (func_8002B830 -> func_800911B4, apply_effect -> func_80091298,
401+
// func_80091440)
402+
#define DRIVING_SPINOUT 0x4000
399403
#define UNKNOWN_BATTLE_VAR 0x8000 // 0x8000 something battle related, unclear if ever set
400404

401405
/*
402406
* @brief triggers indicating that an effect should be applied to a kart
403407
*/
404-
#define HIT_BANANA_TRIGGER 0x1 // hits a banana
405-
#define HIGH_TUMBLE_TRIGGER 0x2 // hit by a red shell, blue shell, or hit a mole
406-
#define LOW_TUMBLE_TRIGGER 0x4 // hit by a green shell
407-
#define DRIVING_SPINOUT_TRIGGER 0x80 // spinning out from erratic driving
408-
#define THWOMP_SQUISH_TRIGGER 0x100 // stomped by thwomp
409-
#define SHROOM_TRIGGER 0x200 // being boosted by trigger a mushroom
410-
#define BOO_TRIGGER 0x800 // being a boo
411-
#define UNUSED_TRIGGER_0x1000 0x1000 // Unused
412-
#define STAR_TRIGGER 0x2000 // Starting a star
413-
#define LIGHTNING_STRIKE_TRIGGER 0x4000 // Struck by lightning
414-
#define BOOST_RAMP_WOOD_TRIGGER 0x8000 // being boosted by a ramp
415-
#define UNUSED_TRIGGER_0x20000 0x20000 // Unused
416-
#define DRAG_ITEM_EFFECT 0x40000 // holding a non-shell item behind you
417-
#define HIT_PADDLE_BOAT_TRIGGER 0x80000 // hit paddle boat
418-
#define UNUSED_TRIGGER_0x10000 0x100000 // Unused
419-
#define SPINOUT_TRIGGER 0x200000 // hit crab or spiny spinout or losing versus race
420-
#define VERTICAL_TUMBLE_TRIGGER 0x400000 // hitting a fake item / bomb / snowman / car / train
408+
#define HIT_BANANA_TRIGGER 0x1 // hits a banana
409+
#define HIGH_TUMBLE_TRIGGER 0x2 // hit by a red shell, blue shell, or hit a mole
410+
#define LOW_TUMBLE_TRIGGER 0x4 // hit by a green shell
411+
#define DRIVING_SPINOUT_TRIGGER 0x80 // spinning out from erratic driving
412+
#define THWOMP_SQUISH_TRIGGER 0x100 // stomped by thwomp
413+
#define SHROOM_TRIGGER 0x200 // being boosted by trigger a mushroom
414+
#define BOO_TRIGGER 0x800 // being a boo
415+
#define UNUSED_TRIGGER_0x1000 0x1000 // Unused
416+
#define STAR_TRIGGER 0x2000 // Starting a star
417+
#define LIGHTNING_STRIKE_TRIGGER 0x4000 // Struck by lightning
418+
#define BOOST_RAMP_WOOD_TRIGGER 0x8000 // being boosted by a ramp
419+
#define UNUSED_TRIGGER_0x20000 0x20000 // Unused
420+
#define DRAG_ITEM_EFFECT 0x40000 // holding a non-shell item behind you
421+
#define HIT_PADDLE_BOAT_TRIGGER 0x80000 // hit paddle boat
422+
#define UNUSED_TRIGGER_0x10000 0x100000 // Unused
423+
#define SPINOUT_TRIGGER 0x200000 // hit crab or spiny spinout or losing versus race
424+
#define VERTICAL_TUMBLE_TRIGGER 0x400000 // hitting a fake item / bomb / snowman / car / train
421425
#define BOOST_RAMP_ASPHALT_TRIGGER 0x800000 // being boosted by a boost pad
422-
#define HIT_BY_STAR_TRIGGER 0x1000000 // being hit by a star
423-
#define START_BOOST_TRIGGER 0x2000000 // Start boost
424-
#define LOSE_BATTLE_EFFECT 0x4000000 // When losing battle mode
425-
#define BECOME_BOMB_EFFECT 0x8000000 // When becoming a bomb in battle mode
426-
#define START_SPINOUT_TRIGGER 0x10000000 // Spinning out by holding gas at start of race
426+
#define HIT_BY_STAR_TRIGGER 0x1000000 // being hit by a star
427+
#define START_BOOST_TRIGGER 0x2000000 // Start boost
428+
#define LOSE_BATTLE_EFFECT 0x4000000 // When losing battle mode
429+
#define BECOME_BOMB_EFFECT 0x8000000 // When becoming a bomb in battle mode
430+
#define START_SPINOUT_TRIGGER 0x10000000 // Spinning out by holding gas at start of race
427431

428432
#define ALL_TRIGGERS (0xFFFFFFFF)
429433
#define RACING_SPINOUT_TRIGGERS (SPINOUT_TRIGGER | DRIVING_SPINOUT_TRIGGER | HIT_BANANA_TRIGGER) // 0x200081

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)