Small, random optimisations (#363)

* Remove useless player pointer copies

Signed-off-by: Thomas Rohloff <v10lator@myway.de>

* Fix target FPS

Signed-off-by: Thomas Rohloff <v10lator@myway.de>

* Add else

Signed-off-by: Thomas Rohloff <v10lator@myway.de>

* Remove useless addition

Signed-off-by: Thomas Rohloff <v10lator@myway.de>

* Simplify func_8001CA24(Player* player, f32 arg1)

Signed-off-by: Thomas Rohloff <v10lator@myway.de>

* Simplify a few more functions

Signed-off-by: Thomas Rohloff <v10lator@myway.de>

* Make 2 arrays static const

Signed-off-by: Thomas Rohloff <v10lator@myway.de>

---------

Signed-off-by: Thomas Rohloff <v10lator@myway.de>
Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
V10lator
2025-07-09 20:06:08 +02:00
committed by GitHub
parent 98d660b825
commit d175f5ef24
13 changed files with 66 additions and 97 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ void render_limb_or_add_mtx(Armature* arg0, s16* arg1, AnimationLimbVector arg2,
for (i = 0; i < 3; i++) {
pos[i] = sOriginalPosAnimation[i] + arg0->pos[i];
}
isNotTheFirst += 1;
isNotTheFirst = 1;
} else {
for (i = 0; i < 3; i++) {
pos[i] = arg0->pos[i];
+4 -26
View File
@@ -342,17 +342,8 @@ void func_8001CA10(Camera* camera) {
}
void func_8001CA24(Player* player, f32 arg1) {
Camera* camera = &cameras[0];
Camera* camera = &cameras[player - gPlayerOne];
if (player == gPlayerTwo) {
camera += 1;
}
if (player == gPlayerThree) {
camera += 2;
}
if (player == gPlayerFour) {
camera += 3;
}
camera->unk_94.unk_8 = 0;
camera->unk_94.unk_0 = arg1;
}
@@ -1049,20 +1040,8 @@ void func_8001EA0C(Camera* camera, Player* player, s8 arg2) {
}
void func_8001EE98(Player* player, Camera* camera, s8 index) {
s32 cameraIndex;
s32 cameraIndex = camera1 - camera;
if (camera == camera1) {
cameraIndex = 0;
}
if (camera == camera2) {
cameraIndex = 1;
}
if (camera == camera3) {
cameraIndex = 2;
}
if (camera == camera4) {
cameraIndex = 3;
}
switch (gModeSelection) {
case GRAND_PRIX:
// clang-format off
@@ -1155,9 +1134,9 @@ void func_8001EE98(Player* player, Camera* camera, s8 index) {
void func_8001F394(Player* player, f32* arg1) {
f32 var_f0;
UNUSED s32 pad;
s32 playerIndex;
s32 playerIndex = player - gPlayerOne;
UNUSED s32 pad2;
Camera* camera = &cameras[0];
Camera* camera = &cameras[playerIndex];
if (player == gPlayerOne) {
playerIndex = 0;
@@ -1278,7 +1257,6 @@ void func_8001F394(Player* player, f32* arg1) {
break;
}
*arg1 = var_f0;
camera += playerIndex; // In 500 words or less, please explain why?
camera->unk_B4 = var_f0;
}
+1 -1
View File
@@ -1322,7 +1322,7 @@ void func_80059D00(void) {
}
func_80078C70(0);
if (playerHUD[PLAYER_ONE].raceCompleteBool == 0) {
func_8005C360((gPlayerOneCopy->speed / 18.0f) * 216.0f);
func_8005C360((gPlayerOne->speed / 18.0f) * 216.0f);
}
func_8005D0FC(PLAYER_ONE);
} else {
+2 -2
View File
@@ -1915,8 +1915,8 @@ void object_origin_pos_randomize_around_xyz(s32 objectIndex, s16 x, s16 y, s16 z
}
void object_origin_pos_around_player_one(s32 objectIndex, s16 dist, u16 angle) {
gObjectList[objectIndex].origin_pos[0] = gPlayerOneCopy->pos[0] + (sins(angle) * dist);
gObjectList[objectIndex].origin_pos[2] = gPlayerOneCopy->pos[2] + (coss(angle) * dist);
gObjectList[objectIndex].origin_pos[0] = gPlayerOne->pos[0] + (sins(angle) * dist);
gObjectList[objectIndex].origin_pos[2] = gPlayerOne->pos[2] + (coss(angle) * dist);
}
UNUSED void func_8008BEA4(s32 objectIndex, u16 arg1, u16 arg2) {
+5 -5
View File
@@ -7,7 +7,7 @@
#include "collision.h"
void func_800914A0(void) {
D_80152308 = gPlayerOneCopy->unk_006 + 7;
D_80152308 = gPlayerOne->unk_006 + 7;
if ((s32) D_8015F6F8 < D_80152308) {
D_80152308 -= D_8015F6F8;
}
@@ -21,7 +21,7 @@ UNUSED void func_800914E0(void) {
struct ActorSpawnData* tempData;
s16 temp3 = (s16) D_80152308;
s16 temp2 = (s16) gPlayerOneCopy->unk_006;
s16 temp2 = (s16) gPlayerOne->unk_006;
s16 temp;
f32 sp38;
f32 sp34;
@@ -46,10 +46,10 @@ UNUSED void func_800914E0(void) {
camera->pos[0] = (f32) (tempData->pos[0] + 10);
camera->pos[1] = (f32) (tempData->pos[1] + 7);
camera->pos[2] = (f32) (tempData->pos[2] - 20);
camera->lookAt[0] = gPlayerOneCopy->pos[0];
camera->lookAt[0] = gPlayerOne->pos[0];
camera->lookAt[1] = gPlayerOneCopy->pos[1];
camera->lookAt[2] = gPlayerOneCopy->pos[2];
camera->lookAt[1] = gPlayerOne->pos[1];
camera->lookAt[2] = gPlayerOne->pos[2];
check_bounding_collision(&camera->collision, 20.0f, camera->pos[0], camera->pos[1], camera->pos[2]);
sp38 = camera->lookAt[0] - camera->pos[0];
sp34 = camera->lookAt[1] - camera->pos[1];
+1 -1
View File
@@ -95,7 +95,7 @@ void freecam(Camera* camera, Player* player, s8 index) {
} else {
func_8001E45C(camera, player, index);
// Required if freecam were to use its own camera instead of borrowing the player camera
//func_8001EE98(gPlayerOneCopy, camera, index);
//func_8001EE98(gPlayerOne, camera, index);
}
}
+6 -12
View File
@@ -85,11 +85,6 @@ Player* gPlayerSix = &gPlayers[5];
Player* gPlayerSeven = &gPlayers[6];
Player* gPlayerEight = &gPlayers[7];
Player* gPlayerOneCopy = &gPlayers[0];
Player* gPlayerTwoCopy = &gPlayers[1];
UNUSED Player* gPlayerThreeCopy = &gPlayers[2];
UNUSED Player* gPlayerFourCopy = &gPlayers[3];
UNUSED s32 D_800FD850[3];
struct GfxPool gGfxPools[2];
struct GfxPool* gGfxPool;
@@ -653,7 +648,7 @@ void calculate_updaterate(void) {
// Get target FPS from configuration variable
s32 targetFPS = 30;
if (targetFPS < 60) {
if (targetFPS < 30) {
targetFPS = 30;
}
@@ -763,13 +758,12 @@ void process_game_tick(void) {
// tick camera
// This looks like it should be in the switch.
// But it needs to be here for player 1 to work in all modes.
func_8001EE98(gPlayerOneCopy, camera1, 0);
func_8001EE98(gPlayerOne, camera1, 0);
// Required if freecam was to have a new camera
//if (CVarGetInteger("gFreecam", 0) == true) {
// freecam(gFreecamCamera, gPlayerOneCopy, 0);
// freecam(gFreecamCamera, gPlayerOne, 0);
//} else {
//func_8001EE98(gPlayerOneCopy, camera1, 0);
//func_8001EE98(gPlayerOne, camera1, 0);
//}
// Editor requires this so the camera keeps moving while the game is paused.
@@ -784,7 +778,7 @@ void process_game_tick(void) {
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL:
func_80029060();
func_8001EE98(gPlayerTwoCopy, camera2, 1);
func_8001EE98(gPlayerTwo, camera2, 1);
func_80029150();
break;
case SCREEN_MODE_3P_4P_SPLITSCREEN:
@@ -825,7 +819,7 @@ void race_logic_loop(void) {
if (sNumVBlanks >= 6) {
sNumVBlanks = 5;
}
if (sNumVBlanks < 0) {
else if (sNumVBlanks < 0) {
sNumVBlanks = 1;
}
-3
View File
@@ -135,9 +135,6 @@ extern Player* gPlayerSix;
extern Player* gPlayerSeven;
extern Player* gPlayerEight;
extern Player* gPlayerOneCopy;
extern Player* gPlayerTwoCopy;
extern struct GfxPool gGfxPools[];
extern struct GfxPool* gGfxPool;
+3 -3
View File
@@ -686,7 +686,7 @@ UNUSED void func_80028F5C(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED s32 arg2, UNU
void func_80028F70(void) {
ClearEffectsMatrixPool();
gMatrixEffectCount = 0;
func_80028E70(gPlayerOneCopy, camera1, 0, 0);
func_80028E70(gPlayerOne, camera1, 0, 0);
func_80028E70(gPlayerTwo, camera1, 1, 0);
func_80028E70(gPlayerThree, camera1, 2, 0);
func_80028E70(gPlayerFour, camera1, 3, 0);
@@ -699,7 +699,7 @@ void func_80028F70(void) {
void func_80029060(void) {
ClearEffectsMatrixPool();
gMatrixEffectCount = 0;
func_80028E70(gPlayerOneCopy, camera1, 0, 0);
func_80028E70(gPlayerOne, camera1, 0, 0);
func_80028E70(gPlayerTwo, camera1, 1, 0);
func_80028E70(gPlayerThree, camera1, 2, 0);
func_80028E70(gPlayerFour, camera1, 3, 0);
@@ -715,7 +715,7 @@ void func_80029150(void) {
void func_80029158(void) {
ClearEffectsMatrixPool();
gMatrixEffectCount = 0;
func_80028E70(gPlayerOneCopy, camera1, 0, 0);
func_80028E70(gPlayerOne, camera1, 0, 0);
func_80028E70(gPlayerTwo, camera1, 1, 0);
func_80028E70(gPlayerThree, camera1, 2, 0);
func_80028E70(gPlayerFour, camera1, 3, 0);
+4 -4
View File
@@ -1196,15 +1196,15 @@ void func_80290B14(void) {
switch (gActiveScreenMode) {
case SCREEN_MODE_1P:
func_8001EE98(gPlayerOneCopy, camera1, 0);
func_8001EE98(gPlayerOne, camera1, 0);
break;
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL:
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
func_8001EE98(gPlayerOneCopy, camera1, 0);
func_8001EE98(gPlayerTwoCopy, camera2, 1);
func_8001EE98(gPlayerOne, camera1, 0);
func_8001EE98(gPlayerTwo, camera2, 1);
break;
case SCREEN_MODE_3P_4P_SPLITSCREEN:
func_8001EE98(gPlayerOneCopy, camera1, 0);
func_8001EE98(gPlayerOne, camera1, 0);
func_8001EE98(gPlayerTwo, camera2, 1);
func_8001EE98(gPlayerThree, camera3, 2);
func_8001EE98(gPlayerFour, camera4, 3);
+16 -16
View File
@@ -524,7 +524,7 @@ void render_players_on_screen_one(void) {
};
gPlayersToRenderCount = 0;
init_render_player(gPlayerOneCopy, camera1, PLAYER_ONE, PLAYER_ONE);
init_render_player(gPlayerOne, camera1, PLAYER_ONE, PLAYER_ONE);
init_render_player(gPlayerTwo, camera1, PLAYER_TWO, PLAYER_ONE);
init_render_player(gPlayerThree, camera1, PLAYER_THREE, PLAYER_ONE);
init_render_player(gPlayerFour, camera1, PLAYER_FOUR, PLAYER_ONE);
@@ -554,7 +554,7 @@ void render_players_on_screen_one(void) {
if (gPlayersToRenderCount != 0) {
// Old call which is out of sync
// load_kart_texture_and_render_kart_particle_on_screen_one();
render_kart_particle_on_screen_one(gPlayerOneCopy, PLAYER_ONE, PLAYER_ONE);
render_kart_particle_on_screen_one(gPlayerOne, PLAYER_ONE, PLAYER_ONE);
render_kart_particle_on_screen_one(gPlayerTwo, PLAYER_TWO, PLAYER_ONE);
render_kart_particle_on_screen_one(gPlayerThree, PLAYER_THREE, PLAYER_ONE);
render_kart_particle_on_screen_one(gPlayerFour, PLAYER_FOUR, PLAYER_ONE);
@@ -565,7 +565,7 @@ void render_players_on_screen_one(void) {
render_kart_particle_on_screen_one(gPlayerEight, PLAYER_EIGHT, PLAYER_ONE);
}
} else {
render_kart_particle_on_screen_one(gPlayerOneCopy, PLAYER_ONE, PLAYER_ONE);
render_kart_particle_on_screen_one(gPlayerOne, PLAYER_ONE, PLAYER_ONE);
render_kart_particle_on_screen_one(gPlayerTwo, PLAYER_TWO, PLAYER_ONE);
render_kart_particle_on_screen_one(gPlayerThree, PLAYER_THREE, PLAYER_ONE);
render_kart_particle_on_screen_one(gPlayerFour, PLAYER_FOUR, PLAYER_ONE);
@@ -727,7 +727,7 @@ s32 D_800DDE74[] = { 96, 128, 192, 256, 288, 384, 512, 544, 576, 0, 0 };
void render_players_on_screen_two(void) {
gPlayersToRenderCount = 0;
init_render_player(gPlayerOneCopy, camera2, PLAYER_ONE, PLAYER_TWO);
init_render_player(gPlayerOne, camera2, PLAYER_ONE, PLAYER_TWO);
init_render_player(gPlayerTwo, camera2, PLAYER_TWO, PLAYER_TWO);
init_render_player(gPlayerThree, camera2, PLAYER_THREE, PLAYER_TWO);
init_render_player(gPlayerFour, camera2, PLAYER_FOUR, PLAYER_TWO);
@@ -755,7 +755,7 @@ void render_players_on_screen_two(void) {
}
if (gPlayersToRenderCount != 0) {
// load_kart_texture_and_render_kart_particle_on_screen_two();
render_kart_particle_on_screen_two(gPlayerOneCopy, PLAYER_ONE, PLAYER_TWO);
render_kart_particle_on_screen_two(gPlayerOne, PLAYER_ONE, PLAYER_TWO);
render_kart_particle_on_screen_two(gPlayerTwo, PLAYER_TWO, PLAYER_TWO);
render_kart_particle_on_screen_two(gPlayerThree, PLAYER_THREE, PLAYER_TWO);
render_kart_particle_on_screen_two(gPlayerFour, PLAYER_FOUR, PLAYER_TWO);
@@ -766,7 +766,7 @@ void render_players_on_screen_two(void) {
render_kart_particle_on_screen_two(gPlayerEight, PLAYER_EIGHT, PLAYER_TWO);
}
} else {
render_kart_particle_on_screen_two(gPlayerOneCopy, PLAYER_ONE, PLAYER_TWO);
render_kart_particle_on_screen_two(gPlayerOne, PLAYER_ONE, PLAYER_TWO);
render_kart_particle_on_screen_two(gPlayerTwo, PLAYER_TWO, PLAYER_TWO);
render_kart_particle_on_screen_two(gPlayerThree, PLAYER_THREE, PLAYER_TWO);
render_kart_particle_on_screen_two(gPlayerFour, PLAYER_FOUR, PLAYER_TWO);
@@ -782,7 +782,7 @@ void render_players_on_screen_two(void) {
void render_players_on_screen_three(void) {
gPlayersToRenderCount = 0;
init_render_player(gPlayerOneCopy, camera3, PLAYER_ONE, PLAYER_THREE);
init_render_player(gPlayerOne, camera3, PLAYER_ONE, PLAYER_THREE);
init_render_player(gPlayerTwo, camera3, PLAYER_TWO, PLAYER_THREE);
init_render_player(gPlayerThree, camera3, PLAYER_THREE, PLAYER_THREE);
init_render_player(gPlayerFour, camera3, PLAYER_FOUR, PLAYER_THREE);
@@ -797,12 +797,12 @@ void render_players_on_screen_three(void) {
try_rendering_player(gPlayerFour, PLAYER_FOUR, PLAYER_THREE);
if (gPlayersToRenderCount != 0) {
// load_kart_texture_and_render_kart_particle_on_screen_three();
render_kart_particle_on_screen_three(gPlayerOneCopy, PLAYER_ONE, PLAYER_THREE);
render_kart_particle_on_screen_three(gPlayerOne, PLAYER_ONE, PLAYER_THREE);
render_kart_particle_on_screen_three(gPlayerTwo, PLAYER_TWO, PLAYER_THREE);
render_kart_particle_on_screen_three(gPlayerThree, PLAYER_THREE, PLAYER_THREE);
render_kart_particle_on_screen_three(gPlayerFour, PLAYER_FOUR, PLAYER_THREE);
} else {
render_kart_particle_on_screen_three(gPlayerOneCopy, PLAYER_ONE, PLAYER_THREE);
render_kart_particle_on_screen_three(gPlayerOne, PLAYER_ONE, PLAYER_THREE);
render_kart_particle_on_screen_three(gPlayerTwo, PLAYER_TWO, PLAYER_THREE);
render_kart_particle_on_screen_three(gPlayerThree, PLAYER_THREE, PLAYER_THREE);
render_kart_particle_on_screen_three(gPlayerFour, PLAYER_FOUR, PLAYER_THREE);
@@ -812,7 +812,7 @@ void render_players_on_screen_three(void) {
void render_players_on_screen_four(void) {
gPlayersToRenderCount = 0;
init_render_player(gPlayerOneCopy, camera4, PLAYER_ONE, PLAYER_FOUR);
init_render_player(gPlayerOne, camera4, PLAYER_ONE, PLAYER_FOUR);
init_render_player(gPlayerTwo, camera4, PLAYER_TWO, PLAYER_FOUR);
init_render_player(gPlayerThree, camera4, PLAYER_THREE, PLAYER_FOUR);
init_render_player(gPlayerFour, camera4, PLAYER_FOUR, PLAYER_FOUR);
@@ -827,12 +827,12 @@ void render_players_on_screen_four(void) {
try_rendering_player(gPlayerFour, PLAYER_FOUR, PLAYER_FOUR);
if (gPlayersToRenderCount != 0) {
// load_kart_texture_and_render_kart_particle_on_screen_four();
render_kart_particle_on_screen_four(gPlayerOneCopy, PLAYER_ONE, PLAYER_FOUR);
render_kart_particle_on_screen_four(gPlayerOne, PLAYER_ONE, PLAYER_FOUR);
render_kart_particle_on_screen_four(gPlayerTwo, PLAYER_TWO, PLAYER_FOUR);
render_kart_particle_on_screen_four(gPlayerThree, PLAYER_THREE, PLAYER_FOUR);
render_kart_particle_on_screen_four(gPlayerFour, PLAYER_FOUR, PLAYER_FOUR);
} else {
render_kart_particle_on_screen_four(gPlayerOneCopy, PLAYER_ONE, PLAYER_FOUR);
render_kart_particle_on_screen_four(gPlayerOne, PLAYER_ONE, PLAYER_FOUR);
render_kart_particle_on_screen_four(gPlayerTwo, PLAYER_TWO, PLAYER_FOUR);
render_kart_particle_on_screen_four(gPlayerThree, PLAYER_THREE, PLAYER_FOUR);
render_kart_particle_on_screen_four(gPlayerFour, PLAYER_FOUR, PLAYER_FOUR);
@@ -841,7 +841,7 @@ void render_players_on_screen_four(void) {
}
void func_80021B0C(void) {
func_8006E7CC(gPlayerOneCopy, 0, 0);
func_8006E7CC(gPlayerOne, 0, 0);
func_8006E7CC(gPlayerTwo, 1, 0);
func_8006E7CC(gPlayerThree, 2, 0);
func_8006E7CC(gPlayerFour, 3, 0);
@@ -868,7 +868,7 @@ void func_80021B0C(void) {
}
void func_80021C78(void) {
func_8006E848(gPlayerOneCopy, 0, 1);
func_8006E848(gPlayerOne, 0, 1);
func_8006E848(gPlayerTwo, 1, 1);
func_8006E848(gPlayerThree, 2, 1);
func_8006E848(gPlayerFour, 3, 1);
@@ -881,14 +881,14 @@ void func_80021C78(void) {
}
void func_80021D40(void) {
func_8006E8C4(gPlayerOneCopy, 0, 2);
func_8006E8C4(gPlayerOne, 0, 2);
func_8006E8C4(gPlayerTwo, 1, 2);
func_8006E8C4(gPlayerThree, 2, 2);
func_8006E8C4(gPlayerFour, 3, 2);
}
void func_80021DA8(void) {
func_8006E940(gPlayerOneCopy, 0, 3);
func_8006E940(gPlayerOne, 0, 3);
func_8006E940(gPlayerTwo, 1, 3);
func_8006E940(gPlayerThree, 2, 3);
func_8006E940(gPlayerFour, 3, 3);
+19 -19
View File
@@ -479,11 +479,11 @@ void func_80039AE4(void) {
void func_80039DA4(void) {
s32 i;
s32 sp2C[] = {
static const s32 sp2C[] = {
7, 6, 5, 4, 3, 2, 1, 0,
};
s32 spC[] = {
static const s32 spC[] = {
0, 1, 2, 3, 4, 5, 6, 7,
};
@@ -531,7 +531,7 @@ void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) {
D_8016556E = 0;
if (gDemoMode == 1) {
spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f,
spawn_player(gPlayerOne, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f,
gCharacterSelections[0], PLAYER_HUMAN_AND_CPU);
spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]], arg2, 32768.0f, chooseCPUPlayers[0],
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
@@ -552,7 +552,7 @@ void spawn_players_gp_one_player(f32* arg0, f32* arg1, f32 arg2) {
if (gNetwork.enabled) {
spawn_network_players(arg0, arg1, arg2);
} else {
spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]] + 250.0f, arg2, 32768.0f,
spawn_player(gPlayerOne, 0, arg0[D_80165270[0]], arg1[D_80165270[0]] + 250.0f, arg2, 32768.0f,
gCharacterSelections[0],
PLAYER_EXISTS | PLAYER_STAGING | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
spawn_player(gPlayerTwo, 1, arg0[D_80165270[1]], arg1[D_80165270[1]] + 250.0f, arg2, 32768.0f,
@@ -587,14 +587,14 @@ void spawn_players_versus_one_player(f32* arg0, f32* arg1, f32 arg2) {
spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0],
PLAYER_START_SEQUENCE | PLAYER_CPU);
if (gDemoMode == 1) {
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
PLAYER_HUMAN_AND_CPU);
spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
PLAYER_START_SEQUENCE | PLAYER_CPU);
spawn_player(gPlayerThree, 2, arg0[1], arg1[1], arg2, 32768.0f, gCharacterSelections[0],
PLAYER_START_SEQUENCE | PLAYER_CPU);
} else if (D_8015F890 != 1) {
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
if (D_80162DD4 == 0) {
spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE0,
@@ -611,7 +611,7 @@ void spawn_players_versus_one_player(f32* arg0, f32* arg1, f32 arg2) {
PLAYER_START_SEQUENCE | PLAYER_CPU);
}
} else {
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE8,
spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE8,
PLAYER_EXISTS | PLAYER_HUMAN | PLAYER_START_SEQUENCE | PLAYER_INVISIBLE_OR_BOMB);
if (D_80162DD8 == 0) {
spawn_player(gPlayerTwo, 1, arg0[0], arg1[0], arg2, 32768.0f, D_80162DE0,
@@ -675,10 +675,10 @@ void spawn_players_gp_two_player(f32* arg0, f32* arg1, f32 arg2) {
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
if (gDemoMode == 1) {
spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f,
spawn_player(gPlayerOne, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f,
gCharacterSelections[0], PLAYER_HUMAN_AND_CPU);
} else {
spawn_player(gPlayerOneCopy, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f,
spawn_player(gPlayerOne, 0, arg0[D_80165270[0]], arg1[D_80165270[0]], arg2, 32768.0f,
gCharacterSelections[0], PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
}
if (gDemoMode == 1) {
@@ -707,10 +707,10 @@ void spawn_players_versus_two_player(f32* arg0, f32* arg1, f32 arg2) {
spawn_player(gPlayerEight, 7, arg0[6], arg1[6], arg2, 32768.0f, gCharacterSelections[0],
PLAYER_START_SEQUENCE | PLAYER_CPU);
if (gDemoMode == 1) {
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
PLAYER_HUMAN_AND_CPU);
} else {
spawn_player(gPlayerOneCopy, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
spawn_player(gPlayerOne, 0, arg0[0], arg1[0], arg2, 32768.0f, gCharacterSelections[0],
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
}
if (gDemoMode == 1) {
@@ -1112,7 +1112,7 @@ void func_8003C0F0(void) {
D_80165230[5] = 130.0f;
D_80165230[6] = 150.0f;
D_80165230[7] = 170.0f;
spawn_player(gPlayerOneCopy, 0, D_80165210[0], D_80165230[0], sp5A, 32768.0f, gCharacterSelections[0],
spawn_player(gPlayerOne, 0, D_80165210[0], D_80165230[0], sp5A, 32768.0f, gCharacterSelections[0],
PLAYER_EXISTS | PLAYER_START_SEQUENCE | PLAYER_HUMAN);
spawn_player(gPlayerTwo, 1, D_80165210[1], D_80165230[1], sp5A, 32768.0f, 1,
PLAYER_EXISTS | PLAYER_CPU | PLAYER_START_SEQUENCE);
@@ -1283,7 +1283,7 @@ void func_8003D080(void) {
switch (gActiveScreenMode) {
case SCREEN_MODE_1P:
func_8003CD98(gPlayerOneCopy, camera1, 0, 0); // sic
func_8003CD98(gPlayerOne, camera1, 0, 0); // sic
func_8003CD98(gPlayerTwo, camera1, 1, 0);
func_8003CD98(gPlayerThree, camera1, 2, 0);
func_8003CD98(gPlayerFour, camera1, 3, 0);
@@ -1295,7 +1295,7 @@ void func_8003D080(void) {
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL:
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
func_8003CD98(gPlayerOneCopy, camera1, 0, 0);
func_8003CD98(gPlayerOne, camera1, 0, 0);
func_8003CD98(gPlayerTwo, camera1, 1, 0);
func_8003CD98(gPlayerThree, camera1, 2, 0);
func_8003CD98(gPlayerFour, camera1, 3, 0);
@@ -1303,7 +1303,7 @@ void func_8003D080(void) {
func_8003CD98(gPlayerSix, camera1, 5, 0);
func_8003CD98(gPlayerSeven, camera1, 6, 0);
func_8003CD98(gPlayerEight, camera1, 7, 0);
func_8003CD98(gPlayerOneCopy, camera2, 0, 1);
func_8003CD98(gPlayerOne, camera2, 0, 1);
func_8003CD98(gPlayerTwo, camera2, 1, 1);
func_8003CD98(gPlayerThree, camera2, 2, 1);
func_8003CD98(gPlayerFour, camera2, 3, 1);
@@ -1314,19 +1314,19 @@ void func_8003D080(void) {
break;
case SCREEN_MODE_3P_4P_SPLITSCREEN:
func_8003CD98(gPlayerOneCopy, camera1, 0, 0);
func_8003CD98(gPlayerOne, camera1, 0, 0);
func_8003CD98(gPlayerTwo, camera1, 1, 0);
func_8003CD98(gPlayerThree, camera1, 2, 0);
func_8003CD98(gPlayerFour, camera1, 3, 0);
func_8003CD98(gPlayerOneCopy, camera2, 0, 1);
func_8003CD98(gPlayerOne, camera2, 0, 1);
func_8003CD98(gPlayerTwo, camera2, 1, 1);
func_8003CD98(gPlayerThree, camera2, 2, 1);
func_8003CD98(gPlayerFour, camera2, 3, 1);
func_8003CD98(gPlayerOneCopy, camera3, 0, 2);
func_8003CD98(gPlayerOne, camera3, 0, 2);
func_8003CD98(gPlayerTwo, camera3, 1, 2);
func_8003CD98(gPlayerThree, camera3, 2, 2);
func_8003CD98(gPlayerFour, camera3, 3, 2);
func_8003CD98(gPlayerOneCopy, camera4, 0, 3);
func_8003CD98(gPlayerOne, camera4, 0, 3);
func_8003CD98(gPlayerTwo, camera4, 1, 3);
func_8003CD98(gPlayerThree, camera4, 2, 3);
func_8003CD98(gPlayerFour, camera4, 3, 3);
+4 -4
View File
@@ -2349,13 +2349,13 @@ void func_80078288(s32 objectIndex) {
break;
case 1:
if (gGamestate != 9) {
sp3A = ((gPlayerOneCopy->speed / 18) * 216) / 2;
sp3A = ((gPlayerOne->speed / 18) * 216) / 2;
sp3E = (random_int(0x000FU) - sp3A) + 0x2D;
sp3C = random_int(0x012CU) + 0x1E;
temp_t6 = camera1->rot[1] + ((s32) (random_int(0x3000U) - 0x1800) / (s16) ((sp3A / 15) + 1));
gObjectList[objectIndex].origin_pos[0] = gPlayerOneCopy->pos[0] + (sins(temp_t6) * sp3C);
gObjectList[objectIndex].origin_pos[1] = sp3E + gPlayerOneCopy->unk_074;
gObjectList[objectIndex].origin_pos[2] = gPlayerOneCopy->pos[2] + (coss(temp_t6) * sp3C);
gObjectList[objectIndex].origin_pos[0] = gPlayerOne->pos[0] + (sins(temp_t6) * sp3C);
gObjectList[objectIndex].origin_pos[1] = sp3E + gPlayerOne->unk_074;
gObjectList[objectIndex].origin_pos[2] = gPlayerOne->pos[2] + (coss(temp_t6) * sp3C);
gObjectList[objectIndex].unk_0C4 = random_int(0x0400U) + 0x100;
gObjectList[objectIndex].unk_01C[0] = (f32) (((f32) random_int(0x0064U) * 0.03) + 2.0);
gObjectList[objectIndex].velocity[1] = (f32) (-0.3 - (f64) (f32) (random_int(0x0032U) * 0.01));