summaryrefslogtreecommitdiff
path: root/src/engine/objects/Podium.cpp
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-02-07 14:36:55 -0700
committerGitHub <noreply@github.com>2025-02-07 14:36:55 -0700
commitfc1e1a97825c129f114a5c59ab1820d1a1b9187f (patch)
tree3d18b98adf1a3c62fcbd203f55a89e047782808a /src/engine/objects/Podium.cpp
parent6f8cbc0279004a39635c922b824e8561f5355bc5 (diff)
Reimpl star emitter (#180)
* Reimpl star emitter * Remove OObject Lists * wip mole reimpl * nearly fix moles * Cleanup * Update reimpl seagull * Rework finishline to auto spawn and not to run in credits * Fix train crossing direction in extra mode * Clarification * micro optimization * update mole --------- Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/engine/objects/Podium.cpp')
-rw-r--r--src/engine/objects/Podium.cpp57
1 files changed, 39 insertions, 18 deletions
diff --git a/src/engine/objects/Podium.cpp b/src/engine/objects/Podium.cpp
index 1922c98a5..d8f1e2ff2 100644
--- a/src/engine/objects/Podium.cpp
+++ b/src/engine/objects/Podium.cpp
@@ -29,45 +29,66 @@ OPodium::OPodium(const FVector& pos) {
_pos = pos;
- for (size_t i = 0; i < NUM_PODIUMS; i++) {
- s32 objectIndex = indexObjectList1[i];
- //init_object(objectIndex, 0);
- //set_obj_origin_pos(objectIndex, pos.x - 1.5, pos.y, pos.z);
- }
+ find_unused_obj_index(&_podium1Index);
+ find_unused_obj_index(&_podium2Index);
+ find_unused_obj_index(&_podium3Index);
+
+ //init_object(objectIndex, 0);
+ //set_obj_origin_pos(objectIndex, pos.x - 1.5, pos.y, pos.z);
}
void OPodium::Tick() { // func_80086604
- s32 objectIndex;
if ((D_8016347C != 0) && (D_802874D8.unk1D < 3)) {
if (D_801658C6 == 0) {
for (size_t i = 0; i < 3; i++) {
- objectIndex = indexObjectList1[i];
- init_object(objectIndex, 0);
+ init_object(_podium1Index, 0);
+ init_object(_podium2Index, 0);
+ init_object(_podium3Index, 0);
}
D_801658C6 = 1;
}
}
- for (size_t i = 0; i != NUM_PODIUMS; i++) {
- objectIndex = indexObjectList1[i];
- if (gObjectList[objectIndex].state != 0) {
- OPodium::func_80086528(objectIndex, i);
- OPodium::func_80086424(objectIndex);
- }
+
+ if (gObjectList[_podium1Index].state != 0) {
+ OPodium::func_80086528(_podium1Index, 0);
+ OPodium::func_80086424(_podium1Index);
+ }
+
+ if (gObjectList[_podium2Index].state != 0) {
+ OPodium::func_80086528(_podium2Index, 1);
+ OPodium::func_80086424(_podium2Index);
+ }
+
+ if (gObjectList[_podium3Index].state != 0) {
+ OPodium::func_80086528(_podium3Index, 2);
+ OPodium::func_80086424(_podium3Index);
}
}
void OPodium::Draw(s32 cameraId) { // func_80055F48
- for (size_t i = 0; i < NUM_PODIUMS; i++) {
- Object* object;
+ Object* object = &gObjectList[_podium1Index];
+ if (object->state >= 2) {
+ //func_80043220(object->pos, object->direction_angle, object->sizeScaling, object->model);
+ rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
+ gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077A0);
+ gSPDisplayList(gDisplayListHead++, object->model);
+ }
- object = &gObjectList[indexObjectList1[i]];
+ object = &gObjectList[_podium2Index];
+ if (object->state >= 2) {
+ //func_80043220(object->pos, object->direction_angle, object->sizeScaling, object->model);
+ rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
+ gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077A0);
+ gSPDisplayList(gDisplayListHead++, object->model);
+ }
+
+ object = &gObjectList[_podium3Index];
if (object->state >= 2) {
//func_80043220(object->pos, object->direction_angle, object->sizeScaling, object->model);
rsp_set_matrix_transformation(object->pos, object->direction_angle, object->sizeScaling);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0077A0);
gSPDisplayList(gDisplayListHead++, object->model);
}
- }
}
void OPodium::func_8008629C(s32 objectIndex, s32 arg1) {