diff options
| author | V10lator <v10lator@myway.de> | 2025-07-09 20:06:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-09 12:06:08 -0600 |
| commit | d175f5ef243c16fed27730d5c89eb709dcfc4d5a (patch) | |
| tree | cfd7d18c7dec274c214714213e5fcd23bdeab020 /src/main.c | |
| parent | 98d660b825d4c1258243efb6474953ae8e38a268 (diff) | |
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>
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/main.c b/src/main.c index 0db07e4e0..7c5f15e91 100644 --- a/src/main.c +++ b/src/main.c @@ -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; } |
