Skip to content

Commit e2039c8

Browse files
MegaMechgithub-actions[bot]
authored andcommitted
Clang Format
1 parent d3feca2 commit e2039c8

38 files changed

+625
-529
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: 63 additions & 59 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,19 +334,21 @@ enum PLACE { FIRST_PLACE, SECOND_PLACE, THIRD_PLACE, FOURTH_PLACE };
334334
// player->oobProps
335335
/* Deals with the lower out of bounds (OOB) plane on levels. Represented by fluids (water / lava)
336336
or nothing for Rainbow Road and Skyscraper. */
337-
#define UNDER_OOB_OR_FLUID_LEVEL 0x1 // Set while mostly under the plane. Does not necessarily trigger Lakitu on Koopa Troopa Beach.
337+
#define UNDER_OOB_OR_FLUID_LEVEL \
338+
0x1 // Set while mostly under the plane. Does not necessarily trigger Lakitu on Koopa Troopa Beach.
338339
#define PASS_OOB_OR_FLUID_LEVEL 0x2 // Set when passing through the lower plane in either direction
339340
// The next two are also activated when passing through the lower plane.
340341
#define UNDER_FLUID_LEVEL 0x4 // Stays active until Lakitu places back on track
341-
#define UNDER_OOB_LEVEL 0x8 // Active while under a non-fluid OOB plane. Is momentarily active when passing through fluids.
342-
342+
#define UNDER_OOB_LEVEL \
343+
0x8 // Active while under a non-fluid OOB plane. Is momentarily active when passing through fluids.
343344

344345
/* UNK_002 has something to do with player animations. Each player has a 32-bit
345346
flag broken into 8 groups of 4 bits. Those 4 bits affect how each of the 8 players
346347
appear to the specified player */
347348
#define CHANGING_ANIMATION 0x1 // Seems to be set when the kart animation has to change.
348-
#define UNK_002_UNKNOWN_0x2 0x2
349-
#define UNK_002_UNKNOWN_0x4 0x4 /* Unclear, but has to do with viewing the side of player. At least tends to change if target
349+
#define UNK_002_UNKNOWN_0x2 0x2
350+
#define UNK_002_UNKNOWN_0x4 \
351+
0x4 /* Unclear, but has to do with viewing the side of player. At least tends to change if target \
350352
player spins. Something with avoding rollover of aniamation frame data? */
351353
#define SIDE_OF_KART 0x8 // Seems to be whether you are in a rectangle shooting out from both sides of target player
352354

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

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

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

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

418422
#define ALL_TRIGGERS (0xFFFFFFFF)
419423
#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)