summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcoco875 <59367621+coco875@users.noreply.github.com>2024-01-17 23:10:26 +0100
committerGitHub <noreply@github.com>2024-01-17 15:10:26 -0700
commit6716570e2a5cc93053b7017e618d08d9b3459214 (patch)
treefb39e47d1227b778c8812ee9bd1fbadb5ed67121 /src
parent7fd1bd2edf3e63a4b3f5f5df3cca324dbc099e37 (diff)
Rename some Object related function and property (#531)
* rename some variables
Diffstat (limited to 'src')
-rw-r--r--src/code_80057C60.c118
-rw-r--r--src/code_80057C60.h24
-rw-r--r--src/code_80057C60_var.c2
-rw-r--r--src/code_8006E9C0.c114
-rw-r--r--src/code_80071F00.c1318
-rw-r--r--src/code_80071F00.h22
-rw-r--r--src/code_80086E70.c246
-rw-r--r--src/code_80086E70.h12
-rw-r--r--src/hud_renderer.c246
-rw-r--r--src/math_util_2.c66
10 files changed, 1086 insertions, 1082 deletions
diff --git a/src/code_80057C60.c b/src/code_80057C60.c
index af5725b25..18e770bbe 100644
--- a/src/code_80057C60.c
+++ b/src/code_80057C60.c
@@ -232,25 +232,25 @@ Mtx D_80183D60;
s32 D_80183DA0;
f32 D_80183DA8[4];
//! Lakitu?
-s32 D_80183DB8[4];
+s32 gIndexLakituList[4];
f32 D_80183DC8[4];
//! Indexes for the objects associated with the Bomb Karts
s32 D_80183DD8[NUM_BOMB_KARTS_MAX];
UNUSED s32 D_80183DF8[16];
-//! Next free spot in D_8018C1B0? Wraps back around to 0 if it gets bigger than D_8018C1B0_SIZE
-s32 D_80183E38;
+//! Next free spot in gObjectParticle1? Wraps back around to 0 if it gets bigger than gObjectParticle1_SIZE
+s32 gNextFreeObjectParticle1;
Vec3f D_80183E40;
-//! Next free spot in D_8018C3F0? Wraps back around to 0 if it gets bigger than D_8018C3F0_SIZE
-s32 D_80183E4C;
+//! Next free spot in gObjectParticle2? Wraps back around to 0 if it gets bigger than gObjectParticle2_SIZE
+s32 gNextFreeObjectParticle2;
Vec3f D_80183E50;
-//! Next free spot in D_8018C630?
-s32 D_80183E5C;
+//! Next free spot in gObjectParticle3?
+s32 gNextFreeObjectParticle3;
UNUSED s32 D_80183E60[3];
-//! Next free spot in D_8018C870? Wraps back around to 0 if it gets bigger than D_8018C870_SIZE
-s32 D_80183E6C;
+//! Next free spot in gObjectParticle4? Wraps back around to 0 if it gets bigger than gObjectParticle4_SIZE
+s32 gNextFreeObjectParticle4;
Vec3f D_80183E70;
-//! Next free spot in D_8018C970? Wraps back around to 0 if it gets bigger than D_8018C970_SIZE
-s32 D_80183E7C;
+//! Next free spot in gLeafParticle? Wraps back around to 0 if it gets bigger than gLeafParticle_SIZE
+s32 gNextFreeLeafParticle;
Vec3su D_80183E80;
//! Appears to be a list of object list indices for the Item Window part of the HUD
s32 gItemWindowObjectByPlayerId[4];
@@ -303,32 +303,32 @@ Collision D_8018C0B0[4];
* Segments of the fire breath from the statues in Bowser's Castle
* Potentially other things
*/
-s32 D_8018C1B0[D_8018C3F0_SIZE];
+s32 gObjectParticle1[gObjectParticle2_SIZE];
Collision D_8018C3B0;
/**
* List of object list indices used for:
* Bats in Banshee's Boardwalk (but only 1 player mode?)
*/
-s32 D_8018C3F0[D_8018C3F0_SIZE];
+s32 gObjectParticle2[gObjectParticle2_SIZE];
// Maybe some unused Collision?
UNUSED Collision D_8018C5F0;
-s32 D_8018C630[D_8018C630_SIZE];
+s32 gObjectParticle3[gObjectParticle3_SIZE];
Collision D_8018C830;
/**
* List of object list indices. Used both for the fires in the DK Jungle cave
* and, seemingly for the trail that shells leave behind them.
* I think they're using the same texture, which would explain the dual use
*/
-s32 D_8018C870[D_8018C870_SIZE];
+s32 gObjectParticle4[gObjectParticle4_SIZE];
/**
* Seemingly a list of object list indices used for the leaves that sometimes fall
* trees when you bonk into them
*/
-s32 D_8018C970[D_8018C970_SIZE];
+s32 gLeafParticle[gLeafParticle_SIZE];
hud_player playerHUD[4];
/**
* List of object list indices used by the clouds and stars in some stages
- * Also used for snowflakes like D_8018C1B0? Not sure what's up with that
+ * Also used for snowflakes like gObjectParticle1? Not sure what's up with that
*/
s32 D_8018CC80[D_8018CC80_SIZE];
struct_D_8018CE10 D_8018CE10[8];
@@ -699,7 +699,7 @@ void func_8005884C(void) {
func_80058B58(3);
}
-void func_800588F4(s32 arg0) {
+void func_800588F4(s32 cameraId) {
switch (gCurrentCourseId) {
case COURSE_MARIO_RACEWAY:
@@ -707,68 +707,68 @@ void func_800588F4(s32 arg0) {
case COURSE_CHOCO_MOUNTAIN:
break;
case COURSE_BOWSER_CASTLE:
- func_80053870(arg0);
- func_80054664(arg0);
+ func_80053870(cameraId);
+ func_80054664(cameraId);
break;
case COURSE_BANSHEE_BOARDWALK:
if (gGamestate != CREDITS_SEQUENCE) {
- func_800527D8(arg0);
- func_80052590(arg0);
- func_8005217C(arg0);
- func_800524B4(arg0);
+ func_800527D8(cameraId);
+ func_80052590(cameraId);
+ func_8005217C(cameraId);
+ func_800524B4(cameraId);
}
break;
case COURSE_YOSHI_VALLEY:
- func_80055228(arg0);
+ func_80055228(cameraId);
if (gGamestate != CREDITS_SEQUENCE) {
- func_8005568C(arg0);
+ func_8005568C(cameraId);
}
break;
case COURSE_FRAPPE_SNOWLAND:
if (gGamestate != CREDITS_SEQUENCE) {
- func_8005327C(arg0);
+ func_8005327C(cameraId);
}
break;
case COURSE_KOOPA_BEACH:
if (gGamestate != CREDITS_SEQUENCE) {
- func_80055528(arg0);
+ func_80055528(cameraId);
}
if (gGamestate != CREDITS_SEQUENCE) {
if ((gPlayerCount == 1) || (gPlayerCount == 2)) {
- func_80055380(arg0);
+ func_80055380(cameraId);
}
} else {
- func_80055380(arg0);
+ func_80055380(cameraId);
}
break;
case COURSE_ROYAL_RACEWAY:
break;
case COURSE_LUIGI_RACEWAY:
if (D_80165898 != 0) {
- func_80055E68(arg0);
+ func_80055E68(cameraId);
}
break;
case COURSE_MOO_MOO_FARM:
if (gGamestate != CREDITS_SEQUENCE) {
- func_800550A4(arg0);
+ func_800550A4(cameraId);
}
break;
case COURSE_TOADS_TURNPIKE:
break;
case COURSE_KALAMARI_DESERT:
- func_800541BC(arg0);
+ func_800541BC(cameraId);
break;
case COURSE_SHERBET_LAND:
if (gGamestate != CREDITS_SEQUENCE) {
- func_80052E30(arg0);
+ func_80052E30(cameraId);
}
- func_8005592C(arg0);
+ func_8005592C(cameraId);
break;
case COURSE_RAINBOW_ROAD:
if (gGamestate != CREDITS_SEQUENCE) {
- func_80056188(arg0);
- func_80055C38(arg0);
+ func_80056188(cameraId);
+ func_80055C38(cameraId);
}
break;
case COURSE_WARIO_STADIUM:
@@ -781,19 +781,19 @@ void func_800588F4(s32 arg0) {
break;
case COURSE_DK_JUNGLE:
if (gGamestate != CREDITS_SEQUENCE) {
- func_80054414(arg0);
+ func_80054414(cameraId);
}
break;
}
- func_80054938(arg0);
- func_80051638(arg0);
+ func_80054938(cameraId);
+ func_80051638(cameraId);
if (D_80165730 != 0) {
- func_80053E6C(arg0);
+ func_80053E6C(cameraId);
}
if (gModeSelection == BATTLE) {
- func_80056AC0(arg0);
+ func_80056AC0(cameraId);
}
}
@@ -1247,7 +1247,7 @@ void func_8005995C(void) {
void func_80059A88(s32 playerId) {
func_80059820(playerId);
if (!gDemoMode) {
- func_8007A948(playerId);
+ update_obj_laikitu(playerId);
func_8007BB9C(playerId);
}
}
@@ -1334,7 +1334,7 @@ void func_80059D00(void) {
func_80059820(PLAYER_TWO);
func_80078C70(2);
}
- func_8005A74C();
+ update_obj();
break;
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
randomize_seed_from_controller(PLAYER_ONE);
@@ -1353,7 +1353,7 @@ void func_80059D00(void) {
}
func_80078C70(2);
func_8005D1F4(1);
- func_8005A74C();
+ update_obj();
break;
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL:
randomize_seed_from_controller(PLAYER_ONE);
@@ -1372,7 +1372,7 @@ void func_80059D00(void) {
}
func_80078C70(4);
func_8005D1F4(1);
- func_8005A74C();
+ update_obj();
break;
case SCREEN_MODE_3P_4P_SPLITSCREEN:
randomize_seed_from_controller(PLAYER_ONE);
@@ -1405,7 +1405,7 @@ void func_80059D00(void) {
}
func_8005D1F4(3);
}
- func_8005A74C();
+ update_obj();
break;
}
func_800744CC();
@@ -1427,7 +1427,7 @@ void func_8005A070(void) {
} else if (gGamestate == CREDITS_SEQUENCE) {
func_80059820(PLAYER_ONE);
func_80078C70(0);
- func_8005A74C();
+ update_obj();
} else {
func_80059D00();
}
@@ -1447,10 +1447,10 @@ void func_8005A14C(s32 playerId) {
lapCount = gLapCountByPlayerId[playerId];
if (player->type & PLAYER_EXISTS) {
if (player->effects & 0x204C0) {
- gObjectList[objectIndex].unk_0BE[2] += 0x1000;
+ gObjectList[objectIndex].direction_angle[2] += 0x1000;
} else {
- if (gObjectList[objectIndex].unk_0BE[2] != 0) {
- gObjectList[objectIndex].unk_0BE[2] += 0x1000;
+ if (gObjectList[objectIndex].direction_angle[2] != 0) {
+ gObjectList[objectIndex].direction_angle[2] += 0x1000;
}
}
if (player->effects & LIGHTNING_EFFECT) {
@@ -1459,9 +1459,9 @@ void func_8005A14C(s32 playerId) {
f32_step_towards(&gObjectList[objectIndex].sizeScaling, 0.6f, 0.02f);
}
if (player->effects & 0x04000000) {
- u16_step_up_towards(&gObjectList[objectIndex].unk_0BE[0], 0x0C00U, 0x0100U);
+ u16_step_up_towards(&gObjectList[objectIndex].direction_angle[0], 0x0C00U, 0x0100U);
} else {
- u16_step_down_towards(&gObjectList[objectIndex].unk_0BE[0], 0, 0x00000100);
+ u16_step_down_towards(&gObjectList[objectIndex].direction_angle[0], 0, 0x00000100);
}
if (player->effects & 0x03000000) {
func_80087D24(objectIndex, 6.0f, 1.5f, 0.0f);
@@ -1474,9 +1474,9 @@ void func_8005A14C(s32 playerId) {
gObjectList[objectIndex].unk_0A0 = 0x00FF;
}
if (lapCount >= 3) {
- gObjectList[objectIndex].unk_0BE[2] = 0;
- gObjectList[objectIndex].unk_0BE[1] = 0;
- gObjectList[objectIndex].unk_0BE[0] = 0;
+ gObjectList[objectIndex].direction_angle[2] = 0;
+ gObjectList[objectIndex].direction_angle[1] = 0;
+ gObjectList[objectIndex].direction_angle[0] = 0;
gObjectList[objectIndex].unk_028[2] = 0.0f;
gObjectList[objectIndex].unk_028[1] = 0.0f;
gObjectList[objectIndex].unk_028[0] = 0.0f;
@@ -1576,14 +1576,14 @@ void func_8005A71C(void) {
}
}
-void func_8005A74C(void) {
+void update_obj(void) {
switch (gCurrentCourseId) {
case COURSE_MARIO_RACEWAY:
case COURSE_CHOCO_MOUNTAIN:
break;
case COURSE_BOWSER_CASTLE:
func_80081208();
- func_80076B84();
+ update_particle_bowser_castle();
break;
case COURSE_BANSHEE_BOARDWALK:
if (gGamestate != CREDITS_SEQUENCE) {
@@ -1637,7 +1637,7 @@ void func_8005A74C(void) {
break;
case COURSE_RAINBOW_ROAD:
if (gGamestate != CREDITS_SEQUENCE) {
- func_800861E0();
+ update_neon();
func_80085AA8();
}
break;
diff --git a/src/code_80057C60.h b/src/code_80057C60.h
index 1605de574..c07dda3ed 100644
--- a/src/code_80057C60.h
+++ b/src/code_80057C60.h
@@ -77,7 +77,7 @@ void func_8005A14C(s32);
void func_8005A380(void);
void func_8005A3C0(void);
void func_8005A71C(void);
-void func_8005A74C(void);
+void update_obj(void);
void func_8005A99C(void);
void func_8005AA34(void);
void func_8005AA4C(void);
@@ -395,21 +395,21 @@ extern Mtx D_80183D60;
// extern s32 D_80183DA0; -> objects.h
extern f32 D_80183DA8[];
-// extern s32 D_80183DB8[]; -> objects.h
+// extern s32 gIndexLakituList[]; -> objects.h
extern f32 D_80183DC8[];
// extern s32 D_80183DD8[]; -> bomb_kart.h
-// extern s32 D_80183E38; -> objects.h
+// extern s32 gNextFreeObjectParticle1; -> objects.h
extern Vec3f D_80183E40;
-// extern s32 D_80183E4C; -> objects.h
+// extern s32 gNextFreeObjectParticle2; -> objects.h
extern Vec3f D_80183E50;
-// extern s32 D_80183E5C; -> objects.h
-// extern s32 D_80183E6C; -> objects.h
+// extern s32 gNextFreeObjectParticle3; -> objects.h
+// extern s32 gNextFreeObjectParticle4; -> objects.h
extern Vec3f D_80183E70;
-// extern s32 D_80183E7C; -> objects.h
+// extern s32 gNextFreeLeafParticle; -> objects.h
extern Vec3su D_80183E80;
// extern s32 gItemWindowObjectByPlayerId[]; -> objects.h
@@ -424,15 +424,15 @@ extern u8 D_80183FA8[4][0x2000];
extern u8 *D_8018C028;
// extern s32 indexObjectList4[]; -> objects.h
// extern Collision D_8018C0B0[]; -> objects.h
-// extern s32 D_8018C1B0[]; -> objects.h
+// extern s32 gObjectParticle1[]; -> objects.h
extern Collision D_8018C3B0;
-// extern s32 D_8018C3F0[]; -> objects.h
-// extern s32 D_8018C630[]; -> objects.h
+// extern s32 gObjectParticle2[]; -> objects.h
+// extern s32 gObjectParticle3[]; -> objects.h
extern Collision D_8018C830;
-// extern s32 D_8018C870[]; -> objects.h
-// extern s32 D_8018C970[]; -> objects.h
+// extern s32 gObjectParticle4[]; -> objects.h
+// extern s32 gLeafParticle[]; -> objects.h
extern hud_player playerHUD[];
// extern s32 D_8018CC80[]; -> objects.h
diff --git a/src/code_80057C60_var.c b/src/code_80057C60_var.c
index c2a246623..04393db96 100644
--- a/src/code_80057C60_var.c
+++ b/src/code_80057C60_var.c
@@ -141,7 +141,7 @@ s32 D_8018D380;
s32 D_8018D384;
s32 D_8018D388;
UNUSED s32 D_8018D390[11];
-//! Controls number of come object type placed into D_8018C3F0 on Frappe Snowland. So, maybe snowmen/snowflakes?
+//! Controls number of come object type placed into gObjectParticle2 on Frappe Snowland. So, maybe snowmen/snowflakes?
s32 D_8018D3BC;
//! Limit on some object type (ice chips?) in Sherbet Land
s32 D_8018D3C0;
diff --git a/src/code_8006E9C0.c b/src/code_8006E9C0.c
index e33513231..8bb4a5d3a 100644
--- a/src/code_8006E9C0.c
+++ b/src/code_8006E9C0.c
@@ -65,24 +65,24 @@ void reset_object_variable(void) {
void func_8006EB10(void) {
s32 i;
- for (i = 0; i < 128; i++) {
- D_8018C1B0[i] = -1;
+ for (i = 0; i < gObjectParticle1_SIZE; i++) {
+ gObjectParticle1[i] = NULL_OBJECT_ID;
}
- for (i = 0; i < 128; i++) {
- D_8018C3F0[i] = -1;
+ for (i = 0; i < gObjectParticle2_SIZE; i++) {
+ gObjectParticle2[i] = NULL_OBJECT_ID;
}
- for (i = 0; i < 128; i++) {
- D_8018C630[i] = -1;
+ for (i = 0; i < gObjectParticle3_SIZE; i++) {
+ gObjectParticle3[i] = NULL_OBJECT_ID;
}
- for (i = 0; i < 64; i++) {
- D_8018C870[i] = -1;
+ for (i = 0; i < gObjectParticle4_SIZE; i++) {
+ gObjectParticle4[i] = NULL_OBJECT_ID;
}
// Has to be on one line, because IDO hates you :)
- for (i = 0; i < D_8018C970_SIZE; i++) { D_8018C970[i] = -1; }
+ for (i = 0; i < gLeafParticle_SIZE; i++) { gLeafParticle[i] = NULL_OBJECT_ID; }
D_8018CFA8 = 0;
D_8018CF90 = D_8018CFA8;
@@ -112,11 +112,11 @@ void func_8006EB10(void) {
D_8018D070 = D_8018D098;
D_8018D048 = D_8018D070;
D_8018D020 = D_8018D048;
- D_80183E7C = 0;
- D_80183E6C = D_80183E7C;
- D_80183E5C = D_80183E6C;
- D_80183E4C = D_80183E5C;
- D_80183E38 = D_80183E4C;
+ gNextFreeLeafParticle = 0;
+ gNextFreeObjectParticle4 = gNextFreeLeafParticle;
+ gNextFreeObjectParticle3 = gNextFreeObjectParticle4;
+ gNextFreeObjectParticle2 = gNextFreeObjectParticle3;
+ gNextFreeObjectParticle1 = gNextFreeObjectParticle2;
}
void clear_object_list() {
@@ -710,7 +710,7 @@ void func_80070250(s32 objectIndex, s32 arg1, StarSpawn *arg2) {
temp_v0 = &gObjectList[objectIndex];
temp_v0->unk_0D5 = arg2->id;
temp_v0->currentItem = ITEM_NONE;
- temp_v0->unk_0BE[1] = arg2->pos[0];
+ temp_v0->direction_angle[1] = arg2->pos[0];
temp_v0->unk_09E = arg2->pos[1];
temp_v0->sizeScaling = (f32) arg2->pos[2] / 100.0;
temp_v0->activeTexture = &D_8018D220[arg2->id];
@@ -753,7 +753,7 @@ void func_800703E0(s32 objectIndex, s32 arg1, StarSpawn *arg2) {
temp_v0 = &gObjectList[objectIndex];
temp_v0->unk_0D5 = arg2->id; // No idea, all 0's for stars
temp_v0->currentItem = ITEM_BANANA;
- temp_v0->unk_0BE[1] = arg2->pos[0]; // No idea
+ temp_v0->direction_angle[1] = arg2->pos[0]; // No idea
temp_v0->unk_09E = arg2->pos[1]; // screen Y position
temp_v0->sizeScaling = (f32)arg2->pos[2] / 100.0; // some type of scaling on the texture
temp_v0->activeTexture = D_0D0293D8;
@@ -852,8 +852,8 @@ void init_course_object(void) {
func_80070714();
}
for (i = 0; i < D_80165738; i++) {
- find_unused_obj_index(&D_8018C630[i]);
- init_object(D_8018C630[i], 0);
+ find_unused_obj_index(&gObjectParticle3[i]);
+ init_object(gObjectParticle3[i], 0);
}
}
break;
@@ -876,8 +876,8 @@ void init_course_object(void) {
for (i = 0; i < gNumActiveThwomps; i++) {
objectId = indexObjectList1[i];
init_object(objectId, 0);
- gObjectList[objectId].unk_010[0] = gThowmpSpawnList[i].startX * xOrientation;
- gObjectList[objectId].unk_010[2] = gThowmpSpawnList[i].startZ;
+ gObjectList[objectId].origin_pos[0] = gThowmpSpawnList[i].startX * xOrientation;
+ gObjectList[objectId].origin_pos[2] = gThowmpSpawnList[i].startZ;
gObjectList[objectId].unk_0D5 = gThowmpSpawnList[i].unk_4;
gObjectList[objectId].unk_0A0 = gThowmpSpawnList[i].unk_6;
}
@@ -894,9 +894,9 @@ void init_course_object(void) {
gObjectList[objectId].pos[0] = gFireBreathsSpawns[i][0] * xOrientation;
gObjectList[objectId].pos[1] = gFireBreathsSpawns[i][1];
gObjectList[objectId].pos[2] = gFireBreathsSpawns[i][2];
- gObjectList[objectId].unk_0BE[1] = 0;
+ gObjectList[objectId].direction_angle[1] = 0;
if (i % 2U) {
- gObjectList[objectId].unk_0BE[1] += 0x8000;
+ gObjectList[objectId].direction_angle[1] += 0x8000;
}
}
for (i = 0; i < 32; i++) {
@@ -907,9 +907,9 @@ void init_course_object(void) {
if (gGamestate != 9) {
objectId = indexObjectList1[0];
init_texture_object(objectId, d_course_banshee_boardwalk_bat_tlut, *d_course_banshee_boardwalk_bat, 0x20U, (u16) 0x00000040);
- gObjectList[objectId].unk_0B2[0] = 0;
- gObjectList[objectId].unk_0B2[1] = 0;
- gObjectList[objectId].unk_0B2[2] = 0x8000;
+ gObjectList[objectId].orientation[0] = 0;
+ gObjectList[objectId].orientation[1] = 0;
+ gObjectList[objectId].orientation[2] = 0x8000;
init_object(indexObjectList1[1], 0);
init_object(indexObjectList1[2], 0);
}
@@ -922,9 +922,9 @@ void init_course_object(void) {
for (i = 0; i < NUM_HEDGEHOGS; i++) {
objectId = indexObjectList2[i];
init_object(objectId, 0);
- gObjectList[objectId].pos[0] = gObjectList[objectId].unk_010[0] = gHedgehogSpawns[i].pos[0] * xOrientation;
+ gObjectList[objectId].pos[0] = gObjectList[objectId].origin_pos[0] = gHedgehogSpawns[i].pos[0] * xOrientation;
gObjectList[objectId].pos[1] = gObjectList[objectId].unk_044 = gHedgehogSpawns[i].pos[1] + 6.0;
- gObjectList[objectId].pos[2] = gObjectList[objectId].unk_010[2] = gHedgehogSpawns[i].pos[2];
+ gObjectList[objectId].pos[2] = gObjectList[objectId].origin_pos[2] = gHedgehogSpawns[i].pos[2];
gObjectList[objectId].unk_0D5 = gHedgehogSpawns[i].unk_06;
gObjectList[objectId].unk_09C = gHedgehogPatrolPoints[i][0] * xOrientation;
gObjectList[objectId].unk_09E = gHedgehogPatrolPoints[i][2];
@@ -933,20 +933,20 @@ void init_course_object(void) {
break;
case COURSE_FRAPPE_SNOWLAND:
for (i = 0; i < NUM_SNOWFLAKES; i++) {
- find_unused_obj_index(&D_8018C1B0[i]);
+ find_unused_obj_index(&gObjectParticle1[i]);
}
if (gGamestate != 9) {
for (i = 0; i < NUM_SNOWMEN; i++) {
objectId = indexObjectList2[i];
init_object(objectId, 0);
- gObjectList[objectId].unk_010[0] = gSnowmanSpawns[i].pos[0] * xOrientation;
- gObjectList[objectId].unk_010[1] = gSnowmanSpawns[i].pos[1] + 5.0 + 3.0;
- gObjectList[objectId].unk_010[2] = gSnowmanSpawns[i].pos[2];
+ gObjectList[objectId].origin_pos[0] = gSnowmanSpawns[i].pos[0] * xOrientation;
+ gObjectList[objectId].origin_pos[1] = gSnowmanSpawns[i].pos[1] + 5.0 + 3.0;
+ gObjectList[objectId].origin_pos[2] = gSnowmanSpawns[i].pos[2];
objectId = indexObjectList1[i];
init_object(objectId, 0);
- gObjectList[objectId].unk_010[0] = gSnowmanSpawns[i].pos[0] * xOrientation;
- gObjectList[objectId].unk_010[1] = gSnowmanSpawns[i].pos[1] + 3.0;
- gObjectList[objectId].unk_010[2] = gSnowmanSpawns[i].pos[2];
+ gObjectList[objectId].origin_pos[0] = gSnowmanSpawns[i].pos[0] * xOrientation;
+ gObjectList[objectId].origin_pos[1] = gSnowmanSpawns[i].pos[1] + 3.0;
+ gObjectList[objectId].origin_pos[2] = gSnowmanSpawns[i].pos[2];
gObjectList[objectId].unk_0D5 = gSnowmanSpawns[i].unk_6;
}
}
@@ -956,10 +956,10 @@ void init_course_object(void) {
for (i = 0; i < NUM_CRABS; i++) {
objectId = indexObjectList1[i];
init_object(objectId, 0);
- gObjectList[objectId].pos[0] = gObjectList[objectId].unk_010[0] = gCrabSpawns[i].startX * xOrientation;
+ gObjectList[objectId].pos[0] = gObjectList[objectId].origin_pos[0] = gCrabSpawns[i].startX * xOrientation;
gObjectList[objectId].unk_01C[0] = gCrabSpawns[i].patrolX * xOrientation;
- gObjectList[objectId].pos[2] = gObjectList[objectId].unk_010[2] = gCrabSpawns[i].startZ;
+ gObjectList[objectId].pos[2] = gObjectList[objectId].origin_pos[2] = gCrabSpawns[i].startZ;
gObjectList[objectId].unk_01C[2] = gCrabSpawns[i].patrolZ;
}
}
@@ -979,8 +979,8 @@ void init_course_object(void) {
func_80070714();
}
for (i = 0; i < D_80165738; i++) {
- find_unused_obj_index(&D_8018C630[i]);
- init_object(D_8018C630[i], 0);
+ find_unused_obj_index(&gObjectParticle3[i]);
+ init_object(gObjectParticle3[i], 0);
}
}
break;
@@ -992,8 +992,8 @@ void init_course_object(void) {
D_80165898 = 0;
init_object(indexObjectList1[0], 0);
for (i = 0; i < D_80165738; i++) {
- find_unused_obj_index(&D_8018C630[i]);
- init_object(D_8018C630[i], 0);
+ find_unused_obj_index(&gObjectParticle3[i]);
+ init_object(gObjectParticle3[i], 0);
}
}
break;
@@ -1040,16 +1040,16 @@ void init_course_object(void) {
find_unused_obj_index(&indexObjectList1[i]);
}
for (i = 0; i < NUM_MAX_MOLES; i++) {
- find_unused_obj_index(&D_8018C1B0[i]);
- objectId = D_8018C1B0[i];
+ find_unused_obj_index(&gObjectParticle1[i]);
+ objectId = gObjectParticle1[i];
init_object(objectId, 0);
gObjectList[objectId].pos[0] = gMoleSpawns[i][0] * xOrientation;
gObjectList[objectId].pos[2] = gMoleSpawns[i][2];
func_800887C0(objectId);
gObjectList[objectId].sizeScaling = 0.7f;
}
- for (i = 0; i < D_8018C3F0_SIZE; i++) {
- find_unused_obj_index(&D_8018C3F0[i]);
+ for (i = 0; i < gObjectParticle2_SIZE; i++) {
+ find_unused_obj_index(&gObjectParticle2[i]);
}
}
break;
@@ -1058,13 +1058,13 @@ void init_course_object(void) {
find_unused_obj_index(&D_8018CF10);
init_object(D_8018CF10, 0);
for (i = 0; i < 50; i++) {
- find_unused_obj_index(&D_8018C1B0[i]);
+ find_unused_obj_index(&gObjectParticle1[i]);
}
for (i = 0; i < 5; i++) {
- find_unused_obj_index(&D_8018C3F0[i]);
+ find_unused_obj_index(&gObjectParticle2[i]);
}
for (i = 0; i < 32; i++) {
- find_unused_obj_index(&D_8018C630[i]);
+ find_unused_obj_index(&gObjectParticle3[i]);
}
}
break;
@@ -1106,8 +1106,8 @@ void init_hud_one_player(void) {
D_8018D150 = 0;
D_8018CFCC = 1.0f;
find_unused_obj_index(&D_80183DA0);
- find_unused_obj_index(&D_80183DB8[0]);
- find_unused_obj_index(&D_80183DB8[1]);
+ find_unused_obj_index(&gIndexLakituList[0]);
+ find_unused_obj_index(&gIndexLakituList[1]);
find_unused_obj_index(&gItemWindowObjectByPlayerId[0]);
find_unused_obj_index(&gItemWindowObjectByPlayerId[1]);
init_object_list_index();
@@ -1185,8 +1185,8 @@ void init_hud_one_player(void) {
void init_hud_two_player_vertical(void) {
find_unused_obj_index(&D_80183DA0);
- find_unused_obj_index(&D_80183DB8[0]);
- find_unused_obj_index(&D_80183DB8[1]);
+ find_unused_obj_index(&gIndexLakituList[0]);
+ find_unused_obj_index(&gIndexLakituList[1]);
find_unused_obj_index(&gItemWindowObjectByPlayerId[0]);
find_unused_obj_index(&gItemWindowObjectByPlayerId[1]);
@@ -1255,8 +1255,8 @@ void init_hud_two_player_vertical(void) {
void init_hud_two_player_horizontal() {
find_unused_obj_index(&D_80183DA0);
- find_unused_obj_index(&D_80183DB8[0]);
- find_unused_obj_index(&D_80183DB8[1]);
+ find_unused_obj_index(&gIndexLakituList[0]);
+ find_unused_obj_index(&gIndexLakituList[1]);
find_unused_obj_index(&gItemWindowObjectByPlayerId[0]);
find_unused_obj_index(&gItemWindowObjectByPlayerId[1]);
@@ -1331,10 +1331,10 @@ void init_hud_two_player_horizontal() {
void init_hud_three_four_player(void) {
find_unused_obj_index(&D_80183DA0);
- find_unused_obj_index(&D_80183DB8[0]);
- find_unused_obj_index(&D_80183DB8[1]);
- find_unused_obj_index(&D_80183DB8[2]);
- find_unused_obj_index(&D_80183DB8[3]);
+ find_unused_obj_index(&gIndexLakituList[0]);
+ find_unused_obj_index(&gIndexLakituList[1]);
+ find_unused_obj_index(&gIndexLakituList[2]);
+ find_unused_obj_index(&gIndexLakituList[3]);
find_unused_obj_index(&gItemWindowObjectByPlayerId[0]);
find_unused_obj_index(&gItemWindowObjectByPlayerId[1]);
diff --git a/src/code_80071F00.c b/src/code_80071F00.c
index e5e32542f..77354e184 100644
--- a/src/code_80071F00.c
+++ b/src/code_80071F00.c
@@ -121,7 +121,7 @@ s32 find_unused_obj_index(s32* arg0) {
void delete_object(s32 *objectIndex) {
func_80072428(*objectIndex);
gObjectList[*objectIndex].unk_0CA = 0;
- *objectIndex = -1;
+ *objectIndex = NULL_OBJECT_ID;
}
s32 func_80071FBC(void) {
@@ -135,42 +135,42 @@ s32 func_80071FBC(void) {
return someCount;
}
-s32 func_80072044(s32 *arg0, s32 *arg1, s32 arg2) {
- s32 var_v1;
- s32 temp_v0;
- s32 *var_a0_2;
+s32 add_unused_obj_index(s32 *listIdx, s32 *nextFree, s32 size) {
+ s32 count;
+ s32 objectIndex;
+ s32 *id;
- if (*arg1 >= arg2) {
- *arg1 = 0;
+ if (*nextFree >= size) {
+ *nextFree = 0;
}
- var_v1 = 0;
- var_a0_2 = &arg0[*arg1];
- /*
- * This HAS to be a for-loop of some variety, but I can't make a for-loop to match.
- * If you replace this with ```for(var_v1 = 0; var_v1 < arg2; var_v1++)```
+ count = 0;
+ id = &listIdx[*nextFree];
+ /**
+ * @todo This HAS to be a for-loop of some variety, but I can't make a for-loop to match.
+ * If you replace this with ```for(var_v1 = 0; var_v1 < size; var_v1++)```
* The diff gets massive.
*/
- if (arg2 > 0) {
+ if (size > 0) {
loop_3:
- if (*var_a0_2 == -1) {
- temp_v0 = find_unused_obj_index(var_a0_2);
- *arg1 += 1;
+ if (*id == NULL_OBJECT_ID) {
+ objectIndex = find_unused_obj_index(id);
+ *nextFree += 1;
} else {
- *arg1 += 1;
- if (*arg1 >= arg2) {
- *arg1 = 0;
+ *nextFree += 1;
+ if (*nextFree >= size) {
+ *nextFree = 0;
}
- var_v1 += 1;
- var_a0_2 = &arg0[*arg1];
- if (var_v1 != arg2) {
+ count += 1;
+ id = &listIdx[*nextFree];
+ if (count != size) { // check if don't check all element of the list
goto loop_3;
}
}
}
- if (var_v1 == arg2) {
- temp_v0 = -1;
+ if (count == size) {
+ objectIndex = NULL_OBJECT_ID;
}
- return temp_v0;
+ return objectIndex;
}
void delete_object_wrapper(s32 *arg0) {
@@ -750,9 +750,9 @@ UNUSED void func_8007348C(s32 objectIndex, u8 *arg1, u8 arg2, u8 arg3, Vtx *arg4
UNUSED void func_800734D4() {
}
-void func_800734DC(s32 objectIndex) {
+void update_neon_texture(s32 objectIndex) {
// I have no idea why this typecast works
- gObjectList[objectIndex].activeTLUT = (u32*)gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].itemDisplay << 7);
+ gObjectList[objectIndex].activeTLUT = (u32*)gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].itemDisplay * 128);
gObjectList[objectIndex].activeTexture = gObjectList[objectIndex].textureList;
}
@@ -776,7 +776,7 @@ UNUSED void func_80073570(s32 objectIndex) {
void func_800735BC(s32 objectIndex, Gfx *arg1, f32 arg2) {
gObjectList[objectIndex].unk_054 = 0;
- gObjectList[objectIndex].unk_070 = arg1;
+ gObjectList[objectIndex].model = arg1;
gObjectList[objectIndex].sizeScaling = arg2;
func_80072488(objectIndex);
}
@@ -1312,34 +1312,34 @@ void func_80074924(s32 objectIndex) {
sp28 = random_int(D_80165748);
sp24 = random_int(0x0096U);
sp20 = random_int(0x2000U);
- temp_s0->unk_010[0] = (f32) ((((f64) D_80165718 + 100.0) - (f64) sp2C) * (f64) xOrientation);
- temp_s0->unk_010[1] = (f32) (D_80165720 + sp28);
- temp_s0->unk_010[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24);
+ temp_s0->origin_pos[0] = (f32) ((((f64) D_80165718 + 100.0) - (f64) sp2C) * (f64) xOrientation);
+ temp_s0->origin_pos[1] = (f32) (D_80165720 + sp28);
+ temp_s0->origin_pos[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24);
break;
case COURSE_ROYAL_RACEWAY:
sp2C = random_int(0x0168U);
sp28 = random_int(D_80165748);
sp24 = random_int(0x00B4U);
sp20 = random_int(0x2000U);
- temp_s0->unk_010[0] = (f32) ((((f64) D_80165718 + 180.0) - (f64) sp2C) * (f64) xOrientation);
- temp_s0->unk_010[1] = (f32) (D_80165720 + sp28);
- temp_s0->unk_010[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24);
+ temp_s0->origin_pos[0] = (f32) ((((f64) D_80165718 + 180.0) - (f64) sp2C) * (f64) xOrientation);
+ temp_s0->origin_pos[1] = (f32) (D_80165720 + sp28);
+ temp_s0->origin_pos[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24);
break;
case COURSE_LUIGI_RACEWAY:
sp2C = random_int(0x012CU);
sp28 = random_int(D_80165748);
sp24 = random_int(0x0096U);
sp20 = random_int(0x2000U);
- temp_s0->unk_010[0] = (f32) ((((f64) D_80165718 + 150.0) - (f64) sp2C) * (f64) xOrientation);
- temp_s0->unk_010[1] = (f32) (D_80165720 + sp28);
- temp_s0->unk_010[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24);
+ temp_s0->origin_pos[0] = (f32) ((((f64) D_80165718 + 150.0) - (f64) sp2C) * (f64) xOrientation);
+ temp_s0->origin_pos[1] = (f32) (D_80165720 + sp28);
+ temp_s0->origin_pos[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24);
break;
}
func_8008B80C(objectIndex, 0, 0, 0);
if (gPlayerCount == 1) {
- temp_s0->unk_038[1] = (f32) (((f64) (f32) (sp2C % 4) * 0.25) + 0.8);
+ temp_s0->velocity[1] = (f32) (((f64) (f32) (sp2C % 4) * 0.25) + 0.8);
} else {
- temp_s0->unk_038[1] = (f32) (((f64) (f32) (sp2C % 3) * 0.2) + 0.4);
+ temp_s0->velocity[1] = (f32) (((f64) (f32) (sp2C % 3) * 0.2) + 0.4);
}
temp_a0 = sp2C % 8;
temp_s0->unk_084[0] = D_800E6F30[temp_a0][0];
@@ -1397,14 +1397,14 @@ void func_80074EE8(void) {
someCount = 0;
for (someIndex = 0; someIndex < D_80165738; someIndex++) {
- objectIndex = D_8018C630[someIndex];
+ objectIndex = gObjectParticle3[someIndex];
if (objectIndex != DELETED_OBJECT_ID) {
object = &gObjectList[objectIndex];
if (object->state != 0) {
func_80074E28(objectIndex);
func_80074D94(objectIndex);
if (object->state == 0) {
- delete_object_wrapper(&D_8018C630[someIndex]);
+ delete_object_wrapper(&gObjectParticle3[someIndex]);
}
someCount += 1;
}
@@ -1420,13 +1420,13 @@ void func_80074FD8(s32 objectIndex) {
case 0:
break;
case 1:
- if (func_80087E08(objectIndex, gObjectList[objectIndex].unk_038[1], 0.12f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].unk_0BE[1], 0x00000064) != 0) {
+ if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.12f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1], 0x00000064) != 0) {
func_80072488(objectIndex);
}
func_8008BF18(objectIndex);
- gObjectList[objectIndex].unk_0B2[0] += D_8016582C[0];
- gObjectList[objectIndex].unk_0B2[1] += D_8016582C[1];
- gObjectList[objectIndex].unk_0B2[2] += D_8016582C[2];
+ gObjectList[objectIndex].orientation[0] += D_8016582C[0];
+ gObjectList[objectIndex].orientation[1] += D_8016582C[1];
+ gObjectList[objectIndex].orientation[2] += D_8016582C[2];
break;
case 2:
func_80086F60(objectIndex);
@@ -1447,35 +1447,35 @@ void func_800750D8(s32 objectIndex, s32 arg1, Vec3f arg2, s32 arg3, s32 arg4) {
temp_v1->unk_0D5 = arg3;
temp_v1->sizeScaling = ((f64) (f32) sp24 * 0.0005) + 0.05;
// ALL HAIL THE FAKE MATCH GODS!!!!!
- temp_v1->unk_038[1] = ((f64) (f32) temp_v0 * (0.05 * 1.0)) + 2.0;
+ temp_v1->velocity[1] = ((f64) (f32) temp_v0 * (0.05 * 1.0)) + 2.0;
temp_v1->unk_034 = ((f64) (f32)(temp_v0 % 5) * 0.1) + 1.0;
- temp_v1->unk_0BE[1] = (arg1 << 0x10) / arg4;
- temp_v1->unk_010[0] = (arg2[0] + (temp_v0 / 2)) - 12.0f;
- temp_v1->unk_010[1] = (arg2[1] - 10.0) + random_int(0x000AU);
- temp_v1->unk_010[2] = (arg2[2] + (temp_v0 / 2)) - 12.0f;
- temp_v1->unk_0B2[0] = sp24 << 7;
- temp_v1->unk_0B2[1] = temp_v0 * 0x50;
- temp_v1->unk_0B2[2] = temp_v0 * 0x50;
+ temp_v1->direction_angle[1] = (arg1 << 0x10) / arg4;
+ temp_v1->origin_pos[0] = (arg2[0] + (temp_v0 / 2)) - 12.0f;
+ temp_v1->origin_pos[1] = (arg2[1] - 10.0) + random_int(0x000AU);
+ temp_v1->origin_pos[2] = (arg2[2] + (temp_v0 / 2)) - 12.0f;
+ temp_v1->orientation[0] = sp24 << 7;
+ temp_v1->orientation[1] = temp_v0 * 0x50;
+ temp_v1->orientation[2] = temp_v0 * 0x50;
}
void func_80075304(Vec3f arg0, s32 arg1, s32 arg2, s32 arg3) {
s32 var_s1;
- s32 var_s0;
+ s32 objectIndex;
for (var_s1 = 0; var_s1 < arg3; var_s1++) {
switch (arg1) { /* irregular */
case 1:
- var_s0 = func_80072044(D_8018C1B0, &D_80183E38, 0x00000080);
+ objectIndex = add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE);
break;
case 2:
- var_s0 = func_80072044(D_8018C3F0, &D_80183E4C, 0x00000080);
+ objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE);
break;
case 3:
- var_s0 = func_80072044(D_8018C630, &D_80183E5C, 0x00000080);
+ objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE);
break;
}
- if (var_s0 == -1) break;
- func_800750D8(var_s0, var_s1, arg0, arg2, arg3);
+ if (objectIndex == NULL_OBJECT_ID) break;
+ func_800750D8(objectIndex, var_s1, arg0, arg2, arg3);
}
}
@@ -1491,13 +1491,13 @@ void func_8007542C(s32 arg0) {
for (var_s2 = 0; var_s2 < 0x80; var_s2++) {
switch (arg0) { /* irregular */
case 1:
- var_s3 = D_8018C1B0;
+ var_s3 = gObjectParticle1;
break;
case 2:
- var_s3 = D_8018C3F0;
+ var_s3 = gObjectParticle2;
break;
case 3:
- var_s3 = D_8018C630;
+ var_s3 = gObjectParticle3;
break;
}
objectIndex = var_s3[var_s2];
@@ -1520,10 +1520,10 @@ void func_80075574(s32 objectIndex, Vec3f arg1, f32 arg2) {
init_object(objectIndex, 0);
temp_v1 = &gObjectList[objectIndex];
- temp_v1->unk_010[0] = arg1[0];
- temp_v1->unk_010[1] = arg1[1];
- temp_v1->unk_010[2] = arg1[2];
- temp_v1->unk_038[1] = arg2;
+ temp_v1->origin_pos[0] = arg1[0];
+ temp_v1->origin_pos[1] = arg1[1];
+ temp_v1->origin_pos[2] = arg1[2];
+ temp_v1->velocity[1] = arg2;
temp_v1->type = random_int(0x0064U) + 0x1E;
}
@@ -1531,13 +1531,13 @@ s32 func_800755FC(s32 arg0, Vec3f arg1, f32 arg2) {
s32 objectIndex;
if (arg0 == 0) {
- objectIndex = func_80072044(D_8018C3F0, &D_80183E4C, D_8018C3F0_SIZE);
- if (objectIndex != -1) {
+ objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
func_80075574(objectIndex, arg1, arg2);
}
} else {
- objectIndex = func_80072044(D_8018C630, &D_80183E5C, D_8018C630_SIZE);
- if (objectIndex != -1) {
+ objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
func_80075574(objectIndex, arg1, arg2);
}
}
@@ -1549,9 +1549,9 @@ void func_80075698(s32 objectIndex) {
gObjectList[objectIndex].activeTexture = D_8018D490;
gObjectList[objectIndex].textureList = D_8018D490;
gObjectList[objectIndex].unk_0A0 = 0xFF;
- gObjectList[objectIndex].unk_0BE[1] = 0;
- gObjectList[objectIndex].unk_0B2[0] = 0;
- gObjectList[objectIndex].unk_0B2[2] = 0;
+ gObjectList[objectIndex].direction_angle[1] = 0;
+ gObjectList[objectIndex].orientation[0] = 0;
+ gObjectList[objectIndex].orientation[2] = 0;
gObjectList[objectIndex].unk_028[0] = 0.0f;
gObjectList[objectIndex].unk_028[1] = 0.0f;
gObjectList[objectIndex].unk_028[2] = 0.0f;
@@ -1565,8 +1565,8 @@ void func_80075714(s32 objectIndex) {
func_80075698(objectIndex);
break;
case 2:
- gObjectList[objectIndex].unk_038[1] -= 0.03;
- f32_step_up_towards(&gObjectList[objectIndex].unk_028[1], 100.0f, gObjectList[objectIndex].unk_038[1]);
+ gObjectList[objectIndex].velocity[1] -= 0.03;
+ f32_step_up_towards(&gObjectList[objectIndex].unk_028[1], 100.0f, gObjectList[objectIndex].velocity[1]);
func_8007415C(objectIndex, &gObjectList[objectIndex].sizeScaling, 0.55f, 1.0f, 0.1f, 1, 0);
if (func_80073B00(objectIndex, &gObjectList[objectIndex].unk_0A0, 0xFF, 0x1E, 7, 0, 0) != 0) {
func_80072488(objectIndex);
@@ -1597,13 +1597,13 @@ void func_80075838(void) {
if ((gTrainList[0].someFlags != 0) || (D_8016578C != 0)) {
count = 0;
for (i = 0; i < 128; i++) {
- temp_a0 = D_8018C3F0[i];
+ temp_a0 = gObjectParticle2[i];
if (temp_a0 != -1) {
temp = &gObjectList[temp_a0];
if (temp->state != 0) {
func_80075714(temp_a0);
if (temp->state == 0) {
- delete_object_wrapper(&D_8018C3F0[i]);
+ delete_object_wrapper(&gObjectParticle2[i]);
}
count += 1;
}
@@ -1616,13 +1616,13 @@ void func_80075838(void) {
if ((gTrainList[1].someFlags != 0) || (D_80165790 != 0)) {
count = 0;
for (i = 0; i < 128; i++) {
- temp_a0 = D_8018C630[i];
+ temp_a0 = gObjectParticle3[i];
if (temp_a0 != -1) {
temp = &gObjectList[temp_a0];
if (temp->state != 0) {
func_80075714(temp_a0);
if (temp->state == 0) {
- delete_object_wrapper(&D_8018C630[i]);
+ delete_object_wrapper(&gObjectParticle3[i]);
}
count += 1;
}
@@ -1639,30 +1639,30 @@ void func_800759EC(s32 objectIndex, Vec3f arg1, f32 arg2) {
init_object(objectIndex, 0);
temp_v0 = &gObjectList[objectIndex];
- temp_v0->unk_010[0] = arg1[0];
- temp_v0->unk_010[1] = arg1[1];
- temp_v0->unk_010[2] = arg1[2];
- temp_v0->unk_038[1] = arg2;
+ temp_v0->origin_pos[0] = arg1[0];
+ temp_v0->origin_pos[1] = arg1[1];
+ temp_v0->origin_pos[2] = arg1[2];
+ temp_v0->velocity[1] = arg2;
temp_v0->type = 0x00FF;
temp_v0->unk_0A2 = 0x0096;
}
s32 func_80075A6C(s32 arg0, Vec3f arg1, f32 arg2) {
- s32 temp_v0;
+ s32 objectIndex;
if (arg0 == 0) {
- temp_v0 = func_80072044(D_8018C3F0, &D_80183E4C, 0x80);
- if (temp_v0 != -1) {
- func_800759EC(temp_v0, arg1, arg2);
+ objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
+ func_800759EC(objectIndex, arg1, arg2);
}
} else {
- temp_v0 = func_80072044(D_8018C630, &D_80183E5C, 0x80);
- if (temp_v0 != -1) {
- func_800759EC(temp_v0, arg1, arg2);
+ objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
+ func_800759EC(objectIndex, arg1, arg2);
}
}
- return temp_v0;
+ return objectIndex;
}
void func_80075B08(s32 objectIndex) {
@@ -1670,9 +1670,9 @@ void func_80075B08(s32 objectIndex) {
gObjectList[objectIndex].activeTexture = D_8018D490;
gObjectList[objectIndex].textureList = D_8018D490;
gObjectList[objectIndex].unk_0A0 = 0xFF;
- gObjectList[objectIndex].unk_0BE[1] = 0;
- gObjectList[objectIndex].unk_0B2[0] = 0;
- gObjectList[objectIndex].unk_0B2[2] = 0;
+ gObjectList[objectIndex].direction_angle[1] = 0;
+ gObjectList[objectIndex].orientation[0] = 0;
+ gObjectList[objectIndex].orientation[2] = 0;
gObjectList[objectIndex].unk_028[0] = 0.0f;
gObjectList[objectIndex].unk_028[1] = 0.0f;
gObjectList[objectIndex].unk_028[2] = 0.0f;
@@ -1686,8 +1686,8 @@ void func_80075B84(s32 objectIndex) {
func_80075B08(objectIndex);
break;
case 2:
- gObjectList[objectIndex].unk_038[1] -= 0.03;
- f32_step_up_towards(&gObjectList[objectIndex].unk_028[1], 100.0f, gObjectList[objectIndex].unk_038[1]);
+ gObjectList[objectIndex].velocity[1] -= 0.03;
+ f32_step_up_towards(&gObjectList[objectIndex].unk_028[1], 100.0f, gObjectList[objectIndex].velocity[1]);
func_8007415C(objectIndex, &gObjectList[objectIndex].sizeScaling, 0.55f, 1.0f, 0.1f, 1, 0);
if (func_80073B00(objectIndex, &gObjectList[objectIndex].unk_0A0, 0xFF, 0x1E, 7, 0, 0) != 0) {
func_80072488(objectIndex);
@@ -1718,13 +1718,13 @@ void func_80075CA8(void) {
if ((gFerries[0].someFlags != 0) || (D_8016578C != 0)) {
count = 0;
for (i = 0; i < 128; i++) {
- temp_a0 = D_8018C3F0[i];
+ temp_a0 = gObjectParticle2[i];
if (temp_a0 != -1) {
temp = &gObjectList[temp_a0];
if (temp->state != 0) {
func_80075B84(temp_a0);
if (temp->state == 0) {
- delete_object_wrapper(&D_8018C3F0[i]);
+ delete_object_wrapper(&gObjectParticle2[i]);
}
count += 1;
}
@@ -1737,13 +1737,13 @@ void func_80075CA8(void) {
if ((gFerries[1].someFlags != 0) || (D_80165790 != 0)) {
count = 0;
for (i = 0; i < 128; i++) {
- temp_a0 = D_8018C630[i];
+ temp_a0 = gObjectParticle3[i];
if (temp_a0 != -1) {
temp = &gObjectList[temp_a0];
if (temp->state != 0) {
func_80075B84(temp_a0);
if (temp->state == 0) {
- delete_object_wrapper(&D_8018C630[i]);
+ delete_object_wrapper(&gObjectParticle3[i]);
}
count += 1;
}
@@ -1762,26 +1762,26 @@ void func_80075E5C(s32 objectIndex, Vec3f arg1, u16 arg2, f32 arg3, s32 arg4) {
temp_v0 = &gObjectList[objectIndex];
temp_v0->sizeScaling = 0.5f;
temp_v0->unk_0D5 = 5;
- temp_v0->unk_010[0] = arg1[0];
- temp_v0->unk_010[1] = arg1[1];
- temp_v0->unk_010[2] = arg1[2];
- temp_v0->unk_0BE[0] = 0x0C00;
- temp_v0->unk_0BE[2] = 0;
+ temp_v0->origin_pos[0] = arg1[0];
+ temp_v0->origin_pos[1] = arg1[1];
+ temp_v0->origin_pos[2] = arg1[2];
+ temp_v0->direction_angle[0] = 0x0C00;
+ temp_v0->direction_angle[2] = 0;
temp_v0->unk_034 = arg3 * 4.0;
- temp_v0->unk_0BE[1] = arg2;
+ temp_v0->direction_angle[1] = arg2;
temp_v0->type = 0x00FF;
temp_v0->unk_0A2 = 0x00FF;
temp_v0->unk_048 = arg4 * 2;
}
s32 func_80075F28(Vec3f arg0, u16 arg1, f32 arg2, s32 arg3) {
- s32 temp_v0;
+ s32 objectIndex;
- temp_v0 = func_80072044(D_8018C1B0, &D_80183E38, 0x80);
- if (temp_v0 != -1) {
- func_80075E5C(temp_v0, arg0, arg1, arg2, arg3);
+ objectIndex = add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
+ func_80075E5C(objectIndex, arg0, arg1, arg2, arg3);
}
- return temp_v0;
+ return objectIndex;
}
void func_80075F98(Vec3f arg0, u16 arg1, f32 arg2) {
@@ -1811,8 +1811,8 @@ void func_8007601C(s32 objectIndex) {
func_8008A6DC(objectIndex, 300.0f);
if ((is_obj_index_flag_unk_054_active(objectIndex, 0x40000) != 0) && (func_80072354(objectIndex, 1) != 0)) {
func_800722A4(objectIndex, 1);
- func_80075F98(gObjectList[objectIndex].pos, (u16) gObjectList[objectIndex].unk_0BE[1], 1.0f);
- func_800C9D80(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_038, 0x5102800A);
+ func_80075F98(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle[1], 1.0f);
+ func_800C9D80(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x5102800A);
if (gObjectList[objectIndex].type > 0) {
gObjectList[objectIndex].type--;
gObjectList[objectIndex].unk_04C = 0x5A;
@@ -1844,14 +1844,14 @@ void func_80076194(s32 objectIndex, Vec3f arg1, f32 arg2, s32 arg3) {
temp_v0 = &gObjectList[objectIndex];
temp_v0->unk_0D5 = 4;
temp_v0->sizeScaling = 1.0f;
- temp_v0->unk_010[0] = arg1[0];
- temp_v0->unk_010[1] = arg1[1];
- temp_v0->unk_010[2] = arg1[2];
- temp_v0->unk_0BE[0] = 0x0C00;
- temp_v0->unk_0BE[2] = 0;
- temp_v0->unk_0BE[1] = 0x2100;
+ temp_v0->origin_pos[0] = arg1[0];
+ temp_v0->origin_pos[1] = arg1[1];
+ temp_v0->origin_pos[2] = arg1[2];
+ temp_v0->direction_angle[0] = 0x0C00;
+ temp_v0->direction_angle[2] = 0;
+ temp_v0->direction_angle[1] = 0x2100;
if (gIsMirrorMode != 0) {
- temp_v0->unk_0BE[1] += -0x4000;
+ temp_v0->direction_angle[1] += -0x4000;
}
temp_v0->type = 0x00FF;
temp_v0->unk_0A2 = 0x00FF;
@@ -1860,13 +1860,13 @@ void func_80076194(s32 objectIndex, Vec3f arg1, f32 arg2, s32 arg3) {
}
s32 func_80076278(Vec3f arg0, f32 arg1, s32 arg2) {
- s32 temp_v0;
+ s32 objectIndex;
- temp_v0 = func_80072044(D_8018C1B0, &D_80183E38, D_8018C1B0_SIZE);
- if (temp_v0 != -1) {
- func_80076194(temp_v0, arg0, arg1, arg2);
+ objectIndex = add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
+ func_80076194(objectIndex, arg0, arg1, arg2);
}
- return temp_v0;
+ return objectIndex;
}
void func_800762DC(Vec3f arg0, f32 arg1) {
@@ -1884,7 +1884,7 @@ void func_8007634C(s32 objectIndex) {
temp_v0->activeTexture = common_texture_particle_smoke;
temp_v0->textureList = common_texture_particle_smoke;
temp_v0->unk_0A0 = 0x00FF;
- func_8008B8BC(objectIndex, 0U, 0U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0U, 0U);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
func_80072488(objectIndex);
}
@@ -1941,7 +1941,7 @@ void func_80076538(s32 objectIndex) {
}
break;
case 2:
- u16_step_down_towards(&gObjectList[objectIndex].unk_0BE[0], 0, 0x00000400);
+ u16_step_down_towards(&gObjectList[objectIndex].direction_angle[0], 0, 0x00000400);
break;
}
if (gObjectList[objectIndex].unk_0AE > 0) {
@@ -1971,7 +1971,7 @@ void func_8007661C(void) {
if ((is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) && (func_80072354(objectIndex, 1) != 0)) {
func_800722A4(objectIndex, 1);
func_800762DC(gObjectList[objectIndex].pos, 1.0f);
- func_800C9D80(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_038, 0x51038009U);
+ func_800C9D80(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x51038009U);
if (gObjectList[objectIndex].type > 0) {
gObjectList[objectIndex].type--;
gObjectList[objectIndex].unk_04C = 0x0000005A;
@@ -1993,24 +1993,24 @@ void func_8007675C(s32 objectIndex, Vec3s arg1, s32 arg2) {
temp_v0 = &gObjectList[objectIndex];
temp_v0->unk_0D5 = 9;
temp_v0->sizeScaling = 1.0f;
- temp_v0->unk_010[0] = arg1[0];
- temp_v0->unk_010[1] = arg1[1];
- temp_v0->unk_010[2] = arg1[2];
- temp_v0->unk_0BE[0] = 0x0C00;
- temp_v0->unk_0BE[1] = 0x2100;
- temp_v0->unk_0BE[2] = 0;
+ temp_v0->origin_pos[0] = arg1[0];
+ temp_v0->origin_pos[1] = arg1[1];
+ temp_v0->origin_pos[2] = arg1[2];
+ temp_v0->direction_angle[0] = 0x0C00;
+ temp_v0->direction_angle[1] = 0x2100;
+ temp_v0->direction_angle[2] = 0;
temp_v0->type = 0x00FF;
temp_v0->unk_0A2 = 0x00FF;
temp_v0->unk_034 = 8.0f;
- temp_v0->unk_038[1] = 8.0f;
+ temp_v0->velocity[1] = 8.0f;
temp_v0->unk_048 = arg2;
}
s32 func_80076828(Vec3s arg0, s32 arg1) {
s32 objectIndex;
- objectIndex = func_80072044(D_8018C1B0, &D_80183E38, D_8018C1B0_SIZE);
- if (objectIndex != -1) {
+ objectIndex = add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
func_8007675C(objectIndex, arg0, arg1);
}
return objectIndex;
@@ -2054,7 +2054,7 @@ void func_80076958(s32 objectIndex) {
temp_v0->activeTexture = common_texture_particle_smoke;
temp_v0->textureList = common_texture_particle_smoke;
temp_v0->unk_0A0 = 0x00FF;
- func_8008B8BC(objectIndex, 0U, 0U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0U, 0U);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
func_80072488(objectIndex);
}
@@ -2111,15 +2111,15 @@ void func_80076B7C(void) {
}
-void func_80076B84(void) {
+void update_particle_bowser_castle(void) {
s32 someIndex;
s32 objectIndex;
Objects *object;
func_8007661C();
func_8007614C();
- for (someIndex = 0; someIndex < D_8018C1B0_SIZE; someIndex++) {
- objectIndex = D_8018C1B0[someIndex];
+ for (someIndex = 0; someIndex < gObjectParticle1_SIZE; someIndex++) {
+ objectIndex = gObjectParticle1[someIndex];
if (objectIndex != DELETED_OBJECT_ID) {
object = &gObjectList[objectIndex];
if (object->state != 0) {
@@ -2131,7 +2131,7 @@ void func_80076B84(void) {
func_80076AEC(objectIndex);
}
if (object->state == 0) {
- delete_object_wrapper(&D_8018C1B0[someIndex]);
+ delete_object_wrapper(&gObjectParticle1[someIndex]);
}
}
}
@@ -2147,19 +2147,19 @@ void func_80076C9C(s32 objectIndex, Vec3f arg1, s16 arg2) {
temp_v0->activeTexture = common_texture_particle_smoke;
temp_v0->textureList = common_texture_particle_smoke;
temp_v0->sizeScaling = 0.3f;
- func_8008B7D4(objectIndex, arg1[0], arg1[1], arg1[2]);
+ set_obj_origin_pos(objectIndex, arg1[0], arg1[1], arg1[2]);
temp_v0->type = 0x00FF;
temp_v0->unk_034 = 0.0f;
- func_8008B8BC(objectIndex, 0U, 0U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0U, 0U);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
}
void func_80076D70(Vec3f arg0, UNUSED f32 arg1, s16 arg2) {
- s32 temp_v0;
+ s32 objectIndex;
- temp_v0 = func_80072044(D_8018C870, &D_80183E6C, 0x00000040);
- if (temp_v0 != -1) {
- func_80076C9C(temp_v0, arg0, arg2);
+ objectIndex = add_unused_obj_index(gObjectParticle4, &gNextFreeObjectParticle4, gObjectParticle4_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
+ func_80076C9C(objectIndex, arg0, arg2);
}
}
@@ -2201,15 +2201,15 @@ void func_80076F2C(void) {
s32 flameIndex;
Objects *object;
- for (someIndex = 0; someIndex < D_8018C870_SIZE; someIndex++) {
- flameIndex = D_8018C870[someIndex];
+ for (someIndex = 0; someIndex < gObjectParticle4_SIZE; someIndex++) {
+ flameIndex = gObjectParticle4[someIndex];
if (flameIndex != DELETED_OBJECT_ID) {
object = &gObjectList[flameIndex];
if (object->state != 0) {
func_80076E14(flameIndex);
func_80076ED8(flameIndex);
if (object->state == 0) {
- delete_object_wrapper(&D_8018C870[someIndex]);
+ delete_object_wrapper(&gObjectParticle4[someIndex]);
}
}
}
@@ -2224,23 +2224,23 @@ void func_80076FEC(s32 objectIndex, s32 flameIndex) {
gObjectList[objectIndex].textureList = common_texture_particle_smoke;
gObjectList[objectIndex].sizeScaling = 0.8f;
- gObjectList[objectIndex].unk_010[0] = (f32)*(gTorchSpawns + (flameIndex * 3) + 0) * xOrientation;
- gObjectList[objectIndex].unk_010[1] = (f32)*(gTorchSpawns + (flameIndex * 3) + 1);
- gObjectList[objectIndex].unk_010[2] = (f32)*(gTorchSpawns + (flameIndex * 3) + 2);
+ gObjectList[objectIndex].origin_pos[0] = (f32)*(gTorchSpawns + (flameIndex * 3) + 0) * xOrientation;
+ gObjectList[objectIndex].origin_pos[1] = (f32)*(gTorchSpawns + (flameIndex * 3) + 1);
+ gObjectList[objectIndex].origin_pos[2] = (f32)*(gTorchSpawns + (flameIndex * 3) + 2);
gObjectList[objectIndex].unk_034 = 0;
gObjectList[objectIndex].type = 255;
gObjectList[objectIndex].unk_0A2 = 255;
gObjectList[objectIndex].unk_0A0 = 255;
- func_8008B8BC(objectIndex, 0, 0, 0);
+ set_obj_orientation(objectIndex, 0, 0, 0);
func_8008B80C(objectIndex, 0, 0, 0);
}
void func_800770F0(s32 arg0) {
- s32 temp_v0;
+ s32 objectIndex;
- temp_v0 = func_80072044(D_8018C870, &D_80183E6C, 0x00000040);
- if (temp_v0 != -1) {
- func_80076FEC(temp_v0, arg0);
+ objectIndex = add_unused_obj_index(gObjectParticle4, &gNextFreeObjectParticle4, gObjectParticle4_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
+ func_80076FEC(objectIndex, arg0);
}
}
@@ -2251,21 +2251,21 @@ void func_80077138(s32 objectIndex, Vec3f arg1, s32 arg2) {
init_object(objectIndex, arg2);
gObjectList[objectIndex].unk_0D5 = 0x0C;
gObjectList[objectIndex].sizeScaling = 0.05f;
- func_8008B7D4(objectIndex, arg1[0], arg1[1], arg1[2]);
- func_8008B8BC(objectIndex, 0U, 0U, 0U);
+ set_obj_origin_pos(objectIndex, arg1[0], arg1[1], arg1[2]);
+ set_obj_orientation(objectIndex, 0U, 0U, 0U);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
switch (arg2) {
case 0:
- gObjectList[objectIndex].unk_038[1] = -1.0f;
+ gObjectList[objectIndex].velocity[1] = -1.0f;
gObjectList[objectIndex].unk_034 = (f32) ((random_int(0x004BU) * 0.01) + 0.25);
- gObjectList[objectIndex].unk_0BE[1] = random_int(0x0040U) << 0xA;
+ gObjectList[objectIndex].direction_angle[1] = random_int(0x0040U) << 0xA;
func_8008751C(objectIndex);
gObjectList[objectIndex].unk_084[5] = 0x001E;
break;
case 1:
- gObjectList[objectIndex].unk_038[1] = 1.5f;
+ gObjectList[objectIndex].velocity[1] = 1.5f;
gObjectList[objectIndex].unk_034 = (f32) ((random_int(0x0064U) * 0.01) + 0.5);
- gObjectList[objectIndex].unk_0BE[1] = random_int(0x0040U) << 0xA;
+ gObjectList[objectIndex].direction_angle[1] = random_int(0x0040U) << 0xA;
func_8008751C(objectIndex);
gObjectList[objectIndex].unk_084[5] = 0x0032;
break;
@@ -2288,15 +2288,15 @@ void func_80077138(s32 objectIndex, Vec3f arg1, s32 arg2) {
}
gObjectList[objectIndex].unk_0A0 = 0x00FF;
gObjectList[objectIndex].unk_084[3] = random_int(0x0800U) + 0x400;
- if ((gObjectList[objectIndex].unk_0BE[1] < 0x3000) || (gObjectList[objectIndex].unk_0BE[1] >= 0xB001)) {
+ if ((gObjectList[objectIndex].direction_angle[1] < 0x3000) || (gObjectList[objectIndex].direction_angle[1] >= 0xB001)) {
gObjectList[objectIndex].unk_084[3] = -gObjectList[objectIndex].unk_084[3];
}
}
void func_800773D8(f32 *arg0, s32 arg1) {
- s32 temp_v0 = func_80072044(D_8018C630, &D_80183E5C, 0x80);
- if (temp_v0 != -1) {
- func_80077138(temp_v0, arg0, arg1);
+ s32 objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
+ func_80077138(objectIndex, arg0, arg1);
}
}
@@ -2339,14 +2339,14 @@ void func_80077584(s32 objectIndex) {
temp_v0 = &gObjectList[objectIndex];
if ((temp_v0->unk_0AE != 0) && (temp_v0->unk_0AE == 1) && ((u8) temp_v0->unk_0D8 != 0)) {
- if (temp_v0->unk_038[1] >= -0.5) {
- temp_v0->unk_038[1] -= 0.15;
+ if (temp_v0->velocity[1] >= -0.5) {
+ temp_v0->velocity[1] -= 0.15;
} else {
- temp_v0->unk_038[2] = 0.0f;
- temp_v0->unk_038[0] = 0.0f;
+ temp_v0->velocity[2] = 0.0f;
+ temp_v0->velocity[0] = 0.0f;
}
}
- temp_v0->unk_0B2[2] += temp_v0->unk_084[3];
+ temp_v0->orientation[2] += temp_v0->unk_084[3];
func_80087710(objectIndex);
func_8008BF18(objectIndex);
}
@@ -2356,22 +2356,22 @@ void func_80077640(void) {
s32 objectIndex;
Objects *object;
- for(someIndex = 0; someIndex < D_8018C630_SIZE; someIndex++) {
- objectIndex = D_8018C630[someIndex];
+ for(someIndex = 0; someIndex < gObjectParticle3_SIZE; someIndex++) {
+ objectIndex = gObjectParticle3[someIndex];
if (objectIndex != DELETED_OBJECT_ID) {
object = &gObjectList[objectIndex];
if (object->state != 0) {
func_80077450(objectIndex);
func_80077584(objectIndex);
if (object->state == 0) {
- delete_object_wrapper(&D_8018C630[someIndex]);
+ delete_object_wrapper(&gObjectParticle3[someIndex]);
}
}
}
}
}
-void func_80077700(s32 objectIndex, Vec3f arg1, s32 arg2) {
+void init_leaf_particle(s32 objectIndex, Vec3f arg1, s32 num) {
UNUSED s32 stackPadding1;
UNUSED u16 stackPadding0;
u16 temp_s0;
@@ -2386,48 +2386,48 @@ void func_80077700(s32 objectIndex, Vec3f arg1, s32 arg2) {
gObjectList[objectIndex].unk_044 = arg1[1];
switch (gCurrentCourseId) {
case COURSE_MARIO_RACEWAY:
- func_8008BD14(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x00000014, 0x0000001E, 0x00000014);
+ func_8008BD14(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x14, 0x1E, 0x14);
gObjectList[objectIndex].unk_034 = 1.5f;
- gObjectList[objectIndex].unk_038[1] = 1.5f;
+ gObjectList[objectIndex].velocity[1] = 1.5f;
break;
case COURSE_YOSHI_VALLEY:
- func_8008BD14(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x00000014, 0x0000001E, 0x00000014);
+ func_8008BD14(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x14, 0x1E, 0x14);
gObjectList[objectIndex].unk_034 = 2.0f;
- gObjectList[objectIndex].unk_038[1] = 2.0f;
+ gObjectList[objectIndex].velocity[1] = 2.0f;
break;
case COURSE_ROYAL_RACEWAY:
- func_8008BD14(objectIndex, arg1[0], arg1[1] + 30.0, arg1[2], 0x00000010, 0x00000028, 0x00000010);
+ func_8008BD14(objectIndex, arg1[0], arg1[1] + 30.0, arg1[2], 0x10, 0x28, 0x10);
gObjectList[objectIndex].unk_034 = 2.0f;
- gObjectList[objectIndex].unk_038[1] = 2.0f;
+ gObjectList[objectIndex].velocity[1] = 2.0f;
break;
case COURSE_LUIGI_RACEWAY:
- func_8008BD14(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x00000014, 0x0000001E, 0x00000014);
+ func_8008BD14(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x14, 0x1E, 0x14);
gObjectList[objectIndex].unk_034 = 1.5f;
- gObjectList[objectIndex].unk_038[1] = 1.0f;
+ gObjectList[objectIndex].velocity[1] = 1.0f;
break;
}
temp_s0 = random_int(0x0010U) << 0xC;
sp3E = random_int(0x0010U) << 0xC;
sp3C = random_int(0x0010U) << 0xC;
- func_8008B888(objectIndex, 0U, (arg2 * 0xFFFF) / 20, 0U);
- func_8008B8BC(objectIndex, temp_s0, sp3E, sp3C);
+ set_obj_direction_angle(objectIndex, 0U, (num * 0xFFFF) / 20, 0U);
+ set_obj_orientation(objectIndex, temp_s0, sp3E, sp3C);
}
-s32 func_80077A54(Vec3f arg0, s32 arg1) {
- s32 temp_v0;
+s32 func_80077A54(Vec3f arg0, s32 num) {
+ s32 objectIndex;
- temp_v0 = func_80072044(D_8018C970, &D_80183E7C, D_8018C970_SIZE);
- if (temp_v0 != -1) {
- func_80077700(temp_v0, arg0, arg1);
+ objectIndex = add_unused_obj_index(gLeafParticle, &gNextFreeLeafParticle, gLeafParticle_SIZE);
+ if (objectIndex != NULL_OBJECT_ID) {
+ init_leaf_particle(objectIndex, arg0, num);
}
- return temp_v0;
+ return objectIndex;
}
void func_80077AB0(Vec3f arg0, UNUSED s32 arg1) {
- s32 var_s0;
+ s32 i;
- for (var_s0 = 0; var_s0 < D_8018C970_SPAWN_SIZE; var_s0++) {
- if (func_80077A54(arg0, var_s0) == -1) break;
+ for (i = 0; i < gLeafParticle_SPAWN_SIZE; i++) {
+ if (func_80077A54(arg0, i) == NULL_OBJECT_ID) break;
}
}
@@ -2460,7 +2460,7 @@ void func_80077B3C(s32 objectIndex) {
void func_80077BCC(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 1:
- func_80087E08(objectIndex, gObjectList[objectIndex].unk_038[1], 0.2f, gObjectList[objectIndex].unk_034, (s16) (s32) gObjectList[objectIndex].unk_0BE[1], 0x0000000A);
+ func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.2f, gObjectList[objectIndex].unk_034, (s16) (s32) gObjectList[objectIndex].direction_angle[1], 0x0000000A);
break;
case 2:
if (func_80087B84(objectIndex, 0.4f, gObjectList[objectIndex].unk_044) != 0) {
@@ -2469,8 +2469,8 @@ void func_80077BCC(s32 objectIndex) {
break;
}
func_8008BF18(objectIndex);
- gObjectList[objectIndex].unk_0B2[0] += 0x1000;
- gObjectList[objectIndex].unk_0B2[1] += 0x1000;
+ gObjectList[objectIndex].orientation[0] += 0x1000;
+ gObjectList[objectIndex].orientation[1] += 0x1000;
}
void func_80077C9C(void) {
@@ -2478,15 +2478,15 @@ void func_80077C9C(void) {
s32 leafIndex;
Objects *object;
- for(someIndex = 0; someIndex < D_8018C970_SIZE; someIndex++) {
- leafIndex = D_8018C970[someIndex];
+ for(someIndex = 0; someIndex < gLeafParticle_SIZE; someIndex++) {
+ leafIndex = gLeafParticle[someIndex];
if (leafIndex != DELETED_OBJECT_ID) {
object = &gObjectList[leafIndex];
if (object->state != 0) {
func_80077B3C(leafIndex);
func_80077BCC(leafIndex);
if (object->state == 0) {
- delete_object_wrapper(&D_8018C970[someIndex]);
+ delete_object_wrapper(&gLeafParticle[someIndex]);
}
}
}
@@ -2549,17 +2549,17 @@ void func_80077F64(s32 objectIndex, Camera *camera) {
switch (gObjectList[objectIndex].unk_0AE) { /* irregular */
case 1:
- gObjectList[objectIndex].unk_0BE[1] = (camera->rot[1] + random_int(0x4000U)) - 0x2000;
+ gObjectList[objectIndex].direction_angle[1] = (camera->rot[1] + random_int(0x4000U)) - 0x2000;
func_8008BAB4(objectIndex, 0x00B4, 0x0014U);
rand = random_int(0x0064U);
- gObjectList[objectIndex].unk_038[1] = (f32) (-0.75 - (f64) (f32) (rand * 0.01));
+ gObjectList[objectIndex].velocity[1] = (f32) (-0.75 - (f64) (f32) (rand * 0.01));
gObjectList[objectIndex].unk_028[0] = 0.0f;
gObjectList[objectIndex].unk_028[1] = 0.0f;
func_80086FD4(objectIndex);
return;
case 2:
- func_80077EB8(objectIndex, gObjectList[objectIndex].unk_0BE[1], camera);
+ func_80077EB8(objectIndex, gObjectList[objectIndex].direction_angle[1], camera);
func_800877C4(objectIndex);
func_8008BF18(objectIndex);
func_8008BFC0(objectIndex);
@@ -2635,24 +2635,24 @@ void func_80078288(s32 objectIndex) {
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].unk_010[0] = gPlayerOneCopy->pos[0] + (sins(temp_t6) * sp3C);
- gObjectList[objectIndex].unk_010[1] = sp3E + gPlayerOneCopy->unk_074;
- gObjectList[objectIndex].unk_010[2] = gPlayerOneCopy->pos[2] + (coss(temp_t6) * sp3C);
+ 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].unk_0C4 = random_int(0x0400U) + 0x100;
gObjectList[objectIndex].unk_01C[0] = (f32) (((f32) random_int(0x0064U) * 0.03) + 2.0);
- gObjectList[objectIndex].unk_038[1] = (f32) (-0.3 - (f64) (f32) (random_int(0x0032U) * 0.01));
+ gObjectList[objectIndex].velocity[1] = (f32) (-0.3 - (f64) (f32) (random_int(0x0032U) * 0.01));
gObjectList[objectIndex].unk_028[0] = 0.0f;
gObjectList[objectIndex].unk_028[1] = 0.0f;
func_80086FD4(objectIndex);
} else {
sp3C = random_int(0x0064U) + 0x28;
temp_t6 = camera1->rot[1] + random_int(0x3000U) - 0x1800;
- gObjectList[objectIndex].unk_010[0] = camera1->pos[0] + (sins(temp_t6) * sp3C);
- gObjectList[objectIndex].unk_010[1] = camera1->pos[1] + 45.0;
- gObjectList[objectIndex].unk_010[2] = camera1->pos[2] + (coss(temp_t6) * sp3C);
+ gObjectList[objectIndex].origin_pos[0] = camera1->pos[0] + (sins(temp_t6) * sp3C);
+ gObjectList[objectIndex].origin_pos[1] = camera1->pos[1] + 45.0;
+ gObjectList[objectIndex].origin_pos[2] = camera1->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].unk_038[1] = (f32) (-0.6 - (f64) (f32) (random_int(0x0032U) * 0.01));
+ gObjectList[objectIndex].velocity[1] = (f32) (-0.6 - (f64) (f32) (random_int(0x0032U) * 0.01));
gObjectList[objectIndex].unk_028[0] = 0.0f;
gObjectList[objectIndex].unk_028[1] = 0.0f;
func_80086FD4(objectIndex);
@@ -2660,13 +2660,13 @@ void func_80078288(s32 objectIndex) {
break;
case 2:
func_800877C4(objectIndex);
- gObjectList[objectIndex].unk_0BE[0] += gObjectList[objectIndex].unk_0C4;
- gObjectList[objectIndex].unk_028[0] = sins(gObjectList[objectIndex].unk_0BE[0]) * gObjectList[objectIndex].unk_01C[0];
+ gObjectList[objectIndex].direction_angle[0] += gObjectList[objectIndex].unk_0C4;
+ gObjectList[objectIndex].unk_028[0] = sins(gObjectList[objectIndex].direction_angle[0]) * gObjectList[objectIndex].unk_01C[0];
func_8008BF18(objectIndex);
if ((f64) gObjectList[objectIndex].pos[1] <= 0.0) {
func_80086FD4(objectIndex);
}
- gObjectList[objectIndex].unk_0B2[1] = angle_between_object_camera(objectIndex, camera1);
+ gObjectList[objectIndex].orientation[1] = angle_between_object_camera(objectIndex, camera1);
break;
case 3:
func_80086F60(objectIndex);
@@ -2701,8 +2701,8 @@ void func_80078790(void) {
if (D_8018D174 >= NUM_SNOWFLAKES) {
D_8018D174 = 0;
}
- if (gObjectList[D_8018C1B0[D_8018D174]].state == 0) {
- init_object(D_8018C1B0[D_8018D174], 1);
+ if (gObjectList[gObjectParticle1[D_8018D174]].state == 0) {
+ init_object(gObjectParticle1[D_8018D174], 1);
break;
}
}
@@ -2721,7 +2721,7 @@ void func_80078838(void) {
func_80078790();
}
for (someIndex = 0; someIndex < NUM_SNOWFLAKES; someIndex++) {
- snowflakeIndex = D_8018C1B0[someIndex];
+ snowflakeIndex = gObjectParticle1[someIndex];
if (gObjectList[snowflakeIndex].state != 0) {
func_800786EC(snowflakeIndex);
}
@@ -2890,39 +2890,39 @@ void func_80078C70(s32 arg0) {
void func_80078F64(void) {
switch (gScreenModeSelection) { /* irregular */
case SCREEN_MODE_1P:
- init_object(D_80183DB8[0], 1);
+ init_object(gIndexLakituList[0], 1);
break;
case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL:
- init_object(D_80183DB8[0], 1);
- init_object(D_80183DB8[1], 1);
+ init_object(gIndexLakituList[0], 1);
+ init_object(gIndexLakituList[1], 1);
break;
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL:
- init_object(D_80183DB8[0], 1);
- init_object(D_80183DB8[1], 1);
+ init_object(gIndexLakituList[0], 1);
+ init_object(gIndexLakituList[1], 1);
break;
case SCREEN_MODE_3P_4P_SPLITSCREEN:
- init_object(D_80183DB8[0], 1);
- init_object(D_80183DB8[1], 1);
- init_object(D_80183DB8[2], 1);
- init_object(D_80183DB8[3], 1);
+ init_object(gIndexLakituList[0], 1);
+ init_object(gIndexLakituList[1], 1);
+ init_object(gIndexLakituList[2], 1);
+ init_object(gIndexLakituList[3], 1);
break;
}
}
void func_80079054(s32 playerId) {
- init_object(D_80183DB8[playerId], 2);
+ init_object(gIndexLakituList[playerId], 2);
}
void func_80079084(s32 playerId) {
- init_object(D_80183DB8[playerId], 4);
+ init_object(gIndexLakituList[playerId], 4);
}
void func_800790B4(s32 playerId) {
- init_object(D_80183DB8[playerId], 5);
+ init_object(gIndexLakituList[playerId], 5);
}
void func_800790E4(s32 playerId) {
- init_object(D_80183DB8[playerId], 6);
+ init_object(gIndexLakituList[playerId], 6);
}
void func_80079114(s32 objectIndex, s32 arg1, s32 arg2) {
@@ -2933,7 +2933,7 @@ void func_80079114(s32 objectIndex, s32 arg1, s32 arg2) {
func_80074894(objectIndex, D_8018C028);
return;
}
- a = D_80183DB8[0];
+ a = gIndexLakituList[0];
gObjectList[objectIndex].activeTLUT = gObjectList[a].activeTLUT;
gObjectList[objectIndex].activeTexture = gObjectList[a].activeTexture;
if (0) { }
@@ -2971,7 +2971,7 @@ void func_800791F0(s32 objectIndex, s32 playerId) {
func_800C9018(playerId, 0x0100FA28);
}
-void func_800792D8(s32 objectIndex, s32 arg1) {
+void init_obj_laikitu_red_flag_countdown(s32 objectIndex, s32 arg1) {
if (arg1 == 0) {
D_801656F0 = 0;
D_8018D168 = 0;
@@ -2984,13 +2984,13 @@ void func_800792D8(s32 objectIndex, s32 arg1) {
gObjectList[objectIndex].unk_048 = D_8018D180;
}
-void func_80079380(s32 objectIndex, s32 arg1) {
+void update_obj_laikitu_countdown(s32 objectIndex, s32 arg1) {
UNUSED s32 pad;
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
- func_800792D8(objectIndex, arg1);
+ init_obj_laikitu_red_flag_countdown(objectIndex, arg1);
break;
case 2:
func_8007278C(objectIndex, gObjectList[objectIndex].unk_048);
@@ -3063,7 +3063,7 @@ void func_80079380(s32 objectIndex, s32 arg1) {
}
}
-void func_8007963C(s32 objectIndex, s32 playerIndex) {
+void init_obj_laikitu_red_flag(s32 objectIndex, s32 playerIndex) {
Objects *temp_v0;
func_800791F0(objectIndex, playerIndex);
@@ -3080,12 +3080,12 @@ void func_8007963C(s32 objectIndex, s32 playerIndex) {
func_80072488(objectIndex);
}
-void func_80079700(s32 objectIndex, s32 playerIndex) {
+void update_obj_laikitu_red_flag(s32 objectIndex, s32 playerIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
- func_8007963C(objectIndex, playerIndex);
+ init_obj_laikitu_red_flag(objectIndex, playerIndex);
break;
case 2:
set_object_flag_unk_054_true(objectIndex, 0x00000010);
@@ -3104,7 +3104,7 @@ void func_800797AC(s32 playerId) {
s32 objectIndex;
Player *player;
- objectIndex = D_80183DB8[playerId];
+ objectIndex = gIndexLakituList[playerId];
player = &gPlayerOne[playerId];
if ((gCurrentCourseId == COURSE_SHERBET_LAND) && (player->unk_0CA & 1)) {
init_object(objectIndex, 7);
@@ -3119,7 +3119,7 @@ void func_80079860(s32 playerId) {
s32 objectIndex;
Player *player;
- objectIndex = D_80183DB8[playerId];
+ objectIndex = gIndexLakituList[playerId];
player = &gPlayerOne[playerId];
if ((func_80072354(objectIndex, 1) != 0) &&
(
@@ -3142,7 +3142,7 @@ void func_8007993C(s32 objectIndex, Player *player) {
func_800722CC(objectIndex, 2);
}
-void func_800799A8(s32 objectIndex, s32 arg1) {
+void init_obj_laikitu_red_flag_fishing(s32 objectIndex, s32 arg1) {
func_800791F0(objectIndex, arg1);
init_texture_object(objectIndex, common_tlut_lakitu_fishing, gTextureLakituFishing1, 0x38U, (u16) 0x00000048);
gObjectList[objectIndex].vertex = D_0D005F30;
@@ -3159,9 +3159,9 @@ void func_80079A5C(s32 objectIndex, UNUSED Player *player) {
case 0:
break;
case 1:
- gObjectList[objectIndex].unk_010[2] = 0.0f;
- gObjectList[objectIndex].unk_010[1] = 0.0f;
- gObjectList[objectIndex].unk_010[0] = 0.0f;
+ gObjectList[objectIndex].origin_pos[2] = 0.0f;
+ gObjectList[objectIndex].origin_pos[1] = 0.0f;
+ gObjectList[objectIndex].origin_pos[0] = 0.0f;
gObjectList[objectIndex].unk_028[2] = 0.0f;
gObjectList[objectIndex].unk_028[0] = 0.0f;
gObjectList[objectIndex].unk_028[1] = 80.0f;
@@ -3180,14 +3180,14 @@ void func_80079A5C(s32 objectIndex, UNUSED Player *player) {
}
}
-void func_80079B40(s32 objectIndex, s32 playerId) {
+void update_obj_laikitu_fishing(s32 objectIndex, s32 playerId) {
Player *player = &gPlayerOne[playerId];
switch (gObjectList[objectIndex].state) { /* switch 1; irregular */
case 0: /* switch 1 */
break;
case 1: /* switch 1 */
- func_800799A8(objectIndex, playerId);
+ init_obj_laikitu_red_flag_fishing(objectIndex, playerId);
break;
case 2: /* switch 1 */
set_object_flag_unk_054_true(objectIndex, 0x00000010);
@@ -3234,7 +3234,7 @@ void func_80079B40(s32 objectIndex, s32 playerId) {
func_80079A5C(objectIndex, player);
}
-void func_80079D44(s32 objectIndex, s32 playerId) {
+void update_obj_laikitu_fishing2(s32 objectIndex, s32 playerId) {
Player *temp_s1;
@@ -3243,7 +3243,7 @@ void func_80079D44(s32 objectIndex, s32 playerId) {
case 0: /* switch 1 */
break;
case 1: /* switch 1 */
- func_800799A8(objectIndex, playerId);
+ init_obj_laikitu_red_flag_fishing(objectIndex, playerId);
break;
case 2: /* switch 1 */
set_object_flag_unk_054_true(objectIndex, 0x00000010);
@@ -3330,7 +3330,7 @@ void func_8007A060(s32 objectIndex, s32 playerIndex) {
func_80072488(objectIndex);
}
-void func_8007A124(s32 objectIndex, s32 playerIndex) {
+void update_obj_laikitu_second_lap(s32 objectIndex, s32 playerIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
break;
@@ -3378,7 +3378,7 @@ void func_8007A228(s32 objectIndex, s32 playerIndex) {
func_80072488(objectIndex);
}
-void func_8007A2EC(s32 objectIndex, s32 playerIndex) {
+void update_obj_laikitu_final_lap(s32 objectIndex, s32 playerIndex) {
switch (gObjectList[objectIndex].state) {
case 0:
break;
@@ -3426,7 +3426,7 @@ void func_8007A3F0(s32 objectIndex, s32 arg1) {
func_800C8F80((u8)arg1, 0x0100FA28);
}
-void func_8007A4D4(s32 objectIndex, s32 playerId) {
+void update_obj_laikitu_reverse(s32 objectIndex, s32 playerId) {
Player *sp2C = &gPlayerOne[playerId];
switch (gObjectList[objectIndex].state) {
@@ -3471,18 +3471,18 @@ void func_8007A66C(s32 objectIndex, Player *player, Camera *camera) {
u16 temp_t8;
temp_t8 = 0x8000 - camera->rot[1];
- gObjectList[objectIndex].pos[0] = (player->pos[0] + (coss(temp_t8) * (gObjectList[objectIndex].unk_010[0] + gObjectList[objectIndex].unk_028[0]))) - (sins(temp_t8) * (gObjectList[objectIndex].unk_010[2] + gObjectList[objectIndex].unk_028[2]));
- gObjectList[objectIndex].pos[1] = player->unk_074 + gObjectList[objectIndex].unk_010[1] + gObjectList[objectIndex].unk_028[1];
- gObjectList[objectIndex].pos[2] = (player->pos[2] + (sins(temp_t8) * (gObjectList[objectIndex].unk_010[0] + gObjectList[objectIndex].unk_028[0]))) + (coss(temp_t8) * (gObjectList[objectIndex].unk_010[2] + gObjectList[objectIndex].unk_028[2]));
+ gObjectList[objectIndex].pos[0] = (player->pos[0] + (coss(temp_t8) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].unk_028[0]))) - (sins(temp_t8) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].unk_028[2]));
+ gObjectList[objectIndex].pos[1] = player->unk_074 + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].unk_028[1];
+ gObjectList[objectIndex].pos[2] = (player->pos[2] + (sins(temp_t8) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].unk_028[0]))) + (coss(temp_t8) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].unk_028[2]));
}
void func_8007A778(s32 objectIndex, Player *player, Camera *camera) {
u16 temp_t8;
temp_t8 = 0x8000 - camera->rot[1];
- gObjectList[objectIndex].pos[0] = (player->pos[0] + (coss(temp_t8) * (gObjectList[objectIndex].unk_010[0] + gObjectList[objectIndex].unk_028[0]))) - (sins(temp_t8) * (gObjectList[objectIndex].unk_010[2] + gObjectList[objectIndex].unk_028[2]));
- gObjectList[objectIndex].pos[1] = player->pos[1] + gObjectList[objectIndex].unk_010[1] + gObjectList[objectIndex].unk_028[1];
- gObjectList[objectIndex].pos[2] = (player->pos[2] + (sins(temp_t8) * (gObjectList[objectIndex].unk_010[0] + gObjectList[objectIndex].unk_028[0]))) + (coss(temp_t8) * (gObjectList[objectIndex].unk_010[2] + gObjectList[objectIndex].unk_028[2]));
+ gObjectList[objectIndex].pos[0] = (player->pos[0] + (coss(temp_t8) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].unk_028[0]))) - (sins(temp_t8) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].unk_028[2]));
+ gObjectList[objectIndex].pos[1] = player->pos[1] + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].unk_028[1];
+ gObjectList[objectIndex].pos[2] = (player->pos[2] + (sins(temp_t8) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].unk_028[0]))) + (coss(temp_t8) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].unk_028[2]));
}
UNUSED void func_8007A884(void) {
@@ -3493,7 +3493,7 @@ void func_8007A88C(s32 playerId) {
s32 objectIndex;
Player *player;
- objectIndex = D_80183DB8[playerId];
+ objectIndex = gIndexLakituList[playerId];
player = &gPlayerOne[playerId];
if ((gObjectList[objectIndex].state == 0) && (player->effects & 0x400000)) {
@@ -3508,37 +3508,37 @@ void func_8007A910(s32 arg0) {
func_80079860(arg0);
}
-void func_8007A948(s32 playerId) {
- s32 objectIndex = D_80183DB8[playerId];
+void update_obj_laikitu(s32 playerId) {
+ s32 objectIndex = gIndexLakituList[playerId];
switch (gObjectList[objectIndex].unk_0D8) {
case 0:
break;
case 1:
- func_80079380(objectIndex, playerId);
+ update_obj_laikitu_countdown(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 2:
- func_80079700(objectIndex, playerId);
+ update_obj_laikitu_red_flag(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 3:
- func_80079B40(objectIndex, playerId);
+ update_obj_laikitu_fishing(objectIndex, playerId);
break;
case 4:
- func_8007A124(objectIndex, playerId);
+ update_obj_laikitu_second_lap(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 5:
- func_8007A2EC(objectIndex, playerId);
+ update_obj_laikitu_final_lap(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 6:
- func_8007A4D4(objectIndex, playerId);
+ update_obj_laikitu_reverse(objectIndex, playerId);
func_8008BFFC(objectIndex);
break;
case 7:
- func_80079D44(objectIndex, playerId);
+ update_obj_laikitu_fishing2(objectIndex, playerId);
break;
}
}
@@ -3547,7 +3547,7 @@ void func_8007AA44(s32 playerId) {
s32 objectIndex;
func_8007A910(playerId);
- objectIndex = D_80183DB8[playerId];
+ objectIndex = gIndexLakituList[playerId];
D_8018C028 = D_80183FA8[playerId];
switch (gObjectList[objectIndex].unk_0D8) {
case 1:
@@ -3998,12 +3998,12 @@ void func_8007BBBC(s32 objectIndex) {
} else {
func_80087E08(objectIndex, 18.0f, 0.7f, 25.0f, (s16) 0x00005800, 0x0000012C);
}
- if (temp_s1->unk_038[2] < 0.0f) {
- var_f14 = -temp_s1->unk_038[2];
+ if (temp_s1->velocity[2] < 0.0f) {
+ var_f14 = -temp_s1->velocity[2];
} else {
- var_f14 = temp_s1->unk_038[2];
+ var_f14 = temp_s1->velocity[2];
}
- temp_s1->unk_0BE[0] = func_80041658(temp_s1->unk_038[1], var_f14);
+ temp_s1->direction_angle[0] = func_80041658(temp_s1->velocity[1], var_f14);
func_8007278C(objectIndex, 0x00000046);
break;
case 3:
@@ -4020,7 +4020,7 @@ void func_8007BD04(s32 playerId) {
objectIndex = indexObjectList2[0];
if (gObjectList[objectIndex].state == 0) {
if (((s32) gNearestWaypointByPlayerId[playerId] >= 0xA0) && ((s32) gNearestWaypointByPlayerId[playerId] < 0xAB)) {
- func_8008B7D4(objectIndex, xOrientation * -1650.0, -200.0f, -1650.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -1650.0, -200.0f, -1650.0f);
init_object(objectIndex, 1);
}
}
@@ -4028,26 +4028,26 @@ void func_8007BD04(s32 playerId) {
void func_8007BDA8(void) {
UNUSED s32 pad;
- s32 temp_a0;
+ s32 objectIndex;
func_8007BD04(0);
- temp_a0 = indexObjectList2[0];
- func_8007BBBC(temp_a0);
- func_8008BF18(temp_a0);
+ objectIndex = indexObjectList2[0];
+ func_8007BBBC(objectIndex);
+ func_8008BF18(objectIndex);
}
-void func_8007BDE0(s32 objectIndex) {
+void init_var_cheep_cheep(s32 objectIndex) {
Objects *temp_v0;
temp_v0 = &gObjectList[objectIndex];
temp_v0->unk_0D5 = 1;
temp_v0->unk_054 = 0;
- temp_v0->unk_070 = d_course_banshee_boardwalk_dl_cheep_cheep;
+ temp_v0->model = d_course_banshee_boardwalk_dl_cheep_cheep;
temp_v0->sizeScaling = 0.2f;
func_80072488(objectIndex);
- func_8008B7D4(objectIndex, D_800E634C[0][0], D_800E634C[0][1] + 55.0, D_800E634C[0][2]);
+ set_obj_origin_pos(objectIndex, D_800E634C[0][0], D_800E634C[0][1] + 55.0, D_800E634C[0][2]);
func_8008B80C(objectIndex, 0.0f, 30.0f, 0.0f);
- func_8008B888(objectIndex, 0U, 0x3800U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0x3800U, 0U);
}
void func_8007BEC8(s32 objectIndex) {
@@ -4056,7 +4056,7 @@ void func_8007BEC8(s32 objectIndex) {
temp_v0 = &gObjectList[objectIndex];
switch (temp_v0->state) {
case 1:
- func_8007BDE0(objectIndex);
+ init_var_cheep_cheep(objectIndex);
break;
case 2:
if (func_8007278C(objectIndex, 0x0000003C) != 0) {
@@ -4093,10 +4093,10 @@ void func_8007BFB0(s32 objectIndex) {
case 0:
break;
case 1:
- temp_s0->unk_038[1] = -0.2f;
+ temp_s0->velocity[1] = -0.2f;
if ((f64) temp_s0->unk_028[1] <= 0.0) {
temp_s0->unk_028[1] = 0.0f;
- temp_s0->unk_038[1] = 0.0f;
+ temp_s0->velocity[1] = 0.0f;
func_80086F60(objectIndex);
}
break;
@@ -4107,10 +4107,10 @@ void func_8007BFB0(s32 objectIndex) {
break;
case 3:
temp_s0->sizeScaling = (f32) ((f64) temp_s0->sizeScaling - 0.0015);
- if ((s32) temp_s0->unk_0BE[0] >= 0xA01) {
+ if ((s32) temp_s0->direction_angle[0] >= 0xA01) {
temp_s0->unk_084[7] -= 4;
}
- if (u16_step_up_towards(temp_s0->unk_0BE, 0x0C00U, (u16) temp_s0->unk_084[7]) != 0) {
+ if (u16_step_up_towards(temp_s0->direction_angle, 0x0C00U, (u16) temp_s0->unk_084[7]) != 0) {
func_80086FD4(objectIndex);
}
break;
@@ -4126,7 +4126,7 @@ void func_8007BFB0(s32 objectIndex) {
}
temp_s0->sizeScaling += temp_s0->unk_034;
s16_step_up_towards(&temp_s0->unk_084[7], 0x0100, 0x0010);
- temp_s0->unk_0BE[0] -= temp_s0->unk_084[7];
+ temp_s0->direction_angle[0] -= temp_s0->unk_084[7];
if (func_80087060(objectIndex, 0x00000035) != 0) {
func_80086FD4(objectIndex);
}
@@ -4224,7 +4224,7 @@ void func_8007C420(s32 objectIndex, Player *player, Camera *camera) {
x = player->pos[0] - gObjectList[objectIndex].pos[0];
z = player->pos[2] - gObjectList[objectIndex].pos[2];
- gObjectList[objectIndex].unk_0BE[1] = func_800417B4(gObjectList[objectIndex].unk_0BE[1], atan2s(x, z));
+ gObjectList[objectIndex].direction_angle[1] = func_800417B4(gObjectList[objectIndex].direction_angle[1], atan2s(x, z));
func_8007C360(objectIndex, camera);
}
@@ -4266,7 +4266,7 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007C4A4.s")
#endif
void func_8007C550(s32 objectIndex) {
- gObjectList[objectIndex].unk_0BE[1] = func_800417B4(gObjectList[objectIndex].unk_0BE[1], atan2s(gObjectList[objectIndex].unk_038[0], gObjectList[objectIndex].unk_038[2]));
+ gObjectList[objectIndex].direction_angle[1] = func_800417B4(gObjectList[objectIndex].direction_angle[1], atan2s(gObjectList[objectIndex].velocity[0], gObjectList[objectIndex].velocity[2]));
func_8007C4A4(objectIndex);
}
@@ -4287,8 +4287,8 @@ void func_8007C5B4(s32 objectIndex) {
func_80073FD4(objectIndex);
func_80086EF0(objectIndex);
set_object_flag_unk_054_true(objectIndex, 0x00000800);
- temp_s0->unk_0B2[0] = 0;
- temp_s0->unk_0B2[2] = 0x8000;
+ temp_s0->orientation[0] = 0;
+ temp_s0->orientation[2] = 0x8000;
}
void func_8007C684(s32 objectIndex) {
@@ -4340,9 +4340,9 @@ void func_8007C7B4(s32 someIndex, s32 arg1) {
random_int(0x1000U);
something = D_800E5D9C[temp_a0];
gObjectList[objectIndex].unk_080 = something;
- gObjectList[objectIndex].unk_010[0] = (f32) temp_s1_2;
- gObjectList[objectIndex].unk_010[1] = (f32) temp_s4;
- gObjectList[objectIndex].unk_010[2] = (f32) temp_s5;
+ gObjectList[objectIndex].origin_pos[0] = (f32) temp_s1_2;
+ gObjectList[objectIndex].origin_pos[1] = (f32) temp_s4;
+ gObjectList[objectIndex].origin_pos[2] = (f32) temp_s5;
}
func_800C9060(arg1, 0x1900705AU);
@@ -4455,9 +4455,9 @@ void func_8007CC00(void) {
player = &gPlayerOne[object->unk_0D1];
camera = &camera1[object->unk_0D1];
temp_t4 = (0x8000 - camera->rot[1]);
- object->pos[0] = player->pos[0] + (coss(temp_t4) * (object->unk_010[0] + object->unk_028[0])) - (sins(temp_t4) * (object->unk_010[2] + object->unk_028[2]));
- object->pos[1] = 6.5 + player->unk_074 + object->unk_010[1] + object->unk_028[1];
- object->pos[2] = player->pos[2] + (sins(temp_t4) * (object->unk_010[0] + object->unk_028[0])) + (coss(temp_t4) * (object->unk_010[2] + object->unk_028[2]));
+ object->pos[0] = player->pos[0] + (coss(temp_t4) * (object->origin_pos[0] + object->unk_028[0])) - (sins(temp_t4) * (object->origin_pos[2] + object->unk_028[2]));
+ object->pos[1] = 6.5 + player->unk_074 + object->origin_pos[1] + object->unk_028[1];
+ object->pos[2] = player->pos[2] + (sins(temp_t4) * (object->origin_pos[0] + object->unk_028[0])) + (coss(temp_t4) * (object->origin_pos[2] + object->unk_028[2]));
func_8007C550(objectIndex);
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00000080) != 0) {
object->vertex = D_800E44B0;
@@ -4482,8 +4482,8 @@ void func_8007CE0C(s32 objectIndex) {
temp_s0->unk_0A0 = 0;
func_80073844(objectIndex);
func_80086EF0(objectIndex);
- temp_s0->unk_0BE[2] = 0x8000;
- temp_s0->unk_0BE[1] = atan2s(D_8018CF1C->pos[0] - temp_s0->unk_010[0], D_8018CF1C->pos[2] - temp_s0->unk_010[2]);
+ temp_s0->direction_angle[2] = 0x8000;
+ temp_s0->direction_angle[1] = atan2s(D_8018CF1C->pos[0] - temp_s0->origin_pos[0], D_8018CF1C->pos[2] - temp_s0->origin_pos[2]);
}
void func_8007CEDC(s32 objectIndex) {
@@ -4546,34 +4546,34 @@ void func_8007D070(void) {
var_v0 = 0;
if ((D_8016559C == 0) && (D_8018D2A4 != 0) && (D_8018CF68[0] < 0x1D) && (D_800E5DB4[D_8018CF68[0]] == 1)) {
- while (gObjectList[D_8018C1B0[var_v0 + 10]].state != 0) {
+ while (gObjectList[gObjectParticle1[var_v0 + 10]].state != 0) {
var_v0++;
if (var_v0 == 30) break;
}
- objectIndex = D_8018C1B0[var_v0 + 10];
+ objectIndex = gObjectParticle1[var_v0 + 10];
if (var_v0 != 30) {
if (gObjectList[objectIndex].state == 0) {
init_object(objectIndex, 1);
temp_s2 = random_int(0x012CU);
temp_s3 = random_int(0x1000U) - 0x800;
temp_t5 = random_int(0x000FU) - 5;
- gObjectList[objectIndex].unk_0BE[1] = D_8018CF1C->unk_02C[1] + 0x8000;
+ gObjectList[objectIndex].direction_angle[1] = D_8018CF1C->unk_02C[1] + 0x8000;
temp_t2 = (D_8018CF14->rot[1] + temp_s3);
- gObjectList[objectIndex].unk_010[0] = D_8018CF1C->pos[0] + (sins(temp_t2) * temp_s2);
- gObjectList[objectIndex].unk_010[1] = temp_t5;
- gObjectList[objectIndex].unk_010[2] = D_8018CF1C->pos[2] + (coss(temp_t2) * temp_s2);
+ gObjectList[objectIndex].origin_pos[0] = D_8018CF1C->pos[0] + (sins(temp_t2) * temp_s2);
+ gObjectList[objectIndex].origin_pos[1] = temp_t5;
+ gObjectList[objectIndex].origin_pos[2] = D_8018CF1C->pos[2] + (coss(temp_t2) * temp_s2);
gObjectList[objectIndex].unk_080 = D_800E5D54;
}
}
}
for (var_v0 = 0; var_v0 < 30; var_v0++) {
- objectIndex = D_8018C1B0[var_v0 + 10];
+ objectIndex = gObjectParticle1[var_v0 + 10];
if (gObjectList[objectIndex].state != 0) {
func_8007CEDC(objectIndex);
func_8008B724(objectIndex);
- gObjectList[objectIndex].pos[0] = gObjectList[objectIndex].unk_010[0] + gObjectList[objectIndex].unk_028[0];
- gObjectList[objectIndex].pos[1] = D_8018CF1C->unk_074 + gObjectList[objectIndex].unk_010[1] + gObjectList[objectIndex].unk_028[1];
- gObjectList[objectIndex].pos[2] = gObjectList[objectIndex].unk_010[2] + gObjectList[objectIndex].unk_028[2];
+ gObjectList[objectIndex].pos[0] = gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].unk_028[0];
+ gObjectList[objectIndex].pos[1] = D_8018CF1C->unk_074 + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].unk_028[1];
+ gObjectList[objectIndex].pos[2] = gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].unk_028[2];
func_8007C420(objectIndex, D_8018CF1C, D_8018CF14);
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00000080) != 0) {
gObjectList[objectIndex].vertex = D_800E44B0;
@@ -4586,27 +4586,27 @@ void func_8007D070(void) {
void func_8007D360(s32 objectIndex, s32 arg1) {
if (arg1 == 1) {
- gObjectList[objectIndex].unk_010[0] = (f32) ((-1775.0 - random_int(0x001EU)) * (f64) xOrientation);
- gObjectList[objectIndex].unk_010[1] = (f32) (random_int(0x0019U) + 25.0);
- gObjectList[objectIndex].unk_010[2] = (f32) (random_int(0x001EU) + 130.0);
+ gObjectList[objectIndex].origin_pos[0] = (f32) ((-1775.0 - random_int(0x001EU)) * (f64) xOrientation);
+ gObjectList[objectIndex].origin_pos[1] = (f32) (random_int(0x0019U) + 25.0);
+ gObjectList[objectIndex].origin_pos[2] = (f32) (random_int(0x001EU) + 130.0);
gObjectList[objectIndex].unk_01C[0] = (f32) ((f64) xOrientation * -2500.0);
gObjectList[objectIndex].unk_01C[1] = 0.0f;
gObjectList[objectIndex].unk_01C[2] = (f32) (220.0 - random_int(0x0096U));
- gObjectList[objectIndex].unk_0BE[0] = 0xDC00;
+ gObjectList[objectIndex].direction_angle[0] = 0xDC00;
gObjectList[objectIndex].unk_0C6 = 0x0800;
}
if (arg1 == 2) {
- gObjectList[objectIndex].unk_010[0] = (f32) (-0x55B - random_int(0x001EU)) * xOrientation;
- gObjectList[objectIndex].unk_010[1] = (f32) (random_int(0x0019U) + 0xF);
- gObjectList[objectIndex].unk_010[2] = (f32) (random_int(0x001EU) - 0xE8);
+ gObjectList[objectIndex].origin_pos[0] = (f32) (-0x55B - random_int(0x001EU)) * xOrientation;
+ gObjectList[objectIndex].origin_pos[1] = (f32) (random_int(0x0019U) + 0xF);
+ gObjectList[objectIndex].origin_pos[2] = (f32) (random_int(0x001EU) - 0xE8);
gObjectList[objectIndex].unk_01C[0] = (f32) ((f64) xOrientation * -2100.0);
gObjectList[objectIndex].unk_01C[1] = 0.0f;
gObjectList[objectIndex].unk_01C[2] = (f32) (random_int(0x00C8U) + -290.0);
- gObjectList[objectIndex].unk_0BE[0] = 0;
+ gObjectList[objectIndex].direction_angle[0] = 0;
gObjectList[objectIndex].unk_0C6 = 0;
}
- gObjectList[objectIndex].unk_0BE[1] = func_80041770(gObjectList[objectIndex].unk_010[0], gObjectList[objectIndex].unk_01C[0], gObjectList[objectIndex].unk_010[2], gObjectList[objectIndex].unk_01C[2]);
- gObjectList[objectIndex].unk_0BE[2] = 0;
+ gObjectList[objectIndex].direction_angle[1] = func_80041770(gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_01C[0], gObjectList[objectIndex].origin_pos[2], gObjectList[objectIndex].unk_01C[2]);
+ gObjectList[objectIndex].direction_angle[2] = 0;
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
gObjectList[objectIndex].unk_0B0 = 0;
if (gCCSelection < CC_150) {
@@ -4629,16 +4629,16 @@ void func_8007D6A8(s32 objectIndex, s32 arg1) {
}
void func_8007D714(s32 arg0) {
- s32 var_v0;
+ s32 objectIndex;
if (arg0 == 1) {
- var_v0 = func_80072044(D_8018C3F0, &D_80183E4C, 0x00000028);
+ objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, 0x28);
} else {
- var_v0 = func_80072044(D_8018C630, &D_80183E5C, 0x0000001E);
+ objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, 0x1E);
}
- if (var_v0 != -1) {
- init_object(var_v0, 0);
- func_8007D6A8(var_v0, arg0);
+ if (objectIndex != NULL_OBJECT_ID) {
+ init_object(objectIndex, 0);
+ func_8007D6A8(objectIndex, arg0);
}
}
@@ -4702,9 +4702,9 @@ void func_8007D8D4(s32 objectIndex, s32 arg1) {
}
}
-void func_8007DA4C(s32 arg0) {
- func_8008781C(arg0);
- func_8008BF18(arg0);
+void func_8007DA4C(s32 objectIndex) {
+ func_8008781C(objectIndex);
+ func_8008BF18(objectIndex);
}
void func_8007DA74(s32 objectIndex) {
@@ -4714,7 +4714,7 @@ void func_8007DA74(s32 objectIndex) {
gObjectList[objectIndex].unk_0C6 = 0U;
}
}
- gObjectList[objectIndex].unk_0BE[0] = func_800417B4(gObjectList[objectIndex].unk_0BE[0], gObjectList[objectIndex].unk_0C6);
+ gObjectList[objectIndex].direction_angle[0] = func_800417B4(gObjectList[objectIndex].direction_angle[0], gObjectList[objectIndex].unk_0C6);
func_80087844(objectIndex);
func_8008BF18(objectIndex);
}
@@ -4746,11 +4746,11 @@ void func_8007DB44(void) {
func_80073514(temp_s0);
temp_s1 = &gObjectList[temp_s0];
func_80073CB0(temp_s0, &temp_s1->unk_0A0, -0x00001000, 0x00001000, 0x00000400, 0, -1);
- temp_s1->unk_0B2[2] = temp_s1->unk_0A0 + 0x8000;
+ temp_s1->orientation[2] = temp_s1->unk_0A0 + 0x8000;
if ((D_8018CFB0 != 0) || (D_8018CFC8 != 0)) {
D_8018CFD8 = 0;
for (var_s2 = 0; var_s2 < 40; var_s2++) {
- temp_s0 = D_8018C3F0[var_s2];
+ temp_s0 = gObjectParticle2[var_s2];
if (temp_s0 == -1) continue;
temp_s1 = &gObjectList[temp_s0];
@@ -4760,7 +4760,7 @@ void func_8007DB44(void) {
func_8007DAF8(temp_s0, 1);
func_8007D794(temp_s0);
if (temp_s1->state == 0) {
- delete_object_wrapper(&D_8018C3F0[var_s2]);
+ delete_object_wrapper(&gObjectParticle2[var_s2]);
}
D_8018CFD8 += 1;
}
@@ -4771,7 +4771,7 @@ void func_8007DB44(void) {
if ((D_8018CFE8 != 0) || (D_8018D000 != 0)) {
D_8018D010 = 0;
for (var_s2 = 0; var_s2 < 30; var_s2++) {
- temp_s0 = D_8018C630[var_s2];
+ temp_s0 = gObjectParticle3[var_s2];
if (temp_s0 == -1) continue;
temp_s1 = &gObjectList[temp_s0];
@@ -4781,7 +4781,7 @@ void func_8007DB44(void) {
func_8007DAF8(temp_s0, 2);
func_8007D794(temp_s0);
if (temp_s1->state == 0) {
- delete_object_wrapper(&D_8018C630[var_s2]);
+ delete_object_wrapper(&gObjectParticle3[var_s2]);
}
D_8018D010 += 1;
}
@@ -4815,7 +4815,7 @@ void func_8007DDC0(s32 objectIndex) {
func_8008A6DC(objectIndex, sp2C);
if ((is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) && (func_80072354(objectIndex, 1) != 0)) {
func_800722A4(objectIndex, 1);
- func_800C9D80(temp_s0->pos, temp_s0->unk_038, 0x51028006U);
+ func_800C9D80(temp_s0->pos, temp_s0->velocity, 0x51028006U);
func_800726CC(objectIndex, 3);
if (temp_s0->type > 0) {
temp_s0->type--;
@@ -4833,20 +4833,20 @@ void func_8007DDC0(s32 objectIndex) {
void init_bb_trash_bin(s32 objectIndex) {
gObjectList[objectIndex].sizeScaling = 1.0f;
- gObjectList[objectIndex].unk_070 = d_course_banshee_boardwalk_dl_trash_bin;
+ gObjectList[objectIndex].model = d_course_banshee_boardwalk_dl_trash_bin;
gObjectList[objectIndex].unk_04C = 0;
gObjectList[objectIndex].unk_084[7] = 0;
- func_8008B8BC(objectIndex, 0U, 0U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0U, 0U);
if (gIsMirrorMode != 0) {
gObjectList[objectIndex].pos[0] = 1765.0f;
gObjectList[objectIndex].pos[2] = 195.0f;
- gObjectList[objectIndex].unk_0B2[1] = 0x8000;
+ gObjectList[objectIndex].orientation[1] = 0x8000;
} else {
gObjectList[objectIndex].pos[0] = -1765.0f;
gObjectList[objectIndex].pos[2] = 70.0f;
}
gObjectList[objectIndex].pos[1] = 45.0f;
- func_8008B8F0(objectIndex, 0.0f, 0.0f, 0.0f);
+ set_obj_velocity(objectIndex, 0.0f, 0.0f, 0.0f);
gObjectList[objectIndex].type = 0;
func_80072488(objectIndex);
}
@@ -4874,22 +4874,22 @@ void func_8007E00C(s32 objectIndex) {
}
}
func_80073CB0(objectIndex, &gObjectList[objectIndex].unk_0A0, -0x00002000, 0, 0x00000400, 0, -1);
- gObjectList[objectIndex].unk_0B2[2] = gObjectList[objectIndex].unk_0A0;
+ gObjectList[objectIndex].orientation[2] = gObjectList[objectIndex].unk_0A0;
if (gObjectList[objectIndex].unk_084[7] == 0) {
- func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_038, 0x1901904EU);
+ func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x1901904EU);
gObjectList[objectIndex].unk_084[7] = 0x0014;
} else {
gObjectList[objectIndex].unk_084[7]--;
}
break;
case 5:
- gObjectList[objectIndex].unk_0B2[2] = func_800417B4(gObjectList[objectIndex].unk_0B2[2], 0U);
- if (gObjectList[objectIndex].unk_0B2[2] == 0) {
+ gObjectList[objectIndex].orientation[2] = func_800417B4(gObjectList[objectIndex].orientation[2], 0U);
+ if (gObjectList[objectIndex].orientation[2] == 0) {
func_80072488(objectIndex);
}
break;
case 6:
- gObjectList[objectIndex].unk_0B2[2] = 0;
+ gObjectList[objectIndex].orientation[2] = 0;
gObjectList[objectIndex].unk_084[7] = 0;
func_80072488(objectIndex);
D_8018CFB0 = 0;
@@ -4933,7 +4933,7 @@ void func_8007E1F4(s32 objectIndex) {
func_8008A6DC(objectIndex, sp2C);
if ((is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) && (func_80072354(objectIndex, 1) != 0)) {
func_800722A4(objectIndex, 1);
- func_800C9D80(temp_s0->pos, temp_s0->unk_038, 0x51028006U);
+ func_800C9D80(temp_s0->pos, temp_s0->velocity, 0x51028006U);
func_800726CC(objectIndex, 3);
if (temp_s0->type > 0) {
temp_s0->type--;
@@ -4953,7 +4953,7 @@ void func_8007E358(s32 objectIndex) {
gObjectList[objectIndex].pos[0] = -1371.0f * xOrientation;
gObjectList[objectIndex].pos[1] = 31.0f;
gObjectList[objectIndex].pos[2] = -217.0f;
- func_8008B8F0(objectIndex, 0.0f, 0.0f, 0.0f);
+ set_obj_velocity(objectIndex, 0.0f, 0.0f, 0.0f);
gObjectList[objectIndex].type = 0;
gObjectList[objectIndex].unk_04C = 0;
gObjectList[objectIndex].unk_084[7] = 0;
@@ -5112,7 +5112,7 @@ void func_8007E63C(s32 objectIndex) {
func_800722A4(objectIndex, 0x00000020);
}
}
- func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_038, 0x19018045U);
+ func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x19018045U);
func_80072488(objectIndex);
}
break;
@@ -5155,7 +5155,7 @@ void func_8007E63C(s32 objectIndex) {
}
break;
case 0x12C:
- if (func_80073E18(objectIndex, &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00008000) != 0) {
+ if (func_80073E18(objectIndex, &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00008000) != 0) {
func_800722CC(objectIndex, 4);
func_8007266C(objectIndex);
}
@@ -5168,17 +5168,17 @@ void func_8007EC30(s32 objectIndex) {
temp_s1 = &gObjectList[objectIndex];
temp_s1->unk_044 = 0.0f;
- temp_s1->unk_010[1] = 0.0f;
+ temp_s1->origin_pos[1] = 0.0f;
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
if (gIsMirrorMode != 0) {
- func_8008B888(objectIndex, 0U, 0x4000U, 0U);
- func_8008B8BC(objectIndex, 0U, 0x4000U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0x4000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0x4000U, 0U);
} else {
- func_8008B888(objectIndex, 0U, 0xC000U, 0U);
- func_8008B8BC(objectIndex, 0U, 0xC000U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0xC000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0xC000U, 0U);
}
init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
- temp_s1->unk_070 = d_course_bowsers_castle_dl_thwomp;
+ temp_s1->model = d_course_bowsers_castle_dl_thwomp;
temp_s1->boundingBoxSize = 0x000C;
temp_s1->sizeScaling = 1.0f;
temp_s1->unk_01C[1] = 30.0f;
@@ -5213,7 +5213,7 @@ void func_8007ED6C(s32 objectIndex) {
}
func_8007E63C(objectIndex);
func_8008BF18(objectIndex);
- gObjectList[objectIndex].unk_0BE[1] = gObjectList[objectIndex].unk_0B2[1];
+ gObjectList[objectIndex].direction_angle[1] = gObjectList[objectIndex].orientation[1];
func_80073514(objectIndex);
}
@@ -5223,22 +5223,22 @@ void func_8007EE5C(s32 objectIndex) {
init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
temp_s0 = &gObjectList[objectIndex];
temp_s0->sizeScaling = 1.0f;
- temp_s0->unk_070 = d_course_bowsers_castle_dl_thwomp;
+ temp_s0->model = d_course_bowsers_castle_dl_thwomp;
temp_s0->boundingBoxSize = 0x000C;
set_object_flag_unk_054_true(objectIndex, 0x04000220);
temp_s0->type = 0;
temp_s0->unk_0DF = 6;
func_80086E70(objectIndex);
temp_s0->unk_044 = 0.0f;
- temp_s0->unk_010[1] = 0.0f;
+ temp_s0->origin_pos[1] = 0.0f;
func_8008B80C(objectIndex, 0.0f, 20.0f, 0.0f);
temp_s0->unk_01C[1] = 20.0f;
if (gIsMirrorMode != 0) {
- func_8008B888(objectIndex, 0U, 0x4000U, 0U);
- func_8008B8BC(objectIndex, 0U, 0x4000U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0x4000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0x4000U, 0U);
} else {
- func_8008B888(objectIndex, 0U, 0xC000U, 0U);
- func_8008B8BC(objectIndex, 0U, 0xC000U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0xC000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0xC000U, 0U);
}
temp_s0->unk_0AE = 1;
if (temp_s0->unk_0A0 == 0) {
@@ -5252,7 +5252,7 @@ void func_8007EE5C(s32 objectIndex) {
void func_8007EFBC(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 1:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0800U, 0x00008000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0800U, 0x00008000) != 0) {
gObjectList[objectIndex].unk_01C[0] = (f32) ((f64) xOrientation * 200.0);
func_80086FD4(objectIndex);
}
@@ -5263,13 +5263,13 @@ void func_8007EFBC(s32 objectIndex) {
}
break;
case 3:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00008000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00008000) != 0) {
func_800726CC(objectIndex, 3);
func_80086FD4(objectIndex);
}
break;
case 5:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x0000C000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x0000C000) != 0) {
func_80086FD4(objectIndex);
}
break;
@@ -5279,13 +5279,13 @@ void func_8007EFBC(s32 objectIndex) {
}
break;
case 7:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00004000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00004000) != 0) {
func_80086FD4(objectIndex);
func_800726CC(objectIndex, 3);
}
break;
case 9:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00010000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00010000) != 0) {
func_80086FD4(objectIndex);
}
break;
@@ -5295,13 +5295,13 @@ void func_8007EFBC(s32 objectIndex) {
}
break;
case 11:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00010000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00010000) != 0) {
func_80086FD4(objectIndex);
func_800726CC(objectIndex, 3);
}
break;
case 13:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00014000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00014000) != 0) {
func_80086FD4(objectIndex);
}
break;
@@ -5311,7 +5311,7 @@ void func_8007EFBC(s32 objectIndex) {
}
break;
case 15:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x0000C000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x0000C000) != 0) {
func_80086FD4(objectIndex);
func_800726CC(objectIndex, 3);
}
@@ -5328,7 +5328,7 @@ void func_8007EFBC(s32 objectIndex) {
void func_8007F280(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 1:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00010000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00010000) != 0) {
gObjectList[objectIndex].unk_01C[0] = (f32) ((f64) xOrientation * -200.0);
func_80086FD4(objectIndex);
}
@@ -5339,13 +5339,13 @@ void func_8007F280(s32 objectIndex) {
}
break;
case 3:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00010000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00010000) != 0) {
func_800726CC(objectIndex, 3);
func_80086FD4(objectIndex);
}
break;
case 5:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00004000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00004000) != 0) {
func_80086FD4(objectIndex);
}
break;
@@ -5355,13 +5355,13 @@ void func_8007F280(s32 objectIndex) {
}
break;
case 7:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x0000C000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x0000C000) != 0) {
func_80086FD4(objectIndex);
func_800726CC(objectIndex, 3);
}
break;
case 9:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00008000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00008000) != 0) {
func_80086FD4(objectIndex);
}
break;
@@ -5371,13 +5371,13 @@ void func_8007F280(s32 objectIndex) {
}
break;
case 11:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00008000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00008000) != 0) {
func_80086FD4(objectIndex);
func_800726CC(objectIndex, 3);
}
break;
case 13:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x0000C000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x0000C000) != 0) {
func_80086FD4(objectIndex);
}
break;
@@ -5387,7 +5387,7 @@ void func_8007F280(s32 objectIndex) {
}
break;
case 15:
- if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].unk_0B2[1], 0x0400U, 0x00014000) != 0) {
+ if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00014000) != 0) {
func_80086FD4(objectIndex);
func_800726CC(objectIndex, 3);
}
@@ -5452,7 +5452,7 @@ void func_8007F6C4(s32 objectIndex, s32 playerId) {
func_800722A4(objectIndex, 8);
func_80086E70(objectIndex);
gObjectList[objectIndex].unk_0DD = 2;
- gObjectList[objectIndex].unk_01C[0] = player->pos[0] - gObjectList[objectIndex].unk_010[0];
+ gObjectList[objectIndex].unk_01C[0] = player->pos[0] - gObjectList[objectIndex].origin_pos[0];
gObjectList[objectIndex].unk_0D1 = playerId;
}
@@ -5521,22 +5521,22 @@ void func_8007FA08(s32 objectIndex) {
init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
temp_s0 = &gObjectList[objectIndex];
- temp_s0->unk_070 = d_course_bowsers_castle_dl_thwomp;
+ temp_s0->model = d_course_bowsers_castle_dl_thwomp;
temp_s0->boundingBoxSize = 0x000C;
temp_s0->sizeScaling = 1.0f;
set_object_flag_unk_054_true(objectIndex, 0x04000220);
temp_s0->type = 0;
temp_s0->unk_044 = 0.0f;
- temp_s0->unk_010[1] = 0.0f;
+ temp_s0->origin_pos[1] = 0.0f;
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- func_8008B888(objectIndex, 0U, 0U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
if (gIsMirrorMode != 0) {
- func_8008B8BC(objectIndex, 0U, 0xC000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0xC000U, 0U);
} else {
- func_8008B8BC(objectIndex, 0U, 0x4000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0x4000U, 0U);
}
- temp_s0->unk_038[0] = 0.0f;
- temp_s0->unk_0BE[1] = temp_s0->unk_0B2[1];
+ temp_s0->velocity[0] = 0.0f;
+ temp_s0->direction_angle[1] = temp_s0->orientation[1];
temp_s0->unk_0DD = 1;
temp_s0->unk_0DF = 8;
temp_s0->unk_028[1] = 15.0f;
@@ -5555,30 +5555,30 @@ void func_8007FB48(s32 objectIndex) {
gObjectList[objectIndex].unk_0B0 = 0x00A0;
gObjectList[objectIndex].unk_028[0] = 0.0f;
gObjectList[objectIndex].unk_028[2] = 0.0f;
- gObjectList[objectIndex].unk_038[2] = 0.0f;
+ gObjectList[objectIndex].velocity[2] = 0.0f;
func_80086FD4(objectIndex);
break;
case 2:
- gObjectList[objectIndex].unk_038[0] = player->unk_094 * xOrientation * 1.25;
+ gObjectList[objectIndex].velocity[0] = player->unk_094 * xOrientation * 1.25;
if (gObjectList[objectIndex].unk_048 >= gObjectList[objectIndex].unk_0B0) {
if (gObjectList[objectIndex].unk_0B0 == gObjectList[objectIndex].unk_048) {
if (D_8018D400 & 1) {
- gObjectList[objectIndex].unk_038[2] = 1.5f;
+ gObjectList[objectIndex].velocity[2] = 1.5f;
} else {
- gObjectList[objectIndex].unk_038[2] = -1.5f;
+ gObjectList[objectIndex].velocity[2] = -1.5f;
}
}
- if (gObjectList[objectIndex].unk_038[2] >= 0.0) {
+ if (gObjectList[objectIndex].velocity[2] >= 0.0) {
if (gObjectList[objectIndex].unk_028[2] >= 40.0) {
- gObjectList[objectIndex].unk_038[2] = -1.5f;
+ gObjectList[objectIndex].velocity[2] = -1.5f;
}
} else if ((f64) gObjectList[objectIndex].unk_028[2] <= -40.0) {
- gObjectList[objectIndex].unk_038[2] = 1.5f;
+ gObjectList[objectIndex].velocity[2] = 1.5f;
}
}
func_8008775C(objectIndex);
if (gObjectList[objectIndex].unk_0B0 < 0x65) {
- gObjectList[objectIndex].unk_0B2[1] = func_800417B4(gObjectList[objectIndex].unk_0B2[1], (gObjectList[objectIndex].unk_0BE[1] + 0x8000));
+ gObjectList[objectIndex].orientation[1] = func_800417B4(gObjectList[objectIndex].orientation[1], (gObjectList[objectIndex].direction_angle[1] + 0x8000));
if (gObjectList[objectIndex].unk_0B0 == 0x0064) {
gObjectList[objectIndex].itemDisplay = 1;
}
@@ -5606,8 +5606,8 @@ void func_8007FB48(s32 objectIndex) {
}
break;
case 5:
- gObjectList[objectIndex].unk_0B2[1] = func_800417B4(gObjectList[objectIndex].unk_0B2[1], gObjectList[objectIndex].unk_0BE[1]);
- if (gObjectList[objectIndex].unk_0B2[1] == gObjectList[objectIndex].unk_0BE[1]) {
+ gObjectList[objectIndex].orientation[1] = func_800417B4(gObjectList[objectIndex].orientation[1], gObjectList[objectIndex].direction_angle[1]);
+ if (gObjectList[objectIndex].orientation[1] == gObjectList[objectIndex].direction_angle[1]) {
func_800722CC(objectIndex, 8);
func_80086FD4(objectIndex);
gObjectList[objectIndex].itemDisplay = 0;
@@ -5681,21 +5681,21 @@ void func_80080078(s32 objectIndex) {
init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
temp_s0 = &gObjectList[objectIndex];
- temp_s0->unk_070 = d_course_bowsers_castle_dl_thwomp;
+ temp_s0->model = d_course_bowsers_castle_dl_thwomp;
temp_s0->boundingBoxSize = 0x000C;
temp_s0->sizeScaling = 1.0f;
set_object_flag_unk_054_true(objectIndex, 0x04000220);
temp_s0->type = 2;
temp_s0->unk_0DF = 8;
- func_8008B888(objectIndex, 0U, 0U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
temp_s0->unk_044 = 0.0f;
- temp_s0->unk_010[1] = 0.0f;
+ temp_s0->origin_pos[1] = 0.0f;
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
temp_s0->unk_01C[1] = 30.0f;
if (gIsMirrorMode != 0) {
- func_8008B8BC(objectIndex, 0U, 0x4000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0x4000U, 0U);
} else {
- func_8008B8BC(objectIndex, 0U, 0xC000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0xC000U, 0U);
}
switch (temp_s0->unk_0A0) { /* irregular */
case 0:
@@ -5747,7 +5747,7 @@ void func_800802C0(s32 objectIndex) {
temp_s0 = &gObjectList[objectIndex];
temp_s0->unk_0D8 = 0;
init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
- temp_s0->unk_070 = d_course_bowsers_castle_dl_thwomp;
+ temp_s0->model = d_course_bowsers_castle_dl_thwomp;
temp_s0->itemDisplay = 0;
temp_s0->boundingBoxSize = 0x000C;
temp_s0->sizeScaling = 1.5f;
@@ -5755,15 +5755,15 @@ void func_800802C0(s32 objectIndex) {
temp_s0->type = 1;
temp_s0->unk_0DF = 6;
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- func_8008B888(objectIndex, 0U, 0U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
temp_s0->unk_044 = 0.0f;
- temp_s0->unk_010[1] = 0.0f;
+ temp_s0->origin_pos[1] = 0.0f;
temp_s0->unk_028[1] = 10.0f;
temp_s0->unk_01C[1] = 10.0f;
if (gIsMirrorMode != 0) {
- func_8008B8BC(objectIndex, 0U, 0x4000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0x4000U, 0U);
} else {
- func_8008B8BC(objectIndex, 0U, 0xC000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0xC000U, 0U);
}
temp_s0->unk_028[0] = 0.0f;
temp_s0->unk_028[2] = 0.0f;
@@ -5781,7 +5781,7 @@ void func_80080408(s32 objectIndex) {
case 2:
func_8008A6DC(objectIndex, 100.0f);
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) {
- func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_038, 0x19018045U);
+ func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x19018045U);
func_80072488(objectIndex);
}
break;
@@ -5805,7 +5805,7 @@ void func_80080524(s32 objectIndex) {
init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040);
temp_s0 = &gObjectList[objectIndex];
- temp_s0->unk_070 = d_course_bowsers_castle_dl_thwomp;
+ temp_s0->model = d_course_bowsers_castle_dl_thwomp;
temp_s0->boundingBoxSize = 0x000C;
temp_s0->itemDisplay = 0;
temp_s0->sizeScaling = 1.0f;
@@ -5815,22 +5815,22 @@ void func_80080524(s32 objectIndex) {
func_80086E70(objectIndex);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
temp_s0->unk_044 = 70.0f;
- temp_s0->unk_010[1] = 70.0f;
+ temp_s0->origin_pos[1] = 70.0f;
temp_s0->unk_01C[1] = 0.0f;
- func_8008B888(objectIndex, 0U, 0U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
if ((gIsMirrorMode != 0) || (gGamestate == 9)) {
- func_8008B8BC(objectIndex, 0U, 0xC000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0xC000U, 0U);
} else {
- func_8008B8BC(objectIndex, 0U, 0x4000U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0x4000U, 0U);
}
switch (temp_s0->unk_0A0) { /* irregular */
case 0:
temp_s0->unk_0DD = 2;
- temp_s0->unk_038[2] = -1.0f;
+ temp_s0->velocity[2] = -1.0f;
break;
case 1:
temp_s0->unk_0DD = 2;
- temp_s0->unk_038[2] = -1.5f;
+ temp_s0->velocity[2] = -1.5f;
break;
}
func_800722A4(objectIndex, 0x00000080);
@@ -5842,14 +5842,14 @@ void func_800806BC(s32 objectIndex) {
case 0:
break;
case 1:
- if (f32_step_towards(&gObjectList[objectIndex].unk_028[2], 250.0f, gObjectList[objectIndex].unk_038[2]) != 0) {
- gObjectList[objectIndex].unk_038[2] = -gObjectList[objectIndex].unk_038[2];
+ if (f32_step_towards(&gObjectList[objectIndex].unk_028[2], 250.0f, gObjectList[objectIndex].velocity[2]) != 0) {
+ gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2];
func_80086FD4(objectIndex);
}
break;
case 2:
- if (f32_step_towards(&gObjectList[objectIndex].unk_028[2], 0.0f, gObjectList[objectIndex].unk_038[2]) != 0) {
- gObjectList[objectIndex].unk_038[2] = -gObjectList[objectIndex].unk_038[2];
+ if (f32_step_towards(&gObjectList[objectIndex].unk_028[2], 0.0f, gObjectList[objectIndex].velocity[2]) != 0) {
+ gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2];
func_8008701C(objectIndex, 1);
}
break;
@@ -5861,14 +5861,14 @@ void func_8008078C(s32 objectIndex) {
case 0:
break;
case 1:
- if (f32_step_towards(&gObjectList[objectIndex].unk_028[2], -250.0f, gObjectList[objectIndex].unk_038[2]) != 0) {
- gObjectList[objectIndex].unk_038[2] = -gObjectList[objectIndex].unk_038[2];
+ if (f32_step_towards(&gObjectList[objectIndex].unk_028[2], -250.0f, gObjectList[objectIndex].velocity[2]) != 0) {
+ gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2];
func_80086FD4(objectIndex);
}
break;
case 2:
- if (f32_step_towards(&gObjectList[objectIndex].unk_028[2], 0.0f, gObjectList[objectIndex].unk_038[2]) != 0) {
- gObjectList[objectIndex].unk_038[2] = -gObjectList[objectIndex].unk_038[2];
+ if (f32_step_towards(&gObjectList[objectIndex].unk_028[2], 0.0f, gObjectList[objectIndex].velocity[2]) != 0) {
+ gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2];
func_8008701C(objectIndex, 1);
}
break;
@@ -5904,10 +5904,10 @@ void func_800808CC(s32 objectIndex) {
func_80073514(objectIndex);
if (gGamestate != 9) {
if ((D_8018D40C == 0) && (gObjectList[objectIndex].state == 2)) {
- func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_038, 0x19036045U);
+ func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x19036045U);
}
} else if ((gCutsceneShotTimer < 0xBF) && (((s16) gCutsceneShotTimer % 88) == 0x0000001E)) {
- func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_038, 0x19036045U);
+ func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x19036045U);
}
}
}
@@ -5925,7 +5925,7 @@ void func_80080A4C(s32 objectIndex, s32 cameraPlayerId) {
if (gScreenModeSelection != SCREEN_MODE_3P_4P_SPLITSCREEN) {
if ((func_80072320(objectIndex, 0x00000010) != 0) && (is_within_horizontal_distance_of_player(objectIndex, player, 500.0f) != 0)) {
func_8001CA10(camera);
- func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_038, 0x1900800FU);
+ func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x1900800FU);
}
}
}
@@ -6000,28 +6000,28 @@ void func_80080E8C(s32 objectIndex1, s32 objectIndex2, s32 arg2) {
init_object(objectIndex1, arg2);
temp_v1 = D_800E594C[arg2];
gObjectList[objectIndex1].unk_0D5 = 2;
- anAngle = gObjectList[objectIndex2].unk_0BE[1];
+ anAngle = gObjectList[objectIndex2].direction_angle[1];
thing1 = func_800416D8(temp_v1[1], temp_v1[0], anAngle);
thing0 = func_80041724(temp_v1[1], temp_v1[0], anAngle);
- gObjectList[objectIndex1].unk_010[0] = gObjectList[objectIndex2].pos[0] + thing0;
- gObjectList[objectIndex1].unk_010[1] = gObjectList[objectIndex2].unk_044 - 9.0;
- gObjectList[objectIndex1].unk_010[2] = gObjectList[objectIndex2].pos[2] + thing1;
- anAngle = D_800E597C[arg2] + gObjectList[objectIndex2].unk_0BE[1];
- gObjectList[objectIndex1].unk_038[0] = sins(anAngle) * 0.6;
- gObjectList[objectIndex1].unk_038[2] = coss(anAngle) * 0.6;
+ gObjectList[objectIndex1].origin_pos[0] = gObjectList[objectIndex2].pos[0] + thing0;
+ gObjectList[objectIndex1].origin_pos[1] = gObjectList[objectIndex2].unk_044 - 9.0;
+ gObjectList[objectIndex1].origin_pos[2] = gObjectList[objectIndex2].pos[2] + thing1;
+ anAngle = D_800E597C[arg2] + gObjectList[objectIndex2].direction_angle[1];
+ gObjectList[objectIndex1].velocity[0] = sins(anAngle) * 0.6;
+ gObjectList[objectIndex1].velocity[2] = coss(anAngle) * 0.6;
}
#else
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80080E8C.s")
#endif
void func_80080FEC(s32 arg0) {
- s32 temp_v0;
- s32 var_s0;
+ s32 objectIndex;
+ s32 i;
- for (var_s0 = 0; var_s0 < 6; var_s0++) {
- temp_v0 = func_80072044(D_8018C3F0, &D_80183E4C, D_8018C3F0_SIZE);
- if (temp_v0 == -1) break;
- func_80080E8C(temp_v0, arg0, var_s0);
+ for (i = 0; i < 6; i++) {
+ objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE);
+ if (objectIndex == NULL_OBJECT_ID) break;
+ func_80080E8C(objectIndex, arg0, i);
}
}
@@ -6032,9 +6032,9 @@ void func_80081080(s32 objectIndex) {
temp_v0->activeTexture = D_8018D490;
temp_v0->textureList = D_8018D490;
temp_v0->unk_0A0 = 0x00FF;
- temp_v0->unk_0BE[1] = 0;
- temp_v0->unk_0B2[0] = 0;
- temp_v0->unk_0B2[2] = 0;
+ temp_v0->direction_angle[1] = 0;
+ temp_v0->orientation[0] = 0;
+ temp_v0->orientation[2] = 0;
temp_v0->unk_028[0] = 0.0f;
temp_v0->unk_028[1] = 0.0f;
temp_v0->unk_028[2] = 0.0f;
@@ -6132,13 +6132,13 @@ void func_80081210(void) {
func_800722CC(objectIndex, 0x00000020);
func_80080FEC(objectIndex);
}
- for (var_s4 = 0; var_s4 < D_8018C3F0_SIZE; var_s4++) {
- objectIndex = D_8018C3F0[var_s4];
+ for (var_s4 = 0; var_s4 < gObjectParticle2_SIZE; var_s4++) {
+ objectIndex = gObjectParticle2[var_s4];
if (objectIndex == DELETED_OBJECT_ID) continue;
if (gObjectList[objectIndex].state == 0) continue;
func_800810F4(objectIndex);
if (gObjectList[objectIndex].state != 0) continue;
- delete_object_wrapper(&D_8018C3F0[var_s4]);
+ delete_object_wrapper(&gObjectParticle2[var_s4]);
}
}
@@ -6156,8 +6156,8 @@ void func_8008153C(s32 objectIndex) {
}
for (var_s7 = 0; var_s7 < sp70; var_s7++) {
- for (var_s1 = 0; var_s1 < D_8018C3F0_SIZE; var_s1++) {
- loopObjectIndex = D_8018C3F0[var_s1];
+ for (var_s1 = 0; var_s1 < gObjectParticle2_SIZE; var_s1++) {
+ loopObjectIndex = gObjectParticle2[var_s1];
if (gObjectList[loopObjectIndex].state != 0) continue;
@@ -6165,14 +6165,14 @@ void func_8008153C(s32 objectIndex) {
gObjectList[loopObjectIndex].activeTLUT = d_course_moo_moo_farm_mole_dirt;
gObjectList[loopObjectIndex].tlutList = d_course_moo_moo_farm_mole_dirt;
gObjectList[loopObjectIndex].sizeScaling = 0.15f;
- gObjectList[loopObjectIndex].unk_038[1] = random_int(0x000AU);
- gObjectList[loopObjectIndex].unk_038[1] = (gObjectList[loopObjectIndex].unk_038[1] * 0.1) + 4.8;
+ gObjectList[loopObjectIndex].velocity[1] = random_int(0x000AU);
+ gObjectList[loopObjectIndex].velocity[1] = (gObjectList[loopObjectIndex].velocity[1] * 0.1) + 4.8;
gObjectList[loopObjectIndex].unk_034 = random_int(5U);
gObjectList[loopObjectIndex].unk_034 = (gObjectList[loopObjectIndex].unk_034 * 0.01) + 0.8;
- gObjectList[loopObjectIndex].unk_0B2[1] = (0x10000 / sp70) * var_s1;
- gObjectList[loopObjectIndex].unk_010[0] = gObjectList[objectIndex].unk_010[0];
- gObjectList[loopObjectIndex].unk_010[1] = gObjectList[objectIndex].unk_010[1] - 13.0;
- gObjectList[loopObjectIndex].unk_010[2] = gObjectList[objectIndex].unk_010[2];
+ gObjectList[loopObjectIndex].orientation[1] = (0x10000 / sp70) * var_s1;
+ gObjectList[loopObjectIndex].origin_pos[0] = gObjectList[objectIndex].origin_pos[0];
+ gObjectList[loopObjectIndex].origin_pos[1] = gObjectList[objectIndex].origin_pos[1] - 13.0;
+ gObjectList[loopObjectIndex].origin_pos[2] = gObjectList[objectIndex].origin_pos[2];
break;
}
}
@@ -6183,7 +6183,7 @@ void func_80081790(s32 objectIndex) {
case 0:
break; /* irregular */
case 1:
- if (func_80087E08(objectIndex, gObjectList[objectIndex].unk_038[1], 0.3f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].unk_0B2[1], 0x00000032) != 0) {
+ if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.3f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].orientation[1], 0x00000032) != 0) {
func_80072488(objectIndex);
}
func_8008BF18(objectIndex);
@@ -6200,10 +6200,10 @@ void func_80081848(s32 objectIndex) {
gObjectList[objectIndex].sizeScaling = 0.15f;
gObjectList[objectIndex].itemDisplay = 0;
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- func_8008B888(objectIndex, 0U, 0U, 0U);
- func_8008B8BC(objectIndex, 0U, 0U, 0x8000U);
+ set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
+ set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
gObjectList[objectIndex].boundingBoxSize = 6;
- gObjectList[objectIndex].unk_038[1] = 4.0f;
+ gObjectList[objectIndex].velocity[1] = 4.0f;
set_object_flag_unk_054_true(objectIndex, 0x04000000);
func_80072488(objectIndex);
}
@@ -6230,8 +6230,8 @@ void func_80081924(s32 objectIndex) {
func_80086F60(objectIndex);
break;
case 10:
- gObjectList[objectIndex].unk_0B2[2] += 0x1000;
- gObjectList[objectIndex].unk_038[1] -= 0.184;
+ gObjectList[objectIndex].orientation[2] += 0x1000;
+ gObjectList[objectIndex].velocity[1] -= 0.184;
func_8008751C(objectIndex);
func_80087710(objectIndex);
if (gObjectList[objectIndex].pos[1] <= -10.0) {
@@ -6281,7 +6281,7 @@ void func_80081AFC(s32 objectIndex, s32 arg1) {
func_80086EAC(objectIndex, 2, 4);
func_8008153C(objectIndex);
func_80072488(objectIndex);
- func_800C98B8(temp_s0->pos, temp_s0->unk_038, 0x19018007U);
+ func_800C98B8(temp_s0->pos, temp_s0->velocity, 0x19018007U);
}
break;
case 0x4:
@@ -6345,14 +6345,14 @@ void func_80081D34(s32 objectIndex) {
} else {
var_s1->statusEffects |= 2;
}
- temp_s0->unk_0BE[1] = var_s4->rot[1];
- temp_s0->unk_038[1] = (var_s1->unk_094 / 2) + 3.0;
+ temp_s0->direction_angle[1] = var_s4->rot[1];
+ temp_s0->velocity[1] = (var_s1->unk_094 / 2) + 3.0;
temp_s0->unk_034 = var_s1->unk_094 + 1.0;
- if (temp_s0->unk_038[1] >= 5.0) {
- temp_s0->unk_038[1] = 5.0f;
+ if (temp_s0->velocity[1] >= 5.0) {
+ temp_s0->velocity[1] = 5.0f;
}
if (temp_s0->unk_034 >= 4.0) {
- temp_s0->unk_038[1] = 4.0f;
+ temp_s0->velocity[1] = 4.0f;
}
}
}
@@ -6361,7 +6361,7 @@ void func_80081D34(s32 objectIndex) {
temp_s0 = &gObjectList[objectIndex];
set_object_flag_unk_054_false(objectIndex, 0x00000200);
func_80086F60(objectIndex);
- func_8008B7D4(objectIndex, temp_s0->pos[0], temp_s0->pos[1], temp_s0->pos[2]);
+ set_obj_origin_pos(objectIndex, temp_s0->pos[0], temp_s0->pos[1], temp_s0->pos[2]);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
func_80086EAC(objectIndex, 2, 0x000A);
func_800726CC(objectIndex, 0x0000000A);
@@ -6422,9 +6422,9 @@ void func_80081FF4(s32 objectIndex, s32 arg1) {
break;
}
}
- gObjectList[objectIndex].unk_010[0] = gMoleSpawns[var_v1][offset + 0] * xOrientation;
- gObjectList[objectIndex].unk_010[1] = gMoleSpawns[var_v1][offset + 1] - 9.0;
- gObjectList[objectIndex].unk_010[2] = gMoleSpawns[var_v1][offset + 2];
+ gObjectList[objectIndex].origin_pos[0] = gMoleSpawns[var_v1][offset + 0] * xOrientation;
+ gObjectList[objectIndex].origin_pos[1] = gMoleSpawns[var_v1][offset + 1] - 9.0;
+ gObjectList[objectIndex].origin_pos[2] = gMoleSpawns[var_v1][offset + 2];
}
#else
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80081FF4.s")
@@ -6476,8 +6476,8 @@ void func_800821FC(void) {
}
}
- for (var_s1 = 0; var_s1 < D_8018C3F0_SIZE; var_s1++) {
- objectIndex = D_8018C3F0[var_s1];
+ for (var_s1 = 0; var_s1 < gObjectParticle2_SIZE; var_s1++) {
+ objectIndex = gObjectParticle2[var_s1];
if (gObjectList[objectIndex].state != 0) {
func_80081790(objectIndex);
}
@@ -6491,7 +6491,7 @@ void func_8008241C(s32 objectIndex, s32 arg1) {
s16 sp20;
gObjectList[objectIndex].unk_0D8 = 1;
- gObjectList[objectIndex].unk_070 = (Gfx *) d_course_koopa_troopa_beach_unk4;
+ gObjectList[objectIndex].model = (Gfx *) d_course_koopa_troopa_beach_unk4;
gObjectList[objectIndex].vertex = (Vtx *) d_course_koopa_troopa_beach_unk_data5;
gObjectList[objectIndex].sizeScaling = 0.2f;
gObjectList[objectIndex].unk_0DD = 1;
@@ -6499,13 +6499,13 @@ void func_8008241C(s32 objectIndex, s32 arg1) {
sp20 = random_int(0x0014);
temp_f4 = random_int(0x00C8) + -100.0;
if (gGamestate == 9) {
- func_8008B7D4(objectIndex, sp22 + -360.0, sp20 + 60.0, temp_f4 + -1300.0);
+ set_obj_origin_pos(objectIndex, sp22 + -360.0, sp20 + 60.0, temp_f4 + -1300.0);
} else if (gObjectList[objectIndex].unk_0D5 != 0) {
- func_8008B7D4(objectIndex, (sp22 + 328.0) * xOrientation, sp20 + 20.0, temp_f4 + 2541.0);
+ set_obj_origin_pos(objectIndex, (sp22 + 328.0) * xOrientation, sp20 + 20.0, temp_f4 + 2541.0);
} else {
- func_8008B7D4(objectIndex, (sp22 + -985.0) * xOrientation, sp20 + 15.0, temp_f4 + 1200.0);
+ set_obj_origin_pos(objectIndex, (sp22 + -985.0) * xOrientation, sp20 + 15.0, temp_f4 + 1200.0);
}
- func_8008B888(objectIndex, 0U, 0U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
gObjectList[objectIndex].unk_034 = 1.0f;
func_80086EF0(objectIndex);
gObjectList[objectIndex].unk_080 = D_800E633C[arg1 % 4];
@@ -6534,12 +6534,12 @@ void func_8008275C(s32 objectIndex) {
case 2:
func_8008B78C(objectIndex);
vec3f_copy(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos);
- func_8000D940(gObjectList[objectIndex].unk_010, &gObjectList[objectIndex].unk_0C6, gObjectList[objectIndex].unk_034, 0.0f, 0);
+ func_8000D940(gObjectList[objectIndex].origin_pos, &gObjectList[objectIndex].unk_0C6, gObjectList[objectIndex].unk_034, 0.0f, 0);
gObjectList[objectIndex].unk_028[0] *= 2.0;
gObjectList[objectIndex].unk_028[1] *= 2.5;
gObjectList[objectIndex].unk_028[2] *= 2.0;
func_8008BF18(objectIndex);
- gObjectList[objectIndex].unk_0BE[1] = get_angle_between_points(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos);
+ gObjectList[objectIndex].direction_angle[1] = get_angle_between_points(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos);
break;
}
func_800873F4(objectIndex);
@@ -6605,7 +6605,7 @@ void init_ktb_crab(s32 objectIndex) {
set_object_flag_unk_054_true(objectIndex, 0x04000420);
func_80086EAC(objectIndex, 0, 1);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- func_8008B8BC(objectIndex, 0U, 0U, 0x8000U);
+ set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
object->unk_034 = 1.5f;
set_object_flag_unk_054_true(objectIndex, 0x00000200);
}
@@ -6632,7 +6632,7 @@ void func_80082B34(s32 objectIndex, s32 unused) {
void func_80082C30(s32 objectIndex) {
switch (gObjectList[objectIndex].unk_0AE) {
case 1:
- if (func_80087A0C(objectIndex, gObjectList[objectIndex].unk_010[0], gObjectList[objectIndex].unk_01C[0], gObjectList[objectIndex].unk_010[2], gObjectList[objectIndex].unk_01C[2]) != 0) {
+ if (func_80087A0C(objectIndex, gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_01C[0], gObjectList[objectIndex].origin_pos[2], gObjectList[objectIndex].unk_01C[2]) != 0) {
func_800726CC(objectIndex, 3);
func_80086FD4(objectIndex);
}
@@ -6695,13 +6695,13 @@ void func_80082E5C(void) {
// https://decomp.me/scratch/RquH0
// Gollygee I sure love register allocation :^)
void func_80082F1C(s32 objectIndex, s32 arg1) {
- gObjectList[objectIndex].unk_070 = d_course_yoshi_valley_unk5;
+ gObjectList[objectIndex].model = d_course_yoshi_valley_unk5;
gObjectList[objectIndex].vertex = d_course_yoshi_valley_unk4;
gObjectList[objectIndex].sizeScaling = 0.027f;
func_80072488(objectIndex);
- func_8008B7D4(objectIndex, D_800E5DF4[arg1].pos[0] * xOrientation, D_800E5DF4[arg1].pos[1], D_800E5DF4[arg1].pos[2]);
+ set_obj_origin_pos(objectIndex, D_800E5DF4[arg1].pos[0] * xOrientation, D_800E5DF4[arg1].pos[1], D_800E5DF4[arg1].pos[2]);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- func_8008B888(objectIndex, 0U, D_800E5DF4[arg1].rot, 0U);
+ set_obj_direction_angle(objectIndex, 0U, D_800E5DF4[arg1].rot, 0U);
}
#else
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80082F1C.s")
@@ -6718,8 +6718,8 @@ void func_80083018(s32 objectIndex, s32 arg1) {
}
}
-void func_80083060(s32 arg0) {
- func_8008BF18(arg0);
+void func_80083060(s32 objectIndex) {
+ func_8008BF18(objectIndex);
}
void func_80083080(void) {
@@ -6747,7 +6747,7 @@ void func_8008311C(s32 objectIndex, s32 arg1) {
temp_s0->itemDisplay = 0;
func_80072488(objectIndex);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- func_8008B8BC(objectIndex, 0U, 0U, 0x8000U);
+ set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
temp_s0->unk_034 = ((arg1 % 6) * 0.1) + 0.5;
func_80086E70(objectIndex);
set_object_flag_unk_054_true(objectIndex, 0x04000600);
@@ -6759,7 +6759,7 @@ void func_80083248(s32 objectIndex) {
case 0:
break;
case 1:
- if (func_80087A0C(objectIndex, gObjectList[objectIndex].unk_010[0], gObjectList[objectIndex].unk_09C, gObjectList[objectIndex].unk_010[2], gObjectList[objectIndex].unk_09E) != 0) {
+ if (func_80087A0C(objectIndex, gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_09C, gObjectList[objectIndex].origin_pos[2], gObjectList[objectIndex].unk_09E) != 0) {
func_80086FD4(objectIndex);
}
break;
@@ -6767,7 +6767,7 @@ void func_80083248(s32 objectIndex) {
func_800871AC(objectIndex, 0x0000003C);
break;
case 3:
- if (func_80087A0C(objectIndex, gObjectList[objectIndex].unk_09C, gObjectList[objectIndex].unk_010[0], gObjectList[objectIndex].unk_09E, gObjectList[objectIndex].unk_010[2]) != 0) {
+ if (func_80087A0C(objectIndex, gObjectList[objectIndex].unk_09C, gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_09E, gObjectList[objectIndex].origin_pos[2]) != 0) {
func_80086FD4(objectIndex);
}
break;
@@ -6834,25 +6834,25 @@ void func_80083538(s32 objectIndex, Vec3f arg1, s32 arg2, s32 arg3) {
temp_s0->tlutList = d_course_frappe_snowland_snow_tlut;
temp_s0->sizeScaling = random_int(0x0064U);
temp_s0->sizeScaling = (temp_s0->sizeScaling * 0.001) + 0.05;
- temp_s0->unk_038[1] = random_int(0x0014U);
- temp_s0->unk_038[1] = (temp_s0->unk_038[1] * 0.5) + 2.6;
+ temp_s0->velocity[1] = random_int(0x0014U);
+ temp_s0->velocity[1] = (temp_s0->velocity[1] * 0.5) + 2.6;
temp_s0->unk_034 = random_int(0x000AU);
temp_s0->unk_034 = (temp_s0->unk_034 *0.1) + 4.5;
- temp_s0->unk_0BE[1] = (arg2 << 0x10) / arg3;
- temp_s0->unk_010[0] = arg1[0];
- temp_s0->unk_010[1] = arg1[1];
- temp_s0->unk_010[2] = arg1[2];
+ temp_s0->direction_angle[1] = (arg2 << 0x10) / arg3;
+ temp_s0->origin_pos[0] = arg1[0];
+ temp_s0->origin_pos[1] = arg1[1];
+ temp_s0->origin_pos[2] = arg1[2];
temp_s0->unk_0A0 = random_int(0x4000U) + 0x1000;
}
void func_800836F0(Vec3f arg0) {
- s32 temp_v0;
- s32 var_s0;
+ s32 objectIndex;
+ s32 i;
- for (var_s0 = 0; var_s0 < D_8018D3BC; var_s0++) {
- temp_v0 = func_80072044(&D_8018C3F0[0], &D_80183E4C, D_8018C3F0_SIZE);
- if (temp_v0 == -1) break;
- func_80083538(temp_v0, arg0, var_s0, D_8018D3BC);
+ for (i = 0; i < D_8018D3BC; i++) {
+ objectIndex = add_unused_obj_index(&gObjectParticle2[0], &gNextFreeObjectParticle2, gObjectParticle2_SIZE);
+ if (objectIndex == NULL_OBJECT_ID) break;
+ func_80083538(objectIndex, arg0, i, D_8018D3BC);
}
}
@@ -6861,7 +6861,7 @@ void func_8008379C(s32 objectIndex) {
case 0:
break;
case 1:
- if (func_80087E08(objectIndex, gObjectList[objectIndex].unk_038[1], 0.74f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].unk_0BE[1], 0x00000064) != 0) {
+ if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.74f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1], 0x00000064) != 0) {
func_80072488(objectIndex);
}
break;
@@ -6871,7 +6871,7 @@ void func_8008379C(s32 objectIndex) {
break;
}
func_8008BF18(objectIndex);
- gObjectList[objectIndex].unk_0B2[2] += gObjectList[objectIndex].unk_0A0;
+ gObjectList[objectIndex].orientation[2] += gObjectList[objectIndex].unk_0A0;
}
void func_80083868(s32 objectIndex) {
@@ -6884,9 +6884,9 @@ void func_80083868(s32 objectIndex) {
temp_s0->itemDisplay = 0;
func_80072488(objectIndex);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- temp_s0->unk_0B2[0] = 0;
- temp_s0->unk_0B2[1] = 0;
- temp_s0->unk_0B2[2] = 0x8000;
+ temp_s0->orientation[0] = 0;
+ temp_s0->orientation[1] = 0;
+ temp_s0->orientation[2] = 0x8000;
temp_s0->unk_0A0 = random_int(0x2000U) - 0x1000;
func_80086E70(objectIndex);
temp_s0->unk_034 = 1.5f;
@@ -6922,7 +6922,7 @@ void func_80083948(s32 objectIndex) {
}
func_8008BF18(objectIndex);
func_80073D0C(objectIndex, &gObjectList[objectIndex].unk_0A0, -0x00001000, 0x00001000, 0x00000400, 1, -1);
- gObjectList[objectIndex].unk_0B2[2] = gObjectList[objectIndex].unk_0A0 + 0x8000;
+ gObjectList[objectIndex].orientation[2] = gObjectList[objectIndex].unk_0A0 + 0x8000;
}
void func_80083A94(s32 objectIndex) {
@@ -6946,16 +6946,16 @@ void func_80083B0C(s32 objectIndex) {
gObjectList[objectIndex].itemDisplay = 0;
func_80072488(objectIndex);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- gObjectList[objectIndex].unk_0B2[0] = 0;
- gObjectList[objectIndex].unk_0B2[1] = 0;
- gObjectList[objectIndex].unk_0B2[2] = 0x8000;
+ gObjectList[objectIndex].orientation[0] = 0;
+ gObjectList[objectIndex].orientation[1] = 0;
+ gObjectList[objectIndex].orientation[2] = 0x8000;
gObjectList[objectIndex].boundingBoxSize = 2;
gObjectList[objectIndex].unk_034 = 1.5f;
set_object_flag_unk_054_true(objectIndex, 0x04000210);
}
-void func_80083BE4(s32 arg0) {
- func_8008BF18(arg0);
+void func_80083BE4(s32 objectIndex) {
+ func_8008BF18(objectIndex);
}
void func_80083C04(s32 objectIndex) {
@@ -7005,15 +7005,15 @@ void func_80083D60(void) {
s32 objectIndex;
Objects *temp_s1;
- for (var_s0 = 0; var_s0 < D_8018C3F0_SIZE; var_s0++) {
- objectIndex = D_8018C3F0[var_s0];
+ for (var_s0 = 0; var_s0 < gObjectParticle2_SIZE; var_s0++) {
+ objectIndex = gObjectParticle2[var_s0];
if (objectIndex == DELETED_OBJECT_ID) continue;
if (gObjectList[objectIndex].state == 0) continue;
func_8008379C(objectIndex);
if (gObjectList[objectIndex].state != 0) continue;
- delete_object_wrapper(&D_8018C3F0[var_s0]);
+ delete_object_wrapper(&gObjectParticle2[var_s0]);
if (var_s0) {} // ??
}
@@ -7043,7 +7043,7 @@ void func_80083F18(s32 objectIndex) {
case 0:
break;
case 1:
- if (func_80087E08(objectIndex, gObjectList[objectIndex].unk_038[1], 0.12f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].unk_0BE[1], 0x00000064) != 0) {
+ if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.12f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1], 0x00000064) != 0) {
func_80072488(objectIndex);
}
func_8008BF18(objectIndex);
@@ -7066,22 +7066,22 @@ void func_80083FD0(s32 objectIndex, s32 arg1, s32 playerId) {
temp_s0->activeTLUT = d_course_sherbet_land_ice;
temp_s0->tlutList = d_course_sherbet_land_ice;
temp_s0->sizeScaling = ((f32) random_int(0x01F4U) * 0.0002) + 0.04;
- temp_s0->unk_038[1] = ((f32) random_int(0x0032U) * 0.05) + 1.0;
+ temp_s0->velocity[1] = ((f32) random_int(0x0032U) * 0.05) + 1.0;
temp_s0->unk_034 = ((f32) random_int(0x000AU) * 0.1) + 1.0;
- temp_s0->unk_0BE[1] = D_801657A2 * arg1;
- temp_s0->unk_010[0] = (sp20->pos[0] + random_int(0x0014U)) - 10.0f;
- temp_s0->unk_010[1] = (sp20->pos[1] - 10.0) + random_int(0x000AU);
- temp_s0->unk_010[2] = (sp20->pos[2] + random_int(0x0014U)) - 10.0f;
+ temp_s0->direction_angle[1] = D_801657A2 * arg1;
+ temp_s0->origin_pos[0] = (sp20->pos[0] + random_int(0x0014U)) - 10.0f;
+ temp_s0->origin_pos[1] = (sp20->pos[1] - 10.0) + random_int(0x000AU);
+ temp_s0->origin_pos[2] = (sp20->pos[2] + random_int(0x0014U)) - 10.0f;
}
void func_8008421C(s32 arg0, s32 playerId) {
- s32 temp_v0;
+ s32 objectIndex;
s32 var_s0;
for (var_s0 = 0; var_s0 < D_8018D3C0; var_s0++) {
- temp_v0 = func_80072044(D_8018C3F0, &D_80183E4C, D_8018C3F0_SIZE);
- if (temp_v0 == -1) break;
- func_80083FD0(temp_v0, var_s0, playerId);
+ objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE);
+ if (objectIndex == NULL_OBJECT_ID) break;
+ func_80083FD0(objectIndex, var_s0, playerId);
}
}
@@ -7096,19 +7096,19 @@ void func_800842C8(void) {
D_8016582C[1] += 0x1000;
D_8016582C[2] += 0x1800;
for (playerId = 0; playerId < gPlayerCountSelection1; playerId++) {
- objectIndex = D_80183DB8[playerId];
+ objectIndex = gIndexLakituList[playerId];
if (func_80072320(objectIndex, 0x00000020) != 0) {
func_800722CC(objectIndex, 0x00000020);
func_8008421C(objectIndex, playerId);
}
}
- for (playerId = 0; playerId < D_8018C3F0_SIZE; playerId++) {
- objectIndex = D_8018C3F0[playerId];
+ for (playerId = 0; playerId < gObjectParticle2_SIZE; playerId++) {
+ objectIndex = gObjectParticle2[playerId];
if (objectIndex != DELETED_OBJECT_ID) {
if (gObjectList[objectIndex].state != 0) {
func_80083F18(objectIndex);
if (gObjectList[objectIndex].state == 0) {
- delete_object_wrapper(&D_8018C3F0[playerId]);
+ delete_object_wrapper(&gObjectParticle2[playerId]);
}
}
}
@@ -7120,13 +7120,13 @@ void func_80084430(s32 objectIndex, s32 arg1) {
temp_s0 = &gObjectList[objectIndex];
temp_s0->unk_0D8 = 0;
- temp_s0->unk_070 = (Gfx *) d_course_sherbet_land_unk_data1;
+ temp_s0->model = (Gfx *) d_course_sherbet_land_unk_data1;
temp_s0->vertex = (Vtx *) d_course_sherbet_land_unk_data11;
temp_s0->sizeScaling = 0.2f;
temp_s0->boundingBoxSize = 0x000C;
temp_s0->unk_09C = 1;
- func_8008B7D4(objectIndex, xOrientation * -383.0, 2.0f, -690.0f);
- func_8008B888(objectIndex, 0U, 0U, 0U);
+ set_obj_origin_pos(objectIndex, xOrientation * -383.0, 2.0f, -690.0f);
+ set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
temp_s0->unk_0DD = 1;
func_80086EF0(objectIndex);
temp_s0->unk_080 = *D_800E672C;
@@ -7155,7 +7155,7 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
temp_s0 = &gObjectList[objectIndex];
temp_s0->unk_0D8 = 0;
- temp_s0->unk_070 = d_course_sherbet_land_unk_data1;
+ temp_s0->model = d_course_sherbet_land_unk_data1;
temp_s0->vertex = d_course_sherbet_land_unk_data11;
temp_s0->boundingBoxSize = 4;
temp_s0->unk_09C = 2;
@@ -7163,19 +7163,19 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
set_object_flag_unk_054_true(objectIndex, 0x04000220);
if ((arg1 > 0) && (arg1 < 9)) {
if ((arg1 == 1) || (arg1 == 2)) {
- func_8008B7D4(objectIndex, xOrientation * -2960.0, -80.0f, 1521.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -2960.0, -80.0f, 1521.0f);
temp_s0->unk_0C6 = 0x0150;
temp_s0->unk_01C[1] = 100.0f;
} else if ((arg1 == 3) || (arg1 == 4)) {
- func_8008B7D4(objectIndex, xOrientation * -2490.0, -80.0f, 1612.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -2490.0, -80.0f, 1612.0f);
temp_s0->unk_0C6 = 0x0100;
temp_s0->unk_01C[1] = 80.0f;
} else if ((arg1 == 5) || (arg1 == 6)) {
- func_8008B7D4(objectIndex, xOrientation * -2098.0, -80.0f, 1624.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -2098.0, -80.0f, 1624.0f);
temp_s0->unk_0C6 = 0xFF00;
temp_s0->unk_01C[1] = 80.0f;
} else if ((arg1 == 7) || (arg1 == 8)) {
- func_8008B7D4(objectIndex, xOrientation * -2080.0, -80.0f, 1171.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -2080.0, -80.0f, 1171.0f);
temp_s0->unk_0C6 = 0x0150;
temp_s0->unk_01C[1] = 80.0f;
}
@@ -7188,9 +7188,9 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
switch (arg1) { /* irregular */
case 9:
if (gGamestate != 9) {
- func_8008B7D4(objectIndex, xOrientation * 146.0, 0.0f, -380.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * 146.0, 0.0f, -380.0f);
} else {
- func_8008B7D4(objectIndex, xOrientation * 380.0, 0.0f, -535.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * 380.0, 0.0f, -535.0f);
temp_s0->sizeScaling = 0.15f;
}
temp_s0->unk_0C6 = 0x9000;
@@ -7200,7 +7200,7 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
temp_s0->unk_0DD = 3;
break;
case 10:
- func_8008B7D4(objectIndex, xOrientation * 380.0, 0.0f, -766.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * 380.0, 0.0f, -766.0f);
temp_s0->unk_0C6 = 0x5000;
if (gIsMirrorMode != 0) {
temp_s0->unk_0C6 += 0x8000;
@@ -7208,7 +7208,7 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
temp_s0->unk_0DD = 4;
break;
case 11:
- func_8008B7D4(objectIndex, xOrientation * -2300.0, 0.0f, -210.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -2300.0, 0.0f, -210.0f);
temp_s0->unk_0C6 = 0xC000;
temp_s0->unk_0DD = 6;
if (gIsMirrorMode != 0) {
@@ -7216,7 +7216,7 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
}
break;
case 12:
- func_8008B7D4(objectIndex, xOrientation * -2500.0, 0.0f, -250.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -2500.0, 0.0f, -250.0f);
temp_s0->unk_0C6 = 0x4000;
temp_s0->unk_0DD = 6;
if (gIsMirrorMode != 0) {
@@ -7224,7 +7224,7 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
}
break;
case 13:
- func_8008B7D4(objectIndex, xOrientation * -535.0, 0.0f, 875.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -535.0, 0.0f, 875.0f);
temp_s0->unk_0C6 = 0x8000;
temp_s0->unk_0DD = 6;
if (gIsMirrorMode != 0) {
@@ -7232,7 +7232,7 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
}
break;
case 14:
- func_8008B7D4(objectIndex, xOrientation * -250.0, 0.0f, 953.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -250.0, 0.0f, 953.0f);
temp_s0->unk_0C6 = 0x9000;
temp_s0->unk_0DD = 6;
if (gIsMirrorMode != 0) {
@@ -7242,7 +7242,7 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
default:
break;
}
- func_8008B888(objectIndex, 0U, temp_s0->unk_0C6 + 0x8000, 0U);
+ set_obj_direction_angle(objectIndex, 0U, temp_s0->unk_0C6 + 0x8000, 0U);
temp_s0->unk_044 = 5.0f;
temp_s0->sizeScaling = 0.04f;
func_800722A4(objectIndex, 0x00000014);
@@ -7293,9 +7293,9 @@ void func_80084B7C(s32 objectIndex, s32 arg1) {
if (func_80072320(objectIndex, 0x00000080) != 0) {
func_800722CC(objectIndex, 0x00000080);
if (func_80072320(objectIndex, 0x00000010) != 0) {
- func_800C98B8(temp_s0->pos, temp_s0->unk_038, 0x19007049U);
+ func_800C98B8(temp_s0->pos, temp_s0->velocity, 0x19007049U);
} else {
- func_800C98B8(temp_s0->pos, temp_s0->unk_038, 0x19007017U);
+ func_800C98B8(temp_s0->pos, temp_s0->velocity, 0x19007017U);
}
}
}
@@ -7307,8 +7307,8 @@ void func_80084D2C(s32 objectIndex, s32 arg1) {
case 0:
break;
case 1:
- gObjectList[objectIndex].unk_0BE[1] = func_800417B4(gObjectList[objectIndex].unk_0BE[1], gObjectList[objectIndex].unk_0C6);
- if (gObjectList[objectIndex].unk_0BE[1] == gObjectList[objectIndex].unk_0C6) {
+ gObjectList[objectIndex].direction_angle[1] = func_800417B4(gObjectList[objectIndex].direction_angle[1], gObjectList[objectIndex].unk_0C6);
+ if (gObjectList[objectIndex].direction_angle[1] == gObjectList[objectIndex].unk_0C6) {
gObjectList[objectIndex].unk_09C = 4;
gObjectList[objectIndex].unk_034 = 0.4f;
func_80086FD4(objectIndex);
@@ -7392,10 +7392,10 @@ void func_8008502C(s32 objectIndex, UNUSED s32 arg1) {
func_800873F4(objectIndex);
}
-void func_80085080(s32 arg0) {
- func_8008B78C(arg0);
- func_8008BF18(arg0);
- func_800873F4(arg0);
+void func_80085080(s32 objectIndex) {
+ func_8008B78C(objectIndex);
+ func_8008BF18(objectIndex);
+ func_800873F4(objectIndex);
}
void func_800850B0(s32 objectIndex, s32 arg1) {
@@ -7432,14 +7432,14 @@ void func_800850B0(s32 objectIndex, s32 arg1) {
func_800722CC(objectIndex, 0x00000020);
} else {
temp_s0->unk_084[7]--;
- temp_s0->unk_0B2[0] = temp_s0->unk_0BE[0];
- temp_s0->unk_0B2[1] += 0x2000;
- temp_s0->unk_0B2[2] = temp_s0->unk_0BE[2];
+ temp_s0->orientation[0] = temp_s0->direction_angle[0];
+ temp_s0->orientation[1] += 0x2000;
+ temp_s0->orientation[2] = temp_s0->direction_angle[2];
}
} else {
- temp_s0->unk_0B2[0] = temp_s0->unk_0BE[0];
- temp_s0->unk_0B2[1] = temp_s0->unk_0BE[1];
- temp_s0->unk_0B2[2] = temp_s0->unk_0BE[2];
+ temp_s0->orientation[0] = temp_s0->direction_angle[0];
+ temp_s0->orientation[1] = temp_s0->direction_angle[1];
+ temp_s0->orientation[2] = temp_s0->direction_angle[2];
}
}
@@ -7474,18 +7474,18 @@ void func_80085214(void) {
void func_800853DC(s32 objectIndex) {
gObjectList[objectIndex].sizeScaling = 1.0f;
- gObjectList[objectIndex].unk_070 = d_course_luigi_raceway_dl_F960;
+ gObjectList[objectIndex].model = d_course_luigi_raceway_dl_F960;
if (gGamestate != 9) {
- func_8008B7D4(objectIndex, xOrientation * -176.0, 0.0f, -2323.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -176.0, 0.0f, -2323.0f);
func_8008B80C(objectIndex, 0.0f, 300.0f, 0.0f);
} else {
- func_8008B7D4(objectIndex, xOrientation * -1250.0, 0.0f, 1110.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -1250.0, 0.0f, 1110.0f);
func_8008B80C(objectIndex, 0.0f, 300.0f, 0.0f);
}
func_8008B844(objectIndex);
func_800886F4(objectIndex);
func_80086EF0(objectIndex);
- gObjectList[objectIndex].unk_038[1] = -2.0f;
+ gObjectList[objectIndex].velocity[1] = -2.0f;
func_802A14BC(0.0f, 0.0f, 0.0f);
func_80072488(objectIndex);
}
@@ -7498,8 +7498,8 @@ void func_80085534(s32 objectIndex) {
}
break;
case 2:
- f32_step_towards(&gObjectList[objectIndex].unk_038[1], 0.0f, 0.05f);
- if (gObjectList[objectIndex].unk_038[1] == 0.0) {
+ f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f);
+ if (gObjectList[objectIndex].velocity[1] == 0.0) {
func_80086FD4(objectIndex);
}
break;
@@ -7507,8 +7507,8 @@ void func_80085534(s32 objectIndex) {
func_800871AC(objectIndex, 1);
break;
case 4:
- f32_step_towards(&gObjectList[objectIndex].unk_038[1], 1.0f, 0.05f);
- if (gObjectList[objectIndex].unk_038[1] == 1.0) {
+ f32_step_towards(&gObjectList[objectIndex].velocity[1], 1.0f, 0.05f);
+ if (gObjectList[objectIndex].velocity[1] == 1.0) {
func_80086FD4(objectIndex);
}
break;
@@ -7516,14 +7516,14 @@ void func_80085534(s32 objectIndex) {
func_800871AC(objectIndex, 0x0000005A);
break;
case 6:
- f32_step_towards(&gObjectList[objectIndex].unk_038[1], 0.0f, 0.05f);
- if (gObjectList[objectIndex].unk_038[1] == 0.0) {
+ f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f);
+ if (gObjectList[objectIndex].velocity[1] == 0.0) {
func_80086FD4(objectIndex);
}
break;
case 7:
- f32_step_towards(&gObjectList[objectIndex].unk_038[1], -1.0f, 0.05f);
- if (gObjectList[objectIndex].unk_038[1] == -1.0) {
+ f32_step_towards(&gObjectList[objectIndex].velocity[1], -1.0f, 0.05f);
+ if (gObjectList[objectIndex].velocity[1] == -1.0) {
func_80086FD4(objectIndex);
}
break;
@@ -7531,14 +7531,14 @@ void func_80085534(s32 objectIndex) {
func_800871AC(objectIndex, 0x0000005A);
break;
case 9:
- f32_step_towards(&gObjectList[objectIndex].unk_038[1], 0.0f, 0.05f);
+ f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f);
if (func_80087060(objectIndex, 0x0000005A) != 0) {
func_8008701C(objectIndex, 3);
}
break;
}
func_800877C4(objectIndex);
- gObjectList[objectIndex].unk_0BE[1] += 0x100;
+ gObjectList[objectIndex].direction_angle[1] += 0x100;
}
void func_80085768(s32 objectIndex) {
@@ -7574,16 +7574,16 @@ void func_80085878(s32 objectIndex, s32 arg1) {
temp_s0 = &gObjectList[objectIndex];
temp_s0->unk_0D8 = 1;
- temp_s0->unk_070 = d_rainbow_road_unk4;
+ temp_s0->model = d_rainbow_road_unk4;
temp_s0->vertex = d_rainbow_road_unk3;
temp_s0->sizeScaling = 0.03f;
temp_s0->boundingBoxSize = 0x000A;
set_object_flag_unk_054_true(objectIndex, 0x04000200);
temp_s0->unk_084[8] = (arg1 * 0x12C) + 0x1F4;
- func_8008B7D4(objectIndex, 0.0f, -15.0f, 0.0f);
+ set_obj_origin_pos(objectIndex, 0.0f, -15.0f, 0.0f);
temp_v0 = &D_80164490[(u16)temp_s0->unk_084[8]];
func_8008B80C(objectIndex, temp_v0->posX, temp_v0->posY, temp_v0->posZ);
- func_8008B888(objectIndex, 0U, 0U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
temp_s0->unk_034 = 4.0f;
temp_s0->type = func_80004EAC(d_rainbow_road_unk3, 0);
func_80072488(objectIndex);
@@ -7604,7 +7604,7 @@ void func_800859C8(s32 objectIndex, s32 arg1) {
break;
}
if (D_8018D40C == 0) {
- func_800C98B8(temp_s0->pos, temp_s0->unk_038, 0x19018057U);
+ func_800C98B8(temp_s0->pos, temp_s0->velocity, 0x19018057U);
}
func_80074344(objectIndex, &temp_s0->unk_044, -0.8f, 0.8f, 0.03f, 0, -1);
}
@@ -7621,7 +7621,7 @@ void func_80085AA8(void) {
func_800859C8(objectIndex, var_s4);
vec3f_copy(temp_s0->unk_01C, temp_s0->unk_028);
func_8000D940(temp_s0->unk_028, &temp_s0->unk_084[8], temp_s0->unk_034, temp_s0->unk_044, 0);
- temp_s0->unk_0BE[1] = get_angle_between_points(temp_s0->unk_01C, temp_s0->unk_028);
+ temp_s0->direction_angle[1] = get_angle_between_points(temp_s0->unk_01C, temp_s0->unk_028);
func_8008BF18(objectIndex);
func_80089CBC(objectIndex, 30.0f);
}
@@ -7631,50 +7631,50 @@ void func_80085AA8(void) {
void func_80085BB4(s32 objectIndex) {
gObjectList[objectIndex].sizeScaling = 8.0f;
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- func_8008B8BC(objectIndex, 0U, 0U, 0x8000U);
+ set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
func_80072488(objectIndex);
}
-void func_80085C20(s32 objectIndex) {
- func_8008B7D4(objectIndex, xOrientation * -1431.0, 827.0f, -2957.0f);
+void init_obj_neon_mushroom(s32 objectIndex) {
+ set_obj_origin_pos(objectIndex, xOrientation * -1431.0, 827.0f, -2957.0f);
init_texture_object(objectIndex, d_course_rainbow_road_neon_mushroom_tlut_list, d_course_rainbow_road_neon_mushroom, 0x40U, (u16) 0x00000040);
func_80085BB4(objectIndex);
}
void func_80085CA0(s32 objectIndex) {
switch (gObjectList[objectIndex].state) {
- case 1:
- func_80085C20(objectIndex);
- break;
- case 2:
- func_80072E54(objectIndex, 0, 4, 1, 0x0000000C, 5);
- break;
- case 3:
- func_80072D3C(objectIndex, 3, 4, 4, 0x0000000A);
- break;
- case 4:
- func_8007278C(objectIndex, 0x00000014);
- break;
- case 5:
- func_80072E54(objectIndex, 0, 4, 1, 0x0000000C, 5);
- break;
- case 6:
- func_8007278C(objectIndex, 0x00000014);
- break;
- case 7:
- func_80072D3C(objectIndex, 3, 4, 0, 0x00000014);
- break;
- case 8:
- func_800726CC(objectIndex, 2);
- break;
- case 0:
- default:
- break;
+ case 1:
+ init_obj_neon_mushroom(objectIndex);
+ break;
+ case 2:
+ func_80072E54(objectIndex, 0, 4, 1, 0x0000000C, 5);
+ break;
+ case 3:
+ func_80072D3C(objectIndex, 3, 4, 4, 0x0000000A);
+ break;
+ case 4:
+ func_8007278C(objectIndex, 0x00000014);
+ break;
+ case 5:
+ func_80072E54(objectIndex, 0, 4, 1, 0x0000000C, 5);
+ break;
+ case 6:
+ func_8007278C(objectIndex, 0x00000014);
+ break;
+ case 7:
+ func_80072D3C(objectIndex, 3, 4, 0, 0x00000014);
+ break;
+ case 8:
+ func_800726CC(objectIndex, 2);
+ break;
+ case 0:
+ default:
+ break;
}
}
void func_80085DB8(s32 objectIndex) {
- func_8008B7D4(objectIndex, xOrientation * 799.0, 1193.0f, -5891.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * 799.0, 1193.0f, -5891.0f);
init_texture_object(objectIndex, d_course_rainbow_road_neon_mario_tlut_list, d_course_rainbow_road_neon_mario, 0x40U, (u16) 0x00000040);
func_80085BB4(objectIndex);
}
@@ -7703,7 +7703,7 @@ void func_80085E38(s32 objectIndex) {
}
void func_80085EF8(s32 objectIndex) {
- func_8008B7D4(objectIndex, xOrientation * -2013.0, 555.0f, 0.0f);
+ set_obj_origin_pos(objectIndex, xOrientation * -2013.0, 555.0f, 0.0f);
init_texture_object(objectIndex, d_course_rainbow_road_neon_boo_tlut_list, d_course_rainbow_road_neon_boo, 0x40U, (u16) 0x00000040);
func_80085BB4(objectIndex);
}
@@ -7742,13 +7742,13 @@ void func_80085F74(s32 objectIndex) {
#ifdef NON_MATCHING
/**
- * arg1 is pushed onto the stack prior to func_8008B7D4, which is correct.
+ * arg1 is pushed onto the stack prior to set_obj_origin_pos, which is correct.
* But then it get popped back into v0 when its supposed to be popped into t0.
* I really, really don't get why that's happening and the permuter hasn't found anything
**/
void func_80086074(s32 objectIndex, s32 arg1) {
- func_8008B7D4(objectIndex, D_800E6734[arg1][0] * xOrientation, D_800E6734[arg1][1], D_800E6734[arg1][2]);
+ set_obj_origin_pos(objectIndex, D_800E6734[arg1][0] * xOrientation, D_800E6734[arg1][1], D_800E6734[arg1][2]);
init_texture_object(objectIndex, d_course_rainbow_road_static_tluts[arg1], d_course_rainbow_road_static_textures[arg1], 64, 64);
func_80085BB4(objectIndex);
}
@@ -7766,33 +7766,33 @@ void func_80086110(s32 objectIndex, s32 arg1) {
}
}
-void func_80086158(s32 objectIndex, s32 arg1) {
- switch (arg1) { /* irregular */
- case 0:
- func_80085CA0(objectIndex);
- break;
- case 1:
- func_80085E38(objectIndex);
- break;
- case 2:
- func_80085F74(objectIndex);
- break;
+void update_obj_neon(s32 objectIndex, s32 id) {
+ switch (id) { /* irregular */
+ case 0:
+ func_80085CA0(objectIndex);
+ break;
+ case 1:
+ func_80085E38(objectIndex);
+ break;
+ case 2:
+ func_80085F74(objectIndex);
+ break;
}
- if (arg1 >= 3) {
- func_80086110(objectIndex, arg1 - 3);
+ if (id >= 3) {
+ func_80086110(objectIndex, id - 3);
}
}
-void func_800861E0(void) {
+void update_neon(void) {
s32 objectIndex;
- s32 var_s2;
+ s32 id;
- for (var_s2 = 0; var_s2 < NUM_NEON_SIGNS; var_s2++) {
- objectIndex = indexObjectList1[var_s2];
+ for (id = 0; id < NUM_NEON_SIGNS; id++) {
+ objectIndex = indexObjectList1[id];
if (gObjectList[objectIndex].state != 0) {
- func_80086158(objectIndex, var_s2);
+ update_obj_neon(objectIndex, id);
if (gObjectList[objectIndex].state >= 2) {
- func_800734DC(objectIndex);
+ update_neon_texture(objectIndex);
func_8008BF18(objectIndex);
}
}
@@ -7802,24 +7802,24 @@ void func_800861E0(void) {
void func_8008629C(s32 objectIndex, s32 arg1) {
switch (arg1) { /* irregular */
case 0:
- gObjectList[objectIndex].unk_070 = podium_dl3;
+ gObjectList[objectIndex].model = podium_dl3;
gObjectList[objectIndex].unk_04C = 0x00000038;
break;
case 1:
- gObjectList[objectIndex].unk_070 = podium2_dl3;
+ gObjectList[objectIndex].model = podium2_dl3;
gObjectList[objectIndex].unk_04C = 0x0000002B;
break;
case 2:
- gObjectList[objectIndex].unk_070 = podium3_dl3;
+ gObjectList[objectIndex].model = podium3_dl3;
gObjectList[objectIndex].unk_04C = 0x0000001E;
break;
default:
break;
}
gObjectList[objectIndex].sizeScaling = 1.0f;
- func_8008B7D4(objectIndex, D_800E634C[0][0] - 1.5, D_800E634C[0][1], D_800E634C[0][2]);
+ set_obj_origin_pos(objectIndex, D_800E634C[0][0] - 1.5, D_800E634C[0][1], D_800E634C[0][2]);
func_8008B80C(objectIndex, 0.0f, -10.0f, 0.0f);
- func_8008B888(objectIndex, 0U, 0xF8E4U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0xF8E4U, 0U);
gObjectList[objectIndex].unk_048 = 0;
func_80072488(objectIndex);
}
@@ -7829,17 +7829,17 @@ void func_80086424(s32 objectIndex) {
case 0:
break;
case 1:
- gObjectList[objectIndex].unk_038[1] = 0.75f;
+ gObjectList[objectIndex].velocity[1] = 0.75f;
func_80086FD4(objectIndex);
break;
case 2:
if (gObjectList[objectIndex].unk_028[1] >= -2.0) {
- gObjectList[objectIndex].unk_038[1] -= 0.1;
+ gObjectList[objectIndex].velocity[1] -= 0.1;
}
func_800877C4(objectIndex);
if (gObjectList[objectIndex].unk_028[1] >= 0.0) {
gObjectList[objectIndex].unk_028[1] = 0.0f;
- gObjectList[objectIndex].unk_038[1] = 0.0f;
+ gObjectList[objectIndex].velocity[1] = 0.0f;
func_80086F60(objectIndex);
}
break;
@@ -7896,13 +7896,13 @@ void func_80086700(s32 objectIndex) {
if (gCCSelection < CC_150) {
switch (D_802874D8.unk1D) { /* switch 1; irregular */
case 0: /* switch 1 */
- gObjectList[objectIndex].unk_070 = gold_trophy_dl10;
+ gObjectList[objectIndex].model = gold_trophy_dl10;
break;
case 1: /* switch 1 */
- gObjectList[objectIndex].unk_070 = gold_trophy_dl12;
+ gObjectList[objectIndex].model = gold_trophy_dl12;
break;
case 2: /* switch 1 */
- gObjectList[objectIndex].unk_070 = gold_trophy_dl14;
+ gObjectList[objectIndex].model = gold_trophy_dl14;
break;
default: /* switch 1 */
break;
@@ -7910,22 +7910,22 @@ void func_80086700(s32 objectIndex) {
} else {
switch (D_802874D8.unk1D) { /* irregular */
case 0:
- gObjectList[objectIndex].unk_070 = gold_trophy_dl11;
+ gObjectList[objectIndex].model = gold_trophy_dl11;
break;
case 1:
- gObjectList[objectIndex].unk_070 = gold_trophy_dl13;
+ gObjectList[objectIndex].model = gold_trophy_dl13;
break;
case 2:
- gObjectList[objectIndex].unk_070 = gold_trophy_dl15;
+ gObjectList[objectIndex].model = gold_trophy_dl15;
break;
default:
break;
}
}
gObjectList[objectIndex].sizeScaling = 0.005f;
- func_8008B7D4(objectIndex, gObjectList[indexObjectList2[0]].pos[0], gObjectList[indexObjectList2[0]].pos[1] + 16.0, gObjectList[indexObjectList2[0]].pos[2]);
+ set_obj_origin_pos(objectIndex, gObjectList[indexObjectList2[0]].pos[0], gObjectList[indexObjectList2[0]].pos[1] + 16.0, gObjectList[indexObjectList2[0]].pos[2]);
func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f);
- func_8008B888(objectIndex, 0U, 0U, 0U);
+ set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
gObjectList[objectIndex].unk_084[1] = 0x0200;
func_80072488(objectIndex);
func_80086E70(objectIndex);
@@ -7944,7 +7944,7 @@ void func_80086940(s32 objectIndex) {
case 2:
f32_step_towards(&temp_s0->sizeScaling, 0.025f, 0.001f);
func_80087C48(objectIndex, 6.0f, 0.1f, 0x000000C8);
- if ((f64) temp_s0->unk_038[1] <= 0.0) {
+ if ((f64) temp_s0->velocity[1] <= 0.0) {
func_8008701C(objectIndex, 3);
}
break;
@@ -7953,24 +7953,24 @@ void func_80086940(s32 objectIndex) {
break;
case 4:
D_801658D6 = 1;
- temp_s0->unk_038[1] = -0.4f;
+ temp_s0->velocity[1] = -0.4f;
func_80086FD4(objectIndex);
- temp_s0->unk_010[1] = 90.0f;
+ temp_s0->origin_pos[1] = 90.0f;
temp_s0->unk_028[1] = 60.0f;
switch (D_802874D8.unk1D) { /* switch 1; irregular */
case 1: /* switch 1 */
- temp_s0->unk_010[0] -= 3.0;
- temp_s0->unk_010[2] += 15.0;
+ temp_s0->origin_pos[0] -= 3.0;
+ temp_s0->origin_pos[2] += 15.0;
break;
case 2: /* switch 1 */
- temp_s0->unk_010[0] -= 2.0;
- temp_s0->unk_010[2] -= 15.0;
+ temp_s0->origin_pos[0] -= 2.0;
+ temp_s0->origin_pos[2] -= 15.0;
break;
}
break;
case 5:
if ((f64) temp_s0->unk_028[1] <= 8.0) {
- f32_step_towards(&temp_s0->unk_038[1], -0.1f, -0.01f);
+ f32_step_towards(&temp_s0->velocity[1], -0.1f, -0.01f);
}
func_800877C4(objectIndex);
if ((f64) temp_s0->unk_028[1] <= 0.0) {
@@ -7990,12 +7990,12 @@ void func_80086940(s32 objectIndex) {
break;
}
if (D_801658D6 != 0) {
- temp_s0->unk_0BE[0] += 0x400;
- temp_s0->unk_0BE[1] = 0xE800;
- temp_s0->unk_0BE[2] = 0xDA00;
+ temp_s0->direction_angle[0] += 0x400;
+ temp_s0->direction_angle[1] = 0xE800;
+ temp_s0->direction_angle[2] = 0xDA00;
} else {
- temp_s0->unk_0BE[0] += 0x400;
- temp_s0->unk_0BE[1] -= 0x200;
+ temp_s0->direction_angle[0] += 0x400;
+ temp_s0->direction_angle[1] -= 0x200;
}
func_8008BF18(objectIndex);
}
diff --git a/src/code_80071F00.h b/src/code_80071F00.h
index 0f8eb4b7e..4ef65fec5 100644
--- a/src/code_80071F00.h
+++ b/src/code_80071F00.h
@@ -12,11 +12,13 @@ typedef struct {
u16 id;
} StarSpawn;
+/** @cond */
+
void func_80077D5C(s32);
s32 find_unused_obj_index(s32*);
void delete_object(s32*);
s32 func_80071FBC(void);
-s32 func_80072044(s32*, s32*, s32);
+s32 add_unused_obj_index(s32*, s32*, s32);
void delete_object_wrapper(s32*);
void func_80072120(s32*, s32);
void func_80072180(void);
@@ -66,7 +68,7 @@ void func_80073404(s32, u8, u8, Vtx*);
void init_texture_object(s32, u8*, u8*, u8, u16);
void func_8007348C(s32, u8*, u8, u8, Vtx *);
void func_800734D4(void);
-void func_800734DC(s32);
+void update_neon_texture(s32);
void func_80073514(s32);
void func_80073568(void);
void func_800735BC(s32, Gfx*, f32);
@@ -151,7 +153,7 @@ void func_80076958(s32);
void func_800769D8(s32);
void func_80076AEC(s32);
void func_80076B7C(void);
-void func_80076B84(void);
+void update_particle_bowser_castle(void);
void func_80076C9C(s32, Vec3f, s16);
void func_80076D70(Vec3f, f32, s16);
void func_80076DC4(s32);
@@ -165,7 +167,7 @@ void func_80077428(s32);
void func_80077450(s32);
void func_80077584(s32);
void func_80077640(void);
-void func_80077700(s32, Vec3f, s32);
+void init_leaf_particle(s32, Vec3f, s32);
s32 func_80077A54(Vec3f, s32);
void func_80077AB0(Vec3f, s32);
void func_80077B14(s32);
@@ -198,7 +200,7 @@ void func_8007A778(s32, Player*, Camera*);
void func_8007A884(void);
void func_8007A88C(s32);
void func_8007A910(s32);
-void func_8007A948(s32);
+void update_obj_laikitu(s32);
void func_8007AA44(s32);
void func_8007ABFC(s32, s32);
void consume_item(s32);
@@ -213,7 +215,7 @@ void func_8007BB9C(s32);
void func_8007BBBC(s32);
void func_8007BD04(s32);
void func_8007BDA8(void);
-void func_8007BDE0(s32);
+void init_var_cheep_cheep(s32);
void func_8007BEC8(s32);
void func_8007BFB0(s32);
void func_8007C280(void);
@@ -350,7 +352,7 @@ void func_80085878(s32, s32);
void func_800859C8(s32, s32);
void func_80085AA8(void);
void func_80085BB4(s32);
-void func_80085C20(s32);
+void init_obj_neon_mushroom(s32);
void func_80085CA0(s32);
void func_80085DB8(s32);
void func_80085E38(s32);
@@ -358,8 +360,8 @@ void func_80085EF8(s32);
void func_80085F74(s32);
void func_80086074(s32, s32);
void func_80086110(s32, s32);
-void func_80086158(s32, s32);
-void func_800861E0(void);
+void update_obj_neon(s32, s32);
+void update_neon(void);
void func_8008629C(s32, s32);
void func_80086424(s32);
void func_80086528(s32, s32);
@@ -406,4 +408,6 @@ extern s8 D_800E5DB4[];
extern s16 *D_800E633C[];
extern s16 *D_800E672C[2];
+/** @endcond */
+
#endif
diff --git a/src/code_80086E70.c b/src/code_80086E70.c
index d2ee56aca..5cfb55fc4 100644
--- a/src/code_80086E70.c
+++ b/src/code_80086E70.c
@@ -98,7 +98,7 @@ s32 func_800871AC(s32 objectIndex, s32 arg1) {
s32 sp24;
sp24 = 0;
- if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != 0) {
+ if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != FALSE) {
set_object_flag_unk_054_true(objectIndex, 8);
gObjectList[objectIndex].unk_0B0 = (s16) arg1;
}
@@ -124,80 +124,80 @@ s32 angle_between_object_camera(s32 objectIndex, Camera *camera) {
return atan2s(gObjectList[objectIndex].pos[0] - camera->pos[0], gObjectList[objectIndex].pos[2] - camera->pos[2]);
}
-u16 func_80087324(s32 objectIndex) {
- return -atan2s(gObjectList[objectIndex].unk_038[1], gObjectList[objectIndex].unk_038[2]);
+u16 get_x_direction_angle(s32 objectIndex) {
+ return -atan2s(gObjectList[objectIndex].velocity[1], gObjectList[objectIndex].velocity[2]);
}
-s32 func_80087368(s32 objectIndex) {
- return atan2s(gObjectList[objectIndex].unk_038[0], gObjectList[objectIndex].unk_038[2]);
+s32 get_y_direction_angle(s32 objectIndex) {
+ return atan2s(gObjectList[objectIndex].velocity[0], gObjectList[objectIndex].velocity[2]);
}
UNUSED void func_800873A4(s32 objectIndex) {
- gObjectList[objectIndex].unk_0BE[0] = func_800417B4(gObjectList[objectIndex].unk_0BE[0], func_80087324(objectIndex));
+ gObjectList[objectIndex].direction_angle[0] = func_800417B4(gObjectList[objectIndex].direction_angle[0], get_x_direction_angle(objectIndex));
}
void func_800873F4(s32 objectIndex) {
- gObjectList[objectIndex].unk_0BE[1] = func_800417B4(gObjectList[objectIndex].unk_0BE[1], func_80087368(objectIndex));
+ gObjectList[objectIndex].direction_angle[1] = func_800417B4(gObjectList[objectIndex].direction_angle[1], get_y_direction_angle(objectIndex));
}
UNUSED void func_80087444(s32 objectIndex) {
- gObjectList[objectIndex].unk_038[0] = gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].unk_0BE[1]);
+ gObjectList[objectIndex].velocity[0] = gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].direction_angle[1]);
}
UNUSED void func_8008748C(s32 objectIndex) {
- gObjectList[objectIndex].unk_038[1] = gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].unk_0BE[0]);
+ gObjectList[objectIndex].velocity[1] = gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].direction_angle[0]);
}
UNUSED void func_800874D4(s32 objectIndex) {
- gObjectList[objectIndex].unk_038[2] = gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].unk_0BE[1]);
+ gObjectList[objectIndex].velocity[2] = gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].direction_angle[1]);
}
void func_8008751C(s32 objectIndex) {
- gObjectList[objectIndex].unk_038[0] = gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].unk_0BE[1]);
- gObjectList[objectIndex].unk_038[2] = gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].unk_0BE[1]);
+ gObjectList[objectIndex].velocity[0] = gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].direction_angle[1]);
+ gObjectList[objectIndex].velocity[2] = gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].direction_angle[1]);
}
void func_8008757C(s32 objectIndex) {
f32 sp24;
- sp24 = coss(gObjectList[objectIndex].unk_0BE[0]);
- gObjectList[objectIndex].unk_038[0] = (gObjectList[objectIndex].unk_034 * sp24) * sins(gObjectList[objectIndex].unk_0BE[1]);
- gObjectList[objectIndex].unk_038[1] = -gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].unk_0BE[0]);
- sp24 = coss(gObjectList[objectIndex].unk_0BE[0]);
- gObjectList[objectIndex].unk_038[2] = (gObjectList[objectIndex].unk_034 * sp24) * coss(gObjectList[objectIndex].unk_0BE[1]);
+ sp24 = coss(gObjectList[objectIndex].direction_angle[0]);
+ gObjectList[objectIndex].velocity[0] = (gObjectList[objectIndex].unk_034 * sp24) * sins(gObjectList[objectIndex].direction_angle[1]);
+ gObjectList[objectIndex].velocity[1] = -gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].direction_angle[0]);
+ sp24 = coss(gObjectList[objectIndex].direction_angle[0]);
+ gObjectList[objectIndex].velocity[2] = (gObjectList[objectIndex].unk_034 * sp24) * coss(gObjectList[objectIndex].direction_angle[1]);
}
void func_80087620(s32 objectIndex) {
- gObjectList[objectIndex].unk_038[0] = gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].unk_0BE[1] + 0x8000);
- gObjectList[objectIndex].unk_038[2] = gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].unk_0BE[1] + 0x8000);
+ gObjectList[objectIndex].velocity[0] = gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].direction_angle[1] + 0x8000);
+ gObjectList[objectIndex].velocity[2] = gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].direction_angle[1] + 0x8000);
}
void func_800876A0(s32 objectIndex) {
- gObjectList[objectIndex].unk_028[0] += gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].unk_0BE[1]);
- gObjectList[objectIndex].unk_028[2] += gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].unk_0BE[1]);
+ gObjectList[objectIndex].unk_028[0] += gObjectList[objectIndex].unk_034 * sins(gObjectList[objectIndex].direction_angle[1]);
+ gObjectList[objectIndex].unk_028[2] += gObjectList[objectIndex].unk_034 * coss(gObjectList[objectIndex].direction_angle[1]);
}
void func_80087710(s32 objectIndex) {
- gObjectList[objectIndex].unk_028[0] += gObjectList[objectIndex].unk_038[0];
- gObjectList[objectIndex].unk_028[1] += gObjectList[objectIndex].unk_038[1];
- gObjectList[objectIndex].unk_028[2] += gObjectList[objectIndex].unk_038[2];
+ gObjectList[objectIndex].unk_028[0] += gObjectList[objectIndex].velocity[0];
+ gObjectList[objectIndex].unk_028[1] += gObjectList[objectIndex].velocity[1];
+ gObjectList[objectIndex].unk_028[2] += gObjectList[objectIndex].velocity[2];
}
void func_8008775C(s32 objectIndex) {
- gObjectList[objectIndex].unk_028[0] += gObjectList[objectIndex].unk_038[0];
- gObjectList[objectIndex].unk_028[2] += gObjectList[objectIndex].unk_038[2];
+ gObjectList[objectIndex].unk_028[0] += gObjectList[objectIndex].velocity[0];
+ gObjectList[objectIndex].unk_028[2] += gObjectList[objectIndex].velocity[2];
}
UNUSED void func_80087798(s32 objectIndex) {
- gObjectList[objectIndex].unk_028[0] += gObjectList[objectIndex].unk_038[0];
+ gObjectList[objectIndex].unk_028[0] += gObjectList[objectIndex].velocity[0];
}
void func_800877C4(s32 objectIndex) {
- gObjectList[objectIndex].unk_028[1] += gObjectList[objectIndex].unk_038[1];
+ gObjectList[objectIndex].unk_028[1] += gObjectList[objectIndex].velocity[1];
}
UNUSED void func_800877F0(s32 objectIndex) {
- gObjectList[objectIndex].unk_028[2] += gObjectList[objectIndex].unk_038[2];
+ gObjectList[objectIndex].unk_028[2] += gObjectList[objectIndex].velocity[2];
}
void func_8008781C(s32 arg0) {
@@ -218,7 +218,7 @@ s32 func_8008789C(s32 objectIndex, s32 arg1) {
s32 sp24;
sp24 = 0;
- if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != 0) {
+ if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != FALSE) {
set_object_flag_unk_054_true(objectIndex, 8);
func_8008751C(objectIndex);
gObjectList[objectIndex].unk_0B0 = arg1;
@@ -237,7 +237,7 @@ s32 func_80087954(s32 objectIndex, s32 arg1) {
s32 sp24;
sp24 = 0;
- if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != 0) {
+ if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != FALSE) {
set_object_flag_unk_054_true(objectIndex, 8);
func_80087620(objectIndex);
gObjectList[objectIndex].unk_0B0 = arg1;
@@ -252,27 +252,27 @@ s32 func_80087954(s32 objectIndex, s32 arg1) {
return sp24;
}
-s32 func_80087A0C(s32 objectIndex, s16 arg1, s16 arg2, s16 arg3, s16 arg4) {
- s16 sp36;
+bool func_80087A0C(s32 objectIndex, s16 arg1, s16 arg2, s16 arg3, s16 arg4) {
+ s16 dist;
s16 temp_a0;
s16 temp_v0;
- s32 sp2C;
+ bool sp2C;
- sp2C = 0;
- if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != 0) {
+ sp2C = FALSE;
+ if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != FALSE) {
set_object_flag_unk_054_true(objectIndex, 8);
temp_v0 = arg2 - arg1;
temp_a0 = arg4 - arg3;
- sp36 = sqrtf((temp_v0 * temp_v0) + (temp_a0 * temp_a0));
- gObjectList[objectIndex].unk_010[1] = 0.0f;
- gObjectList[objectIndex].unk_0BE[1] = atan2s(temp_v0, temp_a0);
+ dist = sqrtf((temp_v0 * temp_v0) + (temp_a0 * temp_a0));
+ gObjectList[objectIndex].origin_pos[1] = 0.0f;
+ gObjectList[objectIndex].direction_angle[1] = atan2s(temp_v0, temp_a0);
func_8008751C(objectIndex);
- gObjectList[objectIndex].unk_0B0 = sp36 / gObjectList[objectIndex].unk_034;
+ gObjectList[objectIndex].unk_0B0 = dist / gObjectList[objectIndex].unk_034;
}
gObjectList[objectIndex].unk_0B0--;
if (gObjectList[objectIndex].unk_0B0 < 0) {
set_object_flag_unk_054_false(objectIndex, 8);
- sp2C = 1;
+ sp2C = TRUE;
} else {
func_8008775C(objectIndex);
}
@@ -283,9 +283,9 @@ s32 func_80087B84(s32 objectIndex, f32 arg1, f32 arg2) {
s32 sp24;
sp24 = 0;
- if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != 0) {
+ if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != FALSE) {
set_object_flag_unk_054_true(objectIndex, 8);
- gObjectList[objectIndex].unk_038[1] = -arg1;
+ gObjectList[objectIndex].velocity[1] = -arg1;
}
func_800877C4(objectIndex);
if (gObjectList[objectIndex].pos[1] <= arg2) {
@@ -300,9 +300,9 @@ s32 func_80087C48(s32 objectIndex, f32 arg1, f32 arg2, s32 arg3) {
s32 sp24;
sp24 = 0;
- if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != 0) {
+ if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != FALSE) {
set_object_flag_unk_054_true(objectIndex, 8);
- gObjectList[objectIndex].unk_038[1] = arg1;
+ gObjectList[objectIndex].velocity[1] = arg1;
gObjectList[objectIndex].unk_0B0 = (s16) arg3;
}
gObjectList[objectIndex].unk_0B0--;
@@ -311,7 +311,7 @@ s32 func_80087C48(s32 objectIndex, f32 arg1, f32 arg2, s32 arg3) {
func_80086FD4(objectIndex);
sp24 = 1;
} else {
- gObjectList[objectIndex].unk_038[1] -= arg2;
+ gObjectList[objectIndex].velocity[1] -= arg2;
func_800877C4(objectIndex);
}
return sp24;
@@ -323,9 +323,9 @@ s32 func_80087D24(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3) {
sp24 = 0;
if (is_obj_index_flag_unk_054_inactive(objectIndex, 8) != 0) {
set_object_flag_unk_054_true(objectIndex, 8);
- gObjectList[objectIndex].unk_038[1] = arg1;
+ gObjectList[objectIndex].velocity[1] = arg1;
}
- gObjectList[objectIndex].unk_038[1] -= arg2;
+ gObjectList[objectIndex].velocity[1] -= arg2;
func_800877C4(objectIndex);
if (gObjectList[objectIndex].unk_028[1] <= arg3) {
set_object_flag_unk_054_false(objectIndex, 8);
@@ -347,8 +347,8 @@ bool func_80087E08(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s32
gObjectList[objectIndex].unk_028[1] = 0.0f;
gObjectList[objectIndex].unk_028[0] = 0.0f;
gObjectList[objectIndex].unk_034 = arg3;
- gObjectList[objectIndex].unk_038[1] = arg1;
- gObjectList[objectIndex].unk_0BE[1] = arg4;
+ gObjectList[objectIndex].velocity[1] = arg1;
+ gObjectList[objectIndex].direction_angle[1] = arg4;
func_8008751C(objectIndex);
gObjectList[objectIndex].unk_0B0 = arg5;
}
@@ -358,7 +358,7 @@ bool func_80087E08(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s32
func_80086FD4(objectIndex);
sp2C = TRUE;
} else {
- gObjectList[objectIndex].unk_038[1] -= arg2;
+ gObjectList[objectIndex].velocity[1] -= arg2;
func_80087710(objectIndex);
}
return sp2C;
@@ -375,8 +375,8 @@ UNUSED s32 func_80087F14(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4
gObjectList[objectIndex].unk_028[1] = 0.0f;
gObjectList[objectIndex].unk_028[0] = 0.0f;
gObjectList[objectIndex].unk_034 = arg3;
- gObjectList[objectIndex].unk_038[1] = arg1;
- gObjectList[objectIndex].unk_0BE[1] = arg4;
+ gObjectList[objectIndex].velocity[1] = arg1;
+ gObjectList[objectIndex].direction_angle[1] = arg4;
func_8008751C(objectIndex);
gObjectList[objectIndex].unk_0B0 = gVBlankTimer;
}
@@ -385,7 +385,7 @@ UNUSED s32 func_80087F14(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4
func_80086FD4(objectIndex);
sp2C = 1;
} else {
- gObjectList[objectIndex].unk_038[1] -= arg2;
+ gObjectList[objectIndex].velocity[1] -= arg2;
func_80087710(objectIndex);
}
return sp2C;
@@ -400,8 +400,8 @@ void func_80088038(s32 objectIndex, f32 arg1, u16 arg2) {
gObjectList[objectIndex].unk_0C4 += arg2;
gObjectList[objectIndex].unk_028[0] = sins(gObjectList[objectIndex].unk_0C4) * arg1;
gObjectList[objectIndex].unk_028[2] = coss(gObjectList[objectIndex].unk_0C4) * arg1;
- gObjectList[objectIndex].unk_038[0] = gObjectList[objectIndex].unk_028[0] - temp_f4;
- gObjectList[objectIndex].unk_038[2] = gObjectList[objectIndex].unk_028[2] - sp20;
+ gObjectList[objectIndex].velocity[0] = gObjectList[objectIndex].unk_028[0] - temp_f4;
+ gObjectList[objectIndex].velocity[2] = gObjectList[objectIndex].unk_028[2] - sp20;
}
UNUSED void func_800880DC(void) {
@@ -429,11 +429,11 @@ void func_80088178(s32 objectIndex, s32 arg1) {
temp_v1 = &gObjectList[objectIndex];
temp_a1 = atan2s(D_80165760[1] - D_80165760[0], D_80165780[1] - D_80165780[0]);
- temp_a1 -= temp_v1->unk_0BE[1];
+ temp_a1 -= temp_v1->direction_angle[1];
if (temp_a1 > 0) {
- temp_v1->unk_0BE[1] += (arg1 << 8);
+ temp_v1->direction_angle[1] += (arg1 << 8);
} else if (temp_a1 < 0) {
- temp_v1->unk_0BE[1] -= (arg1 << 8);
+ temp_v1->direction_angle[1] -= (arg1 << 8);
}
}
@@ -573,9 +573,9 @@ void func_800887C0(s32 objectIndex) {
if (D_8018C3B0.unk34 == 1) {
set_object_flag_unk_054_true(objectIndex, 0x00800000);
gObjectList[objectIndex].unk_044 = func_802ABE30(gObjectList[objectIndex].pos[0], 0.0f, gObjectList[objectIndex].pos[2], D_8018C3B0.unk3A);
- gObjectList[objectIndex].unk_038[0] = D_8018C3B0.orientationVector[0];
- gObjectList[objectIndex].unk_038[1] = D_8018C3B0.orientationVector[1];
- gObjectList[objectIndex].unk_038[2] = D_8018C3B0.orientationVector[2];
+ gObjectList[objectIndex].velocity[0] = D_8018C3B0.orientationVector[0];
+ gObjectList[objectIndex].velocity[1] = D_8018C3B0.orientationVector[1];
+ gObjectList[objectIndex].velocity[2] = D_8018C3B0.orientationVector[2];
return;
}
set_object_flag_unk_054_false(objectIndex, 0x00800000);
@@ -882,8 +882,8 @@ bool has_collided_with_player_and_within_height(s32 objectIndex, Player *player,
bool var_v1;
var_v1 = FALSE;
- x = gObjectList[objectIndex].pos[0] - player->pos[0];
- y = gObjectList[objectIndex].pos[1] - player->pos[1];
+ x = gObjectList[objectIndex].pos[0] - player->pos[0];
+ y = gObjectList[objectIndex].pos[1] - player->pos[1];
z = gObjectList[objectIndex].pos[2] - player->pos[2];
distance = gObjectList[objectIndex].boundingBoxSize + player->boundingBoxSize;
// abs(y)
@@ -1014,15 +1014,15 @@ f32 func_8008933C(Player *player, s32 objectIndex, f32 arg2, f32 arg3) {
player->unk_046 |= 2;
player->effects |= 0x8000;
temp_v1->unk_18[6] = 4;
- something = (player->pos[0] - temp_v0->pos[0]) * temp_v0->unk_038[0];
+ something = (player->pos[0] - temp_v0->pos[0]) * temp_v0->velocity[0];
if (something >= 0.0f) {
- temp_v1->unk_04[0] = (-player->velocity[0] * arg2) + (temp_v0->unk_038[0] * arg3);
+ temp_v1->unk_04[0] = (-player->velocity[0] * arg2) + (temp_v0->velocity[0] * arg3);
} else {
temp_v1->unk_04[0] = -player->velocity[0] * arg2;
}
- something = (player->pos[2] - temp_v0->pos[2]) * temp_v0->unk_038[2];
+ something = (player->pos[2] - temp_v0->pos[2]) * temp_v0->velocity[2];
if (something >= 0.0f) {
- temp_v1->unk_04[2] = (-player->velocity[2] * arg2) + (temp_v0->unk_038[2] * arg3);
+ temp_v1->unk_04[2] = (-player->velocity[2] * arg2) + (temp_v0->velocity[2] * arg3);
} else {
temp_v1->unk_04[2] = -player->velocity[2] * arg2;
}
@@ -1235,7 +1235,7 @@ s32 func_8008A060(s32 objectIndex, Camera *camera, u16 arg2) {
s32 var_v1;
var_v1 = 0;
- temp_t3 = (((u16)camera->rot[1] - gObjectList[objectIndex].unk_0BE[1]) + (arg2 >> 1));
+ temp_t3 = (((u16)camera->rot[1] - gObjectList[objectIndex].direction_angle[1]) + (arg2 >> 1));
//! @warning Always true
if ((temp_t3 >= 0) && (arg2 >= temp_t3)) {
@@ -1438,9 +1438,9 @@ void func_8008A920(s32 objectIndex) {
Vec4s *temp_v0;
temp_v0 = gObjectList[objectIndex].unk_07C;
- gObjectList[objectIndex].unk_038[0] = (f32) (temp_v0[1][0] - temp_v0[0][0]) / (f32) temp_v0[0][3];
- gObjectList[objectIndex].unk_038[1] = (f32) (temp_v0[1][1] - temp_v0[0][1]) / (f32) temp_v0[0][3];
- gObjectList[objectIndex].unk_038[2] = (f32) (temp_v0[1][2] - temp_v0[0][2]) / (f32) temp_v0[0][3];
+ gObjectList[objectIndex].velocity[0] = (f32) (temp_v0[1][0] - temp_v0[0][0]) / (f32) temp_v0[0][3];
+ gObjectList[objectIndex].velocity[1] = (f32) (temp_v0[1][1] - temp_v0[0][1]) / (f32) temp_v0[0][3];
+ gObjectList[objectIndex].velocity[2] = (f32) (temp_v0[1][2] - temp_v0[0][2]) / (f32) temp_v0[0][3];
}
void func_8008A9B8(s32 objectIndex) {
@@ -1478,9 +1478,9 @@ void func_8008AB10(s32 objectIndex) {
Objects *temp_v0;
temp_v0 = &gObjectList[objectIndex];
- temp_v0->unk_028[0] += temp_v0->unk_038[0];
- temp_v0->unk_028[1] += temp_v0->unk_038[1];
- temp_v0->unk_028[2] += temp_v0->unk_038[2];
+ temp_v0->unk_028[0] += temp_v0->velocity[0];
+ temp_v0->unk_028[1] += temp_v0->velocity[1];
+ temp_v0->unk_028[2] += temp_v0->velocity[2];
temp_v0->timer += (u16)temp_v0->unk_09A;
if (temp_v0->timer >= 0x2710) {
temp_v0->unk_084[9] = (u16)temp_v0->unk_084[9] + 1;
@@ -1574,9 +1574,9 @@ void func_8008AE9C(s32 objectIndex) {
Objects *temp_v0;
temp_v0 = &gObjectList[objectIndex];
- temp_v0->unk_038[0] = (D_80183DC8[0] * D_80165760[0]) + (D_80183DC8[1] * D_80165760[1]) + (D_80183DC8[2] * D_80165760[2]) + (D_80183DC8[3] * D_80165760[3]);
- temp_v0->unk_038[1] = (D_80183DC8[0] * D_80165770[0]) + (D_80183DC8[1] * D_80165770[1]) + (D_80183DC8[2] * D_80165770[2]) + (D_80183DC8[3] * D_80165770[3]);
- temp_v0->unk_038[2] = (D_80183DC8[0] * D_80165780[0]) + (D_80183DC8[1] * D_80165780[1]) + (D_80183DC8[2] * D_80165780[2]) + (D_80183DC8[3] * D_80165780[3]);
+ temp_v0->velocity[0] = (D_80183DC8[0] * D_80165760[0]) + (D_80183DC8[1] * D_80165760[1]) + (D_80183DC8[2] * D_80165760[2]) + (D_80183DC8[3] * D_80165760[3]);
+ temp_v0->velocity[1] = (D_80183DC8[0] * D_80165770[0]) + (D_80183DC8[1] * D_80165770[1]) + (D_80183DC8[2] * D_80165770[2]) + (D_80183DC8[3] * D_80165770[3]);
+ temp_v0->velocity[2] = (D_80183DC8[0] * D_80165780[0]) + (D_80183DC8[1] * D_80165780[1]) + (D_80183DC8[2] * D_80165780[2]) + (D_80183DC8[3] * D_80165780[3]);
}
void func_8008AFE0(s32 objectIndex, f32 arg1) {
@@ -1778,10 +1778,10 @@ void func_8008B78C(s32 objectIndex) {
}
}
-void func_8008B7D4(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3) {
- gObjectList[objectIndex].unk_010[0] = arg1;
- gObjectList[objectIndex].unk_010[1] = arg2;
- gObjectList[objectIndex].unk_010[2] = arg3;
+void set_obj_origin_pos(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3) {
+ gObjectList[objectIndex].origin_pos[0] = arg1;
+ gObjectList[objectIndex].origin_pos[1] = arg2;
+ gObjectList[objectIndex].origin_pos[2] = arg3;
}
void func_8008B80C(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3) {
@@ -1791,66 +1791,66 @@ void func_8008B80C(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3) {
}
void func_8008B844(s32 objectIndex) {
- f32 temp_f0 = gObjectList[objectIndex].unk_010[0];
+ f32 temp_f0 = gObjectList[objectIndex].origin_pos[0];
gObjectList[objectIndex].pos[0] = gObjectList[objectIndex].unk_028[0] + temp_f0;
gObjectList[objectIndex].pos[1] = gObjectList[objectIndex].unk_028[1] + temp_f0;
gObjectList[objectIndex].pos[2] = gObjectList[objectIndex].unk_028[2] + temp_f0;
}
-void func_8008B888(s32 objectIndex, u16 arg1, u16 arg2, u16 arg3) {
- gObjectList[objectIndex].unk_0BE[0] = arg1;
- gObjectList[objectIndex].unk_0BE[1] = arg2;
- gObjectList[objectIndex].unk_0BE[2] = arg3;
+void set_obj_direction_angle(s32 objectIndex, u16 arg1, u16 arg2, u16 arg3) {
+ gObjectList[objectIndex].direction_angle[0] = arg1;
+ gObjectList[objectIndex].direction_angle[1] = arg2;
+ gObjectList[objectIndex].direction_angle[2] = arg3;
}
-void func_8008B8BC(s32 objectIndex, u16 arg1, u16 arg2, u16 arg3) {
- gObjectList[objectIndex].unk_0B2[0] = arg1;
- gObjectList[objectIndex].unk_0B2[1] = arg2;
- gObjectList[objectIndex].unk_0B2[2] = arg3;
+void set_obj_orientation(s32 objectIndex, u16 arg1, u16 arg2, u16 arg3) {
+ gObjectList[objectIndex].orientation[0] = arg1;
+ gObjectList[objectIndex].orientation[1] = arg2;
+ gObjectList[objectIndex].orientation[2] = arg3;
}
-void func_8008B8F0(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3) {
- gObjectList[objectIndex].unk_038[0] = arg1;
- gObjectList[objectIndex].unk_038[1] = arg2;
- gObjectList[objectIndex].unk_038[2] = arg3;
+void set_obj_velocity(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3) {
+ gObjectList[objectIndex].velocity[0] = arg1;
+ gObjectList[objectIndex].velocity[1] = arg2;
+ gObjectList[objectIndex].velocity[2] = arg3;
}
void func_8008B928(s32 objectIndex, s16 arg1, s16 arg2, s16 arg3, s16 arg4[][4]) {
Objects *temp_s0;
temp_s0 = &gObjectList[objectIndex];
- temp_s0->unk_010[0] = (f32) arg1;
- temp_s0->unk_010[1] = (f32) arg2;
+ temp_s0->origin_pos[0] = (f32) arg1;
+ temp_s0->origin_pos[1] = (f32) arg2;
temp_s0->unk_080 = arg4;
- temp_s0->unk_010[2] = (f32) arg3;
- temp_s0->unk_038[0] = (f32) (arg4[1][1] - arg4[0][1]);
- temp_s0->unk_038[1] = (f32) (arg4[1][2] - arg4[0][2]);
- temp_s0->unk_038[2] = (f32) (arg4[1][3] - arg4[0][3]);
- temp_s0->unk_0BE[1] = func_80087368(objectIndex);
- temp_s0->unk_038[2] = func_800416D8(temp_s0->unk_038[2], temp_s0->unk_038[0], -temp_s0->unk_0BE[1]);
- temp_s0->unk_0BE[0] = func_80087324(objectIndex);
+ temp_s0->origin_pos[2] = (f32) arg3;
+ temp_s0->velocity[0] = (f32) (arg4[1][1] - arg4[0][1]);
+ temp_s0->velocity[1] = (f32) (arg4[1][2] - arg4[0][2]);
+ temp_s0->velocity[2] = (f32) (arg4[1][3] - arg4[0][3]);
+ temp_s0->direction_angle[1] = get_y_direction_angle(objectIndex);
+ temp_s0->velocity[2] = func_800416D8(temp_s0->velocity[2], temp_s0->velocity[0], -temp_s0->direction_angle[1]);
+ temp_s0->direction_angle[0] = get_x_direction_angle(objectIndex);
}
UNUSED void func_8008BA40(s32 objectIndex, s16 arg1, u16 arg2) {
s16 test;
test = random_int(arg2) - (arg2 / 2);
- gObjectList[objectIndex].unk_010[0] = arg1 + test;
+ gObjectList[objectIndex].origin_pos[0] = arg1 + test;
}
void func_8008BAB4(s32 objectIndex, s16 arg1, u16 arg2) {
s16 test;
test = random_int(arg2) - (arg2 / 2);
- gObjectList[objectIndex].unk_010[1] = arg1 + test;
+ gObjectList[objectIndex].origin_pos[1] = arg1 + test;
}
UNUSED void func_8008BB28(s32 objectIndex, s16 arg1, u16 arg2) {
s16 test;
test = random_int(arg2) - (arg2 / 2);
- gObjectList[objectIndex].unk_010[2] = arg1 + test;
+ gObjectList[objectIndex].origin_pos[2] = arg1 + test;
}
UNUSED void func_8008BB9C(s32 objectIndex, s16 arg1, s16 arg2, u16 arg3, u16 arg4) {
@@ -1859,8 +1859,8 @@ UNUSED void func_8008BB9C(s32 objectIndex, s16 arg1, s16 arg2, u16 arg3, u16 arg
sp1E = random_int(arg3) - ((s32) arg3 / 2);
temp_v0 = random_int(arg4) - ((s32) arg4 / 2);
- gObjectList[objectIndex].unk_010[0] = arg1 + sp1E;
- gObjectList[objectIndex].unk_010[1] = arg2 + temp_v0;
+ gObjectList[objectIndex].origin_pos[0] = arg1 + sp1E;
+ gObjectList[objectIndex].origin_pos[1] = arg2 + temp_v0;
}
UNUSED void func_8008BC58(s32 objectIndex, s16 arg1, s16 arg2, u16 arg3, u16 arg4) {
@@ -1869,8 +1869,8 @@ UNUSED void func_8008BC58(s32 objectIndex, s16 arg1, s16 arg2, u16 arg3, u16 arg
sp1E = random_int(arg3) - ((s32) arg3 / 2);
temp_v0 = random_int(arg4) - ((s32) arg4 / 2);
- gObjectList[objectIndex].unk_010[0] = arg1 + sp1E;
- gObjectList[objectIndex].unk_010[2] = arg2 + temp_v0;
+ gObjectList[objectIndex].origin_pos[0] = arg1 + sp1E;
+ gObjectList[objectIndex].origin_pos[2] = arg2 + temp_v0;
}
void func_8008BD14(s32 objectIndex, s16 arg1, s16 arg2, s16 arg3, u16 arg4, u16 arg5, u16 arg6) {
@@ -1881,17 +1881,17 @@ void func_8008BD14(s32 objectIndex, s16 arg1, s16 arg2, s16 arg3, u16 arg4, u16
sp1E = random_int(arg4) - ((s32) arg4 / 2);
sp1C = random_int(arg5) - ((s32) arg5 / 2);
temp_v0 = random_int(arg6) - ((s32) arg6 / 2);
- gObjectList[objectIndex].unk_010[0] = arg1 + sp1E;
- gObjectList[objectIndex].unk_010[1] = arg2 + sp1C;
- gObjectList[objectIndex].unk_010[2] = arg3 + temp_v0;
+ gObjectList[objectIndex].origin_pos[0] = arg1 + sp1E;
+ gObjectList[objectIndex].origin_pos[1] = arg2 + sp1C;
+ gObjectList[objectIndex].origin_pos[2] = arg3 + temp_v0;
}
void func_8008BE0C(s32 objectIndex, s16 arg1, u16 arg2) {
- gObjectList[objectIndex].unk_010[0] = gPlayerOneCopy->pos[0] + (sins(arg2) * arg1);
- gObjectList[objectIndex].unk_010[2] = gPlayerOneCopy->pos[2] + (coss(arg2) * arg1);
+ gObjectList[objectIndex].origin_pos[0] = gPlayerOneCopy->pos[0] + (sins(arg2) * arg1);
+ gObjectList[objectIndex].origin_pos[2] = gPlayerOneCopy->pos[2] + (coss(arg2) * arg1);
}
-void func_8008BEA4(s32 objectIndex, u16 arg1, u16 arg2) {
+UNUSED void func_8008BEA4(s32 objectIndex, u16 arg1, u16 arg2) {
u16 thing;
u16 thing2;
@@ -1901,9 +1901,9 @@ void func_8008BEA4(s32 objectIndex, u16 arg1, u16 arg2) {
}
void func_8008BF18(s32 objectIndex) {
- gObjectList[objectIndex].pos[0] = gObjectList[objectIndex].unk_010[0] + gObjectList[objectIndex].unk_028[0];
- gObjectList[objectIndex].pos[1] = gObjectList[objectIndex].unk_010[1] + gObjectList[objectIndex].unk_028[1];
- gObjectList[objectIndex].pos[2] = gObjectList[objectIndex].unk_010[2] + gObjectList[objectIndex].unk_028[2];
+ gObjectList[objectIndex].pos[0] = gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].unk_028[0];
+ gObjectList[objectIndex].pos[1] = gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].unk_028[1];
+ gObjectList[objectIndex].pos[2] = gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].unk_028[2];
}
void func_8008BF64(s32 objectIndex) {
@@ -1913,9 +1913,9 @@ void func_8008BF64(s32 objectIndex) {
D_80183E40[0] = temp_v0->pos[0];
D_80183E40[1] = temp_v0->pos[1];
D_80183E40[2] = temp_v0->pos[2];
- D_80183E80[0] = temp_v0->unk_0BE[0];
- D_80183E80[1] = temp_v0->unk_0BE[1];
- D_80183E80[2] = temp_v0->unk_0BE[2];
+ D_80183E80[0] = temp_v0->direction_angle[0];
+ D_80183E80[1] = temp_v0->direction_angle[1];
+ D_80183E80[2] = temp_v0->direction_angle[2];
}
void func_8008BFC0(s32 objectIndex) {
diff --git a/src/code_80086E70.h b/src/code_80086E70.h
index f7cce4948..586d8c310 100644
--- a/src/code_80086E70.h
+++ b/src/code_80086E70.h
@@ -18,8 +18,8 @@ s32 func_800871AC(s32, s32);
void func_80087258(s32, s32, f32);
s32 func_80087294(s32, Player*);
s32 angle_between_object_camera(s32, Camera*);
-u16 func_80087324(s32);
-s32 func_80087368(s32);
+u16 get_x_direction_angle(s32);
+s32 get_y_direction_angle(s32);
void func_800873A4(s32);
void func_800873F4(s32);
void func_80087444(s32);
@@ -143,12 +143,12 @@ void func_8008B620(s32);
void func_8008B6A4(s32);
void func_8008B724(s32);
void func_8008B78C(s32);
-void func_8008B7D4(s32, f32, f32, f32);
+void set_obj_origin_pos(s32, f32, f32, f32);
void func_8008B80C(s32, f32, f32, f32);
void func_8008B844(s32);
-void func_8008B888(s32, u16, u16, u16);
-void func_8008B8BC(s32, u16, u16, u16);
-void func_8008B8F0(s32, f32, f32, f32);
+void set_obj_direction_angle(s32, u16, u16, u16);
+void set_obj_orientation(s32, u16, u16, u16);
+void set_obj_velocity(s32, f32, f32, f32);
void func_8008B928(s32, s16, s16, s16, s16[][4]);
void func_8008BA40(s32, s16, u16);
void func_8008BAB4(s32, s16, u16);
diff --git a/src/hud_renderer.c b/src/hud_renderer.c
index dd445b0a8..35c651cab 100644
--- a/src/hud_renderer.c
+++ b/src/hud_renderer.c
@@ -2835,7 +2835,7 @@ void func_80050E34(s32 playerId, s32 arg1) {
object->pos[0] = object->unk_028[0] + ((f32) (spD0 + 0x20));
object->pos[1] = object->unk_028[1] + ((f32) (spC4 + spCC));
object->pos[2] = object->unk_028[2];
- rsp_set_matrix_transformation(object->pos, object->unk_0BE, object->sizeScaling);
+ rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
gSPDisplayList(gDisplayListHead++, D_0D0069E0);
} else {
gDPLoadTLUT_pal256(gDisplayListHead++, gPortraitTLUTs[characterId]);
@@ -2850,7 +2850,7 @@ void func_80050E34(s32 playerId, s32 arg1) {
object->pos[0] = object->unk_028[0] + ((f32) (spD0 + 0x20));
object->pos[1] = object->unk_028[1] + ((f32) (spC4 + spCC));
object->pos[2] = object->unk_028[2];
- rsp_set_matrix_transformation(object->pos, object->unk_0BE, object->sizeScaling);
+ rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
if (spB8 != 0) {
gSPDisplayList(gDisplayListHead++, D_0D0069F8);
} else {
@@ -2868,7 +2868,7 @@ void func_80050E34(s32 playerId, s32 arg1) {
gSPDisplayList(gDisplayListHead++, D_0D007A40);
func_8004B35C(D_8018D3E4, D_8018D3E8, D_8018D3EC, 0x000000FF);
func_80044924(common_texture_character_portrait_border, 0x00000020, 0x00000020);
- rsp_set_matrix_transformation(object->pos, object->unk_0BE, object->sizeScaling);
+ rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
gSPDisplayList(gDisplayListHead++, D_0D0069E0);
}
}
@@ -2914,8 +2914,8 @@ void func_80051638(UNUSED s32 arg0) {
gSPDisplayList(gDisplayListHead++, D_0D0079C8);
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BOTH);
func_80043D50(common_texture_particle_leaf, 0x00000020, 0x00000010);
- for(someIndex = 0; someIndex < D_8018C970_SIZE; someIndex++) {
- leafIndex = D_8018C970[someIndex];
+ for(someIndex = 0; someIndex < gLeafParticle_SIZE; someIndex++) {
+ leafIndex = gLeafParticle[someIndex];
if (leafIndex != -1) {
object = &gObjectList[leafIndex];
if ((object->state >= 2) && (object->unk_0D5 == 7) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
@@ -2936,7 +2936,7 @@ void func_800517C8(void) {
gDPSetCombineLERP(gDisplayListHead++, 1, 0, SHADE, 0, 0, 0, 0, TEXEL0, 1, 0, SHADE, 0, 0, 0, 0, TEXEL0);
func_80044F34(D_0D0293D8, 0x10, 0x10);
for (someIndex = 0; someIndex < NUM_SNOWFLAKES; someIndex++) {
- snowflakeIndex = D_8018C1B0[someIndex];
+ snowflakeIndex = gObjectParticle1[someIndex];
if (gObjectList[snowflakeIndex].state >= 2) {
rsp_set_matrix_gObjectList(snowflakeIndex);
gSPDisplayList(gDisplayListHead++, D_0D006980);
@@ -3099,7 +3099,7 @@ void func_8005217C(s32 arg0) {
object = &gObjectList[temp_a3];
if (object->state >= 2) {
if (is_obj_index_flag_unk_054_active(temp_a3, 0x00000010) != 0) {
- rsp_set_matrix_transformation(object->pos, object->unk_0BE, object->sizeScaling);
+ rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
func_800520C0(temp_a3);
gSPDisplayList(gDisplayListHead++, D_0D007828);
@@ -3121,14 +3121,14 @@ void func_8005217C(s32 arg0) {
void func_800523B8(s32 objectIndex, s32 arg1, u32 arg2) {
UNUSED s32 pad[2];
- Objects *temp_v1;
+ Objects *object;
Camera *camera = &camera1[arg1];
- temp_v1 = &gObjectList[objectIndex];
- temp_v1->unk_0B2[1] = func_800418AC(temp_v1->pos[0], temp_v1->pos[2], camera->pos);
- func_800484BC(temp_v1->pos, temp_v1->unk_0B2, temp_v1->sizeScaling, temp_v1->unk_0A0, (u8 *) temp_v1->activeTLUT, temp_v1->activeTexture, temp_v1->vertex, 0x00000030, 0x00000028, 0x00000030, 0x00000028);
+ object = &gObjectList[objectIndex];
+ object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos);
+ func_800484BC(object->pos, object->orientation, object->sizeScaling, object->unk_0A0, (u8 *) object->activeTLUT, object->activeTexture, object->vertex, 0x00000030, 0x00000028, 0x00000030, 0x00000028);
if ((is_obj_index_flag_unk_054_active(objectIndex, 0x00000020) != 0) && (arg2 < 0x15F91U)) {
- func_8004A630(&D_8018C830, temp_v1->pos, 0.4f);
+ func_8004A630(&D_8018C830, object->pos, 0.4f);
}
}
@@ -3150,33 +3150,33 @@ void func_800524B4(s32 arg0) {
void func_80052590(s32 cameraId) {
s32 var_s2;
- s32 temp_s0;
+ s32 objectIndex;
Camera *temp_s7;
- temp_s0 = indexObjectList1[0];
+ objectIndex = indexObjectList1[0];
temp_s7 = &camera1[cameraId];
- func_80046F60(gObjectList[temp_s0].activeTLUT, gObjectList[temp_s0].activeTexture, 0x00000020, 0x00000040, 5);
- D_80183E80[0] = gObjectList[temp_s0].unk_0B2[0];
- D_80183E80[2] = gObjectList[temp_s0].unk_0B2[2];
+ func_80046F60(gObjectList[objectIndex].activeTLUT, gObjectList[objectIndex].activeTexture, 0x00000020, 0x00000040, 5);
+ D_80183E80[0] = gObjectList[objectIndex].orientation[0];
+ D_80183E80[2] = gObjectList[objectIndex].orientation[2];
if ((D_8018CFB0 != 0) || (D_8018CFC8 != 0)) {
for (var_s2 = 0; var_s2 < 40; var_s2++) {
- temp_s0 = D_8018C3F0[var_s2];
- if (temp_s0 == -1) continue;
+ objectIndex = gObjectParticle2[var_s2];
+ if (objectIndex == -1) continue;
- if ((gObjectList[temp_s0].state >= 2) && (gMatrixHudCount < 0x2EF)) {
- D_80183E80[1] = func_800418AC(gObjectList[temp_s0].pos[0], gObjectList[temp_s0].pos[2], temp_s7->pos);
- func_800431B0(gObjectList[temp_s0].pos, D_80183E80, gObjectList[temp_s0].sizeScaling, D_0D0062B0);
+ if ((gObjectList[objectIndex].state >= 2) && (gMatrixHudCount < 0x2EF)) {
+ D_80183E80[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], temp_s7->pos);
+ func_800431B0(gObjectList[objectIndex].pos, D_80183E80, gObjectList[objectIndex].sizeScaling, D_0D0062B0);
}
}
}
if ((D_8018CFE8 != 0) || (D_8018D000 != 0)) {
for (var_s2 = 0; var_s2 < 30; var_s2++) {
- temp_s0 = D_8018C630[var_s2];
- if (temp_s0 == -1) continue;
+ objectIndex = gObjectParticle3[var_s2];
+ if (objectIndex == -1) continue;
- if ((gObjectList[temp_s0].state >= 2) && (gMatrixHudCount < 0x2EF)) {
- D_80183E80[1] = func_800418AC(gObjectList[temp_s0].pos[0], gObjectList[temp_s0].pos[2], temp_s7->pos);
- func_800431B0(gObjectList[temp_s0].pos, D_80183E80, gObjectList[temp_s0].sizeScaling, D_0D0062B0);
+ if ((gObjectList[objectIndex].state >= 2) && (gMatrixHudCount < 0x2EF)) {
+ D_80183E80[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], temp_s7->pos);
+ func_800431B0(gObjectList[objectIndex].pos, D_80183E80, gObjectList[objectIndex].sizeScaling, D_0D0062B0);
}
}
}
@@ -3192,7 +3192,7 @@ void func_800527D8(s32 cameraId) {
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) {
object = &gObjectList[objectIndex];
if (object->state >= 2) {
- func_80043220(object->pos, object->unk_0B2, object->sizeScaling, object->unk_070);
+ func_80043220(object->pos, object->orientation, object->sizeScaling, object->model);
}
}
}
@@ -3227,8 +3227,8 @@ void func_800528EC(s32 arg0) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
func_800441E0(d_course_sherbet_land_ice, 0x00000020, 0x00000020);
if (gPlayerCountSelection1 < 3) {
- for (var_s3 = 0; var_s3 < D_8018C3F0_SIZE; var_s3++) {
- objectIndex = D_8018C3F0[var_s3];
+ for (var_s3 = 0; var_s3 < gObjectParticle2_SIZE; var_s3++) {
+ objectIndex = gObjectParticle2[var_s3];
if (objectIndex != -1) {
object = &gObjectList[objectIndex];
if (object->state > 0) {
@@ -3239,8 +3239,8 @@ void func_800528EC(s32 arg0) {
}
}
} else {
- for (var_s3 = 0; var_s3 < D_8018C3F0_SIZE; var_s3++) {
- objectIndex = D_8018C3F0[var_s3];
+ for (var_s3 = 0; var_s3 < gObjectParticle2_SIZE; var_s3++) {
+ objectIndex = gObjectParticle2[var_s3];
if (objectIndex != -1) {
object = &gObjectList[objectIndex];
if ((object->state > 0) && (arg0 == object->unk_084[7]) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
@@ -3266,7 +3266,7 @@ void func_80052C60(s32 arg0) {
gSPLight(gDisplayListHead++, &D_800E4620.l[0], LIGHT_1);
gSPLight(gDisplayListHead++, &D_800E4620.a, LIGHT_2);
for (playerId = 0; playerId < gPlayerCountSelection1; playerId++) {
- objectIndex = D_80183DB8[playerId];
+ objectIndex = gIndexLakituList[playerId];
if (objectIndex) {}
if (func_80072320(objectIndex, 4) != 0) {
func_8005285C(playerId);
@@ -3281,7 +3281,7 @@ void func_80052D70(s32 playerId) {
Player *temp_v1;
temp_v1 = &gPlayerOne[playerId];
- test = D_80183DB8[playerId];
+ test = gIndexLakituList[playerId];
if (func_80072320(test, 8) != 0) {
D_80183E40[0] = temp_v1->pos[0];
D_80183E40[1] = temp_v1->unk_074 - 6.5;
@@ -3313,18 +3313,18 @@ void func_80052F20(s32 cameraId) {
Camera *sp44;
s32 someIndex;
s32 objectIndex;
- Objects *temp_s1;
+ Objects *object;
sp44 = &camera1[cameraId];
func_80046E60(d_course_frappe_snowland_snow_tlut, d_course_frappe_snowland_snow, 0x00000020, 0x00000020);
- for (someIndex = 0; someIndex < D_8018C3F0_SIZE; someIndex++) {
- objectIndex = D_8018C3F0[someIndex];
+ for (someIndex = 0; someIndex < gObjectParticle2_SIZE; someIndex++) {
+ objectIndex = gObjectParticle2[someIndex];
if (objectIndex != -1) {
- temp_s1 = &gObjectList[objectIndex];
- if (temp_s1->state > 0) {
+ object = &gObjectList[objectIndex];
+ if (object->state > 0) {
func_8008A364(objectIndex, cameraId, 0x2AABU, 0x000001F4);
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) {
- temp_s1->unk_0B2[1] = func_800418AC(temp_s1->pos[0], temp_s1->pos[2], sp44->pos);
+ object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], sp44->pos);
rsp_set_matrix_gObjectList(objectIndex);
gSPDisplayList(gDisplayListHead++, D_0D0069E0);
}
@@ -3345,15 +3345,15 @@ void func_8005309C(s32 cameraId) {
if (gObjectList[objectIndex].state >= 2) {
func_8008A364(objectIndex, cameraId, 0x2AABU, 0x00000258);
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) {
- D_80183E80[0] = (s16) gObjectList[objectIndex].unk_0B2[0];
+ D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0];
D_80183E80[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
- D_80183E80[2] = (u16) gObjectList[objectIndex].unk_0B2[2];
+ D_80183E80[2] = (u16) gObjectList[objectIndex].orientation[2];
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00000010) != 0) {
func_800480B4(gObjectList[objectIndex].pos, (u16 *) D_80183E80, gObjectList[objectIndex].sizeScaling, (u8 *) gObjectList[objectIndex].activeTLUT, gObjectList[objectIndex].activeTexture, gObjectList[objectIndex].vertex, 0x00000040, 0x00000040, 0x00000040, 0x00000020);
}
objectIndex = indexObjectList2[var_s4];
- D_80183E80[0] = (s16) gObjectList[objectIndex].unk_0B2[0];
- D_80183E80[2] = (u16) gObjectList[objectIndex].unk_0B2[2];
+ D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0];
+ D_80183E80[2] = (u16) gObjectList[objectIndex].orientation[2];
func_800480B4(gObjectList[objectIndex].pos, (u16 *) D_80183E80, gObjectList[objectIndex].sizeScaling, (u8 *) gObjectList[objectIndex].activeTLUT, gObjectList[objectIndex].activeTexture, gObjectList[objectIndex].vertex, 0x00000040, 0x00000040, 0x00000040, 0x00000020);
}
}
@@ -3373,17 +3373,17 @@ void func_800532A4(s32 cameraId) {
s32 objectIndex;
Objects *object;
- objectIndex = D_80183DB8[cameraId];
+ objectIndex = gIndexLakituList[cameraId];
camera = &camera1[cameraId];
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00000010) != 0) {
object = &gObjectList[objectIndex];
- object->unk_0B2[0] = 0;
- object->unk_0B2[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos);
- object->unk_0B2[2] = 0x8000;
+ object->orientation[0] = 0;
+ object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos);
+ object->orientation[2] = 0x8000;
if (func_80072354(objectIndex, 2) != 0) {
- func_800480B4(object->pos, object->unk_0B2, object->sizeScaling, (u8 *) object->activeTLUT, object->activeTexture, object->vertex, (s32) object->textureWidth, (s32) object->textureHeight, (s32) object->textureWidth, (s32) object->textureHeight / 2);
+ func_800480B4(object->pos, object->orientation, object->sizeScaling, (u8 *) object->activeTLUT, object->activeTexture, object->vertex, (s32) object->textureWidth, (s32) object->textureHeight, (s32) object->textureWidth, (s32) object->textureHeight / 2);
} else {
- func_800485C4(object->pos, object->unk_0B2, object->sizeScaling, (s32) object->unk_0A0, (u8 *) object->activeTLUT, object->activeTexture, object->vertex, (s32) object->textureWidth, (s32) object->textureHeight, (s32) object->textureWidth, (s32) object->textureHeight / 2);
+ func_800485C4(object->pos, object->orientation, object->sizeScaling, (s32) object->unk_0A0, (u8 *) object->activeTLUT, object->activeTexture, object->vertex, (s32) object->textureWidth, (s32) object->textureHeight, (s32) object->textureWidth, (s32) object->textureHeight / 2);
}
if (gScreenModeSelection == SCREEN_MODE_1P) {
var_f0 = object->pos[0] - D_8018CF14->pos[0];
@@ -3439,13 +3439,13 @@ void func_800534E8(s32 objectIndex) {
void func_800536C8(s32 objectIndex) {
if ((gObjectList[objectIndex].state >= 2) && (func_80072354(objectIndex, 0x00000040) != 0)) {
func_8004A7AC(objectIndex, 1.75f);
- rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_0B2, gObjectList[objectIndex].sizeScaling);
+ rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling);
func_800534E8(objectIndex);
gSPDisplayList(gDisplayListHead++, D_0D007828);
gDPSetTextureLUT(gDisplayListHead++, G_TT_RGBA16);
gDPLoadTLUT_pal256(gDisplayListHead++, d_course_bowsers_castle_thwomp_tlut);
rsp_load_texture_mask(gObjectList[objectIndex].activeTexture, 0x00000010, 0x00000040, 4);
- gSPDisplayList(gDisplayListHead++, gObjectList[objectIndex].unk_070);
+ gSPDisplayList(gDisplayListHead++, gObjectList[objectIndex].model);
}
}
@@ -3455,7 +3455,7 @@ void func_80053870(s32 cameraId) {
s32 stackPadding0;
s16 minusone, plusone;
Camera *camera;
- Objects *temp_v0;
+ Objects *object;
camera = &camera1[cameraId];
if (cameraId == 0) {
@@ -3486,12 +3486,12 @@ void func_80053870(s32 cameraId) {
gSPClearGeometryMode(gDisplayListHead++, G_CULL_BOTH);
gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
func_80043D50(d_course_bowsers_castle_thwomp_side, 0x00000020, 0x00000020);
- for (var_s2 = 0; var_s2 < D_8018C630_SIZE; var_s2++) {
- temp_s1 = D_8018C630[var_s2];
+ for (var_s2 = 0; var_s2 < gObjectParticle3_SIZE; var_s2++) {
+ temp_s1 = gObjectParticle3[var_s2];
if (temp_s1 != -1) {
- temp_v0 = &gObjectList[temp_s1];
- if ((temp_v0->state > 0) && (temp_v0->unk_0D5 == 3) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
- rsp_set_matrix_transformation(temp_v0->pos, temp_v0->unk_0B2, temp_v0->sizeScaling);
+ object = &gObjectList[temp_s1];
+ if ((object->state > 0) && (object->unk_0D5 == 3) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
+ rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling);
gSPVertex(gDisplayListHead++, D_0D005C00, 3, 0);
gSPDisplayList(gDisplayListHead++, D_0D006930);
}
@@ -3505,14 +3505,14 @@ void func_80053870(s32 cameraId) {
func_8004B3C8(0);
D_80183E80[0] = 0;
D_80183E80[2] = 0x8000;
- for (var_s2 = 0; var_s2 < D_8018C3F0_SIZE; var_s2++) {
- temp_s1 = D_8018C3F0[var_s2];
+ for (var_s2 = 0; var_s2 < gObjectParticle2_SIZE; var_s2++) {
+ temp_s1 = gObjectParticle2[var_s2];
if (temp_s1 != -1) {
- temp_v0 = &gObjectList[temp_s1];
- if ((temp_v0->state >= 2) && (temp_v0->unk_0D5 == 2) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
- func_8004B138(0x000000FF, 0x000000FF, 0x000000FF, (s32) temp_v0->unk_0A0);
- D_80183E80[1] = func_800418AC(temp_v0->pos[0], temp_v0->pos[2], camera->pos);
- func_800431B0(temp_v0->pos, D_80183E80, temp_v0->sizeScaling, D_0D005AE0);
+ object = &gObjectList[temp_s1];
+ if ((object->state >= 2) && (object->unk_0D5 == 2) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
+ func_8004B138(0x000000FF, 0x000000FF, 0x000000FF, (s32) object->unk_0A0);
+ D_80183E80[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos);
+ func_800431B0(object->pos, D_80183E80, object->sizeScaling, D_0D005AE0);
}
}
}
@@ -3542,14 +3542,14 @@ void func_80053E6C(s32 arg0) {
D_80183E80[1] = 0x8000;
rsp_load_texture(D_8018D4BC, 0x40, 0x20);
for (var_s1 = 0; var_s1 < D_80165738; var_s1++) {
- objectIndex = D_8018C630[var_s1];
+ objectIndex = gObjectParticle3[var_s1];
if ((objectIndex != -1) && (gObjectList[objectIndex].state >= 2)) {
func_80053D74(objectIndex, arg0, 0);
}
}
rsp_load_texture(D_8018D4C0, 0x40, 0x20);
for (var_s1 = 0; var_s1 < D_80165738; var_s1++) {
- objectIndex = D_8018C630[var_s1];
+ objectIndex = gObjectParticle3[var_s1];
if ((objectIndex != -1) && (gObjectList[objectIndex].state >= 2)) {
func_80053D74(objectIndex, arg0, 4);
}
@@ -3591,7 +3591,7 @@ void func_800541BC(s32 cameraId) {
for (i = 0; i < 128; i++) {
// Need to make a way to increase this array for each train.
- func_800540CC(D_8018C3F0[i], cameraId);
+ func_800540CC(gObjectParticle2[i], cameraId);
}
}
}
@@ -3599,14 +3599,14 @@ void func_800541BC(s32 cameraId) {
if ((gTrainList[0].someFlags != 0) && (func_80041980(&gTrainList[0].locomotive.position, camera, 0x4000U) != 0)) {
- for (i = 0; i < D_8018C3F0_SIZE; i++) {
- func_800540CC(D_8018C3F0[i], cameraId);
+ for (i = 0; i < gObjectParticle2_SIZE; i++) {
+ func_800540CC(gObjectParticle2[i], cameraId);
}
}
if ((gTrainList[1].someFlags != 0) && (func_80041980(&gTrainList[1].locomotive.position, camera, 0x4000U) != 0)) {
- for (i = 0; i < D_8018C630_SIZE; i++) {
- func_800540CC(D_8018C630[i], cameraId);
+ for (i = 0; i < gObjectParticle3_SIZE; i++) {
+ func_800540CC(gObjectParticle3[i], cameraId);
}
}
#endif
@@ -3639,13 +3639,13 @@ void func_80054414(s32 cameraId) {
D_80183E80[0] = 0;
D_80183E80[2] = 0x8000;
if ((gFerries[0].someFlags != 0) && (func_80041980(gFerries[0].position, camera, 0x4000U) != 0)) {
- for (i = 0; i < D_8018C3F0_SIZE; i++) {
- func_80054324(D_8018C3F0[i], cameraId);
+ for (i = 0; i < gObjectParticle2_SIZE; i++) {
+ func_80054324(gObjectParticle2[i], cameraId);
}
}
if ((gFerries[1].someFlags != 0) && (func_80041980(gFerries[1].position, camera, 0x4000U) != 0)) {
- for (i = 0; i < D_8018C630_SIZE; i++) {
- func_80054324(D_8018C630[i], cameraId);
+ for (i = 0; i < gObjectParticle3_SIZE; i++) {
+ func_80054324(gObjectParticle3[i], cameraId);
}
}
}
@@ -3676,8 +3676,8 @@ void func_80054664(s32 cameraId) {
func_8004B414(0, 0, 0, 0x000000FF);
D_80183E80[0] = 0;
D_80183E80[2] = 0x8000;
- for (var_s0 = 0; var_s0 < D_8018C1B0_SIZE; var_s0++) {
- objectIndex = D_8018C1B0[var_s0];
+ for (var_s0 = 0; var_s0 < gObjectParticle1_SIZE; var_s0++) {
+ objectIndex = gObjectParticle1[var_s0];
if ((objectIndex != -1) && (gObjectList[objectIndex].state >= 3)) {
func_8005457C(objectIndex, cameraId);
}
@@ -3720,8 +3720,8 @@ void func_80054938(s32 cameraId) {
func_8004B72C(255, 255, 255, 255, 255, 255, 255);
D_80183E80[0] = 0;
D_80183E80[2] = 0x8000;
- for (var_s0 = 0; var_s0 < D_8018C870_SIZE; var_s0++) {
- objectIndex = D_8018C870[var_s0];
+ for (var_s0 = 0; var_s0 < gObjectParticle4_SIZE; var_s0++) {
+ objectIndex = gObjectParticle4[var_s0];
if (objectIndex != -1) {
object = &gObjectList[objectIndex];
if (object->state >= 2) {
@@ -3741,7 +3741,7 @@ void func_80054938(s32 cameraId) {
void func_80054AFC(s32 objectIndex, Vec3f arg1) {
D_80183E80[0] = func_800418E8(gObjectList[objectIndex].pos[2], gObjectList[objectIndex].pos[1], arg1);
D_80183E80[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], arg1);
- D_80183E80[2] = (u16) gObjectList[objectIndex].unk_0B2[2];
+ D_80183E80[2] = (u16) gObjectList[objectIndex].orientation[2];
func_8004B138((s32) gObjectList[objectIndex].unk_084[0], (s32) gObjectList[objectIndex].unk_084[1], (s32) gObjectList[objectIndex].unk_084[2], (s32) gObjectList[objectIndex].unk_0A0);
rsp_set_matrix_transformation(gObjectList[objectIndex].pos, (u16 *) D_80183E80, gObjectList[objectIndex].sizeScaling);
gSPVertex(gDisplayListHead++, D_0D005AE0, 4, 0);
@@ -3758,8 +3758,8 @@ void func_80054BE8(s32 cameraId) {
func_800444B0(D_8018D488, 0x00000020, 0x00000020);
func_8004B35C(0x000000FF, 0x000000FF, 0, 0x000000FF);
D_80183E80[0] = 0;
- for (var_s0 = 0; var_s0 < D_8018C630_SIZE; var_s0++) {
- temp_a0 = D_8018C630[var_s0];
+ for (var_s0 = 0; var_s0 < gObjectParticle3_SIZE; var_s0++) {
+ temp_a0 = gObjectParticle3[var_s0];
if ((temp_a0 != -1) && (gObjectList[temp_a0].state >= 2)) {
func_80054AFC(temp_a0, camera->pos);
}
@@ -3773,9 +3773,9 @@ void func_80054D00(s32 objectIndex, s32 cameraId) {
if (gObjectList[objectIndex].state >= 3) {
func_8008A364(objectIndex, cameraId, 0x2AABU, 0x0000012C);
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) {
- D_80183E80[0] = (s16) gObjectList[objectIndex].unk_0B2[0];
+ D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0];
D_80183E80[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
- D_80183E80[2] = (u16) gObjectList[objectIndex].unk_0B2[2];
+ D_80183E80[2] = (u16) gObjectList[objectIndex].orientation[2];
func_80048130(gObjectList[objectIndex].pos, (u16 *) D_80183E80, gObjectList[objectIndex].sizeScaling, (u8 *) gObjectList[objectIndex].activeTLUT, gObjectList[objectIndex].activeTexture, D_0D0062B0, 0x00000020, 0x00000040, 0x00000020, 0x00000040, 5);
}
}
@@ -3787,9 +3787,9 @@ void func_80054E10(s32 objectIndex) {
D_80183E50[0] = gObjectList[objectIndex].pos[0];
D_80183E50[1] = gObjectList[objectIndex].unk_044 + 0.8;
D_80183E50[2] = gObjectList[objectIndex].pos[2];
- D_80183E70[0] = gObjectList[objectIndex].unk_038[0];
- D_80183E70[1] = gObjectList[objectIndex].unk_038[1];
- D_80183E70[2] = gObjectList[objectIndex].unk_038[2];
+ D_80183E70[0] = gObjectList[objectIndex].velocity[0];
+ D_80183E70[1] = gObjectList[objectIndex].velocity[1];
+ D_80183E70[2] = gObjectList[objectIndex].velocity[2];
func_8004A9B8(gObjectList[objectIndex].sizeScaling);
}
}
@@ -3800,7 +3800,7 @@ void func_80054EB8(UNUSED s32 unused) {
s32 someIndex;
for (someIndex = 0; someIndex < NUM_MAX_MOLES; someIndex++) {
- func_80054E10(D_8018C1B0[someIndex]);
+ func_80054E10(gObjectParticle1[someIndex]);
}
}
@@ -3813,13 +3813,13 @@ void func_80054F04(s32 cameraId) {
sp44 = &camera1[cameraId];
gSPDisplayList(gDisplayListHead++, D_0D0079C8);
func_80043D50(d_course_moo_moo_farm_mole_dirt, 0x00000010, 0x00000010);
- for (var_s2 = 0; var_s2 < D_8018C3F0_SIZE; var_s2++) {
- objectIndex = D_8018C3F0[var_s2];
+ for (var_s2 = 0; var_s2 < gObjectParticle2_SIZE; var_s2++) {
+ objectIndex = gObjectParticle2[var_s2];
object = &gObjectList[objectIndex];
if (object->state > 0) {
func_8008A364(objectIndex, cameraId, 0x2AABU, 0x000000C8);
if ((is_obj_index_flag_unk_054_active(objectIndex, 0x00040000) != 0) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
- object->unk_0B2[1] = func_800418AC(object->pos[0], object->pos[2], sp44->pos);
+ object->orientation[1] = func_800418AC(object->pos[0], object->pos[2], sp44->pos);
rsp_set_matrix_gObjectList(objectIndex);
gSPDisplayList(gDisplayListHead++, D_0D006980);
}
@@ -3847,11 +3847,11 @@ void func_800550A4(s32 arg0) {
void func_80055164(s32 objectIndex) {
if (gObjectList[objectIndex].state >= 2) {
gSPDisplayList(gDisplayListHead++, D_0D0077A0);
- rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_0BE, gObjectList[objectIndex].sizeScaling);
+ rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle, gObjectList[objectIndex].sizeScaling);
if (gIsGamePaused == 0) {
- gObjectList[objectIndex].unk_0A2 = func_80004DFC((animation_type_1 *) gObjectList[objectIndex].unk_070, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
+ gObjectList[objectIndex].unk_0A2 = func_80004DFC((animation_type_1 *) gObjectList[objectIndex].model, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
} else {
- func_80004DFC((animation_type_1 *) gObjectList[objectIndex].unk_070, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
+ func_80004DFC((animation_type_1 *) gObjectList[objectIndex].model, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
}
}
}
@@ -3871,12 +3871,12 @@ void func_80055228(s32 cameraId) {
void func_800552BC(s32 objectIndex) {
if (gObjectList[objectIndex].state >= 2) {
- rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_0BE, gObjectList[objectIndex].sizeScaling);
+ rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle, gObjectList[objectIndex].sizeScaling);
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
if (gIsGamePaused == 0) {
- gObjectList[objectIndex].unk_0A2 = func_80004DFC((animation_type_1 *) gObjectList[objectIndex].unk_070, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
+ gObjectList[objectIndex].unk_0A2 = func_80004DFC((animation_type_1 *) gObjectList[objectIndex].model, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
} else {
- func_80004DFC((animation_type_1 *) gObjectList[objectIndex].unk_070, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
+ func_80004DFC((animation_type_1 *) gObjectList[objectIndex].model, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, gObjectList[objectIndex].unk_0A2);
}
}
}
@@ -3903,8 +3903,8 @@ void func_80055458(s32 objectIndex, s32 cameraId) {
if (gObjectList[objectIndex].state >= 2) {
camera = &camera1[cameraId];
func_8004A6EC(objectIndex, 0.5f);
- gObjectList[objectIndex].unk_0B2[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
- func_800480B4(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_0B2, gObjectList[objectIndex].sizeScaling, (u8 *) gObjectList[objectIndex].activeTLUT, gObjectList[objectIndex].activeTexture, D_0D0060B0, 0x00000040, 0x00000040, 0x00000040, 0x00000020);
+ gObjectList[objectIndex].orientation[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
+ func_800480B4(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling, (u8 *) gObjectList[objectIndex].activeTLUT, gObjectList[objectIndex].activeTexture, D_0D0060B0, 0x00000040, 0x00000040, 0x00000040, 0x00000020);
}
}
@@ -3927,8 +3927,8 @@ void func_800555BC(s32 objectIndex, s32 cameraId) {
if (gObjectList[objectIndex].state >= 2) {
camera = &camera1[cameraId];
func_8004A870(objectIndex, 0.7f);
- gObjectList[objectIndex].unk_0B2[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
- func_800480B4(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_0B2, gObjectList[objectIndex].sizeScaling, (u8 *) gObjectList[objectIndex].activeTLUT, gObjectList[objectIndex].activeTexture, gObjectList[objectIndex].vertex, 64, 64, 64, 32);
+ gObjectList[objectIndex].orientation[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
+ func_800480B4(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling, (u8 *) gObjectList[objectIndex].activeTLUT, gObjectList[objectIndex].activeTexture, gObjectList[objectIndex].vertex, 64, 64, 64, 32);
}
}
@@ -3963,27 +3963,27 @@ UNUSED void func_800557AC() {
void func_800557B4(s32 objectIndex, u32 arg1, u32 arg2) {
Vec3f sp34;
- Objects *temp_s0;
+ Objects *object;
- temp_s0 = &gObjectList[objectIndex];
- if (temp_s0->state >= 2) {
+ object = &gObjectList[objectIndex];
+ if (object->state >= 2) {
if (is_obj_index_flag_unk_054_active(objectIndex, 0x00000020) != 0) {
if (func_80072320(objectIndex, 4) != 0) {
if (arg2 >= arg1) {
- sp34[0] = temp_s0->pos[0];
- sp34[1] = temp_s0->pos[1] - 1.0;
- sp34[2] = temp_s0->pos[2];
- rsp_set_matrix_transformation_inverted_x_y_orientation(sp34, temp_s0->unk_0B2, temp_s0->sizeScaling);
+ sp34[0] = object->pos[0];
+ sp34[1] = object->pos[1] - 1.0;
+ sp34[2] = object->pos[2];
+ rsp_set_matrix_transformation_inverted_x_y_orientation(sp34, object->orientation, object->sizeScaling);
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
- func_80004DFC((animation_type_1 *) temp_s0->unk_070, (animation_type_2 **) temp_s0->vertex, (s16) temp_s0->unk_0D8, (s16) temp_s0->itemDisplay);
+ func_80004DFC((animation_type_1 *) object->model, (animation_type_2 **) object->vertex, (s16) object->unk_0D8, (s16) object->itemDisplay);
}
} else if (arg1 < 0x15F91U) {
func_8004A7AC(objectIndex, 1.5f);
}
}
- rsp_set_matrix_transformation(temp_s0->pos, temp_s0->unk_0B2, temp_s0->sizeScaling);
+ rsp_set_matrix_transformation(object->pos, object->orientation, object->sizeScaling);
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
- func_80004DFC((animation_type_1 *) temp_s0->unk_070, (animation_type_2 **) temp_s0->vertex, (s16) temp_s0->unk_0D8, (s16) temp_s0->itemDisplay);
+ func_80004DFC((animation_type_1 *) object->model, (animation_type_2 **) object->vertex, (s16) object->unk_0D8, (s16) object->itemDisplay);
}
}
@@ -4045,9 +4045,9 @@ void func_80055AB8(s32 objectIndex, s32 cameraId) {
D_80183E80[2] = 0x8000;
func_800468E0(D_80183E40, D_80183E80, 0.54f, d_course_rainbow_road_sphere, D_0D0062B0, 0x00000020, 0x00000040, 0x00000020, 0x00000040, 5);
} else {
- rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].unk_0BE, gObjectList[objectIndex].sizeScaling);
+ rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle, gObjectList[objectIndex].sizeScaling);
gSPDisplayList(gDisplayListHead++, D_0D0077D0);
- func_80004DFC((animation_type_1 *) gObjectList[objectIndex].unk_070, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, (s16) gObjectList[objectIndex].itemDisplay);
+ func_80004DFC((animation_type_1 *) gObjectList[objectIndex].model, (animation_type_2 **) gObjectList[objectIndex].vertex, 0, (s16) gObjectList[objectIndex].itemDisplay);
}
}
}
@@ -4076,16 +4076,16 @@ void func_80055CCC(s32 objectIndex, s32 cameraId) {
test = gObjectList[objectIndex].pos[1] - gObjectList[objectIndex].unk_044;
func_8004A6EC(objectIndex, (20.0 / test) + 0.5);
if (is_obj_index_flag_unk_054_inactive(objectIndex, 0x00100000) != 0) {
- func_80043328(gObjectList[objectIndex].pos, (u16 *) gObjectList[objectIndex].unk_0BE, gObjectList[objectIndex].sizeScaling, d_course_luigi_raceway_dl_F960);
+ func_80043328(gObjectList[objectIndex].pos, (u16 *) gObjectList[objectIndex].direction_angle, gObjectList[objectIndex].sizeScaling, d_course_luigi_raceway_dl_F960);
gSPDisplayList(gDisplayListHead++, d_course_luigi_raceway_dl_F650);
} else {
- D_80183E80[0] = (s16) gObjectList[objectIndex].unk_0BE[0];
+ D_80183E80[0] = (s16) gObjectList[objectIndex].direction_angle[0];
D_80183E80[1] = (s16) (func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos) + 0x8000);
- D_80183E80[2] = (u16) gObjectList[objectIndex].unk_0BE[2];
+ D_80183E80[2] = (u16) gObjectList[objectIndex].direction_angle[2];
func_80043328(gObjectList[objectIndex].pos, D_80183E80, gObjectList[objectIndex].sizeScaling, d_course_luigi_raceway_dl_FBE0);
gSPDisplayList(gDisplayListHead++, d_course_luigi_raceway_dl_FA20);
if (gPlayerCountSelection1 == 1) {
- gObjectList[objectIndex].unk_0BE[1] = 0;
+ gObjectList[objectIndex].direction_angle[1] = 0;
}
}
}
@@ -4110,7 +4110,7 @@ void func_80055EF4(s32 objectIndex, UNUSED s32 arg1) {
object = &gObjectList[objectIndex];
if (object->state >= 2) {
- func_80043220(object->pos, object->unk_0BE, object->sizeScaling, object->unk_070);
+ func_80043220(object->pos, object->direction_angle, object->sizeScaling, object->model);
}
}
@@ -4131,11 +4131,11 @@ void func_80055FA0(s32 objectIndex, UNUSED s32 arg1) {
if (object->state >= 2) {
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxPersp[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- mtxf_set_matrix_transformation(someMatrix1,object->pos, object->unk_0BE, object->sizeScaling);
+ mtxf_set_matrix_transformation(someMatrix1,object->pos, object->direction_angle, object->sizeScaling);
convert_to_fixed_point_matrix(&gGfxPool->mtxHud[gMatrixHudCount], someMatrix1);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxHud[gMatrixHudCount++]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gSPDisplayList(gDisplayListHead++, D_0D0077A0);
- gSPDisplayList(gDisplayListHead++, object->unk_070);
+ gSPDisplayList(gDisplayListHead++, object->model);
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&gGfxPool->mtxLookAt[0]), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
mtxf_identity(someMatrix2);
render_set_position(someMatrix2, 0);
@@ -4158,8 +4158,8 @@ void func_80056188(s32 cameraId) {
if (D_8018E838[cameraId] == 0) {
object = &gObjectList[objectIndex];
if ((object->state >= 2) && (is_obj_index_flag_unk_054_inactive(objectIndex, 0x00080000) != 0) && (func_8008A140(objectIndex, camera, 0x2AABU) != 0)) {
- object->unk_0B2[1] = angle_between_object_camera(objectIndex, camera);
- func_800480B4(object->pos, object->unk_0B2, object->sizeScaling, (u8 *) object->activeTLUT, object->activeTexture, D_0D0060B0, 0x00000040, 0x00000040, 0x00000040, 0x00000020);
+ object->orientation[1] = angle_between_object_camera(objectIndex, camera);
+ func_800480B4(object->pos, object->orientation, object->sizeScaling, (u8 *) object->activeTLUT, object->activeTexture, D_0D0060B0, 0x00000040, 0x00000040, 0x00000040, 0x00000020);
}
}
}
diff --git a/src/math_util_2.c b/src/math_util_2.c
index ced54e7cb..809e8907a 100644
--- a/src/math_util_2.c
+++ b/src/math_util_2.c
@@ -404,32 +404,32 @@ s32 func_80041770(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
return atan2s(arg1 - arg0, arg3 - arg2);
}
-u16 func_800417B4(u16 arg0, u16 arg1) {
- u16 ret;
-
- if ((arg0 >> 8) != (arg1 >> 8)) {
- ret = arg1 - arg0;
- if (ret < 0x400) {
- ret = arg0 + 0x80;
- } else if (ret < 0x800) {
- ret = arg0 + 0x200;
- } else if (ret < 0x4000) {
- ret = arg0 + 0x400;
- } else if (ret < 0x8000) {
- ret = arg0 + 0x700;
- } else if (ret < 0xC000) {
- ret = arg0 - 0x700;
- }else if (ret < 0xF800) {
- ret = arg0 - 0x400;
- } else if (ret < 0xFC00) {
- ret = arg0 - 0x200;
+u16 func_800417B4(u16 angle1, u16 angle2) {
+ u16 out_angle;
+
+ if ((angle1 >> 8) != (angle2 >> 8)) {
+ out_angle = angle2 - angle1;
+ if (out_angle < 0x400) {
+ out_angle = angle1 + 0x80;
+ } else if (out_angle < 0x800) {
+ out_angle = angle1 + 0x200;
+ } else if (out_angle < 0x4000) {
+ out_angle = angle1 + 0x400;
+ } else if (out_angle < 0x8000) {
+ out_angle = angle1 + 0x700;
+ } else if (out_angle < 0xC000) {
+ out_angle = angle1 - 0x700;
+ }else if (out_angle < 0xF800) {
+ out_angle = angle1 - 0x400;
+ } else if (out_angle < 0xFC00) {
+ out_angle = angle1 - 0x200;
} else {
- ret = arg0 - 0x80;
+ out_angle = angle1 - 0x80;
}
} else {
- ret = arg1;
+ out_angle = angle2;
}
- return ret;
+ return out_angle;
}
s32 func_800418AC(f32 arg0, f32 arg1, Vec3f arg2) {
@@ -463,13 +463,13 @@ s32 func_80041980(Vec3f arg0, Camera *arg1, u16 arg2) {
}
void func_800419F8(void) {
- Vec3f sp18;
+ Vec3f pos;
Vec3f vec;
- sp18[0] = 0.0f;
- sp18[1] = 0.0f;
- sp18[2] = 120.0f;
- vec3f_rotate_x_y(vec, sp18, D_80165834);
+ pos[0] = 0.0f;
+ pos[1] = 0.0f;
+ pos[2] = 120.0f;
+ vec3f_rotate_x_y(vec, pos, D_80165834);
D_80165840[0] = vec[0];
D_80165840[1] = vec[1];
D_80165840[2] = vec[2];
@@ -808,12 +808,12 @@ void mtxf_set_matrix_gObjectList(s32 objectIndex, Mat4 transformMatrix) {
f32 cosZ;
f32 cosX;
- sinX = sins(temp_s0->unk_0B2[0]);
- cosX = coss(temp_s0->unk_0B2[0]);
- sinY = sins(temp_s0->unk_0B2[1]);
- cosY = coss(temp_s0->unk_0B2[1]);
- sinZ = sins(temp_s0->unk_0B2[2]);
- cosZ = coss(temp_s0->unk_0B2[2]);
+ sinX = sins(temp_s0->orientation[0]);
+ cosX = coss(temp_s0->orientation[0]);
+ sinY = sins(temp_s0->orientation[1]);
+ cosY = coss(temp_s0->orientation[1]);
+ sinZ = sins(temp_s0->orientation[2]);
+ cosZ = coss(temp_s0->orientation[2]);
transformMatrix[0][0] = temp_s0->sizeScaling * ((cosY * cosZ) + (sinX * sinY * sinZ));
transformMatrix[1][0] = temp_s0->sizeScaling * ((-cosY * sinZ) + sinX * sinY * cosZ);