Code cleanup
This commit is contained in:
1 parent
8ad773a7eb
commit
9b59eb0256
163 files changed
+1806
-2251
No files matched your search
@@ -780,13 +780,9 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
|
||||
}
|
||||
#else
|
||||
u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex) {
|
||||
UNUSED s32 pad1[1];
|
||||
s16 ra;
|
||||
s16 t4;
|
||||
UNUSED s32 pad[2];
|
||||
struct ReverbRingBufferItem *v1;
|
||||
UNUSED s32 pad2[1];
|
||||
s16 temp;
|
||||
|
||||
v1 = &gSynthesisReverb.items[gSynthesisReverb.curFrame][updateIndex];
|
||||
|
||||
@@ -800,7 +796,6 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
|
||||
if (v1->lengthB != 0) {
|
||||
// Ring buffer wrapped
|
||||
aSetLoadBufferPair(cmd++, v1->lengthA, 0);
|
||||
temp = 0;
|
||||
}
|
||||
|
||||
// Use the reverb sound as initial sound for this audio update
|
||||
@@ -814,18 +809,12 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
|
||||
/*out*/ DMEM_ADDR_WET_LEFT_CH);
|
||||
} else {
|
||||
// Same as above but upsample the previously downsampled samples used for reverb first
|
||||
temp = 0; //! jesus christ
|
||||
t4 = (v1->startPos & 7) * 2;
|
||||
ra = AUDIO_ALIGN(v1->lengthA + t4, 4);
|
||||
aSetLoadBufferPair(cmd++, 0, v1->startPos - t4 / 2);
|
||||
if (v1->lengthB != 0) {
|
||||
// Ring buffer wrapped
|
||||
aSetLoadBufferPair(cmd++, ra, 0);
|
||||
//! We need an empty statement (even an empty ';') here to make the function match (because IDO).
|
||||
//! However, copt removes extraneous statements and dead code. So we need to trick copt
|
||||
//! into thinking 'temp' could be undefined, and luckily the compiler optimizes out the
|
||||
//! useless assignment.
|
||||
ra = ra + temp;
|
||||
}
|
||||
aSetBuffer(cmd++, 0, t4 + DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH, bufLen << 1);
|
||||
aResample(cmd++, gSynthesisReverb.resampleFlags, (u16) gSynthesisReverb.resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.resampleStateLeft));
|
||||
|
||||
+13
-13
@@ -496,27 +496,27 @@ void get_audio_frequency(void)
|
||||
void thread1_idle(UNUSED void *arg) {
|
||||
|
||||
osCreateViManager(OS_PRIORITY_VIMGR);
|
||||
switch ( osTvType ) {
|
||||
case OS_TV_NTSC:
|
||||
// NTSC
|
||||
switch ( osTvType ) {
|
||||
case OS_TV_NTSC:
|
||||
// NTSC
|
||||
//osViSetMode(&osViModeTable[OS_VI_NTSC_LAN1]);
|
||||
VI = osViModeTable[OS_VI_NTSC_LAN1];
|
||||
gConfig.tvType = MODE_NTSC;
|
||||
break;
|
||||
case OS_TV_MPAL:
|
||||
// MPAL
|
||||
break;
|
||||
case OS_TV_MPAL:
|
||||
// MPAL
|
||||
//osViSetMode(&osViModeTable[OS_VI_MPAL_LAN1]);
|
||||
VI = osViModeTable[OS_VI_NTSC_LAN1];
|
||||
gConfig.tvType = MODE_MPAL;
|
||||
break;
|
||||
case OS_TV_PAL:
|
||||
// PAL
|
||||
//osViSetMode(&osViModeTable[OS_VI_PAL_LAN1]);
|
||||
break;
|
||||
case OS_TV_PAL:
|
||||
// PAL
|
||||
//osViSetMode(&osViModeTable[OS_VI_PAL_LAN1]);
|
||||
VI = osViModeTable[OS_VI_NTSC_LAN1];
|
||||
gConfig.tvType = MODE_PAL;
|
||||
break;
|
||||
}
|
||||
get_audio_frequency();
|
||||
break;
|
||||
}
|
||||
get_audio_frequency();
|
||||
change_vi(&VI, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
osViSetMode(&VI);
|
||||
osViBlack(TRUE);
|
||||
|
||||
+2
-2
@@ -416,7 +416,7 @@ void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) {
|
||||
dest = main_pool_alloc(*size, MEMORY_POOL_LEFT);
|
||||
#endif
|
||||
if (dest != NULL) {
|
||||
osSyncPrintf("start decompress\n");
|
||||
osSyncPrintf("start decompress\n");
|
||||
#ifdef GZIP
|
||||
expand_gzip(compressed, dest, compSize, (u32)size);
|
||||
#elif RNC1
|
||||
@@ -428,7 +428,7 @@ void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) {
|
||||
#elif MIO0
|
||||
decompress(compressed, dest);
|
||||
#endif
|
||||
osSyncPrintf("end decompress\n");
|
||||
osSyncPrintf("end decompress\n");
|
||||
set_segment_base_addr(segment, dest);
|
||||
main_pool_free(compressed);
|
||||
} else {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
/*
|
||||
* N64-HVQM2 library Sample program
|
||||
*
|
||||
*
|
||||
* FILE : adpcmbuf.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1998,1999 NINTENDO Co.,Ltd.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* 1999-02-22 */
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
/*
|
||||
* Buffer for audio records (ADPCM data) read from the HVQM2 data.
|
||||
* (Note) Please locate at a 16byte aligned address with the spec file.
|
||||
* (Note) Please locate at a 16byte aligned address with the spec file.
|
||||
*/
|
||||
ALIGNED16 u8 adpcmbuf[AUDIO_RECORD_SIZE_MAX];
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
/*
|
||||
* N64-HVQM2 library Sample program
|
||||
*
|
||||
*
|
||||
* FILE : hvqbuf.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1998,1999 NINTENDO Co.,Ltd.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* 1999-02-22 */
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <hvqm/hvqm.h>
|
||||
|
||||
/*
|
||||
* Buffer for video records (HVQM2 compressed data) read from
|
||||
* Buffer for video records (HVQM2 compressed data) read from
|
||||
* the HVQM2 data.
|
||||
* (Note) Please locate at a 16byte aligned address with the spec file.
|
||||
*/
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
/*
|
||||
* N64-HVQM2 library Sample program
|
||||
*
|
||||
*
|
||||
* FILE : hvqmwork.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 1998,1999 NINTENDO Co.,Ltd.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* 1999-02-12 */
|
||||
|
||||
@@ -784,8 +784,6 @@ static s32 bhv_cmd_scale(void) {
|
||||
// Command 0x30: Sets various parameters that the object uses for calculating physics.
|
||||
// Usage: SET_OBJ_PHYSICS(wallHitboxRadius, gravity, bounciness, dragStrength, friction, buoyancy, unused1, unused2)
|
||||
static s32 bhv_cmd_set_obj_physics(void) {
|
||||
UNUSED f32 unused1, unused2;
|
||||
|
||||
gCurrentObject->oWallHitboxRadius = BHV_CMD_GET_1ST_S16(1);
|
||||
gCurrentObject->oGravity = BHV_CMD_GET_2ND_S16(1) / 100.0f;
|
||||
gCurrentObject->oBounciness = BHV_CMD_GET_1ST_S16(2) / 100.0f;
|
||||
@@ -793,8 +791,8 @@ static s32 bhv_cmd_set_obj_physics(void) {
|
||||
gCurrentObject->oFriction = BHV_CMD_GET_1ST_S16(3) / 100.0f;
|
||||
gCurrentObject->oBuoyancy = BHV_CMD_GET_2ND_S16(3) / 100.0f;
|
||||
|
||||
unused1 = BHV_CMD_GET_1ST_S16(4) / 100.0f;
|
||||
unused2 = BHV_CMD_GET_2ND_S16(4) / 100.0f;
|
||||
UNUSED f32 unused1 = BHV_CMD_GET_1ST_S16(4) / 100.0f;
|
||||
UNUSED f32 unused2 = BHV_CMD_GET_2ND_S16(4) / 100.0f;
|
||||
|
||||
gCurBhvCommand += 5;
|
||||
return BHV_PROC_CONTINUE;
|
||||
|
||||
@@ -498,23 +498,9 @@ static void load_environmental_regions(TerrainData **data) {
|
||||
gEnvironmentRegions = *data;
|
||||
numRegions = *(*data)++;
|
||||
|
||||
if (numRegions > 20) {
|
||||
}
|
||||
|
||||
for (i = 0; i < numRegions; i++) {
|
||||
UNUSED TerrainData val, loX, loZ, hiX, hiZ;
|
||||
TerrainData height;
|
||||
|
||||
val = *(*data)++;
|
||||
|
||||
loX = *(*data)++;
|
||||
hiX = *(*data)++;
|
||||
loZ = *(*data)++;
|
||||
hiZ = *(*data)++;
|
||||
|
||||
height = *(*data)++;
|
||||
|
||||
gEnvironmentLevels[i] = height;
|
||||
*data += 5;
|
||||
gEnvironmentLevels[i] = *(*data)++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,6 @@ enum
|
||||
|
||||
typedef struct SurfaceNode SpatialPartitionCell[4];
|
||||
|
||||
// Needed for bs bss reordering memes.
|
||||
extern s32 unused8038BE90;
|
||||
|
||||
extern SpatialPartitionCell gStaticSurfacePartition[NUM_CELLS][NUM_CELLS];
|
||||
extern SpatialPartitionCell gDynamicSurfacePartition[NUM_CELLS][NUM_CELLS];
|
||||
extern struct SurfaceNode *sSurfaceNodePool;
|
||||
|
||||
@@ -63,7 +63,6 @@ void _Ldtob(printf_struct *args, u8 type) {
|
||||
u8 drop;
|
||||
s32 n2;
|
||||
/* */
|
||||
UNUSED u8 unused[0x4];
|
||||
ptr = buff;
|
||||
val = args->value.f64;
|
||||
if (args->precision < 0) {
|
||||
|
||||
@@ -61,8 +61,6 @@ void bhv_activated_back_and_forth_platform_init(void) {
|
||||
* Activated back-and-forth platform update function.
|
||||
*/
|
||||
void bhv_activated_back_and_forth_platform_update(void) {
|
||||
UNUSED s32 unused[3];
|
||||
|
||||
// oVelY is used for vertical platforms' movement and also for
|
||||
// horizontal platforms' dipping up/down when Mario gets on/off them
|
||||
if (gMarioObject->platform == o) {
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
* Update function for bhvBbhTiltingTrapPlatform.
|
||||
*/
|
||||
void bhv_bbh_tilting_trap_platform_loop(void) {
|
||||
UNUSED s32 unused;
|
||||
|
||||
// US (and probably later) versions use oAction for the
|
||||
// if statement, while immediately setting it over here.
|
||||
// This was done so that Mario leaving or getting on the platform
|
||||
|
||||
@@ -12,6 +12,5 @@
|
||||
* Update function for bhvBetaFishSplashSpawner.
|
||||
*/
|
||||
void bhv_beta_fish_splash_spawner_loop(void) {
|
||||
UNUSED u8 pad[12];
|
||||
UNUSED f32 water_level = find_water_level(o->oPosX, o->oPosZ);
|
||||
// UNUSED f32 water_level = find_water_level(o->oPosX, o->oPosZ);
|
||||
}
|
||||
@@ -52,7 +52,6 @@ static void bird_act_inactive(void) {
|
||||
* and the parent spawner bird if it's a spawned bird.
|
||||
*/
|
||||
static void bird_act_fly(void) {
|
||||
UNUSED s32 unused;
|
||||
f32 distance;
|
||||
|
||||
// Compute forward velocity and vertical velocity from oBirdSpeed and pitch
|
||||
|
||||
@@ -12,13 +12,13 @@ void bhv_blue_fish_movement_loop(void) {
|
||||
// Initial dive phase after spawning
|
||||
case BLUE_FISH_ACT_DIVE:
|
||||
cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
|
||||
|
||||
|
||||
// Assigns random values to variables that help determine natural motion.
|
||||
if (o->oTimer == 0) {
|
||||
o->oBlueFishRandomAngle = random_sign() << 11;
|
||||
o->oBlueFishRandomVel = random_float() * 2;
|
||||
o->oBlueFishRandomTime = (s32)(random_float() * 30) & 0xFE;
|
||||
|
||||
|
||||
// Adjusts pitch velocity or sets to zero dependant on outcome of randomSwitch.
|
||||
randomSwitch = random_float() * 5;
|
||||
if (randomSwitch < 2.0f) {
|
||||
@@ -27,20 +27,20 @@ void bhv_blue_fish_movement_loop(void) {
|
||||
o->oAngleVelPitch = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set forward velocity and progress oAction to BLUE_FISH_ACT_TURN.
|
||||
o->oForwardVel = o->oBlueFishRandomVel + 3.0f;
|
||||
if (o->oTimer >= o->oBlueFishRandomTime + 60) {
|
||||
o->oAction++;
|
||||
}
|
||||
|
||||
|
||||
// Set pitch velocity
|
||||
if (o->oTimer < (o->oBlueFishRandomTime + 60) / 2) {
|
||||
o->oFaceAnglePitch += o->oAngleVelPitch;
|
||||
} else {
|
||||
o->oFaceAnglePitch -= o->oAngleVelPitch;
|
||||
}
|
||||
|
||||
|
||||
// Calculate new Y velocity
|
||||
o->oVelY = -sins(o->oFaceAnglePitch) * o->oForwardVel;
|
||||
break;
|
||||
@@ -51,39 +51,39 @@ void bhv_blue_fish_movement_loop(void) {
|
||||
if (o->oTimer == 15) {
|
||||
o->oAction++;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
// Animates and adjusts pitch to an upward direction.
|
||||
case BLUE_FISH_ACT_ASCEND:
|
||||
cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
|
||||
|
||||
// Progresses oAction to BLUE_FISH_ACT_TURN_BACK after elapsed time.
|
||||
|
||||
// Progresses oAction to BLUE_FISH_ACT_TURN_BACK after elapsed time.
|
||||
if (o->oTimer >= o->oBlueFishRandomTime + 60) {
|
||||
o->oAction++;
|
||||
}
|
||||
|
||||
|
||||
// Adjusts pitch angle. Direction relies on time not passed.
|
||||
if (o->oTimer < (o->oBlueFishRandomTime + 60) / 2) {
|
||||
o->oFaceAnglePitch -= o->oAngleVelPitch;
|
||||
} else {
|
||||
o->oFaceAnglePitch += o->oAngleVelPitch;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
// Animates and turns fish around
|
||||
case BLUE_FISH_ACT_TURN_BACK:
|
||||
cur_obj_init_animation_with_accel_and_sound(0, 2.0f);
|
||||
o->oMoveAngleYaw = (s32)(o->oBlueFishRandomAngle + o->oMoveAngleYaw);
|
||||
|
||||
|
||||
// Sets the fish back to the BLUE_FISH_ACT_DIVE phase.
|
||||
if (o->oTimer == 15) {
|
||||
o->oAction = BLUE_FISH_ACT_DIVE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Calculates Y velocity and calls physics engine.
|
||||
o->oVelY = -sins(o->oFaceAnglePitch) * o->oForwardVel;
|
||||
cur_obj_move_using_fvel_and_gravity();
|
||||
|
||||
|
||||
// Deletes object if the parent has oAction set to BLUE_FISH_ACT_DUPLICATE.
|
||||
if (o->parentObj->oAction == BLUE_FISH_ACT_DUPLICATE) {
|
||||
obj_mark_for_deletion(o);
|
||||
@@ -100,25 +100,25 @@ void bhv_tank_fish_group_loop(void) {
|
||||
switch (o->oAction) {
|
||||
case BLUE_FISH_ACT_SPAWN:
|
||||
if (gMarioCurrentRoom == 15 || gMarioCurrentRoom == 7) {
|
||||
|
||||
|
||||
// spawns fifteen fish and moves them within 200.0f
|
||||
for (i = 0; i < 15; i++) {
|
||||
fish = spawn_object_relative(0, 300, 0, -200, o, MODEL_FISH, bhvBlueFish);
|
||||
obj_translate_xyz_random(fish, 200.0f);
|
||||
}
|
||||
|
||||
|
||||
// Proceed to BLUE_FISH_ACT_ROOM phase.
|
||||
o->oAction++;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
// Sets next oAction phase if Mario is not in rooms fifteen and seven.
|
||||
case BLUE_FISH_ACT_ROOM:
|
||||
if (gMarioCurrentRoom != 15 && gMarioCurrentRoom != 7) {
|
||||
o->oAction++;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
// Sets oAction to the BLUE_FISH_ACT_SPAWN phase.
|
||||
case BLUE_FISH_ACT_DUPLICATE:
|
||||
o->oAction = BLUE_FISH_ACT_SPAWN;
|
||||
|
||||
@@ -25,8 +25,6 @@ static struct ObjectHitbox sBooCageHitbox = {
|
||||
* Update function for bhvBooCage.
|
||||
*/
|
||||
void bhv_boo_cage_loop(void) {
|
||||
UNUSED s32 unused;
|
||||
|
||||
obj_set_hitbox(o, &sBooCageHitbox);
|
||||
|
||||
switch (o->oAction) {
|
||||
|
||||
@@ -428,7 +428,7 @@ void bowser_set_act_big_jump(void) {
|
||||
void bowser_bits_actions(void) {
|
||||
switch (o->oBowserIsReacting) {
|
||||
case FALSE:
|
||||
// oBowserBitsJustJump never changes value,
|
||||
// oBowserBitsJustJump never changes value,
|
||||
// so its always FALSE, maybe a debug define
|
||||
if (o->oBowserBitsJustJump == FALSE) {
|
||||
bowser_bits_action_list();
|
||||
@@ -726,7 +726,6 @@ void bowser_short_second_hop(void) {
|
||||
* Makes Bowser do a big jump
|
||||
*/
|
||||
void bowser_act_big_jump(void) {
|
||||
UNUSED s32 unused;
|
||||
if (o->oSubAction == 0) {
|
||||
// Set jump animation
|
||||
if (bowser_set_anim_jump()) {
|
||||
@@ -982,7 +981,6 @@ s32 bowser_check_hit_mine(void) {
|
||||
* Bowser's thrown act that gets called after Mario releases him
|
||||
*/
|
||||
void bowser_act_thrown(void) {
|
||||
UNUSED s32 unused;
|
||||
// Keep Bowser's timer at 0 unless he lands
|
||||
if (o->oTimer < 2)
|
||||
o->oBowserTimer = 0;
|
||||
@@ -1026,7 +1024,6 @@ void bowser_set_goal_invisible(void) {
|
||||
*/
|
||||
void bowser_act_jump_onto_stage(void) {
|
||||
s32 onDynamicFloor;
|
||||
UNUSED s32 unused;
|
||||
struct Surface *floor = o->oFloor;
|
||||
|
||||
// Set dynamic floor check (Object platforms)
|
||||
@@ -1286,7 +1283,6 @@ s32 bowser_dead_default_stage_ending(void) {
|
||||
* Returns TRUE once done
|
||||
*/
|
||||
s32 bowser_dead_final_stage_ending(void) {
|
||||
UNUSED s32 unused;
|
||||
s32 ret = FALSE;
|
||||
s32 dialogID;
|
||||
if (o->oBowserTimer < 2) {
|
||||
@@ -1383,11 +1379,11 @@ struct BowserTiltPlatformInfo {
|
||||
// 0 = Don't move
|
||||
// 1 = Move angle behind Bowser
|
||||
// -1 = Move angle in front of Bowser
|
||||
s16 flag;
|
||||
s16 flag;
|
||||
// Sets platform's tilt angle speed (pattern: positive then negative)
|
||||
s16 angSpeed;
|
||||
s16 angSpeed;
|
||||
// Sets how much time the platform can tilt, increases each move
|
||||
s16 time;
|
||||
s16 time;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1414,9 +1410,7 @@ struct BowserTiltPlatformInfo sBowsertiltPlatformData[] = {
|
||||
void bowser_act_tilt_lava_platform(void) {
|
||||
// Set platform object
|
||||
struct Object *platform = cur_obj_nearest_object_with_behavior(bhvTiltingBowserLavaPlatform);
|
||||
UNUSED s16 angle = o->oBowserAngleToCentre + 0x8000;
|
||||
s16 angSpeed;
|
||||
UNUSED s32 unused;
|
||||
s32 i;
|
||||
s32 isNotTilting;
|
||||
// If there's not platform, return to default action
|
||||
@@ -1875,14 +1869,12 @@ void bowser_open_eye_switch(struct Object *obj, struct GraphNodeSwitchCase *swit
|
||||
* direction otherwise.
|
||||
*/
|
||||
Gfx *geo_switch_bowser_eyes(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx) {
|
||||
UNUSED s16 eyeShut;
|
||||
UNUSED s32 unused;
|
||||
struct Object *obj = (struct Object *) gCurGraphNodeObject;
|
||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node;
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
if (gCurGraphNodeHeldObject != NULL)
|
||||
obj = gCurGraphNodeHeldObject->objNode;
|
||||
switch (eyeShut = obj->oBowserEyesShut) {
|
||||
switch (obj->oBowserEyesShut) {
|
||||
case FALSE: // eyes open, handle eye looking direction
|
||||
bowser_open_eye_switch(obj, switchCase);
|
||||
break;
|
||||
|
||||
@@ -27,7 +27,6 @@ void falling_bowser_plat_act_start(void) {
|
||||
}
|
||||
|
||||
void falling_bowser_plat_act_check(void) {
|
||||
UNUSED s32 unused;
|
||||
struct Object *bowser = o->oBitsPlatformBowser;
|
||||
if (bowser->platform == o) {
|
||||
if (bowser->oAction == BOWSER_ACT_BIG_JUMP && bowser->oBowserStatus & BOWSER_STATUS_BIG_JUMP) {
|
||||
|
||||
@@ -116,8 +116,6 @@ void bhv_flame_moving_forward_growing_init(void) {
|
||||
}
|
||||
|
||||
void bhv_flame_moving_forward_growing_loop(void) {
|
||||
UNUSED s32 unused;
|
||||
UNUSED struct Object *flame;
|
||||
obj_set_hitbox(o, &sGrowingBowserFlameHitbox);
|
||||
o->oFlameScale = o->oFlameScale + 0.5;
|
||||
cur_obj_scale(o->oFlameScale);
|
||||
@@ -131,7 +129,7 @@ void bhv_flame_moving_forward_growing_loop(void) {
|
||||
}
|
||||
if (o->oPosY < o->oFloorHeight) {
|
||||
o->oPosY = o->oFloorHeight;
|
||||
flame = spawn_object(o, MODEL_RED_FLAME, bhvFlameBowser);
|
||||
spawn_object(o, MODEL_RED_FLAME, bhvFlameBowser);
|
||||
obj_mark_for_deletion(o);
|
||||
}
|
||||
}
|
||||
@@ -152,7 +150,6 @@ void bhv_flame_floating_landing_init(void) {
|
||||
f32 sFlameFloatingYLimit[] = { -8.0f, -6.0f, -3.0f };
|
||||
|
||||
void bhv_flame_floating_landing_loop(void) {
|
||||
UNUSED s32 unused;
|
||||
cur_obj_update_floor_and_walls();
|
||||
cur_obj_move_standard(78);
|
||||
bowser_flame_move();
|
||||
|
||||
@@ -29,9 +29,7 @@ static void camera_lakitu_intro_act_trigger_cutscene(void) {
|
||||
//! These bounds are slightly smaller than the actual bridge bounds, allowing
|
||||
// the RTA speedrunning method of lakitu skip
|
||||
if (gMarioObject->oPosX > -544.0f && gMarioObject->oPosX < 545.0f && gMarioObject->oPosY > 800.0f
|
||||
&& gMarioObject->oPosZ > -2000.0f && gMarioObject->oPosZ < -177.0f
|
||||
&& gMarioObject->oPosZ < -177.0f) // always double check your conditions
|
||||
{
|
||||
&& gMarioObject->oPosZ > -2000.0f && gMarioObject->oPosZ < -177.0f) {
|
||||
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_START) {
|
||||
o->oAction = CAMERA_LAKITU_INTRO_ACT_SPAWN_CLOUD;
|
||||
}
|
||||
@@ -115,7 +113,7 @@ static void camera_lakitu_intro_act_show_dialog(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
} else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_034)) {
|
||||
o->oCameraLakituFinishedDialog = TRUE;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,6 @@ void opened_cannon_act_5(void) {
|
||||
}
|
||||
|
||||
void opened_cannon_act_1(void) {
|
||||
UNUSED s32 unused;
|
||||
cur_obj_become_intangible();
|
||||
cur_obj_disable_rendering();
|
||||
o->oCannonIsActive = 0;
|
||||
@@ -98,7 +97,6 @@ void opened_cannon_act_2(void) {
|
||||
}
|
||||
|
||||
void opened_cannon_act_3(void) {
|
||||
UNUSED s32 unused;
|
||||
if (o->oTimer > 3)
|
||||
o->oAction = 0;
|
||||
}
|
||||
|
||||
@@ -39,9 +39,9 @@ void cap_switch_act_2(void) {
|
||||
}
|
||||
} else {
|
||||
//! Neither of these flags are defined in this function so they do nothing.
|
||||
// On an extra note, there's a specific check for this cutscene and
|
||||
// On an extra note, there's a specific check for this cutscene and
|
||||
// there's no dialog defined since the cutscene itself calls the dialog.
|
||||
response = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_FRONT,
|
||||
response = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_FRONT,
|
||||
(DIALOG_FLAG_TEXT_RESPONSE | DIALOG_FLAG_UNK_CAPSWITCH), CUTSCENE_CAP_SWITCH_PRESS, 0);
|
||||
if (response)
|
||||
o->oAction = 3;
|
||||
|
||||
@@ -54,7 +54,6 @@ void bhv_castle_floor_trap_rotate(void) {
|
||||
}
|
||||
|
||||
void bhv_castle_floor_trap_loop(void) {
|
||||
UNUSED s32 unused[3];
|
||||
switch (o->oAction) {
|
||||
case 0:
|
||||
bhv_castle_floor_trap_open_detect();
|
||||
|
||||
@@ -256,7 +256,7 @@ static void chain_chomp_released_trigger_cutscene(void) {
|
||||
|
||||
//! Can delay this if we get into a cutscene-unfriendly action after the
|
||||
// last post ground pound and before this
|
||||
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK
|
||||
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK
|
||||
&& (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) && cutscene_object(CUTSCENE_STAR_SPAWN, o) == 1) {
|
||||
o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_LUNGE_AROUND;
|
||||
o->oTimer = 0;
|
||||
|
||||
@@ -6,12 +6,6 @@ struct UnusedChuckyaData {
|
||||
f32 unk8;
|
||||
};
|
||||
|
||||
struct UnusedChuckyaData sUnusedChuckyaData[] = { { 2, 0.f, 1.f },
|
||||
{ 2, 10.f, 1.f },
|
||||
{ 2, 20.f, 1.f },
|
||||
{ 2, 20.f, 1.f },
|
||||
{ 8, 10.f, 1.f }};
|
||||
|
||||
void common_anchor_mario_behavior(f32 forwardVel, f32 yVel, s32 flag) {
|
||||
switch (o->parentObj->oCommonAnchorAction) {
|
||||
case 0:
|
||||
|
||||
@@ -24,7 +24,6 @@ void bhv_punch_tiny_triangle_loop(void) {
|
||||
|
||||
void bhv_punch_tiny_triangle_init(void) {
|
||||
s32 i;
|
||||
UNUSED s32 unused;
|
||||
struct Object *triangle;
|
||||
for (i = 0; i < 6; i++) {
|
||||
triangle = spawn_object(o, MODEL_DIRT_ANIMATION, bhvPunchTinyTriangle);
|
||||
@@ -50,7 +49,6 @@ void bhv_wall_tiny_star_particle_loop(void) {
|
||||
|
||||
void bhv_tiny_star_particles_init(void) {
|
||||
s32 i;
|
||||
UNUSED s32 unused;
|
||||
struct Object *particle;
|
||||
for (i = 0; i < 7; i++) {
|
||||
particle = spawn_object(o, MODEL_CARTOON_STAR, bhvWallTinyStarParticle);
|
||||
|
||||
@@ -45,7 +45,7 @@ void play_warp_door_open_noise(void) {
|
||||
|
||||
void bhv_door_loop(void) {
|
||||
s32 index = 0;
|
||||
|
||||
|
||||
while (sDoorActions[index].flag != (u32)~0) {
|
||||
if (cur_obj_clear_interact_status_flag(sDoorActions[index].flag)) {
|
||||
set_door_camera_event();
|
||||
|
||||
@@ -68,7 +68,7 @@ void dorrie_act_lower_head(void) {
|
||||
if (o->oTimer > 150) {
|
||||
dorrie_begin_head_raise(FALSE);
|
||||
} else if (gMarioObject->platform == o) {
|
||||
if (o->oDorrieForwardDistToMario > 830.0f
|
||||
if (o->oDorrieForwardDistToMario > 830.0f
|
||||
&& set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_START) {
|
||||
dorrie_begin_head_raise(TRUE);
|
||||
} else if (o->oDorrieForwardDistToMario > 320.0f) {
|
||||
@@ -112,8 +112,6 @@ void dorrie_act_raise_head(void) {
|
||||
|
||||
void bhv_dorrie_update(void) {
|
||||
f32 boundsShift;
|
||||
UNUSED s32 unused1;
|
||||
UNUSED s32 unused2;
|
||||
f32 maxOffsetY;
|
||||
|
||||
if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// elevator.c.inc
|
||||
|
||||
static s16 sElevatorHeights[] = { -51, 0, 0,
|
||||
-461, 0, 0,
|
||||
-512, 0, 0,
|
||||
-2611, 0, 0,
|
||||
-2360, 0, 0,
|
||||
214, 0, 0,
|
||||
static s16 sElevatorHeights[] = { -51, 0, 0,
|
||||
-461, 0, 0,
|
||||
-512, 0, 0,
|
||||
-2611, 0, 0,
|
||||
-2360, 0, 0,
|
||||
214, 0, 0,
|
||||
-50, 1945, 1 };
|
||||
|
||||
void elevator_starting_shake(void) {
|
||||
|
||||
@@ -86,7 +86,6 @@ void exclamation_box_act_2(void) {
|
||||
}
|
||||
|
||||
void exclamation_box_act_3(void) {
|
||||
UNUSED s32 unused;
|
||||
cur_obj_move_using_fvel_and_gravity();
|
||||
if (o->oVelY < 0.0f) {
|
||||
o->oVelY = 0.0f;
|
||||
|
||||
@@ -84,7 +84,7 @@ void bhv_fish_spawner_loop(void) {
|
||||
static void fish_vertical_roam(s32 speed) {
|
||||
f32 parentY = o->parentObj->oPosY;
|
||||
|
||||
// If the stage is Secret Aquarium, the fish can
|
||||
// If the stage is Secret Aquarium, the fish can
|
||||
// travel as far vertically as they wish.
|
||||
if (gCurrLevelNum == LEVEL_SA) {
|
||||
if (500.0f < absf(o->oPosY - o->oFishGoalY)) {
|
||||
@@ -125,7 +125,7 @@ static void fish_act_roam(void) {
|
||||
}
|
||||
|
||||
o->oFishGoalY = gMarioObject->oPosY + o->oFishHeightOffset;
|
||||
|
||||
|
||||
// Rotate the fish towards Mario.
|
||||
cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
|
||||
|
||||
@@ -201,7 +201,7 @@ static void fish_act_flee(void) {
|
||||
} else {
|
||||
fish_vertical_roam(4);
|
||||
}
|
||||
|
||||
|
||||
// Don't let the fish leave the water vertically.
|
||||
} else {
|
||||
o->oPosY = o->oFishWaterLevel - 50.0f;
|
||||
@@ -234,9 +234,7 @@ static void (*sFishActions[])(void) = {
|
||||
/**
|
||||
* Main loop for fish
|
||||
*/
|
||||
void bhv_fish_loop(void)
|
||||
{
|
||||
UNUSED s32 unused[4];
|
||||
void bhv_fish_loop(void) {
|
||||
cur_obj_scale(1.0f);
|
||||
|
||||
// oFishWaterLevel tracks if a fish has roamed out of water.
|
||||
|
||||
@@ -38,7 +38,6 @@ void bhv_flamethrower_loop(void) {
|
||||
f32 flameVel;
|
||||
s32 flameTimeRemaining;
|
||||
s32 model;
|
||||
UNUSED u8 pad[8];
|
||||
if (o->oAction == 0) {
|
||||
if (gCurrLevelNum != LEVEL_BBH || gMarioOnMerryGoRound == TRUE)
|
||||
if (o->oDistanceToMario < 2000.0f)
|
||||
|
||||
@@ -67,9 +67,7 @@ static u8 sGoombaAttackHandlers[][6] = {
|
||||
* Update function for goomba triplet spawner.
|
||||
*/
|
||||
void bhv_goomba_triplet_spawner_update(void) {
|
||||
UNUSED s32 unused1;
|
||||
s16 goombaFlag;
|
||||
UNUSED s16 unused2;
|
||||
s32 angle;
|
||||
s32 dAngle;
|
||||
s16 dx;
|
||||
|
||||
@@ -41,7 +41,6 @@ void heave_ho_act_1(void) {
|
||||
}
|
||||
|
||||
void heave_ho_act_2(void) {
|
||||
UNUSED s32 unused;
|
||||
s16 angleVel;
|
||||
if (1000.0f < cur_obj_lateral_dist_from_mario_to_home())
|
||||
o->oAngleToMario = cur_obj_angle_to_home();
|
||||
|
||||
@@ -232,7 +232,7 @@ void bhv_hoot_loop(void) {
|
||||
case HOOT_AVAIL_WANTS_TO_TALK:
|
||||
hoot_awake_loop();
|
||||
|
||||
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK
|
||||
if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK
|
||||
&& cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_044)) {
|
||||
set_mario_npc_dialog(MARIO_DIALOG_STOP);
|
||||
|
||||
|
||||
@@ -24,11 +24,9 @@ void intro_lakitu_set_offset_from_camera(struct Object *o, Vec3f offset) {
|
||||
}
|
||||
|
||||
void intro_lakitu_set_focus(struct Object *o, Vec3f newFocus) {
|
||||
UNUSED Vec3f unusedVec3f;
|
||||
Vec3f origin;
|
||||
f32 dist;
|
||||
s16 pitch, yaw;
|
||||
UNUSED u32 unused;
|
||||
|
||||
// newFocus is an offset from lakitu's origin, not a point in the world.
|
||||
vec3f_set(origin, 0.f, 0.f, 0.f);
|
||||
@@ -59,7 +57,6 @@ s32 intro_lakitu_set_pos_and_focus(struct Object *o, struct CutsceneSplinePoint
|
||||
|
||||
void bhv_intro_lakitu_loop(void) {
|
||||
Vec3f offset, fromPoint, toPoint;
|
||||
UNUSED u32 pad[4];
|
||||
|
||||
switch (gCurrentObject->oAction) {
|
||||
case 0:
|
||||
|
||||
@@ -171,7 +171,7 @@ void king_bobomb_act_6(void) {
|
||||
|
||||
void king_bobomb_act_7(void) {
|
||||
cur_obj_init_animation_with_sound(2);
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_TEXT_DEFAULT, CUTSCENE_DIALOG, DIALOG_116)) {
|
||||
create_sound_spawner(SOUND_OBJ_KING_WHOMP_DEATH);
|
||||
cur_obj_hide();
|
||||
@@ -264,7 +264,7 @@ void king_bobomb_act_5(void) { // bobomb returns home
|
||||
o->oSubAction++;
|
||||
break;
|
||||
case 4:
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_128))
|
||||
o->oAction = 2;
|
||||
break;
|
||||
|
||||
@@ -319,8 +319,6 @@ void obj_set_speed_to_zero(void) {
|
||||
}
|
||||
|
||||
void bhv_klepto_update(void) {
|
||||
UNUSED s32 unused;
|
||||
|
||||
cur_obj_update_floor_and_walls();
|
||||
|
||||
o->oKleptoDistanceToTarget = cur_obj_lateral_dist_to_home();
|
||||
|
||||
@@ -519,8 +519,6 @@ static void koopa_the_quick_act_show_init_text(void) {
|
||||
sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].initText);
|
||||
|
||||
if (response == DIALOG_RESPONSE_YES) {
|
||||
UNUSED s32 unused;
|
||||
|
||||
gMarioShotFromCannon = FALSE;
|
||||
o->oAction = KOOPA_THE_QUICK_ACT_RACE;
|
||||
o->oForwardVel = 0.0f;
|
||||
@@ -731,7 +729,7 @@ static void koopa_the_quick_act_after_race(void) {
|
||||
o->oFlags &= ~OBJ_FLAG_ACTIVE_FROM_AFAR;
|
||||
}
|
||||
} else if (o->parentObj->oKoopaRaceEndpointDialog > 0) {
|
||||
s32 dialogResponse = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
s32 dialogResponse = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, o->parentObj->oKoopaRaceEndpointDialog);
|
||||
if (dialogResponse != 0) {
|
||||
o->parentObj->oKoopaRaceEndpointDialog = DIALOG_NONE;
|
||||
|
||||
@@ -13,7 +13,6 @@ struct ObjectHitbox sKoopaShellHitbox = {
|
||||
};
|
||||
|
||||
void koopa_shell_spawn_water_drop(void) {
|
||||
UNUSED s32 unused;
|
||||
struct Object *drop;
|
||||
spawn_object(o, MODEL_WAVE_TRAIL, bhvObjectWaveTrail);
|
||||
if (gMarioStates[0].forwardVel > 10.0f) {
|
||||
|
||||
@@ -15,7 +15,6 @@ void hexagonal_ring_spawn_flames(void) {
|
||||
}
|
||||
|
||||
void bhv_lll_rotating_hexagonal_ring_loop(void) {
|
||||
UNUSED s32 unused;
|
||||
o->oCollisionDistance = 4000.0f;
|
||||
o->oDrawingDistance = 8000.0f;
|
||||
switch (o->oAction) {
|
||||
|
||||
@@ -7,7 +7,7 @@ void bhv_volcano_flames_loop(void) {
|
||||
o->oPosZ += o->oVelZ;
|
||||
cur_obj_move_y(-4.0f, -0.7f, 2.0f);
|
||||
|
||||
if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE
|
||||
if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE
|
||||
| OBJ_MOVE_UNDERWATER_OFF_GROUND))
|
||||
obj_mark_for_deletion(o);
|
||||
}
|
||||
@@ -5,15 +5,15 @@
|
||||
* These rings contain a significant bug that is documented in water_ring.inc.c
|
||||
*/
|
||||
|
||||
static Trajectory sMantaRayTraj[] = {
|
||||
TRAJECTORY_POS(0, /*pos*/ -4500, -1380, -40),
|
||||
TRAJECTORY_POS(1, /*pos*/ -4120, -2240, 740),
|
||||
TRAJECTORY_POS(2, /*pos*/ -3280, -3080, 1040),
|
||||
TRAJECTORY_POS(3, /*pos*/ -2240, -3320, 720),
|
||||
TRAJECTORY_POS(4, /*pos*/ -1840, -3140, -280),
|
||||
TRAJECTORY_POS(5, /*pos*/ -2320, -2480, -1100),
|
||||
TRAJECTORY_POS(6, /*pos*/ -3220, -1600, -1360),
|
||||
TRAJECTORY_POS(7, /*pos*/ -4180, -1020, -1040),
|
||||
static Trajectory sMantaRayTraj[] = {
|
||||
TRAJECTORY_POS(0, /*pos*/ -4500, -1380, -40),
|
||||
TRAJECTORY_POS(1, /*pos*/ -4120, -2240, 740),
|
||||
TRAJECTORY_POS(2, /*pos*/ -3280, -3080, 1040),
|
||||
TRAJECTORY_POS(3, /*pos*/ -2240, -3320, 720),
|
||||
TRAJECTORY_POS(4, /*pos*/ -1840, -3140, -280),
|
||||
TRAJECTORY_POS(5, /*pos*/ -2320, -2480, -1100),
|
||||
TRAJECTORY_POS(6, /*pos*/ -3220, -1600, -1360),
|
||||
TRAJECTORY_POS(7, /*pos*/ -4180, -1020, -1040),
|
||||
TRAJECTORY_END(),
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ s32 check_if_moving_over_floor(f32 maxDist, f32 offset) {
|
||||
}
|
||||
|
||||
void bhv_pushable_loop(void) {
|
||||
UNUSED s16 unused;
|
||||
s16 angleToMario;
|
||||
obj_set_hitbox(o, &sMetalBoxHitbox);
|
||||
o->oForwardVel = 0.0f;
|
||||
|
||||
@@ -33,7 +33,6 @@ void bhv_piranha_plant_bubble_loop(void) {
|
||||
s32 frame = parent->header.gfx.animInfo.animFrame;
|
||||
// TODO: rename lastFrame if it is inaccurate
|
||||
s32 lastFrame = parent->header.gfx.animInfo.curAnim->loopEnd - 2;
|
||||
s32 UNUSED unused;
|
||||
f32 doneShrinkingFrame; // the first frame after shrinking is done
|
||||
f32 beginGrowingFrame; // the frame just before growing begins
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
void bhv_purple_switch_loop(void) {
|
||||
UNUSED s32 unused;
|
||||
switch (o->oAction) {
|
||||
/**
|
||||
* Set the switch's model and scale. If Mario is standing near the
|
||||
|
||||
@@ -143,7 +143,7 @@ static void racing_penguin_act_show_final_text(void) {
|
||||
o->oForwardVel = 4.0f;
|
||||
}
|
||||
} else if (o->oRacingPenguinFinalTextbox > 0) {
|
||||
if ((textResult = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
if ((textResult = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, o->oRacingPenguinFinalTextbox))) {
|
||||
o->oRacingPenguinFinalTextbox = -1;
|
||||
o->oTimer = 0;
|
||||
|
||||
@@ -24,7 +24,6 @@ s32 update_angle_from_move_flags(s32 *angle) {
|
||||
}
|
||||
|
||||
void bhv_scuttlebug_loop(void) {
|
||||
UNUSED s32 unused;
|
||||
f32 animSpeed;
|
||||
cur_obj_update_floor_and_walls();
|
||||
if (o->oSubAction != 0
|
||||
|
||||
@@ -39,7 +39,6 @@ void bhv_seesaw_platform_update(void) {
|
||||
if (gMarioObject->platform == o) {
|
||||
// Rotate toward mario
|
||||
f32 rotation = o->oDistanceToMario * coss(o->oAngleToMario - o->oMoveAngleYaw);
|
||||
UNUSED s32 unused;
|
||||
|
||||
// Deceleration is faster than acceleration
|
||||
if (o->oSeesawPlatformPitchVel * rotation < 0) {
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
// sl_snowman_wind.c.inc
|
||||
|
||||
void bhv_sl_snowman_wind_loop(void) {
|
||||
UNUSED s32 unusedVar = 0;
|
||||
s16 marioAngleFromWindSource;
|
||||
Vec3f tempPos;
|
||||
|
||||
|
||||
if (o->oTimer == 0)
|
||||
o->oSLSnowmanWindOriginalYaw = o->oMoveAngleYaw;
|
||||
|
||||
|
||||
// Waiting for Mario to approach.
|
||||
if (o->oSubAction == SL_SNOWMAN_WIND_ACT_IDLE) {
|
||||
o->oDistanceToMario = 0;
|
||||
|
||||
|
||||
// Check if Mario is within 1000 units of the center of the bridge, and ready to speak.
|
||||
vec3f_copy_2(tempPos, &o->oPosX);
|
||||
obj_set_pos(o, 1100, 3328, 1164); // Position is in the middle of the ice bridge
|
||||
if (cur_obj_can_mario_activate_textbox(1000.0f, 30.0f, 0x7FFF))
|
||||
o->oSubAction++;
|
||||
vec3f_copy_2(&o->oPosX, tempPos);
|
||||
|
||||
|
||||
// Mario has come close, begin dialog.
|
||||
} else if (o->oSubAction == SL_SNOWMAN_WIND_ACT_TALKING) {
|
||||
if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TEXT_DEFAULT, DIALOG_153, 0))
|
||||
o->oSubAction++;
|
||||
|
||||
|
||||
// Blowing, spawn wind particles (SL_SNOWMAN_WIND_ACT_BLOWING)
|
||||
} else if (o->oDistanceToMario < 1500.0f && absf(gMarioObject->oPosY - o->oHomeY) < 500.0f) {
|
||||
// Point towards Mario, but only within 0x1500 angle units of the original angle.
|
||||
|
||||
@@ -22,11 +22,11 @@ static s32 sl_walking_penguin_turn(void) {
|
||||
// Stay still and use walking animation for the turn.
|
||||
o->oForwardVel = 0.0f;
|
||||
cur_obj_init_animation_with_accel_and_sound(PENGUIN_ANIM_WALK, 1.0f);
|
||||
|
||||
|
||||
// Turn around.
|
||||
o->oAngleVelYaw = 0x400;
|
||||
o->oMoveAngleYaw += o->oAngleVelYaw;
|
||||
|
||||
|
||||
if (o->oTimer == 31)
|
||||
return TRUE; // Finished turning
|
||||
else
|
||||
@@ -36,10 +36,10 @@ static s32 sl_walking_penguin_turn(void) {
|
||||
void bhv_sl_walking_penguin_loop(void) {
|
||||
f32 adjustedXPos, adjustedZPos;
|
||||
f32 perpendicularOffset = 100.0f;
|
||||
|
||||
|
||||
o->oAngleVelYaw = 0;
|
||||
cur_obj_update_floor_and_walls();
|
||||
|
||||
|
||||
switch (o->oAction) {
|
||||
// Walk erratically across the ice bridge using preset steps.
|
||||
case SL_WALKING_PENGUIN_ACT_MOVING_FORWARDS:
|
||||
@@ -48,7 +48,7 @@ void bhv_sl_walking_penguin_loop(void) {
|
||||
o->oSLWalkingPenguinCurStep = 0;
|
||||
o->oSLWalkingPenguinCurStepTimer = 0;
|
||||
}
|
||||
|
||||
|
||||
if (o->oSLWalkingPenguinCurStepTimer < sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].stepLength)
|
||||
o->oSLWalkingPenguinCurStepTimer++;
|
||||
else {
|
||||
@@ -59,57 +59,57 @@ void bhv_sl_walking_penguin_loop(void) {
|
||||
// Reached the end of the list, go back to the start
|
||||
o->oSLWalkingPenguinCurStep = 0;
|
||||
}
|
||||
|
||||
|
||||
if (o->oPosX < 300.0f)
|
||||
o->oAction++; // If reached the end of the bridge, turn around and head back.
|
||||
else {
|
||||
// Move and animate the penguin
|
||||
o->oForwardVel = sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].speed;
|
||||
|
||||
|
||||
cur_obj_init_animation_with_accel_and_sound(
|
||||
sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].anim,
|
||||
sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].animSpeed
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
// At the end, turn around and prepare to head back across the bridge.
|
||||
case SL_WALKING_PENGUIN_ACT_TURNING_BACK:
|
||||
if (sl_walking_penguin_turn())
|
||||
o->oAction++; // Finished turning
|
||||
break;
|
||||
|
||||
|
||||
// Walk back across the bridge at a constant speed.
|
||||
case SL_WALKING_PENGUIN_ACT_RETURNING:
|
||||
// Move and animate the penguin
|
||||
o->oForwardVel = 12.0f;
|
||||
cur_obj_init_animation_with_accel_and_sound(PENGUIN_ANIM_WALK, 2.0f);
|
||||
|
||||
|
||||
if (o->oPosX > 1700.0f)
|
||||
o->oAction++; // If reached the start of the bridge, turn around.
|
||||
break;
|
||||
|
||||
|
||||
// At the start, turn around and prepare to walk erratically across the bridge.
|
||||
case SL_WALKING_PENGUIN_ACT_TURNING_FORWARDS:
|
||||
if (sl_walking_penguin_turn())
|
||||
o->oAction = SL_WALKING_PENGUIN_ACT_MOVING_FORWARDS; // Finished turning
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
cur_obj_move_standard(-78);
|
||||
if (!cur_obj_hide_if_mario_far_away_y(1000.0f))
|
||||
play_penguin_walking_sound(PENGUIN_WALK_BIG);
|
||||
|
||||
|
||||
// Adjust the position to get a point better lined up with the visual model, for stopping the wind.
|
||||
// The new point is 60 units behind the penguin and 100 units perpedicularly, away from the snowman.
|
||||
|
||||
|
||||
adjustedXPos = o->oPosX + sins(0xDBB0) * 60.0f; // 0xDBB0 = -51 degrees, the angle the penguin is facing
|
||||
adjustedZPos = o->oPosZ + coss(0xDBB0) * 60.0f;
|
||||
adjustedXPos += perpendicularOffset * sins(0x1BB0); // 0x1BB0 = 39 degrees, perpendicular to the penguin
|
||||
adjustedZPos += perpendicularOffset * coss(0x1BB0);
|
||||
o->oSLWalkingPenguinWindCollisionXPos = adjustedXPos;
|
||||
o->oSLWalkingPenguinWindCollisionZPos = adjustedZPos;
|
||||
|
||||
|
||||
print_debug_bottom_up("x %d", o->oPosX);
|
||||
print_debug_bottom_up("z %d", o->oPosZ);
|
||||
}
|
||||
@@ -30,7 +30,7 @@ struct ObjectHitbox sSnufitBulletHitbox = {
|
||||
};
|
||||
|
||||
/**
|
||||
* This geo function shifts snufit's mask when it shrinks down,
|
||||
* This geo function shifts snufit's mask when it shrinks down,
|
||||
* since the parts move independently.
|
||||
*/
|
||||
Gfx *geo_snufit_move_mask(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
|
||||
@@ -77,7 +77,7 @@ void snufit_act_idle(void) {
|
||||
// if the game would not have already crashed.
|
||||
marioDist = (s32)(o->oDistanceToMario / 10.0f);
|
||||
if (o->oTimer > marioDist && o->oDistanceToMario < 800.0f) {
|
||||
|
||||
|
||||
// Controls an alternating scaling factor in a cos.
|
||||
o->oSnufitBodyScalePeriod
|
||||
= approach_s16_symmetric(o->oSnufitBodyScalePeriod, 0, 1500);
|
||||
@@ -121,7 +121,7 @@ void bhv_snufit_loop(void) {
|
||||
// Only update if Mario is in the current room.
|
||||
if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
|
||||
o->oDeathSound = SOUND_OBJ_SNUFIT_SKEETER_DEATH;
|
||||
|
||||
|
||||
// Face Mario if he is within range.
|
||||
if (o->oDistanceToMario < 800.0f) {
|
||||
obj_turn_pitch_toward_mario(120.0f, 2000);
|
||||
@@ -198,7 +198,7 @@ void bhv_snufit_balls_loop(void) {
|
||||
o->oGravity = -4.0f;
|
||||
|
||||
cur_obj_become_intangible();
|
||||
} else if (o->oAction == 1
|
||||
} else if (o->oAction == 1
|
||||
|| (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_HIT_WALL))) {
|
||||
// The Snufit shot Mario and has fulfilled its lonely existance.
|
||||
//! The above check could theoretically be avoided by finding a geometric
|
||||
|
||||
@@ -8,7 +8,6 @@ void star_door_update_pos(void) {
|
||||
}
|
||||
|
||||
void bhv_star_door_loop(void) {
|
||||
UNUSED u8 pad[4];
|
||||
struct Object *doorObj;
|
||||
doorObj = cur_obj_nearest_object_with_behavior(bhvStarDoor);
|
||||
switch (o->oAction) {
|
||||
|
||||
@@ -16,24 +16,24 @@ void bhv_strong_wind_particle_loop(void) {
|
||||
struct Object *penguinObj;
|
||||
f32 distanceFromPenguin;
|
||||
f32 penguinXDist, penguinZDist;
|
||||
|
||||
|
||||
obj_set_hitbox(o, &sStrongWindParticleHitbox);
|
||||
|
||||
|
||||
if (o->oTimer == 0) {
|
||||
o->oStrongWindParticlePenguinObj = cur_obj_nearest_object_with_behavior(bhvSLWalkingPenguin);
|
||||
obj_translate_xyz_random(o, 100.0f);
|
||||
|
||||
|
||||
o->oForwardVel = coss(o->oMoveAnglePitch) * 100.0f;
|
||||
o->oVelY = sins(o->oMoveAnglePitch) * -100.0f;
|
||||
|
||||
|
||||
o->oMoveAngleYaw += random_f32_around_zero(o->oBehParams2ndByte * 500); // Wind spread
|
||||
o->oOpacity = 100;
|
||||
}
|
||||
|
||||
|
||||
cur_obj_move_using_fvel_and_gravity();
|
||||
if (o->oTimer > 15) // Deactivate after 15 frames
|
||||
obj_mark_for_deletion(o);
|
||||
|
||||
|
||||
// If collided with the SL walking penguin, deactivate.
|
||||
penguinObj = o->oStrongWindParticlePenguinObj;
|
||||
if (penguinObj != NULL) {
|
||||
|
||||
@@ -79,9 +79,7 @@ void bhv_tilting_inverted_pyramid_loop(void) {
|
||||
f32 mz;
|
||||
|
||||
s32 marioOnPlatform = FALSE;
|
||||
UNUSED s32 unused;
|
||||
Mat4 *transform = &o->transform;
|
||||
UNUSED s32 unused2[7];
|
||||
|
||||
if (gMarioObject->platform == o) {
|
||||
get_mario_pos(&mx, &my, &mz);
|
||||
@@ -95,7 +93,7 @@ void bhv_tilting_inverted_pyramid_loop(void) {
|
||||
dy = 500.0f;
|
||||
dz = gMarioObject->oPosZ - o->oPosZ;
|
||||
d = sqrtf(dx * dx + dy * dy + dz * dz);
|
||||
|
||||
|
||||
//! Always true since dy = 500, making d >= 500.
|
||||
if (d != 0.0f) {
|
||||
// Normalizing
|
||||
@@ -120,7 +118,7 @@ void bhv_tilting_inverted_pyramid_loop(void) {
|
||||
o->oTiltingPyramidMarioOnPlatform = FALSE;
|
||||
}
|
||||
|
||||
// Approach the normals by 0.01f towards the new goal, then create a transform matrix and orient the object.
|
||||
// Approach the normals by 0.01f towards the new goal, then create a transform matrix and orient the object.
|
||||
// Outside of the other conditionals since it needs to tilt regardless of whether Mario is on.
|
||||
o->oTiltingPyramidNormalX = approach_by_increment(dx, o->oTiltingPyramidNormalX, 0.01f);
|
||||
o->oTiltingPyramidNormalY = approach_by_increment(dy, o->oTiltingPyramidNormalY, 0.01f);
|
||||
|
||||
@@ -69,7 +69,6 @@ void spawn_and_init_wf_platforms(s16 a, const BehaviorScript *bhv) {
|
||||
}
|
||||
|
||||
void spawn_wf_platform_group(void) {
|
||||
UNUSED s32 unused = 8;
|
||||
o->oPlatformSpawnerWFTowerPlatformNum = 0;
|
||||
o->oPlatformSpawnerWFTowerYawOffset = 0;
|
||||
o->oPlatformSpawnerWFTowerDYaw = 0x2000;
|
||||
|
||||
@@ -37,10 +37,8 @@ void bhv_snow_leaf_particle_spawn_init(void) {
|
||||
#ifdef TREE_PARTICLE_FIX
|
||||
struct Object *nearestTree = NULL;
|
||||
#endif
|
||||
UNUSED s32 unused;
|
||||
s32 isSnow;
|
||||
f32 scale;
|
||||
UNUSED s32 unused2;
|
||||
gMarioObject->oActiveParticleFlags &= ~0x2000;
|
||||
#ifdef TREE_PARTICLE_FIX
|
||||
nearestTree = cur_obj_nearest_object_with_behavior(bhvTree);
|
||||
|
||||
@@ -52,7 +52,7 @@ void tuxies_mother_act_1(void) {
|
||||
dialogID = DIALOG_058;
|
||||
else
|
||||
dialogID = DIALOG_059;
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, dialogID)) {
|
||||
if (dialogID == DIALOG_058)
|
||||
o->oSubAction = 1;
|
||||
@@ -115,7 +115,7 @@ void tuxies_mother_act_0(void) {
|
||||
o->oSubAction++;
|
||||
break;
|
||||
case 1:
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_057))
|
||||
o->oSubAction++;
|
||||
break;
|
||||
|
||||
@@ -25,11 +25,11 @@ void tweester_scale_and_move(f32 preScale) {
|
||||
s16 dYaw = 0x2C00;
|
||||
f32 scale = preScale * 0.4;
|
||||
|
||||
o->header.gfx.scale[0]
|
||||
o->header.gfx.scale[0]
|
||||
= (( coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.3 + 1.0) * scale;
|
||||
o->header.gfx.scale[1]
|
||||
o->header.gfx.scale[1]
|
||||
= ((-coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.5 + 0.5) * scale;
|
||||
o->header.gfx.scale[2]
|
||||
o->header.gfx.scale[2]
|
||||
= (( coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.3 + 1.0) * scale;
|
||||
|
||||
o->oTweesterScaleTimer += 0x200;
|
||||
@@ -125,7 +125,7 @@ void tweester_act_hide(void) {
|
||||
void (*sTweesterActions[])(void) = { tweester_act_idle, tweester_act_chase, tweester_act_hide };
|
||||
|
||||
/**
|
||||
* Loop behavior for Tweester.
|
||||
* Loop behavior for Tweester.
|
||||
* Loads the hitbox and calls its relevant action.
|
||||
*/
|
||||
void bhv_tweester_loop(void) {
|
||||
|
||||
@@ -174,8 +174,6 @@ void ukiki_act_idle(void) {
|
||||
* Only used for the cap ukiki.
|
||||
*/
|
||||
void ukiki_act_return_home(void) {
|
||||
UNUSED s32 unused;
|
||||
|
||||
cur_obj_init_animation_with_sound(UKIKI_ANIM_RUN);
|
||||
o->oMoveAngleYaw = cur_obj_angle_to_home();
|
||||
o->oForwardVel = 10.0f;
|
||||
@@ -383,7 +381,7 @@ void ukiki_act_go_to_cage(void) {
|
||||
case UKIKI_SUB_ACT_CAGE_TALK_TO_MARIO:
|
||||
cur_obj_init_animation_with_sound(UKIKI_ANIM_HANDSTAND);
|
||||
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_DOWN,
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_DOWN,
|
||||
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_080)) {
|
||||
o->oSubAction++;
|
||||
}
|
||||
@@ -578,7 +576,7 @@ void cap_ukiki_held_loop(void) {
|
||||
break;
|
||||
|
||||
case UKIKI_TEXT_HAS_CAP:
|
||||
if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP,
|
||||
if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP,
|
||||
(DIALOG_FLAG_TEXT_DEFAULT | DIALOG_FLAG_TIME_STOP_ENABLED), DIALOG_101, 0)) {
|
||||
mario_retrieve_cap();
|
||||
set_mario_npc_dialog(MARIO_DIALOG_STOP);
|
||||
|
||||
@@ -57,7 +57,6 @@ void bhv_water_splash_spawn_droplets(void) {
|
||||
}
|
||||
|
||||
void bhv_water_droplet_loop(void) {
|
||||
UNUSED u32 unusedVar;
|
||||
f32 waterLevel = find_water_level(o->oPosX, o->oPosZ);
|
||||
|
||||
if (o->oTimer == 0) {
|
||||
|
||||
@@ -28,7 +28,7 @@ void whomp_init(void) {
|
||||
cur_obj_set_pos_to_home();
|
||||
o->oHealth = 3;
|
||||
}
|
||||
} else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
} else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_114))
|
||||
o->oAction = 2;
|
||||
} else if (o->oDistanceToMario < 500.0f)
|
||||
@@ -216,7 +216,7 @@ void whomp_on_ground_general(void) {
|
||||
|
||||
void whomp_die(void) {
|
||||
if (o->oBehParams2ndByte != 0) {
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_TEXT_DEFAULT, CUTSCENE_DIALOG, DIALOG_115)) {
|
||||
obj_set_angle(o, 0, 0, 0);
|
||||
cur_obj_hide();
|
||||
|
||||
@@ -299,7 +299,7 @@ static void wiggler_act_jumped_on(void) {
|
||||
// defeated) or go back to walking
|
||||
if (o->header.gfx.scale[1] >= 4.0f) {
|
||||
if (o->oTimer > 30) {
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP,
|
||||
DIALOG_FLAG_NONE, CUTSCENE_DIALOG, attackText[o->oHealth - 2])) {
|
||||
// Because we don't want the wiggler to disappear after being
|
||||
// defeated, we leave its health at 1
|
||||
|
||||
+14
-188
@@ -122,17 +122,12 @@ extern f32 sHandheldShakeInc;
|
||||
extern s16 sHandheldShakePitch;
|
||||
extern s16 sHandheldShakeYaw;
|
||||
extern s16 sHandheldShakeRoll;
|
||||
extern u32 unused8033B30C;
|
||||
extern u32 unused8033B310;
|
||||
extern s16 sSelectionFlags;
|
||||
extern s16 unused8033B316;
|
||||
extern s16 s2ndRotateFlags;
|
||||
extern s16 unused8033B31A;
|
||||
extern s16 sCameraSoundFlags;
|
||||
extern u16 sCButtonsPressed;
|
||||
extern s16 sCutsceneDialogID;
|
||||
extern struct LakituState gLakituState;
|
||||
extern s16 unused8033B3E8;
|
||||
extern s16 sAreaYaw;
|
||||
extern s16 sAreaYawChange;
|
||||
extern s16 sLakituDist;
|
||||
@@ -161,7 +156,6 @@ extern struct CutsceneSplinePoint sCurCreditsSplinePos[32];
|
||||
extern struct CutsceneSplinePoint sCurCreditsSplineFocus[32];
|
||||
extern s16 sCutsceneSplineSegment;
|
||||
extern f32 sCutsceneSplineSegmentProgress;
|
||||
extern s16 unused8033B6E8;
|
||||
extern s16 sCutsceneShot;
|
||||
extern s16 gCutsceneTimer;
|
||||
extern struct CutsceneVariable sCutsceneVars[10];
|
||||
@@ -204,7 +198,6 @@ f32 sCutsceneSplineSegmentProgress;
|
||||
* The current segment of the CutsceneSplinePoint[] being used.
|
||||
*/
|
||||
s16 sCutsceneSplineSegment;
|
||||
s16 unused8033B6E8;
|
||||
|
||||
// Shaky Hand-held Camera effect variables
|
||||
struct HandheldShakePoint sHandheldShakeSpline[4];
|
||||
@@ -225,9 +218,6 @@ u32 gCutsceneObjSpawn;
|
||||
*/
|
||||
s32 gObjCutsceneDone;
|
||||
|
||||
u32 unused8033B30C;
|
||||
u32 unused8033B310;
|
||||
|
||||
/**
|
||||
* Determines which R-Trigger mode is selected in the pause menu.
|
||||
*/
|
||||
@@ -237,7 +227,6 @@ s16 sSelectionFlags;
|
||||
* Flags that determine what movements the camera should start / do this frame.
|
||||
*/
|
||||
s16 gCameraMovementFlags;
|
||||
s16 unused8033B316;
|
||||
|
||||
/**
|
||||
* Flags that change how modes operate and how Lakitu moves.
|
||||
@@ -250,7 +239,6 @@ s16 sStatusFlags;
|
||||
* determine whether to rotate all the way, or just to 60 degrees.
|
||||
*/
|
||||
s16 s2ndRotateFlags;
|
||||
s16 unused8033B31A;
|
||||
/**
|
||||
* Flags that control buzzes and sounds that play, mostly for C-button input.
|
||||
*/
|
||||
@@ -271,10 +259,7 @@ s16 sCutsceneShot;
|
||||
* The current frame of the cutscene shot.
|
||||
*/
|
||||
s16 gCutsceneTimer;
|
||||
s16 unused8033B3E8;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
s16 unused8033B3E82;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The angle of the direction vector from the area's center to Mario's position.
|
||||
*/
|
||||
@@ -389,12 +374,8 @@ struct CameraStoredInfo sCameraStoreCUp;
|
||||
struct CameraStoredInfo sCameraStoreCutscene;
|
||||
|
||||
// first iteration of data
|
||||
u32 unused8032CFC0 = 0;
|
||||
struct Object *gCutsceneFocus = NULL;
|
||||
|
||||
u32 unused8032CFC8 = 0;
|
||||
u32 unused8032CFCC = 0;
|
||||
|
||||
/**
|
||||
* The information of a second focus camera used by some objects
|
||||
*/
|
||||
@@ -407,9 +388,6 @@ s16 sYawSpeed = 0x400;
|
||||
s32 gCurrLevelArea = 0;
|
||||
u32 gPrevLevel = 0;
|
||||
|
||||
f32 unused8032CFE0 = 1000.0f;
|
||||
f32 unused8032CFE4 = 800.0f;
|
||||
u32 unused8032CFE8 = 0;
|
||||
f32 gCameraZoomDist = 800.0f;
|
||||
|
||||
/**
|
||||
@@ -439,7 +417,6 @@ u8 sFramesSinceCutsceneEnded = 0;
|
||||
u8 sCutsceneDialogResponse = DIALOG_RESPONSE_NONE;
|
||||
struct PlayerCameraState *sMarioCamState = &gPlayerCameraState[0];
|
||||
struct PlayerCameraState *sLuigiCamState = &gPlayerCameraState[1];
|
||||
u32 unused8032D008 = 0;
|
||||
Vec3f sFixedModeBasePosition = { 646.0f, 143.0f, -1513.0f };
|
||||
Vec3f sUnusedModeBasePosition_2 = { 646.0f, 143.0f, -1513.0f };
|
||||
Vec3f sUnusedModeBasePosition_3 = { 646.0f, 143.0f, -1513.0f };
|
||||
@@ -723,12 +700,8 @@ void focus_on_mario(Vec3f focus, Vec3f pos, f32 posYOff, f32 focYOff, f32 dist,
|
||||
static UNUSED void set_pos_to_mario(Vec3f foc, Vec3f pos, f32 yOff, f32 focYOff, f32 dist, s16 pitch, s16 yaw) {
|
||||
Vec3f marioPos;
|
||||
f32 posDist;
|
||||
f32 focDist;
|
||||
|
||||
s16 posPitch;
|
||||
s16 posYaw;
|
||||
s16 focPitch;
|
||||
s16 focYaw;
|
||||
|
||||
vec3f_copy(marioPos, sMarioCamState->pos);
|
||||
marioPos[1] += yOff;
|
||||
@@ -899,11 +872,8 @@ s32 update_radial_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
f32 cenDistZ = sMarioCamState->pos[2] - c->areaCenZ;
|
||||
s16 camYaw = atan2s(cenDistZ, cenDistX) + sModeOffsetYaw;
|
||||
s16 pitch = look_down_slopes(camYaw);
|
||||
UNUSED f32 unused1;
|
||||
f32 posY;
|
||||
f32 focusY;
|
||||
UNUSED f32 unused2;
|
||||
UNUSED f32 unused3;
|
||||
f32 yOff = 125.f;
|
||||
f32 baseDist = 1000.f;
|
||||
|
||||
@@ -919,15 +889,10 @@ s32 update_radial_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
* Update the camera during 8 directional mode
|
||||
*/
|
||||
s32 update_8_directions_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
UNUSED f32 cenDistX = sMarioCamState->pos[0] - c->areaCenX;
|
||||
UNUSED f32 cenDistZ = sMarioCamState->pos[2] - c->areaCenZ;
|
||||
s16 camYaw = s8DirModeBaseYaw + s8DirModeYawOffset;
|
||||
s16 pitch = look_down_slopes(camYaw);
|
||||
f32 posY;
|
||||
f32 focusY;
|
||||
UNUSED f32 unused1;
|
||||
UNUSED f32 unused2;
|
||||
UNUSED f32 unused3;
|
||||
f32 yOff = 125.f;
|
||||
f32 baseDist = 1000.f;
|
||||
|
||||
@@ -953,11 +918,8 @@ void radial_camera_move(struct Camera *c) {
|
||||
s16 rotateSpeed = 0x1000;
|
||||
s16 avoidYaw;
|
||||
s32 avoidStatus;
|
||||
UNUSED s16 unused1 = 0;
|
||||
UNUSED s32 unused2 = 0;
|
||||
f32 areaDistX = sMarioCamState->pos[0] - c->areaCenX;
|
||||
f32 areaDistZ = sMarioCamState->pos[2] - c->areaCenZ;
|
||||
UNUSED s32 filler;
|
||||
|
||||
// How much the camera's yaw changed
|
||||
s16 yawOffset = calculate_yaw(sMarioCamState->pos, c->pos) - atan2s(areaDistZ, areaDistX);
|
||||
@@ -1139,9 +1101,7 @@ void update_yaw_and_dist_from_c_up(UNUSED struct Camera *c) {
|
||||
*/
|
||||
void mode_radial_camera(struct Camera *c) {
|
||||
Vec3f pos;
|
||||
UNUSED u8 unused1[8];
|
||||
s16 oldAreaYaw = sAreaYaw;
|
||||
UNUSED u8 unused2[4];
|
||||
|
||||
if (gCameraMovementFlags & CAM_MOVING_INTO_MODE) {
|
||||
update_yaw_and_dist_from_c_up(c);
|
||||
@@ -1270,34 +1230,21 @@ s32 update_parallel_tracking_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
Vec3f focOffset;
|
||||
s16 pathPitch;
|
||||
s16 pathYaw;
|
||||
UNUSED u8 filler[4];
|
||||
f32 distThresh;
|
||||
f32 zoom;
|
||||
f32 camParDist;
|
||||
UNUSED u8 filler2[8];
|
||||
f32 pathLength;
|
||||
UNUSED u8 filler3[8];
|
||||
UNUSED f32 unusedScale = 0.5f;
|
||||
f32 parScale = 0.5f;
|
||||
f32 marioFloorDist;
|
||||
Vec3f marioPos;
|
||||
UNUSED u8 filler4[12];
|
||||
UNUSED Vec3f unused4;
|
||||
Vec3s pathAngle;
|
||||
// Variables for changing to the next/prev path in the list
|
||||
Vec3f oldPos;
|
||||
Vec3f prevPathPos;
|
||||
Vec3f nextPathPos;
|
||||
f32 distToNext;
|
||||
f32 distToPrev;
|
||||
s16 prevPitch;
|
||||
s16 nextPitch;
|
||||
s16 prevYaw;
|
||||
s16 nextYaw;
|
||||
|
||||
unused4[0] = 0.f;
|
||||
unused4[1] = 0.f;
|
||||
unused4[2] = 0.f;
|
||||
f32 distToNext, distToPrev;
|
||||
s16 prevPitch, nextPitch;
|
||||
s16 prevYaw, nextYaw;
|
||||
|
||||
// Store camera pos, for changing between paths
|
||||
vec3f_copy(oldPos, pos);
|
||||
@@ -1456,14 +1403,12 @@ s32 update_fixed_camera(struct Camera *c, Vec3f focus, UNUSED Vec3f pos) {
|
||||
f32 ceilHeight;
|
||||
f32 heightOffset;
|
||||
f32 distCamToFocus;
|
||||
UNUSED u8 filler2[8];
|
||||
f32 scaleToMario = 0.5f;
|
||||
s16 pitch;
|
||||
s16 yaw;
|
||||
Vec3s faceAngle;
|
||||
struct Surface *ceiling;
|
||||
Vec3f basePos;
|
||||
UNUSED u8 filler[12];
|
||||
|
||||
play_camera_buzz_if_c_sideways();
|
||||
|
||||
@@ -1543,21 +1488,16 @@ s32 update_fixed_camera(struct Camera *c, Vec3f focus, UNUSED Vec3f pos) {
|
||||
*/
|
||||
s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
struct Object *o;
|
||||
UNUSED u8 filler2[12];
|
||||
f32 focusDistance;
|
||||
UNUSED u8 filler3[4];
|
||||
// Floor normal values
|
||||
f32 nx;
|
||||
f32 ny;
|
||||
f32 nz;
|
||||
/// Floor originOffset
|
||||
f32 oo;
|
||||
UNUSED u8 filler4[4];
|
||||
UNUSED s16 unused;
|
||||
s16 yaw;
|
||||
s16 heldState;
|
||||
struct Surface *floor;
|
||||
UNUSED u8 filler[20];
|
||||
Vec3f secondFocus;
|
||||
Vec3f holdFocOffset = { 0.f, -150.f, -125.f };
|
||||
|
||||
@@ -1668,10 +1608,6 @@ s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
return yaw;
|
||||
}
|
||||
|
||||
// 2nd iteration of data
|
||||
s16 unused8032D0A8[] = { 14, 1, 2, 4 };
|
||||
s16 unused8032D0B0[] = { 16, 9, 17, 0 };
|
||||
|
||||
/**
|
||||
* Maps cutscene to numbers in [0,4]. Used in determine_dance_cutscene() with sDanceCutsceneIndexTable.
|
||||
*
|
||||
@@ -1746,8 +1682,6 @@ void mode_parallel_tracking_camera(struct Camera *c) {
|
||||
* Fixed camera mode, the camera rotates around a point and looks and zooms toward Mario.
|
||||
*/
|
||||
void mode_fixed_camera(struct Camera *c) {
|
||||
UNUSED u8 unused[8];
|
||||
|
||||
if (gCurrLevelNum == LEVEL_BBH) {
|
||||
set_fov_function(CAM_FOV_BBH);
|
||||
} else {
|
||||
@@ -1765,9 +1699,7 @@ void mode_fixed_camera(struct Camera *c) {
|
||||
* The C-Buttons rotate the camera 90 degrees left/right and 67.5 degrees up/down.
|
||||
*/
|
||||
s32 update_behind_mario_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
UNUSED u8 unused2[12];
|
||||
f32 dist;
|
||||
UNUSED u8 unused3[4];
|
||||
s16 absPitch;
|
||||
s16 pitch;
|
||||
s16 yaw;
|
||||
@@ -1776,7 +1708,6 @@ s32 update_behind_mario_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
s16 goalYawOff = 0;
|
||||
s16 yawSpeed;
|
||||
s16 pitchInc = 32;
|
||||
UNUSED u8 unused[12];
|
||||
f32 maxDist = 800.f;
|
||||
f32 focYOff = 125.f;
|
||||
|
||||
@@ -1792,10 +1723,6 @@ s32 update_behind_mario_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
// Focus on Mario
|
||||
vec3f_copy(focus, sMarioCamState->pos);
|
||||
c->focus[1] += focYOff;
|
||||
//! @bug unnecessary
|
||||
dist = calc_abs_dist(focus, pos);
|
||||
//! @bug unnecessary
|
||||
pitch = calculate_pitch(focus, pos);
|
||||
vec3f_get_dist_and_angle(focus, pos, &dist, &pitch, &yaw);
|
||||
if (dist > maxDist) {
|
||||
dist = maxDist;
|
||||
@@ -1915,7 +1842,7 @@ s32 mode_behind_mario(struct Camera *c) {
|
||||
struct Surface *floor;
|
||||
Vec3f newPos;
|
||||
//! @bug oldPos is unused, see resolve_geometry_collisions
|
||||
Vec3f oldPos;
|
||||
UNUSED Vec3f oldPos;
|
||||
f32 waterHeight;
|
||||
f32 floorHeight;
|
||||
f32 distCamToFocus;
|
||||
@@ -1972,7 +1899,6 @@ s16 update_slide_camera(struct Camera *c) {
|
||||
f32 pitchScale;
|
||||
s16 camPitch;
|
||||
s16 camYaw;
|
||||
UNUSED struct MarioState *marioState = &gMarioStates[0];
|
||||
s16 goalPitch = 0x1555;
|
||||
s16 goalYaw = sMarioCamState->faceAngle[1] + DEGREES(180);
|
||||
|
||||
@@ -2072,7 +1998,6 @@ s32 update_mario_camera(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
s16 update_default_camera(struct Camera *c) {
|
||||
Vec3f tempPos;
|
||||
Vec3f cPos;
|
||||
UNUSED u8 unused1[12];
|
||||
struct Surface *marioFloor;
|
||||
struct Surface *cFloor;
|
||||
struct Surface *tempFloor;
|
||||
@@ -2080,11 +2005,9 @@ s16 update_default_camera(struct Camera *c) {
|
||||
f32 camFloorHeight;
|
||||
f32 tempFloorHeight;
|
||||
f32 marioFloorHeight;
|
||||
UNUSED u8 unused2[4];
|
||||
f32 dist;
|
||||
f32 zoomDist;
|
||||
f32 waterHeight;
|
||||
f32 gasHeight;
|
||||
f32 waterHeight, gasHeight;
|
||||
s16 avoidYaw;
|
||||
s16 pitch;
|
||||
s16 yaw;
|
||||
@@ -2092,10 +2015,8 @@ s16 update_default_camera(struct Camera *c) {
|
||||
f32 posHeight;
|
||||
f32 focHeight;
|
||||
f32 distFromWater;
|
||||
s16 tempPitch;
|
||||
s16 tempYaw;
|
||||
s16 tempPitch, tempYaw;
|
||||
f32 xzDist;
|
||||
UNUSED u8 unused4[4];
|
||||
s16 nextYawVel;
|
||||
s16 yawVel = 0;
|
||||
f32 scale;
|
||||
@@ -2422,7 +2343,6 @@ void mode_mario_camera(struct Camera *c) {
|
||||
* Rotates the camera around the spiral staircase.
|
||||
*/
|
||||
s32 update_spiral_stairs_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
UNUSED s16 unused1;
|
||||
/// The returned yaw
|
||||
s16 camYaw;
|
||||
// unused
|
||||
@@ -2433,7 +2353,6 @@ s32 update_spiral_stairs_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
s16 posPitch;
|
||||
/// The camera's yaw around the stairs
|
||||
s16 posYaw;
|
||||
UNUSED s32 unused2;
|
||||
Vec3f cPos;
|
||||
Vec3f checkPos;
|
||||
struct Surface *floor;
|
||||
@@ -2738,8 +2657,6 @@ void move_into_c_up(struct Camera *c) {
|
||||
* The main update function for C-Up mode
|
||||
*/
|
||||
s32 mode_c_up_camera(struct Camera *c) {
|
||||
UNUSED u8 unused[12];
|
||||
|
||||
// Play a sound when entering C-Up mode
|
||||
if (!(sCameraSoundFlags & CAM_SOUND_C_UP_PLAYED)) {
|
||||
play_sound_cbutton_up();
|
||||
@@ -2796,8 +2713,6 @@ s32 update_in_cannon(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) {
|
||||
* sCannonYOffset is used to make the camera rotate down when Mario has just entered the cannon
|
||||
*/
|
||||
void mode_cannon_camera(struct Camera *c) {
|
||||
UNUSED u8 unused[24];
|
||||
|
||||
sLakituPitch = 0;
|
||||
gCameraMovementFlags &= ~CAM_MOVING_INTO_MODE;
|
||||
c->nextYaw = update_in_cannon(c, c->focus, c->pos);
|
||||
@@ -2921,10 +2836,8 @@ void update_lakitu(struct Camera *c) {
|
||||
struct Surface *floor = NULL;
|
||||
Vec3f newPos;
|
||||
Vec3f newFoc;
|
||||
UNUSED Vec3f unusedVec3f;
|
||||
f32 distToFloor;
|
||||
s16 newYaw;
|
||||
UNUSED u8 unused1[8];
|
||||
|
||||
if (gCameraMovementFlags & CAM_MOVE_PAUSE_SCREEN) {
|
||||
} else {
|
||||
@@ -3023,8 +2936,6 @@ void update_lakitu(struct Camera *c) {
|
||||
* Gets controller input, checks for cutscenes, handles mode changes, and moves the camera
|
||||
*/
|
||||
void update_camera(struct Camera *c) {
|
||||
UNUSED u8 unused[24];
|
||||
|
||||
gCamera = c;
|
||||
update_camera_hud_status(c);
|
||||
if (c->cutscene == 0 &&
|
||||
@@ -3269,11 +3180,6 @@ void update_camera(struct Camera *c) {
|
||||
* Reset all the camera variables to their arcane defaults
|
||||
*/
|
||||
void reset_camera(struct Camera *c) {
|
||||
UNUSED s32 unused = 0;
|
||||
UNUSED u8 unused1[16];
|
||||
UNUSED struct LinearTransitionPoint *start = &sModeInfo.transitionStart;
|
||||
UNUSED struct LinearTransitionPoint *end = &sModeInfo.transitionEnd;
|
||||
|
||||
gCamera = c;
|
||||
gCameraMovementFlags = 0;
|
||||
s2ndRotateFlags = 0;
|
||||
@@ -3283,19 +3189,13 @@ void reset_camera(struct Camera *c) {
|
||||
gCutsceneObjSpawn = 0;
|
||||
gObjCutsceneDone = FALSE;
|
||||
gCutsceneFocus = NULL;
|
||||
unused8032CFC8 = 0;
|
||||
unused8032CFCC = 0;
|
||||
gSecondCameraFocus = NULL;
|
||||
sCButtonsPressed = 0;
|
||||
vec3f_copy(sModeTransition.marioPos, sMarioCamState->pos);
|
||||
sModeTransition.framesLeft = 0;
|
||||
unused8032CFCC = -1;
|
||||
unused8032CFC8 = -1;
|
||||
gCameraMovementFlags = 0;
|
||||
gCameraMovementFlags |= CAM_MOVE_INIT_CAMERA;
|
||||
unused8033B316 = 0;
|
||||
sStatusFlags = 0;
|
||||
unused8033B31A = 0;
|
||||
sCameraSoundFlags = 0;
|
||||
sCUpCameraPitch = 0;
|
||||
sModeOffsetYaw = 0;
|
||||
@@ -3337,8 +3237,6 @@ void reset_camera(struct Camera *c) {
|
||||
sFOVState.shakePhase = 0;
|
||||
sObjectCutscene = 0;
|
||||
gRecentCutscene = 0;
|
||||
unused8033B30C = 0;
|
||||
unused8033B310 = 0;
|
||||
}
|
||||
|
||||
void init_camera(struct Camera *c) {
|
||||
@@ -3377,7 +3275,6 @@ void init_camera(struct Camera *c) {
|
||||
}
|
||||
sCutsceneSplineSegment = 0;
|
||||
sCutsceneSplineSegmentProgress = 0.f;
|
||||
unused8033B6E8 = 0;
|
||||
sHandheldShakeInc = 0.f;
|
||||
sHandheldShakeTimer = 0.f;
|
||||
sHandheldShakeMag = 0;
|
||||
@@ -3521,11 +3418,9 @@ void init_camera(struct Camera *c) {
|
||||
* modulo-4's the result, because each 8-bit mask only has 4 area bits for each level
|
||||
*/
|
||||
void zoom_out_if_paused_and_outside(struct GraphNodeCamera *camera) {
|
||||
UNUSED u8 unused1[8];
|
||||
UNUSED f32 dist;
|
||||
UNUSED s16 pitch;
|
||||
s16 yaw;
|
||||
UNUSED u8 unused2[4];
|
||||
s32 areaMaskIndex = gCurrLevelArea / 32;
|
||||
s32 areaBit = 1 << (((gCurrLevelArea & 0x10) / 4) + (((gCurrLevelArea & 0xF) - 1) & 3));
|
||||
|
||||
@@ -3582,9 +3477,6 @@ void create_camera(struct GraphNodeCamera *gc, struct AllocOnlyPool *pool) {
|
||||
* Copy Lakitu's pos and foc into `gc`
|
||||
*/
|
||||
void update_graph_node_camera(struct GraphNodeCamera *gc) {
|
||||
UNUSED u8 unused[8];
|
||||
UNUSED struct Camera *c = gc->config.camera;
|
||||
|
||||
gc->rollScreen = gLakituState.roll;
|
||||
vec3f_copy(gc->pos, gLakituState.pos);
|
||||
vec3f_copy(gc->focus, gLakituState.focus);
|
||||
@@ -3593,8 +3485,6 @@ void update_graph_node_camera(struct GraphNodeCamera *gc) {
|
||||
|
||||
Gfx *geo_camera_main(s32 callContext, struct GraphNode *g, void *context) {
|
||||
struct GraphNodeCamera *gc = (struct GraphNodeCamera *) g;
|
||||
UNUSED Mat4 *unusedMat = context;
|
||||
|
||||
switch (callContext) {
|
||||
case GEO_CONTEXT_CREATE:
|
||||
create_camera(gc, context);
|
||||
@@ -3845,7 +3735,6 @@ void shake_camera_handheld(Vec3f pos, Vec3f focus) {
|
||||
f32 dist;
|
||||
s16 pitch;
|
||||
s16 yaw;
|
||||
UNUSED u8 unused[8];
|
||||
|
||||
if (sHandheldShakeMag == 0) {
|
||||
vec3f_set(shakeOffset, 0.f, 0.f, 0.f);
|
||||
@@ -4282,7 +4171,6 @@ f32 camera_approach_f32_symmetric(f32 current, f32 target, f32 increment) {
|
||||
*/
|
||||
void random_vec3s(Vec3s dst, s16 xRange, s16 yRange, s16 zRange) {
|
||||
f32 randomFloat;
|
||||
UNUSED u8 unused[4];
|
||||
f32 tempXRange;
|
||||
f32 tempYRange;
|
||||
f32 tempZRange;
|
||||
@@ -4377,12 +4265,7 @@ s32 clamp_positions_and_find_yaw(Vec3f pos, Vec3f origin, f32 xMax, f32 xMin, f3
|
||||
* developers just add 180 degrees to the result.
|
||||
*/
|
||||
s32 calc_avoid_yaw(s16 yawFromMario, s16 wallYaw) {
|
||||
s16 yawDiff;
|
||||
UNUSED u8 unused[34]; // Debug print buffer? ;)
|
||||
UNUSED s32 unused1 = 0;
|
||||
UNUSED s32 unused2 = 0;
|
||||
|
||||
yawDiff = wallYaw - yawFromMario + DEGREES(90);
|
||||
s16 yawDiff = wallYaw - yawFromMario + DEGREES(90);
|
||||
|
||||
if (yawDiff < 0) {
|
||||
// Deflect to the right
|
||||
@@ -4416,7 +4299,6 @@ s32 is_surf_within_bounding_box(struct Surface *surf, f32 xMax, f32 yMax, f32 zM
|
||||
f32 dx;
|
||||
f32 dy;
|
||||
f32 dz;
|
||||
UNUSED u8 unused[4];
|
||||
s32 i;
|
||||
s32 j;
|
||||
// result
|
||||
@@ -4494,7 +4376,6 @@ s32 is_range_behind_surface(Vec3f from, Vec3f to, struct Surface *surf, s16 rang
|
||||
s32 behindSurface = TRUE;
|
||||
s32 leftBehind = 0;
|
||||
s32 rightBehind = 0;
|
||||
UNUSED u8 unused[20];
|
||||
f32 checkDist;
|
||||
s16 checkPitch;
|
||||
s16 checkYaw;
|
||||
@@ -4763,8 +4644,6 @@ void shake_camera_yaw(Vec3f pos, Vec3f focus) {
|
||||
* Apply a rotational shake to the camera by adjusting its roll
|
||||
*/
|
||||
void shake_camera_roll(s16 *roll) {
|
||||
UNUSED u8 unused[8];
|
||||
|
||||
if (gLakituState.shakeMagnitude[2] != 0) {
|
||||
increment_shake_offset(&gLakituState.shakeRollPhase, gLakituState.shakeRollVel);
|
||||
*roll += gLakituState.shakeMagnitude[2] * sins(gLakituState.shakeRollPhase);
|
||||
@@ -4999,7 +4878,6 @@ void radial_camera_input(struct Camera *c) {
|
||||
*/
|
||||
s32 trigger_cutscene_dialog(s32 trigger) {
|
||||
s32 result = 0;
|
||||
UNUSED struct Camera *c = gCamera;
|
||||
|
||||
if (trigger == 1) {
|
||||
start_object_cutscene_without_focus(CUTSCENE_READ_MESSAGE);
|
||||
@@ -5153,9 +5031,7 @@ u8 open_door_cutscene(u8 pullResult, u8 pushResult) {
|
||||
* @return the cutscene that should start, 0 if none
|
||||
*/
|
||||
u8 get_cutscene_from_mario_status(struct Camera *c) {
|
||||
UNUSED u8 unused1[4];
|
||||
u8 cutscene = c->cutscene;
|
||||
UNUSED u8 unused2[12];
|
||||
|
||||
if (cutscene == 0) {
|
||||
// A cutscene started by an object, if any, will start if nothing else happened
|
||||
@@ -5342,7 +5218,6 @@ void stub_camera_4(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c, UNUSED s32 d) {
|
||||
*/
|
||||
void set_focus_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) {
|
||||
s16 yaw;
|
||||
UNUSED u16 unused;
|
||||
f32 focFloorYOff;
|
||||
|
||||
calc_y_to_curr_floor(&focFloorYOff, 1.f, 200.f, &focFloorYOff, 0.9f, 200.f);
|
||||
@@ -6754,24 +6629,18 @@ void resolve_geometry_collisions(Vec3f pos, UNUSED Vec3f lastGood) {
|
||||
* @return 3 if a wall is covering Mario, 1 if a wall is only near the camera.
|
||||
*/
|
||||
s32 rotate_camera_around_walls(struct Camera *c, Vec3f cPos, s16 *avoidYaw, s16 yawRange) {
|
||||
UNUSED f32 unused1;
|
||||
struct WallCollisionData colData;
|
||||
struct Surface *wall;
|
||||
UNUSED Vec3f unused2;
|
||||
f32 dummyDist, checkDist;
|
||||
UNUSED f32 unused3;
|
||||
f32 coarseRadius;
|
||||
f32 fineRadius;
|
||||
s16 wallYaw, horWallNorm;
|
||||
UNUSED s16 unused4;
|
||||
s16 dummyPitch;
|
||||
// The yaw of the vector from Mario to the camera.
|
||||
s16 yawFromMario;
|
||||
UNUSED s16 unused5;
|
||||
s32 status = 0;
|
||||
/// The current iteration. The algorithm takes 8 equal steps from Mario back to the camera.
|
||||
s32 step = 0;
|
||||
UNUSED s32 unused6;
|
||||
|
||||
vec3f_get_dist_and_angle(sMarioCamState->pos, cPos, &dummyDist, &dummyPitch, &yawFromMario);
|
||||
sStatusFlags &= ~CAM_FLAG_CAM_NEAR_WALL;
|
||||
@@ -6974,8 +6843,7 @@ void stop_cutscene_and_retrieve_stored_info(struct Camera *c) {
|
||||
vec3f_copy(c->pos, sCameraStoreCutscene.pos);
|
||||
}
|
||||
|
||||
void cap_switch_save(s16 dummy) {
|
||||
UNUSED s16 unused = dummy;
|
||||
void cap_switch_save(UNUSED s16 param) {
|
||||
save_file_do_save(gCurrSaveFileNum - 1);
|
||||
}
|
||||
|
||||
@@ -6989,7 +6857,6 @@ void init_spline_point(struct CutsceneSplinePoint *splinePoint, s8 index, u8 spe
|
||||
void copy_spline_segment(struct CutsceneSplinePoint dst[], struct CutsceneSplinePoint src[]) {
|
||||
s32 j = 0;
|
||||
s32 i = 0;
|
||||
UNUSED s32 pad[2];
|
||||
|
||||
init_spline_point(&dst[i], src[j].index, src[j].speed, src[j].point);
|
||||
i += 1;
|
||||
@@ -6998,7 +6865,7 @@ void copy_spline_segment(struct CutsceneSplinePoint dst[], struct CutsceneSpline
|
||||
init_spline_point(&dst[i], src[j].index, src[j].speed, src[j].point);
|
||||
i += 1;
|
||||
j += 1;
|
||||
} while ((src[j].index != -1) && (src[j].index != -1)); //! same comparison performed twice
|
||||
} while (src[j].index != -1);
|
||||
} while (j > 16);
|
||||
|
||||
// Create the end of the spline by duplicating the last point
|
||||
@@ -7784,8 +7651,6 @@ void star_dance_bound_yaw(struct Camera *c, s16 absYaw, s16 yawMax) {
|
||||
* Store the camera's focus in cvar9.
|
||||
*/
|
||||
void cutscene_dance_closeup_start(struct Camera *c) {
|
||||
UNUSED s32 pad[2];
|
||||
|
||||
if ((gLastCompletedStarNum == 4) && (gCurrCourseNum == COURSE_JRB)) {
|
||||
star_dance_bound_yaw(c, 0x0, 0x4000);
|
||||
}
|
||||
@@ -8221,10 +8086,7 @@ void cutscene_star_spawn_store_info(struct Camera *c) {
|
||||
* Focus on the top of the star.
|
||||
*/
|
||||
void cutscene_star_spawn_focus_star(struct Camera *c) {
|
||||
UNUSED f32 hMul;
|
||||
Vec3f starPos;
|
||||
UNUSED f32 vMul;
|
||||
|
||||
if (gCutsceneFocus != NULL) {
|
||||
object_pos_to_vec3f(starPos, gCutsceneFocus);
|
||||
starPos[1] += gCutsceneFocus->hitboxHeight;
|
||||
@@ -8430,7 +8292,6 @@ void cutscene_red_coin_star_end(struct Camera *c) {
|
||||
* @param rotYaw constant yaw offset to add to the camera's focus
|
||||
*/
|
||||
void cutscene_goto_cvar_pos(struct Camera *c, f32 goalDist, s16 goalPitch, s16 rotPitch, s16 rotYaw) {
|
||||
UNUSED f32 unused1;
|
||||
f32 nextDist;
|
||||
s16 nextPitch, nextYaw;
|
||||
// The next 2 polar coord points are only used in CUTSCENE_PREPARE_CANNON
|
||||
@@ -8438,7 +8299,6 @@ void cutscene_goto_cvar_pos(struct Camera *c, f32 goalDist, s16 goalPitch, s16 r
|
||||
s16 cannonPitch, cannonYaw;
|
||||
f32 curDist;
|
||||
s16 curPitch, curYaw;
|
||||
UNUSED f64 unused2;
|
||||
vec3f_get_dist_and_angle(sCutsceneVars[3].point, c->pos, &nextDist, &nextPitch, &nextYaw);
|
||||
// If over 8000 units away from the cannon, just teleport there
|
||||
if ((nextDist > 8000.f) && (c->cutscene == CUTSCENE_PREPARE_CANNON)) {
|
||||
@@ -8698,12 +8558,8 @@ void cutscene_suffocation_fly_away(UNUSED struct Camera *c) {
|
||||
* Keep Lakitu above the gas level.
|
||||
*/
|
||||
void cutscene_suffocation_stay_above_gas(struct Camera *c) {
|
||||
UNUSED f32 unused1;
|
||||
f32 gasLevel;
|
||||
UNUSED f32 unused2;
|
||||
|
||||
cutscene_goto_cvar_pos(c, 400.f, 0x2800, 0x200, 0);
|
||||
gasLevel = find_poison_gas_level(sMarioCamState->pos[0], sMarioCamState->pos[2]);
|
||||
f32 gasLevel = find_poison_gas_level(sMarioCamState->pos[0], sMarioCamState->pos[2]);
|
||||
|
||||
if (gasLevel != FLOOR_LOWER_LIMIT) {
|
||||
if ((gasLevel += 130.f) > c->pos[1]) {
|
||||
@@ -8750,8 +8606,6 @@ void cutscene_enter_pool_start(struct Camera *c) {
|
||||
}
|
||||
|
||||
void cutscene_enter_pool_loop(struct Camera *c) {
|
||||
UNUSED u32 pad[2];
|
||||
|
||||
cutscene_goto_cvar_pos(c, 1200.f, 0x2000, 0x200, 0);
|
||||
}
|
||||
|
||||
@@ -8835,8 +8689,6 @@ void cutscene_pyramid_top_explode_cam_shake(UNUSED struct Camera *c) {
|
||||
* Warp back to the old position, and start a heavy camera shake.
|
||||
*/
|
||||
void cutscene_pyramid_top_explode_warp_back(struct Camera *c) {
|
||||
UNUSED u32 pad[2];
|
||||
|
||||
vec3f_copy(c->pos, sCutsceneVars[4].point);
|
||||
vec3f_copy(c->focus, sCutsceneVars[5].point);
|
||||
set_environmental_camera_shake(SHAKE_ENV_BOWSER_JUMP);
|
||||
@@ -8905,11 +8757,8 @@ UNUSED static void unused_cutscene_goto_cvar(struct Camera *c) {
|
||||
* cvar9.angle[1] is the yaw between Mario and the gCutsceneFocus
|
||||
*/
|
||||
void cutscene_dialog_start(struct Camera *c) {
|
||||
UNUSED f32 unused1;
|
||||
UNUSED s16 unused2;
|
||||
s16 yaw;
|
||||
|
||||
|
||||
cutscene_soften_music(c);
|
||||
set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_DIALOG);
|
||||
|
||||
@@ -9063,8 +8912,6 @@ UNUSED static void unused_cam_to_mario(struct Camera *c) {
|
||||
* Cutscene that plays when Mario is reading a message (a sign or message on the wall)
|
||||
*/
|
||||
void cutscene_read_message(struct Camera *c) {
|
||||
UNUSED u32 pad[2];
|
||||
|
||||
cutscene_event(cutscene_read_message_start, c, 0, 0);
|
||||
sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT;
|
||||
|
||||
@@ -9130,9 +8977,7 @@ void cutscene_exit_succ_start(UNUSED struct Camera *c) {
|
||||
* Set the camera pos depending on which level Mario exited.
|
||||
*/
|
||||
void cutscene_non_painting_set_cam_pos(struct Camera *c) {
|
||||
UNUSED u32 unused1;
|
||||
struct Surface *floor;
|
||||
UNUSED Vec3f unused2;
|
||||
|
||||
switch (gPrevLevel) {
|
||||
case LEVEL_HMC:
|
||||
@@ -9314,12 +9159,8 @@ void cutscene_non_painting_death(struct Camera *c) {
|
||||
* because cvar1 rotates until is reaches 0, so it's important that it's a multiple of 0x100.
|
||||
*/
|
||||
void cutscene_cap_switch_press_start(struct Camera *c) {
|
||||
UNUSED s16 unused1;
|
||||
s16 yaw;
|
||||
UNUSED u32 pad[2];
|
||||
|
||||
store_info_star(c);
|
||||
yaw = calculate_yaw(sMarioCamState->pos, c->pos);
|
||||
s16 yaw = calculate_yaw(sMarioCamState->pos, c->pos);
|
||||
sCutsceneVars[3].angle[1] = 0x1200;
|
||||
// Basically the amount of rotation to get from behind Mario to in front of Mario
|
||||
sCutsceneVars[1].angle[1] = (yaw - (sMarioCamState->faceAngle[1] + sCutsceneVars[3].angle[1])) & 0xFF00;
|
||||
@@ -9332,9 +9173,6 @@ void cutscene_cap_switch_press_start(struct Camera *c) {
|
||||
void cutscene_cap_switch_press_rotate_around_mario(struct Camera *c) {
|
||||
f32 dist;
|
||||
s16 pitch, yaw;
|
||||
UNUSED s16 unusedYaw = sMarioCamState->faceAngle[1] + 0x1000;
|
||||
UNUSED s16 unused;
|
||||
UNUSED s32 cvar1Yaw = sCutsceneVars[1].angle[1];
|
||||
|
||||
vec3f_get_dist_and_angle(sMarioCamState->pos, c->pos, &dist, &pitch, &yaw);
|
||||
|
||||
@@ -9625,8 +9463,6 @@ void cutscene_intro_peach_fly_to_pipe(struct Camera *c) {
|
||||
* Lakitu flies around the warp pipe, then Mario jumps out.
|
||||
*/
|
||||
void cutscene_intro_peach_mario_appears(struct Camera *c) {
|
||||
UNUSED u32 pad[2];
|
||||
|
||||
sMarioCamState->cameraEvent = 0;
|
||||
cutscene_event(cutscene_intro_peach_reset_spline, c, 0, 0);
|
||||
cutscene_event(cutscene_intro_peach_follow_pipe_spline, c, 0, -1);
|
||||
@@ -9936,9 +9772,8 @@ void cutscene_sliding_doors_fly_back_up(UNUSED struct Camera *c) {
|
||||
*/
|
||||
void cutscene_sliding_doors_follow_mario(struct Camera *c) {
|
||||
Vec3f pos;
|
||||
UNUSED u32 pad[5];
|
||||
|
||||
vec3f_copy(pos, c->pos);
|
||||
|
||||
// Update cvar1 with Mario's position (the y value doesn't change)
|
||||
sCutsceneVars[1].point[0] = sMarioCamState->pos[0];
|
||||
sCutsceneVars[1].point[2] = sMarioCamState->pos[2];
|
||||
@@ -9962,8 +9797,6 @@ void cutscene_sliding_doors_follow_mario(struct Camera *c) {
|
||||
* Note: the star door unlocking event is not a cutscene, it's handled by Mario separately.
|
||||
*/
|
||||
void cutscene_sliding_doors_open(struct Camera *c) {
|
||||
UNUSED u32 pad[2];
|
||||
|
||||
reset_pan_distance(c);
|
||||
cutscene_event(cutscene_sliding_doors_open_start, c, 0, 8);
|
||||
cutscene_event(cutscene_sliding_doors_open_set_cvars, c, 8, 8);
|
||||
@@ -10184,7 +10017,6 @@ void cutscene_enter_cannon_end(struct Camera *c) {
|
||||
*/
|
||||
void cutscene_enter_cannon_raise(struct Camera *c) {
|
||||
struct Object *o;
|
||||
UNUSED u32 pad[2];
|
||||
f32 floorHeight;
|
||||
struct Surface *floor;
|
||||
Vec3f cannonFocus;
|
||||
@@ -10332,8 +10164,6 @@ void cutscene_door_end(struct Camera *c) {
|
||||
* Used for entering a room that uses a specific camera mode, like the castle lobby or BBH
|
||||
*/
|
||||
void cutscene_door_mode(struct Camera *c) {
|
||||
UNUSED u32 pad[2];
|
||||
|
||||
reset_pan_distance(c);
|
||||
camera_course_processing(c);
|
||||
|
||||
@@ -11141,13 +10971,9 @@ struct CutsceneSplinePoint sCcmOutsideCreditsSplineFocus[] = {
|
||||
* the duration they want the flag to be active.
|
||||
*/
|
||||
void play_cutscene(struct Camera *c) {
|
||||
UNUSED u32 pad[3];
|
||||
UNUSED s16 unusedYawFocToMario;
|
||||
s16 cutsceneDuration;
|
||||
u8 oldCutscene;
|
||||
u8 oldCutscene = c->cutscene;
|
||||
|
||||
unusedYawFocToMario = sAreaYaw;
|
||||
oldCutscene = c->cutscene;
|
||||
sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT;
|
||||
gCameraMovementFlags &= ~CAM_MOVING_INTO_MODE;
|
||||
|
||||
|
||||
+1
-42
@@ -162,7 +162,6 @@ void print_debug_top_down_normal(const char *str, s32 number) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef VERSION_EU
|
||||
void print_mapinfo(void) {
|
||||
struct Surface *pfloor;
|
||||
f32 bgY;
|
||||
@@ -180,10 +179,7 @@ void print_mapinfo(void) {
|
||||
print_debug_top_down_normal("mapinfo", 0);
|
||||
print_debug_top_down_mapinfo("area %x", area);
|
||||
print_debug_top_down_mapinfo("wx %d", gCurrentObject->oPosX);
|
||||
//! Fat finger: programmer hit tab instead of space. Japanese
|
||||
// thumb shift keyboards had the tab key next to the spacebar,
|
||||
// so this was likely the reason.
|
||||
print_debug_top_down_mapinfo("wy\t %d", gCurrentObject->oPosY);
|
||||
print_debug_top_down_mapinfo("wy %d", gCurrentObject->oPosY);
|
||||
print_debug_top_down_mapinfo("wz %d", gCurrentObject->oPosZ);
|
||||
print_debug_top_down_mapinfo("bgY %d", bgY);
|
||||
print_debug_top_down_mapinfo("angY %d", angY);
|
||||
@@ -199,41 +195,6 @@ void print_mapinfo(void) {
|
||||
print_debug_top_down_mapinfo("water %d", water);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void print_mapinfo(void) {
|
||||
// EU mostly stubbed this function out.
|
||||
struct Surface *pfloor;
|
||||
UNUSED f32 bgY;
|
||||
UNUSED f32 water;
|
||||
UNUSED s32 area;
|
||||
// s32 angY;
|
||||
//
|
||||
// angY = gCurrentObject->oMoveAngleYaw / 182.044000;
|
||||
// area = ((s32)gCurrentObject->oPosX + 0x2000) / 1024
|
||||
// + ((s32)gCurrentObject->oPosZ + 0x2000) / 1024 * 16;
|
||||
//
|
||||
bgY = find_floor(gCurrentObject->oPosX, gCurrentObject->oPosY, gCurrentObject->oPosZ, &pfloor);
|
||||
water = find_water_level(gCurrentObject->oPosX, gCurrentObject->oPosZ);
|
||||
|
||||
print_debug_top_down_normal("mapinfo", 0);
|
||||
// print_debug_top_down_mapinfo("area %x", area);
|
||||
// print_debug_top_down_mapinfo("wx %d", gCurrentObject->oPosX);
|
||||
// print_debug_top_down_mapinfo("wy\t %d", gCurrentObject->oPosY);
|
||||
// print_debug_top_down_mapinfo("wz %d", gCurrentObject->oPosZ);
|
||||
// print_debug_top_down_mapinfo("bgY %d", bgY);
|
||||
// print_debug_top_down_mapinfo("angY %d", angY);
|
||||
//
|
||||
// if(pfloor) // not null
|
||||
//{
|
||||
// print_debug_top_down_mapinfo("bgcode %d", pfloor->type);
|
||||
// print_debug_top_down_mapinfo("bgstatus %d", pfloor->flags);
|
||||
// print_debug_top_down_mapinfo("bgarea %d", pfloor->room);
|
||||
//}
|
||||
//
|
||||
// if(gCurrentObject->oPosY < water)
|
||||
// print_debug_top_down_mapinfo("water %d", water);
|
||||
}
|
||||
#endif
|
||||
|
||||
void print_checkinfo(void) {
|
||||
print_debug_top_down_normal("checkinfo", 0);
|
||||
@@ -506,8 +467,6 @@ void try_print_debug_mario_level_info(void) {
|
||||
* [5][7] (b7 in the string array) to 1 to enable debug spawn.
|
||||
*/
|
||||
void try_do_mario_debug_object_spawn(void) {
|
||||
UNUSED s32 unused;
|
||||
|
||||
if (sDebugPage == DEBUG_PAGE_STAGEINFO && gDebugInfo[DEBUG_PAGE_ENEMYINFO][7] == 1) {
|
||||
if (gPlayer1Controller->buttonPressed & R_JPAD) {
|
||||
spawn_object_relative(0, 0, 100, 200, gCurrentObject, MODEL_KOOPA_SHELL, bhvKoopaShell);
|
||||
|
||||
@@ -75,7 +75,6 @@ struct DmaHandlerList gDemoInputsBuf;
|
||||
|
||||
// fillers
|
||||
UNUSED static u8 sfillerGameInit[0x90];
|
||||
UNUSED static s32 sUnusedGameInitValue = 0;
|
||||
|
||||
// General timer that runs as the game starts
|
||||
u32 gGlobalTimer = 0;
|
||||
@@ -481,8 +480,6 @@ UNUSED static void record_demo(void) {
|
||||
* Take the updated controller struct and calculate the new x, y, and distance floats.
|
||||
*/
|
||||
void adjust_analog_stick(struct Controller *controller) {
|
||||
UNUSED u8 pad[8];
|
||||
|
||||
// Reset the controller's x and y floats.
|
||||
controller->stickX = 0;
|
||||
controller->stickY = 0;
|
||||
|
||||
@@ -72,12 +72,6 @@ struct PowerMeterHUD {
|
||||
f32 unused;
|
||||
};
|
||||
|
||||
struct UnusedHUDStruct {
|
||||
u32 unused1;
|
||||
u16 unused2;
|
||||
u16 unused3;
|
||||
};
|
||||
|
||||
struct CameraHUD {
|
||||
s16 status;
|
||||
};
|
||||
@@ -98,8 +92,6 @@ static struct PowerMeterHUD sPowerMeterHUD = {
|
||||
// when the power meter is hidden.
|
||||
s32 sPowerMeterVisibleTimer = 0;
|
||||
|
||||
UNUSED static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 };
|
||||
|
||||
static struct CameraHUD sCameraHUD = { CAM_STATUS_NONE };
|
||||
|
||||
/**
|
||||
|
||||
@@ -656,7 +656,6 @@ void print_hud_my_score_stars(s8 fileNum, s8 courseNum, s16 x, s16 y) {
|
||||
u8 strStarCount[4];
|
||||
s16 starCount;
|
||||
u8 textSymStar[] = { GLYPH_STAR, GLYPH_SPACE };
|
||||
UNUSED u16 unused;
|
||||
u8 textSymX[] = { GLYPH_MULTIPLY, GLYPH_SPACE };
|
||||
|
||||
starCount = save_file_get_course_star_count(fileNum, courseNum);
|
||||
@@ -753,8 +752,6 @@ void reset_dialog_render_state(void) {
|
||||
#define Y_VAL2 5.0f
|
||||
|
||||
void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) {
|
||||
UNUSED s32 unused;
|
||||
|
||||
create_dl_translation_matrix(MENU_MTX_NOPUSH, dialog->leftOffset, dialog->width, 0);
|
||||
|
||||
switch (gDialogBoxType) {
|
||||
@@ -890,10 +887,7 @@ u32 ensure_nonnegative(s16 value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 lowerBound)
|
||||
{
|
||||
UNUSED s32 pad[2];
|
||||
|
||||
void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 lowerBound) {
|
||||
u8 strChar;
|
||||
|
||||
s16 colorLoop;
|
||||
|
||||
@@ -1242,8 +1242,6 @@ u32 interact_clam_or_bubba(struct MarioState *m, UNUSED u32 interactType, struct
|
||||
}
|
||||
|
||||
u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
|
||||
UNUSED u32 unused;
|
||||
|
||||
u32 interaction;
|
||||
if (m->flags & MARIO_METAL_CAP) {
|
||||
interaction = INT_FAST_ATTACK_OR_SHELL;
|
||||
@@ -1337,8 +1335,6 @@ u32 interact_mr_blizzard(struct MarioState *m, UNUSED u32 interactType, struct O
|
||||
}
|
||||
|
||||
u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
|
||||
UNUSED u32 unused;
|
||||
|
||||
u32 interaction;
|
||||
if (m->flags & MARIO_METAL_CAP) {
|
||||
interaction = INT_FAST_ATTACK_OR_SHELL;
|
||||
@@ -1775,8 +1771,8 @@ void check_kick_or_punch_wall(struct MarioState *m) {
|
||||
detector.x = m->pos[0] + 50.0f * sins(m->faceAngle[1]);
|
||||
detector.z = m->pos[2] + 50.0f * coss(m->faceAngle[1]);
|
||||
detector.y = m->pos[1];
|
||||
detector.offsetY = 80.0f;
|
||||
detector.radius = 5.0f;
|
||||
detector.offsetY = 80.0f;
|
||||
detector.radius = 5.0f;
|
||||
|
||||
if (find_wall_collisions(&detector) > 0) {
|
||||
if (m->action != ACT_MOVE_PUNCHING || m->forwardVel >= 0.0f) {
|
||||
|
||||
@@ -177,17 +177,11 @@ s16 sDelayedWarpOp;
|
||||
s16 sDelayedWarpTimer;
|
||||
s16 sSourceWarpNodeId;
|
||||
s32 sDelayedWarpArg;
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
s16 unusedEULevelUpdateBss1;
|
||||
#endif
|
||||
s8 sTimerRunning;
|
||||
s8 gNeverEnteredCastle;
|
||||
|
||||
struct MarioState *gMarioState = &gMarioStates[0];
|
||||
u8 unused1[4] = { 0 };
|
||||
s8 sWarpCheckpointActive = FALSE;
|
||||
u8 unused3[4];
|
||||
u8 unused4[2];
|
||||
|
||||
u16 level_control_timer(s32 timerOp) {
|
||||
switch (timerOp) {
|
||||
|
||||
@@ -68,7 +68,6 @@ extern struct MarioState *gMarioState;
|
||||
extern s16 sCurrPlayMode;
|
||||
extern s16 sTransitionTimer;
|
||||
extern void (*sTransitionUpdate)(s16 *);
|
||||
extern u8 unused3[4];
|
||||
extern void load_language_text(void);
|
||||
|
||||
struct WarpDest {
|
||||
@@ -86,7 +85,6 @@ extern s16 sDelayedWarpOp;
|
||||
extern s16 sDelayedWarpTimer;
|
||||
extern s16 sSourceWarpNodeId;
|
||||
extern s32 sDelayedWarpArg;
|
||||
extern u8 unused4[2];
|
||||
extern s8 sTimerRunning;
|
||||
|
||||
struct HudDisplay {
|
||||
|
||||
@@ -171,8 +171,6 @@ void spawn_macro_objects(s32 areaIndex, s16 *macroObjList) {
|
||||
}
|
||||
|
||||
void spawn_macro_objects_hardcoded(s32 areaIndex, s16 *macroObjList) {
|
||||
UNUSED u8 pad[8];
|
||||
|
||||
// This version of macroObjList has the preset and Y-Rotation separated,
|
||||
// and lacks behavior params. Might be an early version of the macro object list?
|
||||
s16 macroObjX;
|
||||
@@ -181,8 +179,6 @@ void spawn_macro_objects_hardcoded(s32 areaIndex, s16 *macroObjList) {
|
||||
s16 macroObjPreset;
|
||||
s16 macroObjRY; // Y Rotation
|
||||
|
||||
UNUSED u8 pad2[10];
|
||||
|
||||
gMacroObjectDefaultParent.header.gfx.areaIndex = areaIndex;
|
||||
gMacroObjectDefaultParent.header.gfx.activeAreaIndex = areaIndex;
|
||||
|
||||
|
||||
@@ -340,8 +340,6 @@ void update_flying_pitch(struct MarioState *m) {
|
||||
}
|
||||
|
||||
void update_flying(struct MarioState *m) {
|
||||
UNUSED u32 unused;
|
||||
|
||||
update_flying_pitch(m);
|
||||
update_flying_yaw(m);
|
||||
|
||||
|
||||
@@ -58,9 +58,6 @@ void play_climbing_sounds(struct MarioState *m, s32 b) {
|
||||
}
|
||||
|
||||
s32 set_pole_position(struct MarioState *m, f32 offsetY) {
|
||||
UNUSED s32 unused1;
|
||||
UNUSED s32 unused2;
|
||||
UNUSED s32 unused3;
|
||||
struct Surface *floor;
|
||||
struct Surface *ceil;
|
||||
f32 floorHeight;
|
||||
@@ -301,16 +298,15 @@ s32 act_top_of_pole(struct MarioState *m) {
|
||||
}
|
||||
|
||||
s32 perform_hanging_step(struct MarioState *m, Vec3f nextPos) {
|
||||
UNUSED s32 unused;
|
||||
struct Surface *ceil;
|
||||
struct Surface *floor;
|
||||
f32 ceilHeight;
|
||||
f32 floorHeight;
|
||||
f32 ceilOffset;
|
||||
struct WallCollisionData wallCollisionData;
|
||||
struct WallCollisionData wallCollisionData;
|
||||
|
||||
resolve_and_return_wall_collisions(nextPos, 50.0f, 50.0f, &wallCollisionData);
|
||||
m->wall = wallCollisionData.numWalls == 0 ? NULL : wallCollisionData.walls[0];
|
||||
resolve_and_return_wall_collisions(nextPos, 50.0f, 50.0f, &wallCollisionData);
|
||||
m->wall = wallCollisionData.numWalls == 0 ? NULL : wallCollisionData.walls[0];
|
||||
|
||||
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
||||
ceilHeight = find_ceil(nextPos[0], nextPos[1] + 3.0f, nextPos[2], &ceil);
|
||||
|
||||
@@ -34,7 +34,6 @@ static struct Object *sEndPeachObj;
|
||||
static struct Object *sEndRightToadObj;
|
||||
static struct Object *sEndLeftToadObj;
|
||||
static struct Object *sEndJumboStarObj;
|
||||
static UNUSED s32 sUnused;
|
||||
static s16 sEndPeachAnimation;
|
||||
static s16 sEndToadAnims[2];
|
||||
|
||||
|
||||
@@ -511,8 +511,6 @@ s32 should_begin_sliding(struct MarioState *m) {
|
||||
}
|
||||
|
||||
s32 check_ground_dive_or_punch(struct MarioState *m) {
|
||||
UNUSED s32 unused;
|
||||
|
||||
if (m->input & INPUT_B_PRESSED) {
|
||||
//! Speed kick (shoutouts to SimpleFlips)
|
||||
if (m->forwardVel >= 29.0f && m->controller->stickMag > 48.0f) {
|
||||
|
||||
@@ -76,7 +76,7 @@ static u32 perform_water_full_step(struct MarioState *m, Vec3f nextPos) {
|
||||
f32 floorHeight;
|
||||
|
||||
resolve_and_return_wall_collisions(nextPos, 10.0f, 110.0f, &wallData);
|
||||
wall = wallData.numWalls == 0 ? NULL : wallData.walls[0];
|
||||
wall = wallData.numWalls == 0 ? NULL : wallData.walls[0];
|
||||
floorHeight = find_floor(nextPos[0], nextPos[1], nextPos[2], &floor);
|
||||
ceilHeight = find_ceil(nextPos[0], nextPos[1] + 3.0f, nextPos[2], &ceil);
|
||||
|
||||
@@ -167,7 +167,6 @@ static void apply_water_current(struct MarioState *m, Vec3f step) {
|
||||
}
|
||||
|
||||
static u32 perform_water_step(struct MarioState *m) {
|
||||
UNUSED u32 unused;
|
||||
u32 stepResult;
|
||||
Vec3f nextPos;
|
||||
Vec3f step;
|
||||
|
||||
@@ -243,9 +243,7 @@ void bhv_unlock_door_star_init(void) {
|
||||
}
|
||||
|
||||
void bhv_unlock_door_star_loop(void) {
|
||||
UNUSED u8 unused1[4];
|
||||
s16 prevYaw = gCurrentObject->oMoveAngleYaw;
|
||||
UNUSED u8 unused2[4];
|
||||
|
||||
// Speed up the star every frame
|
||||
if (gCurrentObject->oUnlockDoorStarYawVel < 0x2400) {
|
||||
|
||||
@@ -303,7 +303,6 @@ struct MovtexObject gMovtexColored2[] = {
|
||||
*/
|
||||
Gfx *geo_wdw_set_initial_water_level(s32 callContext, UNUSED struct GraphNode *node, UNUSED Mat4 mtx) {
|
||||
s32 i;
|
||||
UNUSED u8 unused[] = { 1, 0, 4, 0, 7, 0, 10, 0 };
|
||||
s16 wdwWaterHeight;
|
||||
|
||||
// Why was this global variable needed when they could just check for GEO_CONTEXT_AREA_LOAD?
|
||||
|
||||
@@ -31,23 +31,23 @@ int nuPiInitSram()
|
||||
{
|
||||
if (SramHandle.baseAddress == PHYS_TO_K1(SRAM_START_ADDR))
|
||||
return 0;
|
||||
|
||||
|
||||
/* Fill basic information */
|
||||
SramHandle.type = DEVICE_TYPE_SRAM;
|
||||
SramHandle.baseAddress = PHYS_TO_K1(SRAM_START_ADDR);
|
||||
|
||||
|
||||
/* Get Domain parameters */
|
||||
SramHandle.latency = (u8)SRAM_LATENCY;
|
||||
SramHandle.pulse = (u8)SRAM_PULSE;
|
||||
SramHandle.pageSize = (u8)SRAM_PAGE_SIZE;
|
||||
SramHandle.relDuration = (u8)SRAM_REL_DURATION;
|
||||
SramHandle.domain = PI_DOMAIN2;
|
||||
|
||||
|
||||
/* Fill speed and transferInfo to zero */
|
||||
SramHandle.speed = 0;
|
||||
bzero((void *)&(SramHandle.transferInfo),
|
||||
sizeof(SramHandle.transferInfo));
|
||||
|
||||
|
||||
/* Put the SramHandle onto PiTable*/
|
||||
osEPiLinkHandle(&SramHandle);
|
||||
nuPiSramHandle = &SramHandle;
|
||||
|
||||
@@ -22,7 +22,7 @@ extern OSPiHandle* nuPiSramHandle;
|
||||
/* RET: None */
|
||||
/*----------------------------------------------------------------------*/
|
||||
int nuPiReadWriteSram(u32 addr, void* buf_ptr, u32 size, s32 flag)
|
||||
{
|
||||
{
|
||||
OSIoMesg dmaIoMesgBuf;
|
||||
OSMesgQueue dmaMesgQ;
|
||||
OSMesg dmaMesgBuf;
|
||||
|
||||
@@ -153,7 +153,6 @@ static void platform_on_track_update_pos_or_spawn_ball(s32 ballIndex, f32 x, f32
|
||||
struct Waypoint *initialPrevWaypoint;
|
||||
struct Waypoint *nextWaypoint;
|
||||
struct Waypoint *prevWaypoint;
|
||||
UNUSED s32 unused;
|
||||
f32 amountToMove;
|
||||
f32 dx;
|
||||
f32 dy;
|
||||
|
||||
@@ -368,7 +368,6 @@ s16 obj_angle_to_object(struct Object *obj1, struct Object *obj2) {
|
||||
|
||||
s16 obj_turn_toward_object(struct Object *obj, struct Object *target, s16 angleIndex, s16 turnAmount) {
|
||||
f32 a, b, c, d;
|
||||
UNUSED s32 unused;
|
||||
s16 targetAngle = 0;
|
||||
s16 startAngle;
|
||||
|
||||
@@ -1186,9 +1185,6 @@ static s32 cur_obj_move_xz(f32 steepSlopeNormalY, s32 careAboutEdgesAndSteepSlop
|
||||
f32 intendedFloorHeight = find_floor(intendedX, o->oPosY, intendedZ, &intendedFloor);
|
||||
f32 deltaFloorHeight = intendedFloorHeight - o->oFloorHeight;
|
||||
|
||||
UNUSED f32 unused;
|
||||
UNUSED f32 ny;
|
||||
|
||||
o->oMoveFlags &= ~OBJ_MOVE_HIT_EDGE;
|
||||
|
||||
if (o->oRoom != -1 && intendedFloor != NULL) {
|
||||
@@ -1222,7 +1218,7 @@ static s32 cur_obj_move_xz(f32 steepSlopeNormalY, s32 careAboutEdgesAndSteepSlop
|
||||
o->oMoveFlags |= OBJ_MOVE_HIT_EDGE;
|
||||
return FALSE;
|
||||
}
|
||||
} else if ((ny = intendedFloor->normal.y) > steepSlopeNormalY || o->oPosY > intendedFloorHeight) {
|
||||
} else if (intendedFloor->normal.y > steepSlopeNormalY || o->oPosY > intendedFloorHeight) {
|
||||
// Allow movement upward, provided either:
|
||||
// - The target floor is flat enough (e.g. walking up stairs)
|
||||
// - We are above the target floor (most likely in the air)
|
||||
|
||||
@@ -34,8 +34,6 @@ s32 gDebugInfoFlags;
|
||||
*/
|
||||
s32 gNumFindFloorMisses;
|
||||
|
||||
UNUSED s32 unused_8033BEF8;
|
||||
|
||||
/**
|
||||
* An unused debug counter with the label "WALL".
|
||||
*/
|
||||
@@ -475,9 +473,7 @@ void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo) {
|
||||
|
||||
while (spawnInfo != NULL) {
|
||||
struct Object *object;
|
||||
UNUSED s32 unused;
|
||||
const BehaviorScript *script;
|
||||
UNUSED s16 arg16 = (s16)(spawnInfo->behaviorArg & 0xFFFF);
|
||||
|
||||
script = segmented_to_virtual(spawnInfo->behaviorScript);
|
||||
|
||||
@@ -588,7 +584,6 @@ void update_non_terrain_objects(void) {
|
||||
* Unload deactivated objects in any object list.
|
||||
*/
|
||||
void unload_deactivated_objects(void) {
|
||||
UNUSED s32 unused;
|
||||
s32 listIndex;
|
||||
|
||||
s32 i = 0;
|
||||
|
||||
@@ -63,7 +63,6 @@ extern struct ObjectNode gObjectListArray[];
|
||||
|
||||
extern s32 gDebugInfoFlags;
|
||||
extern s32 gNumFindFloorMisses;
|
||||
extern UNUSED s32 unused_8033BEF8;
|
||||
extern s32 gUnknownWallCount;
|
||||
extern u32 gObjectCounter;
|
||||
|
||||
|
||||
@@ -770,7 +770,6 @@ s8 normalize_component(f32 comp) {
|
||||
* The table used in game, seg2_painting_mesh_neighbor_tris, is in bin/segment2.c.
|
||||
*/
|
||||
void painting_average_vertex_normals(s16 *neighborTris, s16 numVtx) {
|
||||
UNUSED s16 unused;
|
||||
s16 tri;
|
||||
s16 i;
|
||||
s16 j;
|
||||
|
||||
@@ -21,7 +21,6 @@ struct Object *gMarioPlatform = NULL;
|
||||
*/
|
||||
void update_mario_platform(void) {
|
||||
struct Surface *floor;
|
||||
UNUSED u32 unused;
|
||||
f32 marioX;
|
||||
f32 marioY;
|
||||
f32 marioZ;
|
||||
@@ -242,9 +241,6 @@ void apply_platform_displacement(u32 isMario, struct Object *platform) {
|
||||
Vec3f relativeOffset;
|
||||
Vec3f newObjectOffset;
|
||||
Vec3s rotation;
|
||||
UNUSED s16 unused1;
|
||||
UNUSED s16 unused2;
|
||||
UNUSED s16 unused3;
|
||||
f32 displaceMatrix[4][4];
|
||||
|
||||
rotation[0] = platform->oAngleVelPitch;
|
||||
|
||||
@@ -254,8 +254,6 @@ void print_text(s32 x, s32 y, const char *str) {
|
||||
*/
|
||||
void print_text_centered(s32 x, s32 y, const char *str) {
|
||||
char c = 0;
|
||||
UNUSED s8 unused1 = 0;
|
||||
UNUSED s32 unused2 = 0;
|
||||
s32 length = 0;
|
||||
s32 srcIndex = 0;
|
||||
|
||||
|
||||
@@ -1316,7 +1316,6 @@ void geo_process_node_and_siblings(struct GraphNode *firstNode) {
|
||||
* to set up the projection and draw display lists.
|
||||
*/
|
||||
void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) {
|
||||
UNUSED s32 unused;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -20,11 +20,11 @@ extern int nuPiReadWriteSram(u32 addr, void* buf_ptr, u32 size, s32 flag);
|
||||
/*----------------------------------------------------------------------*/
|
||||
#define nuPiReadSram(addr, buf_ptr, size) \
|
||||
nuPiReadWriteSram(addr, buf_ptr, size, OS_READ)
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* nuPiWriteSram - Write to SRAM */
|
||||
/*----------------------------------------------------------------------*/
|
||||
#define nuPiWriteSram(addr, buf_ptr, size) \
|
||||
nuPiReadWriteSram(addr, buf_ptr, size, OS_WRITE)
|
||||
nuPiReadWriteSram(addr, buf_ptr, size, OS_WRITE)
|
||||
|
||||
#endif // SRAM_H
|
||||
+1
-1
@@ -12,7 +12,7 @@ f32 round_double_to_float(f64);
|
||||
* This check forces RTZ bug on vc
|
||||
* If console is N64/adequate Emu round-to-nearest (RTN) rounding mode is used
|
||||
* If console is VC round-to-zero (RTZ) mode is used
|
||||
*
|
||||
*
|
||||
* The double value 0.9999999999999999 used is 0x3FEFFFFFFFFFFFFF in binary
|
||||
* Exponent=01111111110, Mantissa=1111111111111111111111111111111111111111111111111111
|
||||
* RTZ will output not 1.0f, RTN will output exactly 1.0f
|
||||
|
||||
@@ -439,7 +439,6 @@ void print_stack_trace(void) {
|
||||
*/
|
||||
void fatal_printf(const char *fmt, ...) {
|
||||
char cur;
|
||||
UNUSED u8 pad[4];
|
||||
va_list vl;
|
||||
|
||||
va_start(vl, fmt);
|
||||
@@ -669,7 +668,6 @@ char *sprint_val_withspecifiers(char *str, union PrintVal val, char *specifiers)
|
||||
s32 intPart; // sp38
|
||||
s32 intPrec; // sp34
|
||||
s32 fracPrec; // sp30
|
||||
UNUSED u8 pad[4];
|
||||
char cur; // sp2B
|
||||
|
||||
fracPrec = 6;
|
||||
|
||||
@@ -168,7 +168,6 @@ void draw_shape(struct ObjShape *shape, s32 flag, f32 c, f32 d, f32 e, // "sweep
|
||||
f32 i, f32 j, f32 k, // translate shape
|
||||
f32 l, f32 m, f32 n, // rotate x, y, z
|
||||
s32 colorIdx, Mat4f *rotMtx) {
|
||||
UNUSED u8 unused[8];
|
||||
struct GdVec3f sp1C;
|
||||
|
||||
restart_timer("drawshape");
|
||||
@@ -245,7 +244,6 @@ void draw_shape(struct ObjShape *shape, s32 flag, f32 c, f32 d, f32 e, // "sweep
|
||||
void draw_shape_2d(struct ObjShape *shape, s32 flag, UNUSED f32 c, UNUSED f32 d, UNUSED f32 e, f32 f,
|
||||
f32 g, f32 h, UNUSED f32 i, UNUSED f32 j, UNUSED f32 k, UNUSED f32 l, UNUSED f32 m,
|
||||
UNUSED f32 n, UNUSED s32 color, UNUSED s32 p) {
|
||||
UNUSED u8 unused[8];
|
||||
struct GdVec3f sp1C;
|
||||
|
||||
restart_timer("drawshape2d");
|
||||
@@ -437,7 +435,6 @@ void draw_face(struct ObjFace *face) {
|
||||
f32 z; // 38
|
||||
f32 y; // 34
|
||||
f32 x; // 30
|
||||
UNUSED u8 pad[12];
|
||||
s32 i; // 20; also used to store mtl's gddl number
|
||||
s32 hasTextCoords; // 1c
|
||||
Vtx *gbiVtx; // 18
|
||||
@@ -536,7 +533,6 @@ void Unknown801792F0(struct GdObj *obj) {
|
||||
void draw_label(struct ObjLabel *label) {
|
||||
struct GdVec3f position;
|
||||
char strbuf[0x100];
|
||||
UNUSED u8 unused[16];
|
||||
struct ObjValPtr *valptr;
|
||||
union ObjVarVal varval;
|
||||
valptrproc_t valfn = label->valfn;
|
||||
@@ -593,7 +589,6 @@ void draw_label(struct ObjLabel *label) {
|
||||
void draw_net(struct ObjNet *self) {
|
||||
struct ObjNet *net = self;
|
||||
s32 netColor;
|
||||
UNUSED u8 unused[80];
|
||||
|
||||
if (sSceneProcessType == FIND_PICKS) {
|
||||
return;
|
||||
@@ -729,7 +724,6 @@ void world_pos_to_screen_coords(struct GdVec3f *pos, struct ObjCamera *cam, stru
|
||||
*/
|
||||
void check_grabable_click(struct GdObj *input) {
|
||||
struct GdVec3f objPos;
|
||||
UNUSED u8 unused[12];
|
||||
struct GdObj *obj;
|
||||
Mat4f *mtx;
|
||||
|
||||
@@ -772,8 +766,6 @@ void check_grabable_click(struct GdObj *input) {
|
||||
* @param lightgrp lights of `ObjView
|
||||
*/
|
||||
void drawscene(enum SceneType process, struct ObjGroup *interactables, struct ObjGroup *lightgrp) {
|
||||
UNUSED u8 unused[16];
|
||||
|
||||
restart_timer("drawscene");
|
||||
imin("draw_scene()");
|
||||
sUnreadShapeFlag = 0;
|
||||
@@ -868,11 +860,9 @@ void draw_shape_faces(struct ObjShape *shape) {
|
||||
*/
|
||||
void draw_particle(struct GdObj *obj) {
|
||||
struct ObjParticle *ptc = (struct ObjParticle *) obj;
|
||||
UNUSED u8 unused1[16];
|
||||
struct GdColour *white;
|
||||
struct GdColour *black;
|
||||
f32 brightness;
|
||||
UNUSED u8 unused2[16];
|
||||
|
||||
if (ptc->timeout > 0) {
|
||||
white = sColourPalette[0];
|
||||
@@ -906,32 +896,8 @@ void draw_particle(struct GdObj *obj) {
|
||||
* @note This function returns before doing any work. It seems
|
||||
* that Goddard moved away from using bones in the final code
|
||||
*/
|
||||
void draw_bone(struct GdObj *obj) {
|
||||
struct ObjBone *bone = (struct ObjBone *) obj;
|
||||
UNUSED u8 unused1[4];
|
||||
s32 colour;
|
||||
UNUSED u8 unused2[4];
|
||||
struct GdVec3f scale; // guess
|
||||
|
||||
void draw_bone(UNUSED struct GdObj *obj) {
|
||||
return;
|
||||
|
||||
// dead code
|
||||
scale.x = 1.0f;
|
||||
scale.y = 1.0f;
|
||||
scale.z = bone->unkF8 / 50.0f;
|
||||
|
||||
if (bone->header.drawFlags & OBJ_HIGHLIGHTED) {
|
||||
colour = COLOUR_YELLOW;
|
||||
} else {
|
||||
colour = bone->colourNum;
|
||||
}
|
||||
bone->header.drawFlags &= ~OBJ_HIGHLIGHTED;
|
||||
|
||||
if (sSceneProcessType != FIND_PICKS) {
|
||||
draw_shape(bone->shapePtr, 0x1B, scale.x, scale.y, scale.z, bone->worldPos.x, bone->worldPos.y,
|
||||
bone->worldPos.z, 0.0f, 0.0f, 0.0f, bone->unk28.x, bone->unk28.y, bone->unk28.z, colour,
|
||||
&bone->mat70);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -939,14 +905,10 @@ void draw_bone(struct GdObj *obj) {
|
||||
*/
|
||||
void draw_joint(struct GdObj *obj) {
|
||||
struct ObjJoint *joint = (struct ObjJoint *) obj;
|
||||
UNUSED u8 unused1[4];
|
||||
UNUSED f32 sp7C = 70.0f;
|
||||
UNUSED u8 unused2[4];
|
||||
UNUSED s32 sp74 = 1;
|
||||
s32 colour;
|
||||
UNUSED u8 unused[8];
|
||||
struct ObjShape *boneShape;
|
||||
UNUSED u8 unused3[28];
|
||||
|
||||
if ((boneShape = joint->shapePtr) == NULL) {
|
||||
return;
|
||||
@@ -1260,7 +1222,7 @@ static void find_thisface_verts(struct ObjFace *face, struct ObjGroup *vertexGrp
|
||||
struct ListNode *node;
|
||||
|
||||
for (i = 0; i < face->vtxCount; i++) {
|
||||
// find the vertex or particle whose index in vertexGrp equals face->vertices[i]
|
||||
// find the vertex or particle whose index in vertexGrp equals face->vertices[i]
|
||||
node = vertexGrp->firstMember;
|
||||
currIndex = 0;
|
||||
while (node != NULL) {
|
||||
@@ -1347,7 +1309,6 @@ void unpick_obj(struct GdObj *obj) {
|
||||
*/
|
||||
void find_closest_pickable_obj(struct GdObj *input) {
|
||||
struct GdObj *obj = input;
|
||||
UNUSED u8 unused[12];
|
||||
f32 distance;
|
||||
|
||||
if (obj->drawFlags & OBJ_IS_GRABBALE) {
|
||||
|
||||
@@ -158,8 +158,6 @@ void reset_dynlist(void) {
|
||||
* Normally the dynlist specifically sets an object for return.
|
||||
*/
|
||||
struct GdObj *proc_dynlist(struct DynList *dylist) {
|
||||
UNUSED u32 pad[2];
|
||||
|
||||
if (dylist++->cmd != 0xD1D4) {
|
||||
fatal_printf("proc_dynlist() not a valid dyn list");
|
||||
}
|
||||
@@ -1224,7 +1222,7 @@ void d_map_materials(DynObjName name) {
|
||||
|
||||
/**
|
||||
* For all faces in the current `ObjGroup`, resolve their vertex indices to
|
||||
* `ObjVertex` pointers that point to vertices in the specified vertex group.
|
||||
* `ObjVertex` pointers that point to vertices in the specified vertex group.
|
||||
* Also compute normals for all faces in the current `ObjGroup` and all vertices
|
||||
* in the specified vertex group.
|
||||
* See `map_vertices()` for more info.
|
||||
@@ -2631,7 +2629,7 @@ void d_set_parm_ptr(enum DParmPtr param, void *ptr) {
|
||||
fatal_printf("dsetparmp() too many points");
|
||||
}
|
||||
// `ptr` here is a vertex index, not an actual pointer.
|
||||
// These vertex indices later get converted to `ObjVertex` pointers when `find_thisface_verts` is called.
|
||||
// These vertex indices later get converted to `ObjVertex` pointers when `find_thisface_verts` is called.
|
||||
((struct ObjFace *) sDynListCurObj)->vertices[((struct ObjFace *) sDynListCurObj)->vtxCount++] = ptr;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/**
|
||||
* Set the initial position of the current object
|
||||
* Supported Objs: joints, particles, nets, vertices, cameras
|
||||
* Supported Objs: joints, particles, nets, vertices, cameras
|
||||
*/
|
||||
#define SetInitialPosition(x, y, z) \
|
||||
{ 1, {0}, {0}, {(x), (y), (z)} }
|
||||
@@ -150,7 +150,7 @@
|
||||
{ 19, {0}, {(void *)(type)}, {0.0, 0.0, 0.0} }
|
||||
|
||||
/**
|
||||
* Set the current shape's material group to the specified group.
|
||||
* Set the current shape's material group to the specified group.
|
||||
* Supported Objs: shapes
|
||||
*/
|
||||
#define SetMaterialGroup(mtlGrpName) \
|
||||
|
||||
@@ -354,7 +354,7 @@ struct DynList dynlist_mario_face_shape[] = {
|
||||
MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_FACE_TRI_GROUP),
|
||||
LinkWithPtr(&mario_Face_FaceInfo),
|
||||
|
||||
StartGroup(DYNOBJ_MARIO_FACE_MTL_GROUP),
|
||||
StartGroup(DYNOBJ_MARIO_FACE_MTL_GROUP),
|
||||
// Teeth color
|
||||
MakeDynObj(D_MATERIAL, 0),
|
||||
SetId(0),
|
||||
@@ -366,7 +366,7 @@ struct DynList dynlist_mario_face_shape[] = {
|
||||
SetAmbient(0.883, 0.602, 0.408),
|
||||
SetDiffuse(0.883, 0.602, 0.408),
|
||||
// Shadow on back of hat
|
||||
MakeDynObj(D_MATERIAL, 0),
|
||||
MakeDynObj(D_MATERIAL, 0),
|
||||
SetId(2),
|
||||
SetAmbient(0.362, 0.0, 0.0),
|
||||
SetDiffuse(0.362, 0.0, 0.0),
|
||||
|
||||
@@ -1089,7 +1089,7 @@ struct DynList dynlist_mario_master[] = {
|
||||
AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR),
|
||||
SetNodeGroup(DYNOBJ_RIGHT_EYELID_ANIMDATA_GROUP),
|
||||
LinkWith(DYNOBJ_RIGHT_EYELID_JOINT_1),
|
||||
|
||||
|
||||
// whole head animator?
|
||||
MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_HEAD_ANIMDATA_GROUP),
|
||||
LinkWithPtr(&anim_mario_intro),
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
/**
|
||||
* @file gd_macros.h
|
||||
*
|
||||
*
|
||||
* Common macros that Goddard used throughout the Mario Head subsytem code.
|
||||
*/
|
||||
|
||||
|
||||
+5
-12
@@ -515,7 +515,7 @@ f32 gd_mat4f_det(Mat4f *mtx) {
|
||||
* returns the determinant.
|
||||
*/
|
||||
f32 gd_3x3_det(f32 r0c0, f32 r0c1, f32 r0c2,
|
||||
f32 r1c0, f32 r1c1, f32 r1c2,
|
||||
f32 r1c0, f32 r1c1, f32 r1c2,
|
||||
f32 r2c0, f32 r2c1, f32 r2c2) {
|
||||
f32 det;
|
||||
|
||||
@@ -602,7 +602,6 @@ void UNUSED gd_quat_rotation(f32 quat[4], UNUSED s32 unused, f32 c, f32 s, s32 i
|
||||
s32 j;
|
||||
s32 k;
|
||||
f32 quatVal;
|
||||
UNUSED u32 pad[2];
|
||||
|
||||
if ((j = i + 1) >= 4) {
|
||||
j = 1;
|
||||
@@ -655,16 +654,14 @@ void gd_shift_mat_up(Mat4f *mtx) {
|
||||
* | 0 w^2+i^2-j^2-k^2 2ij+2wk 2ik+2wj |
|
||||
* | 0 2ij-2wk w^2+j^2-i^2-k^2 2jk+2wi |
|
||||
* | 0 2ik+2wj 2jk-2wi w^2+k^2-i^2-j^2 |
|
||||
*
|
||||
*
|
||||
* Potentially broken if 'mtx' is not an identity matrix/zero'ed.
|
||||
*/
|
||||
void UNUSED gd_create_quat_rot_mat(f32 quat[4], UNUSED s32 unused, Mat4f *mtx) {
|
||||
f32 twoIJ;
|
||||
f32 two0K;
|
||||
f32 sqQuat[4];
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 k;
|
||||
s32 i, j, k;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
sqQuat[i] = SQ(quat[i]);
|
||||
@@ -699,10 +696,10 @@ void UNUSED gd_create_quat_rot_mat(f32 quat[4], UNUSED s32 unused, Mat4f *mtx) {
|
||||
* Creates a rotation matrix to multiply the primary matrix by.
|
||||
* s/c are sin(angle)/cos(angle). That angular rotation is about vector
|
||||
* 'vec'.
|
||||
*
|
||||
*
|
||||
* Matrix has form-
|
||||
*
|
||||
* | (1-c)z^2+c (1-c)zy-sx (1-c)xz-sy 0 |
|
||||
* | (1-c)z^2+c (1-c)zy-sx (1-c)xz-sy 0 |
|
||||
* | (1-c)zy-sx (1-c)y^2+c (1-c)xy-sz 0 |
|
||||
* | (1-c)xz-sy (1-c)xy-sz (1-c)x^2+c 0 |
|
||||
* | 0 0 0 1 |
|
||||
@@ -876,8 +873,6 @@ void gd_mult_mat4f(const Mat4f *mA, const Mat4f *mB, Mat4f *dst) {
|
||||
* Printed the prefix at some point, as shown by how the function is used.
|
||||
*/
|
||||
void gd_print_vec(UNUSED const char *prefix, const struct GdVec3f *vec) {
|
||||
UNUSED u8 pad[8];
|
||||
|
||||
printf("%f,%f,%f\n", vec->x, vec->y, vec->z);
|
||||
printf("\n");
|
||||
}
|
||||
@@ -888,8 +883,6 @@ void gd_print_vec(UNUSED const char *prefix, const struct GdVec3f *vec) {
|
||||
* Printed a prefix at some point, as shone by how the function is used.
|
||||
*/
|
||||
void gd_print_bounding_box(UNUSED const char *prefix, UNUSED const struct GdBoundingBox *p) {
|
||||
UNUSED u8 pad[8];
|
||||
|
||||
printf("Min X = %f, Max X = %f \n", p->minX, p->maxX);
|
||||
printf("Min Y = %f, Max Y = %f \n", p->minY, p->maxY);
|
||||
printf("Min Z = %f, Max Z = %f \n", p->minZ, p->maxZ);
|
||||
|
||||
@@ -24,7 +24,7 @@ enum GdRotAxis {
|
||||
void gd_adjunct_mat4f(Mat4f *src, Mat4f *dst);
|
||||
f32 gd_mat4f_det(Mat4f *mtx);
|
||||
f32 gd_3x3_det(f32 r0c0, f32 r0c1, f32 r0c2,
|
||||
f32 r1c0, f32 r1c1, f32 r1c2,
|
||||
f32 r1c0, f32 r1c1, f32 r1c2,
|
||||
f32 r2c0, f32 r2c1, f32 r2c2);
|
||||
f32 gd_2x2_det(f32 a, f32 b, f32 c, f32 d);
|
||||
|
||||
|
||||
Loaded 100 of 163 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user