From d175f5ef243c16fed27730d5c89eb709dcfc4d5a Mon Sep 17 00:00:00 2001 From: V10lator Date: Wed, 9 Jul 2025 20:06:08 +0200 Subject: Small, random optimisations (#363) * Remove useless player pointer copies Signed-off-by: Thomas Rohloff * Fix target FPS Signed-off-by: Thomas Rohloff * Add else Signed-off-by: Thomas Rohloff * Remove useless addition Signed-off-by: Thomas Rohloff * Simplify func_8001CA24(Player* player, f32 arg1) Signed-off-by: Thomas Rohloff * Simplify a few more functions Signed-off-by: Thomas Rohloff * Make 2 arrays static const Signed-off-by: Thomas Rohloff --------- Signed-off-by: Thomas Rohloff Co-authored-by: MegaMech --- src/update_objects.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/update_objects.c') diff --git a/src/update_objects.c b/src/update_objects.c index 02f7d15e4..5b2758466 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -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)); -- cgit v1.2.3