summaryrefslogtreecommitdiff
path: root/src/update_objects.c
diff options
context:
space:
mode:
authorcoco875 <59367621+coco875@users.noreply.github.com>2024-09-17 17:32:50 +0200
committerGitHub <noreply@github.com>2024-09-17 09:32:50 -0600
commit203090e5913f79df01ee273e40dea03b294f061e (patch)
tree2ee78c50742b20238c07610b8ba9f7f93c3a80e1 /src/update_objects.c
parentd36d7dcd604d0f85b6b547a85e9b7a4fe3e59b5c (diff)
update with the decomp (#97)
* Update menus.c (#634) * Update common_data.yml (#635) * Renames for screenId and other changes (#636) * screenId renames * Rename surface map to collision mesh (#637) * Rename some stack vars (#638) * Fix syntax error (#639) * Rename some stack vars * Update collision.c * Collision Documentation (#640) * Collision related renames * update doxygen (#649) * change bool (#644) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Update (#642) * Delete trig_tables_bss.c (#650) * fix typo audio (#656) * fix typo src actor (#657) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo include (#658) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix course (#659) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo debug (#660) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo data (#661) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * replace number with const (#665) * fix typo buffers (#655) * fix typo buffers * tweak ld file * rename to sMemoryPool * add a warning --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo src (#654) * fix typo src * fix non matcing * Update code_80091750.c --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo racing (#653) * fix typo racing * get it match * replace G_LINE3D to G_QUAD --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix typo src (#652) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * fix ending typo (#651) * Action more info when it doesn't match and fix first diff (#662) * Update linux-compile.yml * fix first-diff * Update first-diff.py --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * document texture of kart (#663) * document texture of kart * change screenPlayerId to screenId * some documentation around object * Revert "some documentation around object" This reverts commit cbb39078e036bf2a417bed67359e910213acab28. * more rename --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Make evaluate_collision_players_palm_tree better (#667) This matches just the same as before, but using those two casts instead of shifts seems more likely to be accurate to the original source code Signed-off-by: Gabriel Ravier <gabravier@gmail.com> * add fedora instruciton (#666) Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * start documenting animation (#668) * start documenting animation * Update course_data.c * change comment * update libultra asm (#648) * update libultra asm * fix gcc __osThreadTail --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Document Vehicles (#641) * start doc collision * fix merge * finish rename fonction related to vehicle * document around waypoint of vehicle * make some modification * make some change and rename one * copy_ to oldPos * doc smoke ferry and train * some rename * fix some renaming * precise index * rename a funciton * simplify waypoint_vehicles * change some name * change some name * rename move_to_point_direction * fix some conflict * Update code_80005FD0.c * Update code_80005FD0.h --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Label a save info loop (#645) * save info * more gcc progress * fix a value and do a rename (#669) * update clang and add action (#664) * update clang and add action * try clang on course folder only * forget two file * Update course_displaylists.inc.c * forget few other file * Update course_vertices.inc.c * format all code while get it match * second pass * format other dir * disable clang format on bad ido code * fix some tabulation * revert format on tool dir * Update clang-format.yml * ignore gbi.h * add some read me instruction * fix error * format and fixing error * Update README.md --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Update linkonly_generator.py (#670) * some rename for torch (#588) * rename gBombKartSpawns, and fix cup ID * Update doxygen_syms.md * rename for gCourseIndexInCup and his constant * rename to gCupSelectedCourseIndex * forget a change in constant * fix compilation issue * Update Dockerfile to latest Ubuntu LTS + fixed missing cmake (#674) * Fix color font matrix function (#676) * Fix label variables used in menus (#675) * Fix label variables used in menus * split D_800F2BDC and clang format menu.c --------- Co-authored-by: coco875 <pereira.jannin@gmail.com> * Fix some libultra struct types (#677) * Uintptr (#671) * Update render_courses.c * Update math_util.c * Update math_util.c * Update math_util.h * Update render_courses.c * Clang suggest (#678) * add clang suggestion * Update clang-format-suggest.yml * Update clang-format-suggest.yml * simplify * switch to ubuntu * Update clang-format-suggest.yml * update ubuntu --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * Clang pr (#679) * Create clang-pr.yml * Update clang-pr.yml * Update osCreateMesgQueue.c * Update osCreateMesgQueue.c * Update clang-pr.yml * Update clang-pr.yml * Update clang-format.yml * clang format (#680) Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com> * some rename in ceremony (#647) * rename ceremony * apply some suggestion * some rename --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * clang format (#681) Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com> * Rename Object Timing Related Code (#673) * start making models extraction with blender * finishing extract model * Update fast64 * extract course * Update fast64 * Update fast64 * simplify import of course_displaylists and course_textures and remplace adress with texture * Update fast64 * change data format and simplify the thread queue * move in a blender folder * remove fast64 * re add fast64 * add model_extract and fast64_blender in makefile * multithread with make file split the models into multiple json and add course segment * Update fast64 * remove old model_extract * remove the error when he don't find blender * start rename around course section * rename around object * update submodule fast64 * fix compilation issue and add some model to extract * Update fast64 * remove fast64 * re add fast64 * update submodule * fix compilation issue * add other collision gfx and prepare reorganise file * re arrange json * Create README.MD * Update README.MD * Update README.MD * update fast64 * rename to initiate_next_state * Revert "Merge branch '3d-objects' into general-object" This reverts commit f5347b38cc75af4d10ee3726dc1524c1c71d6849, reversing changes made to a353c4d954fb5b50c8b48fe3f9d67c95ccaab299. * revert the revert... * revert 3d-models PR * finish some revert * Update code_80005FD0.c * fix code_80091750.c * Update code_80091750.c * rename isTimerRunning to isTimerActive and set_object_timer_running to set_object_timer_state * rename to initialize_next_state * rename to object_next_state --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * extract models with blender (#577) * start making models extraction with blender * finishing extract model * Update fast64 * extract course * Update fast64 * Update fast64 * simplify import of course_displaylists and course_textures and remplace adress with texture * Update fast64 * change data format and simplify the thread queue * move in a blender folder * remove fast64 * re add fast64 * add model_extract and fast64_blender in makefile * multithread with make file split the models into multiple json and add course segment * Update fast64 * remove old model_extract * remove the error when he don't find blender * start rename around course section * update submodule fast64 * fix compilation issue and add some model to extract * Update fast64 * remove fast64 * re add fast64 * update submodule * fix compilation issue * add other collision gfx and prepare reorganise file * re arrange json * Create README.MD * Update README.MD * Update README.MD * update fast64 --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> * other * fix some error of compilation * finish fix all error --------- Signed-off-by: Gabriel Ravier <gabravier@gmail.com> Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> Co-authored-by: Gabriel Ravier <gabravier@gmail.com> Co-authored-by: MisterSheeple <27652712+MisterSheeple@users.noreply.github.com> Co-authored-by: AloXado320 <38191089+AloXado320@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/update_objects.c')
-rw-r--r--src/update_objects.c652
1 files changed, 328 insertions, 324 deletions
diff --git a/src/update_objects.c b/src/update_objects.c
index 2c3c2481f..a0ea003c8 100644
--- a/src/update_objects.c
+++ b/src/update_objects.c
@@ -270,8 +270,8 @@ bool func_80072354(s32 objectIndex, s32 arg1) {
return b;
}
-void set_object_unk_0CB(s32 objectIndex, s32 arg1) {
- gObjectList[objectIndex].unk_0CB = arg1;
+void set_object_timer_state(s32 objectIndex, s32 arg1) {
+ gObjectList[objectIndex].isTimerActive = arg1;
}
void init_object(s32 objectIndex, s32 arg1) {
@@ -280,27 +280,27 @@ void init_object(s32 objectIndex, s32 arg1) {
gObjectList[objectIndex].unk_05C = 0;
gObjectList[objectIndex].unk_0CD = 0;
gObjectList[objectIndex].unk_0CF = 0;
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
gObjectList[objectIndex].unk_0D8 = arg1;
gObjectList[objectIndex].state = 1;
}
UNUSED void func_80072408(s32 objectIndex) {
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
}
void func_80072428(s32 objectIndex) {
gObjectList[objectIndex].state = 0;
gObjectList[objectIndex].unk_0D8 = 0;
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
gObjectList[objectIndex].status = 0;
gObjectList[objectIndex].unk_058 = 0;
gObjectList[objectIndex].unk_05C = 0;
func_80086F60(objectIndex);
}
-void func_80072488(s32 objectIndex) {
- set_object_unk_0CB(objectIndex, 0);
+void object_next_state(s32 objectIndex) {
+ set_object_timer_state(objectIndex, 0);
set_object_flag_status_false(objectIndex, 0x2000);
gObjectList[objectIndex].state++;
}
@@ -320,16 +320,16 @@ s16 func_80072530(s32 objectIndex) {
}
void func_80072568(s32 objectIndex, s32 arg1) {
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
set_object_flag_status_false(objectIndex, 0x2000);
set_object_flag_status_false(objectIndex, 8);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
func_800724F8(objectIndex, gObjectList[objectIndex].state);
gObjectList[objectIndex].state = arg1;
}
void func_800725E8(s32 objectIndex, s32 arg1, s32 arg2) {
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
set_object_flag_status_false(objectIndex, 0x2000);
set_object_flag_status_false(objectIndex, 8);
gObjectList[objectIndex].state = arg2;
@@ -340,44 +340,47 @@ void func_800725E8(s32 objectIndex, s32 arg1, s32 arg2) {
s16 func_80072530(s32); // extern
void func_8007266C(s32 objectIndex) {
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
set_object_flag_status_false(objectIndex, 0x2000);
set_object_flag_status_false(objectIndex, 8);
gObjectList[objectIndex].state = func_80072530(objectIndex);
}
void func_800726CC(s32 objectIndex, s32 arg1) {
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
set_object_flag_status_false(objectIndex, 0x2000);
gObjectList[objectIndex].state = arg1;
}
UNUSED void func_8007271C(s32 objectIndex, s32 arg1) {
- if (gObjectList[objectIndex].unk_0CB == 0) {
+ if (gObjectList[objectIndex].isTimerActive == 0) {
gObjectList[objectIndex].state = arg1;
}
}
UNUSED void func_8007274C(s32 objectIndex) {
- if (gObjectList[objectIndex].unk_0CB == 0) {
- func_80072488(objectIndex);
+ if (gObjectList[objectIndex].isTimerActive == 0) {
+ object_next_state(objectIndex);
}
}
-s32 func_8007278C(s32 objectIndex, s32 arg1) {
- s32 phi_v1;
+/**
+ * @brief will return true if the timer is done
+ */
+bool set_and_run_timer_object(s32 objectIndex, s32 timer) {
+ bool phi_v1;
- phi_v1 = 0;
- if (gObjectList[objectIndex].unk_0CB == 0) {
- set_object_unk_0CB(objectIndex, 1);
- gObjectList[objectIndex].unk_050 = arg1;
+ phi_v1 = false;
+ if (gObjectList[objectIndex].isTimerActive == false) {
+ set_object_timer_state(objectIndex, true);
+ gObjectList[objectIndex].timer = timer;
}
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 < 0) {
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
- phi_v1 = 1;
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer < 0) {
+ set_object_timer_state(objectIndex, false);
+ object_next_state(objectIndex);
+ phi_v1 = true;
}
return phi_v1;
@@ -387,15 +390,15 @@ UNUSED s32 func_8007281C(s32 objectIndex, s32 arg1) {
s32 phi_a2;
phi_a2 = 0;
- if (gObjectList[objectIndex].unk_0CB == 0) {
- set_object_unk_0CB(objectIndex, 1);
- gObjectList[objectIndex].unk_050 = random_int((u16) arg1);
+ if (gObjectList[objectIndex].isTimerActive == 0) {
+ set_object_timer_state(objectIndex, 1);
+ gObjectList[objectIndex].timer = random_int((u16) arg1);
}
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 < 0) {
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer < 0) {
+ set_object_timer_state(objectIndex, 0);
+ object_next_state(objectIndex);
phi_a2 = 1;
}
@@ -407,15 +410,15 @@ UNUSED s32 func_800728B0(s32 objectIndex, s32 arg1, s32 arg2) {
s32 phi_a3;
phi_a3 = 0;
- if (gObjectList[objectIndex].unk_0CB == 0) {
- set_object_unk_0CB(objectIndex, 1);
- gObjectList[objectIndex].unk_050 = random_int((u16) arg2) + arg1;
+ if (gObjectList[objectIndex].isTimerActive == 0) {
+ set_object_timer_state(objectIndex, 1);
+ gObjectList[objectIndex].timer = random_int((u16) arg2) + arg1;
}
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 < 0) {
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer < 0) {
+ set_object_timer_state(objectIndex, 0);
+ object_next_state(objectIndex);
phi_a3 = 1;
}
@@ -451,7 +454,7 @@ void func_800729EC(s32 objectIndex) {
s32 i;
start_race();
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
D_8018D2BC = 1;
D_8018D2A4 = 1;
@@ -464,25 +467,25 @@ void func_800729EC(s32 objectIndex) {
}
UNUSED void func_80072A78(s32 objectIndex, s32 arg1) {
- gObjectList[objectIndex].itemDisplay = arg1;
- func_80072488(objectIndex);
+ gObjectList[objectIndex].textureListIndex = arg1;
+ object_next_state(objectIndex);
}
s32 func_80072AAC(s32 objectIndex, s32 arg1, s32 arg2) {
s32 phi_v1;
phi_v1 = 0;
- if (gObjectList[objectIndex].unk_0CB == 0) {
+ if (gObjectList[objectIndex].isTimerActive == 0) {
- set_object_unk_0CB(objectIndex, 1);
- gObjectList[objectIndex].itemDisplay = arg1;
- gObjectList[objectIndex].unk_050 = arg2;
+ set_object_timer_state(objectIndex, 1);
+ gObjectList[objectIndex].textureListIndex = arg1;
+ gObjectList[objectIndex].timer = arg2;
}
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 < 0) {
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer < 0) {
+ set_object_timer_state(objectIndex, 0);
+ object_next_state(objectIndex);
phi_v1 = 1;
}
@@ -493,18 +496,18 @@ s32 func_80072B48(s32 objectIndex, s32 arg1) {
s32 phi_v1;
phi_v1 = 0;
- if (gObjectList[objectIndex].unk_0CB == 0) {
- set_object_unk_0CB(objectIndex, 1);
+ if (gObjectList[objectIndex].isTimerActive == 0) {
+ set_object_timer_state(objectIndex, 1);
set_object_flag_status_true(objectIndex, 0x80000);
- gObjectList[objectIndex].itemDisplay = D_8018D140;
- gObjectList[objectIndex].unk_050 = arg1;
+ gObjectList[objectIndex].textureListIndex = D_8018D140;
+ gObjectList[objectIndex].timer = arg1;
}
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 < 0) {
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer < 0) {
set_object_flag_status_false(objectIndex, 0x80000);
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
+ set_object_timer_state(objectIndex, 0);
+ object_next_state(objectIndex);
phi_v1 = 1;
}
@@ -513,15 +516,15 @@ s32 func_80072B48(s32 objectIndex, s32 arg1) {
void func_80072C00(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3) {
if (is_obj_index_flag_status_inactive(objectIndex, 0x2000) != 0) {
- gObjectList[objectIndex].unk_050 = arg2;
- gObjectList[objectIndex].itemDisplay = arg1;
+ gObjectList[objectIndex].timer = arg2;
+ gObjectList[objectIndex].textureListIndex = arg1;
gObjectList[objectIndex].unk_0D4 = 1;
gObjectList[objectIndex].unk_0CC = arg3;
set_object_flag_status_true(objectIndex, 0x2000);
} else {
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 < 0) {
- gObjectList[objectIndex].unk_050 = arg2;
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer < 0) {
+ gObjectList[objectIndex].timer = arg2;
gObjectList[objectIndex].unk_0D4--;
if ((gObjectList[objectIndex].unk_0D4 & 1) != 0) {
set_object_flag_status_false(objectIndex, 0x80000);
@@ -538,7 +541,7 @@ void func_80072C00(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3) {
if (gObjectList[objectIndex].unk_0CC == 0) {
set_object_flag_status_false(objectIndex, 0x2000);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
}
}
@@ -547,22 +550,22 @@ void func_80072C00(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3) {
void func_80072D3C(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
if (is_obj_index_flag_status_inactive(objectIndex, 0x2000) != 0) {
- gObjectList[objectIndex].unk_050 = arg3;
- gObjectList[objectIndex].itemDisplay = arg1;
+ gObjectList[objectIndex].timer = arg3;
+ gObjectList[objectIndex].textureListIndex = arg1;
gObjectList[objectIndex].unk_0D4 = 1;
gObjectList[objectIndex].unk_0CC = arg4;
set_object_flag_status_true(objectIndex, 0x2000);
return;
}
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 < 0) {
- gObjectList[objectIndex].unk_050 = arg3;
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer < 0) {
+ gObjectList[objectIndex].timer = arg3;
gObjectList[objectIndex].unk_0D4--;
if ((gObjectList[objectIndex].unk_0D4 & 1) != 0) {
- gObjectList[objectIndex].itemDisplay = arg1;
+ gObjectList[objectIndex].textureListIndex = arg1;
} else {
- gObjectList[objectIndex].itemDisplay = arg2;
+ gObjectList[objectIndex].textureListIndex = arg2;
}
if (gObjectList[objectIndex].unk_0D4 < 0) {
@@ -573,7 +576,7 @@ void func_80072D3C(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
if (gObjectList[objectIndex].unk_0CC == 0) {
set_object_flag_status_false(objectIndex, 0x2000);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
}
}
@@ -584,29 +587,29 @@ s32 func_80072E54(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 a
sp24 = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 0x2000) != 0) {
- gObjectList[objectIndex].itemDisplay = arg1;
- gObjectList[objectIndex].unk_050 = arg4;
+ gObjectList[objectIndex].textureListIndex = arg1;
+ gObjectList[objectIndex].timer = arg4;
gObjectList[objectIndex].unk_0CC = arg5;
- set_object_unk_0CB(objectIndex, 1);
+ set_object_timer_state(objectIndex, 1);
set_object_flag_status_true(objectIndex, 0x2000);
} else {
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 <= 0) {
- gObjectList[objectIndex].unk_050 = arg4;
- gObjectList[objectIndex].itemDisplay += arg3;
- if (arg2 < gObjectList[objectIndex].itemDisplay) {
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer <= 0) {
+ gObjectList[objectIndex].timer = arg4;
+ gObjectList[objectIndex].textureListIndex += arg3;
+ if (arg2 < gObjectList[objectIndex].textureListIndex) {
if (gObjectList[objectIndex].unk_0CC > 0) {
gObjectList[objectIndex].unk_0CC--;
}
if (gObjectList[objectIndex].unk_0CC == 0) {
- gObjectList[objectIndex].itemDisplay = arg2;
+ gObjectList[objectIndex].textureListIndex = arg2;
set_object_flag_status_false(objectIndex, 0x2000);
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
+ set_object_timer_state(objectIndex, 0);
+ object_next_state(objectIndex);
sp24 = 1;
} else {
- gObjectList[objectIndex].itemDisplay = arg1;
+ gObjectList[objectIndex].textureListIndex = arg1;
}
}
}
@@ -619,28 +622,28 @@ bool func_80072F88(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32
sp24 = false;
if (is_obj_index_flag_status_inactive(objectIndex, 0x2000) != 0) {
- gObjectList[objectIndex].itemDisplay = arg1;
- gObjectList[objectIndex].unk_050 = arg4;
+ gObjectList[objectIndex].textureListIndex = arg1;
+ gObjectList[objectIndex].timer = arg4;
gObjectList[objectIndex].unk_0CC = arg5;
- set_object_unk_0CB(objectIndex, 1);
+ set_object_timer_state(objectIndex, 1);
set_object_flag_status_true(objectIndex, 0x2000);
} else {
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 <= 0) {
- gObjectList[objectIndex].unk_050 = arg4;
- gObjectList[objectIndex].itemDisplay -= arg3;
- if (gObjectList[objectIndex].itemDisplay < arg2) {
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer <= 0) {
+ gObjectList[objectIndex].timer = arg4;
+ gObjectList[objectIndex].textureListIndex -= arg3;
+ if (gObjectList[objectIndex].textureListIndex < arg2) {
if (gObjectList[objectIndex].unk_0CC > 0) {
gObjectList[objectIndex].unk_0CC--;
}
if (gObjectList[objectIndex].unk_0CC == 0) {
- gObjectList[objectIndex].itemDisplay = arg2;
+ gObjectList[objectIndex].textureListIndex = arg2;
set_object_flag_status_false(objectIndex, 0x2000);
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
+ set_object_timer_state(objectIndex, 0);
+ object_next_state(objectIndex);
sp24 = true;
} else {
- gObjectList[objectIndex].itemDisplay = arg1;
+ gObjectList[objectIndex].textureListIndex = arg1;
}
}
}
@@ -653,26 +656,26 @@ bool func_800730BC(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32
sp24 = false;
if (is_obj_index_flag_status_inactive(objectIndex, 0x2000) != 0) {
- gObjectList[objectIndex].itemDisplay = arg1;
- gObjectList[objectIndex].unk_050 = arg4;
+ gObjectList[objectIndex].textureListIndex = arg1;
+ gObjectList[objectIndex].timer = arg4;
gObjectList[objectIndex].unk_0CC = arg5;
- set_object_unk_0CB(objectIndex, 1);
+ set_object_timer_state(objectIndex, 1);
set_object_flag_status_true(objectIndex, 0x2000);
set_object_flag_status_false(objectIndex, 0x4000);
} else {
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 <= 0) {
- gObjectList[objectIndex].unk_050 = arg4;
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer <= 0) {
+ gObjectList[objectIndex].timer = arg4;
if (is_obj_index_flag_status_inactive(objectIndex, 0x4000) != 0) {
- gObjectList[objectIndex].itemDisplay += arg3;
- if (gObjectList[objectIndex].itemDisplay >= arg2) {
- gObjectList[objectIndex].itemDisplay = arg2;
+ gObjectList[objectIndex].textureListIndex += arg3;
+ if (gObjectList[objectIndex].textureListIndex >= arg2) {
+ gObjectList[objectIndex].textureListIndex = arg2;
set_object_flag_status_true(objectIndex, 0x4000);
}
} else {
- gObjectList[objectIndex].itemDisplay -= arg3;
- if (arg1 >= gObjectList[objectIndex].itemDisplay) {
- gObjectList[objectIndex].itemDisplay = arg1;
+ gObjectList[objectIndex].textureListIndex -= arg3;
+ if (arg1 >= gObjectList[objectIndex].textureListIndex) {
+ gObjectList[objectIndex].textureListIndex = arg1;
if (gObjectList[objectIndex].unk_0CC > 0) {
gObjectList[objectIndex].unk_0CC--;
}
@@ -680,8 +683,8 @@ bool func_800730BC(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32
if (gObjectList[objectIndex].unk_0CC == 0) {
set_object_flag_status_false(objectIndex, 0x80);
set_object_flag_status_false(objectIndex, 0x2000);
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
+ set_object_timer_state(objectIndex, 0);
+ object_next_state(objectIndex);
sp24 = true;
} else {
set_object_flag_status_false(objectIndex, 0x4000);
@@ -699,33 +702,33 @@ s32 func_8007326C(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 a
sp24 = 0;
if (is_obj_index_flag_status_inactive(objectIndex, 0x2000) != 0) {
- gObjectList[objectIndex].itemDisplay = arg1;
- gObjectList[objectIndex].unk_050 = arg4;
+ gObjectList[objectIndex].textureListIndex = arg1;
+ gObjectList[objectIndex].timer = arg4;
gObjectList[objectIndex].unk_0CC = arg5;
- set_object_unk_0CB(objectIndex, 1);
+ set_object_timer_state(objectIndex, 1);
set_object_flag_status_true(objectIndex, 0x2000);
set_object_flag_status_false(objectIndex, 0x4000);
} else {
- gObjectList[objectIndex].unk_050--;
- if (gObjectList[objectIndex].unk_050 <= 0) {
- gObjectList[objectIndex].unk_050 = arg4;
+ gObjectList[objectIndex].timer--;
+ if (gObjectList[objectIndex].timer <= 0) {
+ gObjectList[objectIndex].timer = arg4;
if (is_obj_index_flag_status_inactive(objectIndex, 0x4000) != 0) {
- gObjectList[objectIndex].itemDisplay -= arg3;
- if (arg2 >= gObjectList[objectIndex].itemDisplay) {
- gObjectList[objectIndex].itemDisplay = arg2;
+ gObjectList[objectIndex].textureListIndex -= arg3;
+ if (arg2 >= gObjectList[objectIndex].textureListIndex) {
+ gObjectList[objectIndex].textureListIndex = arg2;
set_object_flag_status_true(objectIndex, 0x4000);
}
} else {
- gObjectList[objectIndex].itemDisplay += arg3;
- if (gObjectList[objectIndex].itemDisplay >= arg1) {
- gObjectList[objectIndex].itemDisplay = arg1;
+ gObjectList[objectIndex].textureListIndex += arg3;
+ if (gObjectList[objectIndex].textureListIndex >= arg1) {
+ gObjectList[objectIndex].textureListIndex = arg1;
if (gObjectList[objectIndex].unk_0CC > 0) {
gObjectList[objectIndex].unk_0CC--;
}
if (gObjectList[objectIndex].unk_0CC == 0) {
set_object_flag_status_false(objectIndex, 0x2000);
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
+ set_object_timer_state(objectIndex, 0);
+ object_next_state(objectIndex);
sp24 = 1;
} else {
set_object_flag_status_false(objectIndex, 0x4000);
@@ -741,7 +744,7 @@ void func_80073404(s32 objectIndex, u8 arg1, u8 arg2, Vtx* arg3) {
gObjectList[objectIndex].vertex = arg3;
gObjectList[objectIndex].textureWidth = arg1;
gObjectList[objectIndex].textureHeight = arg2;
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
gObjectList[objectIndex].unk_0D3 = -1;
gObjectList[objectIndex].status = 0;
}
@@ -751,7 +754,7 @@ void init_texture_object(s32 objectIndex, u8* texture, const char** arg2, u8 arg
gObjectList[objectIndex].textureList = arg2;
gObjectList[objectIndex].textureWidth = arg3;
gObjectList[objectIndex].textureHeight = arg4;
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
gObjectList[objectIndex].unk_0D3 = -1;
gObjectList[objectIndex].status = 0;
}
@@ -762,7 +765,7 @@ UNUSED void func_8007348C(s32 objectIndex, u8* arg1, u8 arg2, u8 arg3, Vtx* arg4
gObjectList[objectIndex].textureWidth = arg2;
gObjectList[objectIndex].textureHeight = arg3;
gObjectList[objectIndex].vertex = arg4;
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
gObjectList[objectIndex].unk_0D3 = -1;
gObjectList[objectIndex].status = 0;
}
@@ -773,13 +776,14 @@ UNUSED void func_800734D4() {
void update_neon_texture(s32 objectIndex) {
// I have no idea why this typecast works
gObjectList[objectIndex].activeTLUT =
- (u8*) ((u32*) gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].itemDisplay * 128));
+ (u8*) ((u32*) gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].textureListIndex * 128));
gObjectList[objectIndex].activeTexture = gObjectList[objectIndex].textureList;
}
void func_80073514(s32 objectIndex) {
gObjectList[objectIndex].activeTLUT = gObjectList[objectIndex].tlutList;
- gObjectList[objectIndex].activeTexture = gObjectList[objectIndex].textureList[gObjectList[objectIndex].itemDisplay];
+ gObjectList[objectIndex].activeTexture =
+ gObjectList[objectIndex].textureList[gObjectList[objectIndex].textureListIndex];
}
UNUSED void func_80073568() {
@@ -799,11 +803,11 @@ void func_800735BC(s32 objectIndex, Gfx* arg1, f32 arg2) {
gObjectList[objectIndex].status = 0;
gObjectList[objectIndex].model = arg1;
gObjectList[objectIndex].sizeScaling = arg2;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80073600(s32 objectIndex) {
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
gObjectList[objectIndex].unk_0D6 = 0;
gObjectList[objectIndex].unk_04C = -1;
set_object_flag_status_false(objectIndex, 0x8000);
@@ -1294,13 +1298,13 @@ size_t func_80074790(s32 objectIndex, const char** lakituTexturePtr) {
void func_800747F0(s32 objectIndex, const char** lakituTexturePtr) {
const char* nextTexture = NULL;
- if (gObjectList[objectIndex].itemDisplay != gObjectList[objectIndex].unk_0D3) {
- nextTexture = gObjectList[objectIndex].textureList[gObjectList[objectIndex].itemDisplay];
+ if (gObjectList[objectIndex].textureListIndex != gObjectList[objectIndex].unk_0D3) {
+ nextTexture = gObjectList[objectIndex].textureList[gObjectList[objectIndex].textureListIndex];
if (nextTexture != NULL) {
func_80074574(lakituTexturePtr, nextTexture, func_80074790(objectIndex, lakituTexturePtr),
gObjectList[objectIndex].textureWidth, gObjectList[objectIndex].textureHeight);
- gObjectList[objectIndex].unk_0D3 = gObjectList[objectIndex].itemDisplay;
+ gObjectList[objectIndex].unk_0D3 = gObjectList[objectIndex].textureListIndex;
func_80074478(objectIndex);
}
}
@@ -1382,7 +1386,7 @@ void func_80074924(s32 objectIndex) {
object->unk_084[7] = -0x100 - (sp20 / 32);
}
object->primAlpha = 0x00E6;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80074D94(s32 objectIndex) {
@@ -1402,7 +1406,7 @@ void func_80074E28(s32 objectIndex) {
func_80074924(objectIndex);
break;
case 2:
- if (func_8007278C(objectIndex, 1) != 0) {
+ if (set_and_run_timer_object(objectIndex, 1) != false) {
func_80086E70(objectIndex);
break;
}
@@ -1451,7 +1455,7 @@ void func_80074FD8(s32 objectIndex) {
if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.12f,
gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1],
0x00000064) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
object_calculate_new_pos_offset(objectIndex);
gObjectList[objectIndex].orientation[0] += D_8016582C[0];
@@ -1587,7 +1591,7 @@ void func_80075698(s32 objectIndex) {
gObjectList[objectIndex].offset[1] = 0.0f;
gObjectList[objectIndex].offset[2] = 0.0f;
gObjectList[objectIndex].sizeScaling = 0.5f;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80075714(s32 objectIndex) {
@@ -1600,7 +1604,7 @@ void func_80075714(s32 objectIndex) {
f32_step_up_towards(&gObjectList[objectIndex].offset[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].primAlpha, 0xFF, 0x1E, 7, 0, 0) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 3:
@@ -1708,7 +1712,7 @@ void func_80075B08(s32 objectIndex) {
gObjectList[objectIndex].offset[1] = 0.0f;
gObjectList[objectIndex].offset[2] = 0.0f;
gObjectList[objectIndex].sizeScaling = 0.5f;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80075B84(s32 objectIndex) {
@@ -1721,7 +1725,7 @@ void func_80075B84(s32 objectIndex) {
f32_step_up_towards(&gObjectList[objectIndex].offset[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].primAlpha, 0xFF, 0x1E, 7, 0, 0) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 3:
@@ -1924,7 +1928,7 @@ void func_8007634C(s32 objectIndex) {
object->primAlpha = 0x00FF;
set_obj_orientation(objectIndex, 0U, 0U, 0U);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_800763CC(s32 objectIndex) {
@@ -1937,7 +1941,7 @@ void func_800763CC(s32 objectIndex) {
func_8007634C(objectIndex);
break;
case 2:
- if (func_8007278C(objectIndex, object->unk_048) != 0) {
+ if (set_and_run_timer_object(objectIndex, object->unk_048) != 0) {
func_80086E70(objectIndex);
}
break;
@@ -1953,7 +1957,7 @@ void func_800763CC(s32 objectIndex) {
}
if ((object->unk_0AE >= 2) &&
(func_80073B00(objectIndex, &object->primAlpha, 0x000000FF, 0x00000050, 0x00000020, 0, 0) != 0)) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 4:
@@ -2092,7 +2096,7 @@ void func_80076958(s32 objectIndex) {
object->primAlpha = 0x00FF;
set_obj_orientation(objectIndex, 0U, 0U, 0U);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_800769D8(s32 objectIndex) {
@@ -2106,7 +2110,7 @@ void func_800769D8(s32 objectIndex) {
func_80076958(objectIndex);
break;
case 2:
- if (func_8007278C(objectIndex, object->unk_048) != 0) {
+ if (set_and_run_timer_object(objectIndex, object->unk_048) != 0) {
func_80086E70(objectIndex);
}
break;
@@ -2115,7 +2119,7 @@ void func_800769D8(s32 objectIndex) {
s16_step_towards(&object->type, 0, 0x0018);
if ((object->unk_0AE >= 2) &&
(func_80073B00(objectIndex, &object->primAlpha, 0x000000FF, 0x00000050, 0x00000020, 0, 0) != 0)) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 4:
@@ -2200,7 +2204,7 @@ void init_smoke_particle(Vec3f arg0, UNUSED f32 arg1, s16 arg2) {
}
void func_80076DC4(s32 objectIndex) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
if (gObjectList[objectIndex].unk_0D5 != 0x0B) {
func_80086E70(objectIndex);
}
@@ -2215,7 +2219,7 @@ void func_80076E14(s32 objectIndex) {
if ((gObjectList[objectIndex].unk_0AE >= 2) &&
(func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0x000000FF, 0x00000050, 0x00000020, 0,
0) != 0)) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 0:
@@ -2340,7 +2344,7 @@ void func_800773D8(f32* arg0, s32 arg1) {
}
void func_80077428(s32 arg0) {
- func_80072488(arg0);
+ object_next_state(arg0);
func_80086E70(arg0);
}
@@ -2475,7 +2479,7 @@ void spawn_leaf(Vec3f arg0, UNUSED s32 arg1) {
}
void func_80077B14(s32 arg0) {
- func_80072488(arg0);
+ object_next_state(arg0);
func_80086E70(arg0);
}
@@ -2491,7 +2495,7 @@ void func_80077B3C(s32 objectIndex) {
break;
case 2:
if (object->unk_0AE == 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 3:
@@ -2576,7 +2580,7 @@ void func_80077E20(s32 objectIndex) {
object->primAlpha = 0x00FF;
object->unk_0D5 = 0;
object->type = 0;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80077EB8(s32 objectIndex, u16 arg1, Camera* camera) {
@@ -2631,7 +2635,7 @@ void func_800780CC(s32 objectIndex, Camera* camera) {
case 2:
func_80077F64(objectIndex, camera);
if (gObjectList[objectIndex].unk_0AE == 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
return;
}
case 0:
@@ -2666,7 +2670,7 @@ void func_80078220(s32 objectIndex) {
object->vertex = vtx;
object->sizeScaling = 0.15f;
func_80086EF0(objectIndex);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80078288(s32 objectIndex) {
@@ -2735,7 +2739,7 @@ void func_800786EC(s32 objectIndex) {
case 2:
func_80078288(objectIndex);
if (gObjectList[objectIndex].unk_0AE == 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 3:
@@ -3035,44 +3039,44 @@ void init_obj_lakitu_red_flag_countdown(s32 objectIndex, s32 playerId) {
gObjectList[objectIndex].vertex = vtx;
gObjectList[objectIndex].sizeScaling = 0.15f;
set_object_flag_status_false(objectIndex, 0x00000010);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
gObjectList[objectIndex].unk_048 = D_8018D180;
}
-void update_object_lakitu_countdown(s32 objectIndex, s32 playerId) {
+void update_object_lakitu_countdown(s32 objectIndex, s32 arg1) {
UNUSED s32 pad;
switch (gObjectList[objectIndex].state) {
case 0:
break;
case 1:
- init_obj_lakitu_red_flag_countdown(objectIndex, playerId);
+ init_obj_lakitu_red_flag_countdown(objectIndex, arg1);
break;
case 2:
- func_8007278C(objectIndex, gObjectList[objectIndex].unk_048);
- if ((gObjectList[objectIndex].unk_050 == 0x00000055) && (gPlayerCount == 3) && (playerId == 0)) {
+ set_and_run_timer_object(objectIndex, gObjectList[objectIndex].unk_048);
+ if ((gObjectList[objectIndex].timer == 0x00000055) && (gPlayerCount == 3) && (arg1 == 0)) {
D_8018D168 = 1;
}
break;
case 3:
set_object_flag_status_true(objectIndex, 0x00000010);
- func_80086F10(objectIndex, 1, &D_800E67B8);
- func_80072488(objectIndex);
+ func_80086F10(objectIndex, 1, &D_800E67B8); // set a spline
+ object_next_state(objectIndex);
break;
case 4:
- if ((func_8007278C(objectIndex, 0x0000001E) != 0) && (gPlayerCount != 3) && (playerId == 0)) {
+ if ((set_and_run_timer_object(objectIndex, 0x0000001E) != false) && (gPlayerCount != 3) && (arg1 == 0)) {
D_8018D168 = 1;
}
break;
case 5:
- func_8007278C(objectIndex, 0x0000001E);
+ set_and_run_timer_object(objectIndex, 0x0000001E);
break;
case 6:
func_80072E54(objectIndex, 1, 7, 1, 2, 0);
break;
case 7:
- if (func_8007278C(objectIndex, 0x00000014) != 0) {
+ if (set_and_run_timer_object(objectIndex, 0x00000014) != 0) {
gObjectList[objectIndex].tlutList += 0x200;
- if (playerId == 0) {
+ if (arg1 == 0) {
play_sound2(SOUND_ACTION_COUNTDOWN_LIGHT);
}
}
@@ -3081,19 +3085,19 @@ void update_object_lakitu_countdown(s32 objectIndex, s32 playerId) {
func_80072E54(objectIndex, 8, 0x0000000F, 1, 6, 0);
break;
case 9:
- if ((func_8007278C(objectIndex, 8) != 0) && (playerId == 0)) {
+ if ((set_and_run_timer_object(objectIndex, 8) != 0) && (arg1 == 0)) {
play_sound2(SOUND_ACTION_COUNTDOWN_LIGHT);
}
break;
case 10:
- if ((func_80072E54(objectIndex, 0x00000010, 0x00000017, 1, 6, 0) != 0) && (playerId == 0)) {
+ if ((func_80072E54(objectIndex, 0x00000010, 0x00000017, 1, 6, 0) != 0) && (arg1 == 0)) {
D_801656F0 = 1;
}
break;
case 11:
- if (func_8007278C(objectIndex, 8) != 0) {
+ if (set_and_run_timer_object(objectIndex, 8) != 0) {
gObjectList[objectIndex].tlutList += 0x200;
- if (playerId == 0) {
+ if (arg1 == 0) {
play_sound2(SOUND_ACTION_GREEN_LIGHT);
}
}
@@ -3102,15 +3106,15 @@ void update_object_lakitu_countdown(s32 objectIndex, s32 playerId) {
func_80072E54(objectIndex, 0x00000018, 0x0000001B, 1, 6, 0);
break;
case 13:
- if (playerId == 0) {
+ if (arg1 == 0) {
func_800729EC(objectIndex);
D_8018D160 = 1;
break;
}
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 14:
- func_8007278C(objectIndex, 0x00000078);
+ set_and_run_timer_object(objectIndex, 0x00000078);
break;
case 15:
func_80072428(objectIndex);
@@ -3150,7 +3154,7 @@ void init_obj_lakitu_red_flag(s32 objectIndex, s32 playerIndex) {
object->sizeScaling = 0.15f;
func_80086F10(objectIndex, 2, &D_800E6834);
set_object_flag_status_false(objectIndex, 0x00000010);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void update_object_lakitu_red_flag(s32 objectIndex, s32 playerIndex) {
@@ -3162,7 +3166,7 @@ void update_object_lakitu_red_flag(s32 objectIndex, s32 playerIndex) {
break;
case 2:
set_object_flag_status_true(objectIndex, 0x00000010);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 3:
func_80072E54(objectIndex, 0, 0x0000001F, 1, 2, -1);
@@ -3226,7 +3230,7 @@ void init_obj_lakitu_red_flag_fishing(s32 objectIndex, s32 arg1) {
func_80086E70(objectIndex);
set_object_flag_status_false(objectIndex, 0x00000010);
func_80073720(objectIndex);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
func_800C8F80((u8) arg1, 0x0100FA28);
}
@@ -3268,7 +3272,7 @@ void update_object_lakitu_fishing(s32 objectIndex, s32 playerId) {
case 2: /* switch 1 */
set_object_flag_status_true(objectIndex, 0x00000010);
func_800736E0(objectIndex);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 3: /* switch 1 */
func_800730BC(objectIndex, 0, 3, 1, 2, -1);
@@ -3323,7 +3327,7 @@ void update_object_lakitu_fishing2(s32 objectIndex, s32 playerId) {
set_object_flag_status_true(objectIndex, 0x00000010);
func_800736E0(objectIndex);
player->unk_0CA |= 0x80;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 3: /* switch 1 */
func_800730BC(objectIndex, 0, 3, 1, 2, -1);
@@ -3413,7 +3417,7 @@ void func_8007A060(s32 objectIndex, s32 playerIndex) {
object->sizeScaling = 0.15f;
set_object_flag_status_false(objectIndex, 0x00000010);
func_80086F10(objectIndex, 5, &D_800E694C);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void update_object_lakitu_second_lap(s32 objectIndex, s32 playerIndex) {
@@ -3425,16 +3429,16 @@ void update_object_lakitu_second_lap(s32 objectIndex, s32 playerIndex) {
break;
case 2:
set_object_flag_status_true(objectIndex, 0x00000010);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 3:
- func_8007278C(objectIndex, 0x00000014);
+ set_and_run_timer_object(objectIndex, 0x00000014);
break;
case 4:
func_80072E54(objectIndex, 0, 0x0000000F, 1, 2, 1);
break;
case 5:
- func_8007278C(objectIndex, 0x0000003C);
+ set_and_run_timer_object(objectIndex, 0x0000003C);
break;
case 6:
func_80072F88(objectIndex, 0x0000000F, 0, 1, 2, 1);
@@ -3472,7 +3476,7 @@ void func_8007A228(s32 objectIndex, s32 playerIndex) {
object->sizeScaling = 0.15f;
set_object_flag_status_false(objectIndex, 0x00000010);
func_80086F10(objectIndex, 5, &D_800E694C);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void update_object_lakitu_final_lap(s32 objectIndex, s32 playerIndex) {
@@ -3484,16 +3488,16 @@ void update_object_lakitu_final_lap(s32 objectIndex, s32 playerIndex) {
break;
case 2:
set_object_flag_status_true(objectIndex, 0x00000010);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 3:
- func_8007278C(objectIndex, 0x00000014);
+ set_and_run_timer_object(objectIndex, 0x00000014);
break;
case 4:
func_80072E54(objectIndex, 0, 0x0000000F, 1, 2, 1);
break;
case 5:
- func_8007278C(objectIndex, 0x0000003C);
+ set_and_run_timer_object(objectIndex, 0x0000003C);
break;
case 6:
func_80072F88(objectIndex, 0x0000000F, 0, 1, 2, 1);
@@ -3530,7 +3534,7 @@ void func_8007A3F0(s32 objectIndex, s32 arg1) {
set_object_flag_status_false(objectIndex, 0x00000010);
func_80086F10(objectIndex, 6, &D_800E69B0);
gObjectList[objectIndex].unk_0D6 = 0;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
func_800C8F80((u8) arg1, 0x0100FA28);
}
@@ -3546,7 +3550,7 @@ void update_object_lakitu_reverse(s32 objectIndex, s32 playerId) {
case 2:
set_object_flag_status_true(objectIndex, 0x00000010);
gObjectList[objectIndex].unk_0D6 = 1;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 3:
func_800730BC(objectIndex, 0, 0x0000000F, 1, 2, -1);
@@ -3568,7 +3572,7 @@ void update_object_lakitu_reverse(s32 objectIndex, s32 playerId) {
case 2: /* switch 1 */
gObjectList[objectIndex].unk_04C--;
if (gObjectList[objectIndex].unk_04C == 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
gObjectList[objectIndex].unk_0D6 = 0;
}
break;
@@ -3740,13 +3744,13 @@ void consume_item(s32 playerId) {
func_800722CC(objectIndex, 2);
player->currentItemCopy = ITEM_NONE;
itemWindow->currentItem = ITEM_NONE;
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
func_800726CC(objectIndex, 9);
}
} else {
player->currentItemCopy = ITEM_NONE;
itemWindow->currentItem = ITEM_NONE;
- set_object_unk_0CB(objectIndex, 0);
+ set_object_timer_state(objectIndex, 0);
}
}
@@ -4292,7 +4296,7 @@ s32 func_8007B040(s32 objectIndex, s32 playerId) {
func_800C9060(playerId, 0x1900A058U);
}
var_t3 = 1;
- gObjectList[objectIndex].itemDisplay = gObjectList[objectIndex].unk_0A2 = var_v1;
+ gObjectList[objectIndex].textureListIndex = gObjectList[objectIndex].unk_0A2 = var_v1;
} else {
for (var_v1_2 = 0; var_v1_2 < gPlayerCountSelection1; var_v1_2++) {
temp_a0 = gItemWindowObjectByPlayerId[var_v1_2];
@@ -4308,7 +4312,7 @@ s32 func_8007B040(s32 objectIndex, s32 playerId) {
var_v1 = random_int(var_a3);
temp_a1 = sp40[var_v1];
gObjectList[objectIndex].unk_0A2 = temp_a1;
- gObjectList[objectIndex].itemDisplay = temp_a1;
+ gObjectList[objectIndex].textureListIndex = temp_a1;
temp_v1 = sp50[var_v1];
gObjectList[objectIndex].unk_0D1 = temp_v1;
temp_a0 = gItemWindowObjectByPlayerId[temp_v1];
@@ -4318,7 +4322,7 @@ s32 func_8007B040(s32 objectIndex, s32 playerId) {
sp38->currentItemCopy = 0;
if (func_80072320(temp_a0, 2) != 0) {
func_800722CC(temp_a0, 2);
- gObjectList[temp_a0].timer = 0;
+ gObjectList[temp_a0].animationTimer = 0;
}
var_t3 = 1;
}
@@ -4338,14 +4342,14 @@ void func_8007B254(s32 objectIndex, s32 arg1) {
gObjectList[objectIndex].textureHeight = 0x20;
gObjectList[objectIndex].unk_04C = 0x00000032;
gObjectList[objectIndex].unk_0D6 = 1;
- gObjectList[objectIndex].timer = 0;
+ gObjectList[objectIndex].animationTimer = 0;
func_800722A4(objectIndex, 4);
if (D_80165888 != 0) {
func_800726CC(objectIndex, 8);
gObjectList[objectIndex].unk_0D6 = 2;
gObjectList[objectIndex].type = 0x000E;
test = gObjectList[objectIndex].type;
- gObjectList[objectIndex].itemDisplay = test;
+ gObjectList[objectIndex].textureListIndex = test;
gObjectList[objectIndex].unk_0A2 = test;
playerHUD[PLAYER_ONE].slideItemBoxY = 0;
D_80165888 = 0;
@@ -4380,24 +4384,24 @@ void func_8007B34C(s32 playerId) {
if (gActiveScreenMode == 0) {
s16_step_up_towards(&playerHUD[playerId].slideItemBoxY, 0x0040, 4);
if (playerHUD[playerId].slideItemBoxY == 0x0040) {
- func_80072488(temp_s0);
+ object_next_state(temp_s0);
}
} else if (gActiveScreenMode == 3) {
if ((playerId == 0) || (playerId == 2)) {
s16_step_up_towards(&playerHUD[playerId].slideItemBoxX, 0x0080, 8);
if (playerHUD[playerId].slideItemBoxX == 0x0080) {
- func_80072488(temp_s0);
+ object_next_state(temp_s0);
}
} else {
s16_step_down_towards(&playerHUD[playerId].slideItemBoxX, -0x0080, 8);
if (playerHUD[playerId].slideItemBoxX == -0x0080) {
- func_80072488(temp_s0);
+ object_next_state(temp_s0);
}
}
} else {
s16_step_up_towards(&playerHUD[playerId].slideItemBoxX, 0x0080, 8);
if (playerHUD[playerId].slideItemBoxX == 0x0080) {
- func_80072488(temp_s0);
+ object_next_state(temp_s0);
}
}
break;
@@ -4411,10 +4415,10 @@ void func_8007B34C(s32 playerId) {
func_80072E54(temp_s0, 1, 4, 1, 0x00000010, 1);
break;
case 6:
- object->itemDisplay = func_8007AFB0(temp_s0, playerId);
+ object->textureListIndex = func_8007AFB0(temp_s0, playerId);
object->unk_04C = 8;
object->unk_0D6 = 2;
- func_80072488(temp_s0);
+ object_next_state(temp_s0);
func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFE, 0x1C));
func_800C8F80((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFE, 0x47));
break;
@@ -4424,31 +4428,31 @@ void func_8007B34C(s32 playerId) {
case 9:
func_800722CC(temp_s0, 4);
func_80073600(temp_s0);
- object->itemDisplay = 0;
- func_80072488(temp_s0);
+ object->textureListIndex = 0;
+ object_next_state(temp_s0);
break;
case 10:
- func_8007278C(temp_s0, 0x00000014);
+ set_and_run_timer_object(temp_s0, 0x00000014);
break;
case 11:
if (gActiveScreenMode == 0) {
if (s16_step_down_towards(&playerHUD[playerId].slideItemBoxY, 0, 4) != 0) {
- func_80072488(temp_s0);
+ object_next_state(temp_s0);
}
} else if (gActiveScreenMode == 3) {
if ((playerId == 0) || (playerId == 2)) {
s16_step_down_towards(&playerHUD[playerId].slideItemBoxX, 0, 8);
if (playerHUD[playerId].slideItemBoxX == 0) {
- func_80072488(temp_s0);
+ object_next_state(temp_s0);
}
} else {
s16_step_up_towards(&playerHUD[playerId].slideItemBoxX, 0, 8);
if (playerHUD[playerId].slideItemBoxX == 0) {
- func_80072488(temp_s0);
+ object_next_state(temp_s0);
}
}
} else if (s16_step_down_towards(&playerHUD[playerId].slideItemBoxX, 0, 8) != 0) {
- func_80072488(temp_s0);
+ object_next_state(temp_s0);
}
break;
case 12:
@@ -4493,10 +4497,10 @@ void func_8007B34C(s32 playerId) {
break;
}
if (func_80072320(temp_s0, 2) != 0) {
- if (object->timer == 0) {
+ if (object->animationTimer == 0) {
consume_item(playerId);
} else {
- object->timer--;
+ object->animationTimer--;
}
}
if (object->unk_04C >= 0) {
@@ -4542,8 +4546,8 @@ void func_8007B34C(s32 playerId) {
}
}
}
- object->activeTLUT = (u8*) gItemWindowTLUTs[object->itemDisplay];
- object->activeTexture = gItemWindowTextures[object->itemDisplay];
+ object->activeTLUT = (u8*) gItemWindowTLUTs[object->textureListIndex];
+ object->activeTexture = gItemWindowTextures[object->textureListIndex];
sp38->currentItemCopy = object->type;
}
@@ -4574,7 +4578,7 @@ void func_8007BBBC(s32 objectIndex) {
var_f14 = object->velocity[2];
}
object->direction_angle[0] = func_80041658(object->velocity[1], var_f14);
- func_8007278C(objectIndex, 0x00000046);
+ set_and_run_timer_object(objectIndex, 0x00000046);
break;
case 3:
func_80072428(objectIndex);
@@ -4615,7 +4619,7 @@ void init_var_cheep_cheep(s32 objectIndex) {
object->status = 0;
object->model = d_course_banshee_boardwalk_dl_cheep_cheep;
object->sizeScaling = 0.2f;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
set_obj_origin_pos(objectIndex, D_800E634C[0][0], D_800E634C[0][1] + 55.0, D_800E634C[0][2]);
set_obj_origin_offset(objectIndex, 0.0f, 30.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, 0x3800U, 0U);
@@ -4630,18 +4634,18 @@ void func_8007BEC8(s32 objectIndex) {
init_var_cheep_cheep(objectIndex);
break;
case 2:
- if (func_8007278C(objectIndex, 0x0000003C) != 0) {
+ if (set_and_run_timer_object(objectIndex, 0x0000003C) != 0) {
set_object_flag_status_true(objectIndex, 0x00000010);
func_80086E70(objectIndex);
}
break;
case 3:
if (object->unk_0AE == 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 4:
- if (func_8007278C(objectIndex, 0x0000000A) != 0) {
+ if (set_and_run_timer_object(objectIndex, 0x0000000A) != 0) {
func_8008701C(objectIndex, 2);
}
break;
@@ -4763,10 +4767,10 @@ void func_8007C360(s32 objectIndex, Camera* camera) {
if (temp < 0x13) {
set_object_flag_status_false(objectIndex, 0x80);
- gObjectList[objectIndex].itemDisplay = temp;
+ gObjectList[objectIndex].textureListIndex = temp;
} else {
set_object_flag_status_true(objectIndex, 0x80);
- gObjectList[objectIndex].itemDisplay = 0x24 - temp;
+ gObjectList[objectIndex].textureListIndex = 0x24 - temp;
}
}
@@ -4791,10 +4795,10 @@ void func_8007C4A4(s32 objectIndex) {
if (var_t9 < 0x13) {
set_object_flag_status_false(objectIndex, 0x80);
- gObjectList[objectIndex].itemDisplay = var_t9;
+ gObjectList[objectIndex].textureListIndex = var_t9;
} else {
set_object_flag_status_true(objectIndex, 0x80);
- gObjectList[objectIndex].itemDisplay = 0x24 - var_t9;
+ gObjectList[objectIndex].textureListIndex = 0x24 - var_t9;
}
}
@@ -4814,7 +4818,7 @@ void func_8007C5B4(s32 objectIndex) {
object->pos[1] = 0.0f;
object->pos[2] = 0.0f;
set_object_flag_status_true(objectIndex, 0x00000020);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
object->primAlpha = 0;
func_80073844(objectIndex);
object->sizeScaling = 0.15f;
@@ -5010,12 +5014,12 @@ void func_8007CE0C(s32 objectIndex) {
init_texture_object(objectIndex, d_course_banshee_boardwalk_boo_tlut, gTextureGhosts, 0x30U, (u16) 0x00000028);
object = &gObjectList[objectIndex];
- object->itemDisplay = 0x1C;
+ object->textureListIndex = 0x1C;
object->pos[0] = 0.0f;
object->pos[1] = 0.0f;
object->pos[2] = 0.0f;
object->sizeScaling = 0.15f;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
object->primAlpha = 0;
func_80073844(objectIndex);
func_80086EF0(objectIndex);
@@ -5035,10 +5039,10 @@ void func_8007CEDC(s32 objectIndex) {
func_8007CE0C(objectIndex);
break;
case 2: /* switch 1 */
- func_8007278C(objectIndex, 0x0000001E);
+ set_and_run_timer_object(objectIndex, 0x0000001E);
break;
case 3: /* switch 1 */
- func_8007278C(objectIndex, 0x000003E8);
+ set_and_run_timer_object(objectIndex, 0x000003E8);
break;
case 4: /* switch 1 */
func_80072428(objectIndex);
@@ -5211,7 +5215,7 @@ s32 func_8007D804(s32 objectIndex) {
}
void func_8007D8AC(s32 arg0) {
- func_80072488(arg0);
+ object_next_state(arg0);
func_80086E70(arg0);
}
@@ -5403,7 +5407,7 @@ void init_bb_trash_bin(s32 objectIndex) {
gObjectList[objectIndex].pos[1] = 45.0f;
set_obj_velocity(objectIndex, 0.0f, 0.0f, 0.0f);
gObjectList[objectIndex].type = 0;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_8007E00C(s32 objectIndex) {
@@ -5413,10 +5417,10 @@ void func_8007E00C(s32 objectIndex) {
break;
case 3:
D_8018CFB0 = 1;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 4:
- func_8007278C(objectIndex, 0x000000D2);
+ set_and_run_timer_object(objectIndex, 0x000000D2);
if (D_80165594 == 0) {
if (gCCSelection < CC_150) {
func_8007D714(1);
@@ -5441,13 +5445,13 @@ void func_8007E00C(s32 objectIndex) {
case 5:
gObjectList[objectIndex].orientation[2] = func_800417B4(gObjectList[objectIndex].orientation[2], 0U);
if (gObjectList[objectIndex].orientation[2] == 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 6:
gObjectList[objectIndex].orientation[2] = 0;
gObjectList[objectIndex].unk_084[7] = 0;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
D_8018CFB0 = 0;
break;
case 0:
@@ -5514,7 +5518,7 @@ void func_8007E358(s32 objectIndex) {
gObjectList[objectIndex].type = 0;
gObjectList[objectIndex].unk_04C = 0;
gObjectList[objectIndex].unk_084[7] = 0;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_8007E3EC(s32 objectIndex) {
@@ -5525,10 +5529,10 @@ void func_8007E3EC(s32 objectIndex) {
break;
case 3:
D_8018CFE8 = 1;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 4:
- func_8007278C(objectIndex, 0x000000D2);
+ set_and_run_timer_object(objectIndex, 0x000000D2);
if (D_80165598 == 0) {
if (gCCSelection < CC_150) {
func_8007D714(2);
@@ -5540,7 +5544,7 @@ void func_8007E3EC(s32 objectIndex) {
break;
case 5:
D_8018CFE8 = 0;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
case 0:
case 2:
@@ -5597,17 +5601,17 @@ void func_8007E63C(s32 objectIndex) {
set_object_flag_status_true(objectIndex, 0x00000200);
func_800722A4(objectIndex, 1);
func_800722CC(objectIndex, 2);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 0x33:
if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 0.0f, 2.0f) != 0) {
if (gObjectList[objectIndex].offset[1] >= 16.0f) {
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
} else if (gObjectList[objectIndex].offset[1] >= 8.0f) {
- gObjectList[objectIndex].itemDisplay = 1;
+ gObjectList[objectIndex].textureListIndex = 1;
} else {
- gObjectList[objectIndex].itemDisplay = 2;
+ gObjectList[objectIndex].textureListIndex = 2;
}
func_800722CC(objectIndex, 1);
if (is_obj_flag_status_active(objectIndex, 0x00010000) != 0) {
@@ -5619,7 +5623,7 @@ void func_8007E63C(s32 objectIndex) {
if (func_80072320(objectIndex, 2) != 0) {
func_800726CC(objectIndex, 0x00000064);
} else {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
}
break;
@@ -5631,9 +5635,9 @@ void func_8007E63C(s32 objectIndex) {
break;
case 0x36:
if (gObjectList[objectIndex].offset[1] >= 20.0f) {
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
} else if (gObjectList[objectIndex].offset[1] >= 18.0f) {
- gObjectList[objectIndex].itemDisplay = 1;
+ gObjectList[objectIndex].textureListIndex = 1;
}
if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], gObjectList[objectIndex].unk_01C[1], 0.5f) !=
0) {
@@ -5645,11 +5649,11 @@ void func_8007E63C(s32 objectIndex) {
func_80072E54(objectIndex, 3, 5, 1, 8, 0);
break;
case 0x65:
- func_8007278C(objectIndex, 0x0000001E);
+ set_and_run_timer_object(objectIndex, 0x0000001E);
break;
case 0x66:
if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 20.0f, 1.5f) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 0x67:
@@ -5660,12 +5664,12 @@ void func_8007E63C(s32 objectIndex) {
func_800722A4(objectIndex, 0x00000020);
}
}
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 0x68:
if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 12.0f, 1.5f) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 0x69:
@@ -5678,7 +5682,7 @@ void func_8007E63C(s32 objectIndex) {
}
func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity,
SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x45));
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 0x6A:
@@ -5688,33 +5692,33 @@ void func_8007E63C(s32 objectIndex) {
break;
case 0x6B:
if (gObjectList[objectIndex].offset[1] >= 22.0f) {
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
} else if (gObjectList[objectIndex].offset[1] >= 20.0f) {
- gObjectList[objectIndex].itemDisplay = 1;
+ gObjectList[objectIndex].textureListIndex = 1;
} else if (gObjectList[objectIndex].offset[1] >= 18.0f) {
- gObjectList[objectIndex].itemDisplay = 2;
+ gObjectList[objectIndex].textureListIndex = 2;
} else if (gObjectList[objectIndex].offset[1] >= 16.0f) {
- gObjectList[objectIndex].itemDisplay = 3;
+ gObjectList[objectIndex].textureListIndex = 3;
} else if (gObjectList[objectIndex].offset[1] >= 14.0f) {
- gObjectList[objectIndex].itemDisplay = 4;
+ gObjectList[objectIndex].textureListIndex = 4;
} else {
func_800730BC(objectIndex, 3, 5, 1, 6, -1);
}
if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], gObjectList[objectIndex].unk_01C[1], 0.5f) !=
0) {
- set_object_unk_0CB(objectIndex, 0);
- func_80072488(objectIndex);
+ set_object_timer_state(objectIndex, 0);
+ object_next_state(objectIndex);
}
break;
case 0x6C:
- if (func_8007278C(objectIndex, 0x00000064) != 0) {
+ if (set_and_run_timer_object(objectIndex, 0x00000064) != 0) {
func_800722CC(objectIndex, 2);
set_object_flag_status_false(objectIndex, 0x00000200);
func_8007266C(objectIndex);
}
break;
case 0xC8:
- if (func_8007278C(objectIndex, 0x0000012C) != 0) {
+ if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) {
func_80072320(objectIndex, 0x00000080);
func_80072428(objectIndex);
func_800726CC(objectIndex, 1);
@@ -5753,7 +5757,7 @@ void func_8007EC30(s32 objectIndex) {
object->type = 0;
object->unk_0DF = 6;
func_800724DC(objectIndex);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_8007ED6C(s32 objectIndex) {
@@ -5765,7 +5769,7 @@ void func_8007ED6C(s32 objectIndex) {
func_8007EC30(objectIndex);
break;
case 2:
- func_8007278C(objectIndex, 0x0000003C);
+ set_and_run_timer_object(objectIndex, 0x0000003C);
break;
case 3:
func_80072568(objectIndex, 0x00000032);
@@ -5814,7 +5818,7 @@ void func_8007EE5C(s32 objectIndex) {
} else {
object->unk_0DD = 2;
}
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_8007EFBC(s32 objectIndex) {
@@ -5993,7 +5997,7 @@ void func_8007F5A8(s32 objectIndex) {
break;
case 4:
func_80086FD4(objectIndex);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
}
func_8007E63C(objectIndex);
@@ -6112,7 +6116,7 @@ void func_8007FA08(s32 objectIndex) {
object->unk_0DF = 8;
object->offset[1] = 15.0f;
object->unk_01C[1] = 15.0f;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_8007FB48(s32 objectIndex) {
@@ -6152,7 +6156,7 @@ void func_8007FB48(s32 objectIndex) {
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;
+ gObjectList[objectIndex].textureListIndex = 1;
}
}
var_v0 = 0;
@@ -6183,7 +6187,7 @@ void func_8007FB48(s32 objectIndex) {
if (gObjectList[objectIndex].orientation[1] == gObjectList[objectIndex].direction_angle[1]) {
func_800722CC(objectIndex, 8);
func_80086FD4(objectIndex);
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
}
break;
case 0:
@@ -6238,7 +6242,7 @@ void func_8007FFC0(s32 objectIndex) {
func_80072568(objectIndex, 0x00000032);
break;
case 4:
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
func_80086FD4(objectIndex);
break;
}
@@ -6272,20 +6276,20 @@ void func_80080078(s32 objectIndex) {
}
switch (object->primAlpha) { /* irregular */
case 0:
- object->unk_050 = 2;
+ object->timer = 2;
break;
case 1:
- object->unk_050 = 0x0000003C;
+ object->timer = 0x0000003C;
break;
case 2:
- object->unk_050 = 0x00000078;
+ object->timer = 0x00000078;
break;
case 3:
- object->unk_050 = 0x000000B4;
+ object->timer = 0x000000B4;
break;
}
func_800724DC(objectIndex);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_800801FC(s32 objectIndex) {
@@ -6299,13 +6303,13 @@ void func_800801FC(s32 objectIndex) {
func_80080078(objectIndex);
break;
case 2:
- func_8007278C(objectIndex, object->unk_050);
+ set_and_run_timer_object(objectIndex, object->timer);
break;
case 3:
func_80072568(objectIndex, 0x00000032);
break;
case 4:
- object->unk_050 = 0x0000003C;
+ object->timer = 0x0000003C;
func_800726CC(objectIndex, 2);
break;
}
@@ -6322,7 +6326,7 @@ void func_800802C0(s32 objectIndex) {
init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces,
0x10U, (u16) 0x00000040);
object->model = d_course_bowsers_castle_dl_thwomp;
- object->itemDisplay = 0;
+ object->textureListIndex = 0;
object->boundingBoxSize = 0x000C;
object->sizeScaling = 1.5f;
set_object_flag_status_true(objectIndex, 0x05000220);
@@ -6342,7 +6346,7 @@ void func_800802C0(s32 objectIndex) {
object->offset[0] = 0.0f;
object->offset[2] = 0.0f;
func_800724DC(objectIndex);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80080408(s32 objectIndex) {
@@ -6357,16 +6361,16 @@ void func_80080408(s32 objectIndex) {
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity,
SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x45));
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 3:
if (func_800730BC(objectIndex, 3, 5, 1, 6, 6) != 0) {
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
}
break;
case 4:
- if (func_8007278C(objectIndex, 0x0000012C) != 0) {
+ if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) {
func_800726CC(objectIndex, 2);
}
break;
@@ -6383,7 +6387,7 @@ void func_80080524(s32 objectIndex) {
object = &gObjectList[objectIndex];
object->model = d_course_bowsers_castle_dl_thwomp;
object->boundingBoxSize = 0x000C;
- object->itemDisplay = 0;
+ object->textureListIndex = 0;
object->sizeScaling = 1.0f;
set_object_flag_status_true(objectIndex, 0x04000220);
object->type = 0;
@@ -6410,7 +6414,7 @@ void func_80080524(s32 objectIndex) {
break;
}
func_800722A4(objectIndex, 0x00000080);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_800806BC(s32 objectIndex) {
@@ -6627,7 +6631,7 @@ void func_80081080(s32 objectIndex) {
object->offset[1] = 0.0f;
object->offset[2] = 0.0f;
object->sizeScaling = 0.25f;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_800810F4(s32 objectIndex) {
@@ -6642,7 +6646,7 @@ void func_800810F4(s32 objectIndex) {
f32_step_up_towards(&gObjectList[objectIndex].offset[1], 14.0f, 0.5f);
func_8007415C(objectIndex, &gObjectList[objectIndex].sizeScaling, 0.25f, 0.75f, 0.025f, 1, 0);
if (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0x000000FF, 0, 4, 0, 0) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 3:
@@ -6785,7 +6789,7 @@ void func_80081790(s32 objectIndex) {
case 1:
if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.3f, gObjectList[objectIndex].unk_034,
gObjectList[objectIndex].orientation[1], 0x00000032) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
object_calculate_new_pos_offset(objectIndex);
break;
@@ -6801,14 +6805,14 @@ void func_80081848(s32 objectIndex) {
u8* tlut = (u8*) LOAD_ASSET(d_course_moo_moo_farm_mole_tlut);
init_texture_object(objectIndex, d_course_moo_moo_farm_mole_tlut, (u8*) mole, 0x20U, (u16) 0x00000040);
gObjectList[objectIndex].sizeScaling = 0.15f;
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
gObjectList[objectIndex].boundingBoxSize = 6;
gObjectList[objectIndex].velocity[1] = 4.0f;
set_object_flag_status_true(objectIndex, 0x04000000);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80081924(s32 objectIndex) {
@@ -6873,7 +6877,7 @@ void func_80081AFC(s32 objectIndex, s32 arg1) {
case 0x2:
if (object->unk_04C == 0) {
func_80086EAC(objectIndex, 2, 1);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
set_object_flag_status_true(objectIndex, 0x00000200);
} else {
object->unk_04C--;
@@ -6883,7 +6887,7 @@ void func_80081AFC(s32 objectIndex, s32 arg1) {
if (object->unk_0AE == 0) {
func_80086EAC(objectIndex, 2, 4);
func_8008153C(objectIndex);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
func_800C98B8(object->pos, object->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x07));
}
break;
@@ -7107,7 +7111,7 @@ void func_8008241C(s32 objectIndex, s32 arg1) {
func_80086EF0(objectIndex);
gObjectList[objectIndex].spline = D_800E633C[arg1 % 4];
set_object_flag_status_true(objectIndex, 0x00000800);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80082714(s32 objectIndex, s32 arg1) {
@@ -7201,8 +7205,8 @@ void init_ktb_crab(s32 objectIndex) {
(u8*) d_course_koopa_troopa_beach_crab_frames, 0x40U, (u16) 0x00000040);
object = &gObjectList[objectIndex];
object->sizeScaling = 0.15f;
- object->itemDisplay = 0;
- func_80072488(objectIndex);
+ object->textureListIndex = 0;
+ object_next_state(objectIndex);
object->boundingBoxSize = 1;
set_object_flag_status_true(objectIndex, 0x04000420);
func_80086EAC(objectIndex, 0, 1);
@@ -7305,7 +7309,7 @@ void func_80082F1C(s32 objectIndex, s32 arg1) {
gObjectList[objectIndex].sizeScaling = 0.027f;
// if (test->rot && test->rot) {}
test = &D_800E5DF4[arg1];
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
set_obj_origin_pos(objectIndex, test->pos[0] * xOrientation, test->pos[1], test->pos[2]);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, test->rot, 0U);
@@ -7354,8 +7358,8 @@ void func_8008311C(s32 objectIndex, s32 arg1) {
object->activeTexture = d_course_yoshi_valley_hedgehog;
object->vertex = vtx;
object->sizeScaling = 0.2f;
- object->itemDisplay = 0;
- func_80072488(objectIndex);
+ object->textureListIndex = 0;
+ object_next_state(objectIndex);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
object->unk_034 = ((arg1 % 6) * 0.1) + 0.5;
@@ -7409,7 +7413,7 @@ void func_800833D0(s32 objectIndex, s32 arg1) {
func_80072D3C(objectIndex, 0, 1, 4, -1);
break;
}
- if (gObjectList[objectIndex].itemDisplay == 0) {
+ if (gObjectList[objectIndex].textureListIndex == 0) {
Vtx* vtx = (Vtx*) LOAD_ASSET(common_vtx_hedgehog);
gObjectList[objectIndex].vertex = vtx;
} else {
@@ -7480,7 +7484,7 @@ void func_8008379C(s32 objectIndex) {
if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.74f,
gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1],
0x00000064) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 2:
@@ -7501,8 +7505,8 @@ void func_80083868(s32 objectIndex) {
object = &gObjectList[objectIndex];
object->vertex = vtx;
object->sizeScaling = 0.1f;
- object->itemDisplay = 0;
- func_80072488(objectIndex);
+ object->textureListIndex = 0;
+ object_next_state(objectIndex);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
object->orientation[0] = 0;
object->orientation[1] = 0;
@@ -7566,8 +7570,8 @@ void func_80083B0C(s32 objectIndex) {
init_texture_object(objectIndex, d_course_frappe_snowland_snowman_tlut, sSnowmanBodyList, 0x40U, (u16) 0x00000040);
gObjectList[objectIndex].vertex = vtx;
gObjectList[objectIndex].sizeScaling = 0.1f;
- gObjectList[objectIndex].itemDisplay = 0;
- func_80072488(objectIndex);
+ gObjectList[objectIndex].textureListIndex = 0;
+ object_next_state(objectIndex);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
gObjectList[objectIndex].orientation[0] = 0;
gObjectList[objectIndex].orientation[1] = 0;
@@ -7592,22 +7596,22 @@ void func_80083C04(s32 objectIndex) {
func_80083B0C(objectIndex);
break;
case 2:
- func_8007278C(objectIndex, 0x00000096);
+ set_and_run_timer_object(objectIndex, 0x00000096);
break;
case 10:
- if (func_8007278C(objectIndex, 0x0000012C) != 0) {
+ if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) {
func_800722A4(objectIndex, 2);
}
break;
case 11:
- if (func_8007278C(objectIndex, 0x0000000A) != 0) {
+ if (set_and_run_timer_object(objectIndex, 0x0000000A) != 0) {
set_object_flag_status_true(objectIndex, 0x00000010);
object->sizeScaling = 0.001f;
}
break;
case 12:
if (func_80074118(objectIndex, &object->sizeScaling, 0.001f, 0.1f, 0.0025f, 0, 0) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 13:
@@ -7675,7 +7679,7 @@ void func_80083F18(s32 objectIndex) {
if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.12f,
gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1],
0x00000064) != 0) {
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
object_calculate_new_pos_offset(objectIndex);
break;
@@ -7765,7 +7769,7 @@ void func_80084430(s32 objectIndex, UNUSED s32 arg1) {
object->spline = D_800E672C[0];
set_object_flag_status_true(objectIndex, 0x04000800);
object->type = get_animation_length(d_course_sherbet_land_unk_data11, 0);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_8008453C(s32 objectIndex, s32 arg1) {
@@ -7883,7 +7887,7 @@ void func_800845C8(s32 objectIndex, s32 arg1) {
func_80086EF0(objectIndex);
object->unk_034 = 0.0f;
object->type = get_animation_length(d_course_sherbet_land_unk_data11, 0);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80084B7C(s32 objectIndex, s32 arg1) {
@@ -7912,7 +7916,7 @@ void func_80084B7C(s32 objectIndex, s32 arg1) {
break;
case 4:
func_800722CC(objectIndex, 2);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
break;
}
if (func_80072320(objectIndex, 0x00000020) != 0) {
@@ -7955,7 +7959,7 @@ void func_80084D2C(s32 objectIndex, s32 arg1) {
func_800722A4(objectIndex, 2);
gObjectList[objectIndex].unk_09C = 1;
gObjectList[objectIndex].unk_0D8 = 1;
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
gObjectList[objectIndex].type =
get_animation_length(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8);
func_800726CC(objectIndex, 3);
@@ -7996,7 +8000,7 @@ void func_80084D2C(s32 objectIndex, s32 arg1) {
if (func_80087060(objectIndex, 0x0000000A) != 0) {
func_800722A4(objectIndex, 2);
gObjectList[objectIndex].unk_0D8 = 2;
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
gObjectList[objectIndex].type =
get_animation_length(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8);
func_800726CC(objectIndex, 3);
@@ -8006,7 +8010,7 @@ void func_80084D2C(s32 objectIndex, s32 arg1) {
case 6:
if (func_80072354(objectIndex, 2) != 0) {
gObjectList[objectIndex].unk_0D8 = 0;
- gObjectList[objectIndex].itemDisplay = 0;
+ gObjectList[objectIndex].textureListIndex = 0;
gObjectList[objectIndex].type =
get_animation_length(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8);
gObjectList[objectIndex].unk_0C6 += 0x8000;
@@ -8124,7 +8128,7 @@ void init_hot_air_balloon(s32 objectIndex) {
func_80086EF0(objectIndex);
gObjectList[objectIndex].velocity[1] = -2.0f;
init_actor_hot_air_balloon_item_box(0.0f, 0.0f, 0.0f);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80085534(s32 objectIndex) {
@@ -8223,7 +8227,7 @@ void func_80085878(s32 objectIndex, s32 arg1) {
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
object->unk_034 = 4.0f;
object->type = get_animation_length(d_rainbow_road_unk3, 0);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_800859C8(s32 objectIndex, s32 arg1) {
@@ -8269,7 +8273,7 @@ void func_80085BB4(s32 objectIndex) {
gObjectList[objectIndex].sizeScaling = 8.0f;
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_orientation(objectIndex, 0U, 0U, 0x8000U);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
const char* sNeonMushroomList[] = { d_course_rainbow_road_neon_mushroom };
@@ -8295,13 +8299,13 @@ void func_80085CA0(s32 objectIndex) {
func_80072D3C(objectIndex, 3, 4, 4, 0x0000000A);
break;
case 4:
- func_8007278C(objectIndex, 0x00000014);
+ set_and_run_timer_object(objectIndex, 0x00000014);
break;
case 5:
func_80072E54(objectIndex, 0, 4, 1, 0x0000000C, 5);
break;
case 6:
- func_8007278C(objectIndex, 0x00000014);
+ set_and_run_timer_object(objectIndex, 0x00000014);
break;
case 7:
func_80072D3C(objectIndex, 3, 4, 0, 0x00000014);
@@ -8369,13 +8373,13 @@ void func_80085F74(s32 objectIndex) {
func_80072E54(objectIndex, 0, 4, 1, 5, 1);
break;
case 3:
- func_8007278C(objectIndex, 0x0000001E);
+ set_and_run_timer_object(objectIndex, 0x0000001E);
break;
case 4:
func_80072C00(objectIndex, 4, 0, 7);
break;
case 5:
- func_8007278C(objectIndex, 0x0000001E);
+ set_and_run_timer_object(objectIndex, 0x0000001E);
break;
case 6:
func_80072F88(objectIndex, 3, 0, 1, 5, 1);
@@ -8474,7 +8478,7 @@ void func_8008629C(s32 objectIndex, s32 arg1) {
set_obj_origin_offset(objectIndex, 0.0f, -10.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, 0xF8E4U, 0U);
gObjectList[objectIndex].unk_048 = 0;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
void func_80086424(s32 objectIndex) {
@@ -8506,10 +8510,10 @@ void func_80086528(s32 objectIndex, s32 arg1) {
func_8008629C(objectIndex, arg1);
break;
case 2:
- if (func_8007278C(objectIndex, gObjectList[objectIndex].unk_04C) != 0) {
+ if (set_and_run_timer_object(objectIndex, gObjectList[objectIndex].unk_04C) != 0) {
func_80091440(arg1);
func_80086E70(objectIndex);
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
case 0:
@@ -8517,7 +8521,7 @@ void func_80086528(s32 objectIndex, s32 arg1) {
case 3:
if (gObjectList[objectIndex].unk_0AE == 0) {
gObjectList[objectIndex].unk_048 = 1;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
}
break;
}
@@ -8581,7 +8585,7 @@ void func_80086700(s32 objectIndex) {
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
set_obj_direction_angle(objectIndex, 0U, 0U, 0U);
gObjectList[objectIndex].unk_084[1] = 0x0200;
- func_80072488(objectIndex);
+ object_next_state(objectIndex);
func_80086E70(objectIndex);
}