summaryrefslogtreecommitdiff
path: root/src/render_objects.c
diff options
context:
space:
mode:
authorMegaMech <7255464+MegaMech@users.noreply.github.com>2024-12-06 21:50:01 -0700
committerMegaMech <7255464+MegaMech@users.noreply.github.com>2024-12-06 21:50:01 -0700
commitbcf4a7f384fdcecd813e61368685bed712299f6b (patch)
treef73fd7edd6705e24fca09875dd242585f47126b5 /src/render_objects.c
parentf87ad2350098dee00b235d771d068d53559dff8c (diff)
Put all thwomp code in thomp class
Diffstat (limited to 'src/render_objects.c')
-rw-r--r--src/render_objects.c131
1 files changed, 0 insertions, 131 deletions
diff --git a/src/render_objects.c b/src/render_objects.c
index e7062e767..a5b828f0f 100644
--- a/src/render_objects.c
+++ b/src/render_objects.c
@@ -56,16 +56,6 @@ Lights1 D_800E45C0[] = {
Lights1 D_800E4620 = gdSPDefLights1(150, 180, 250, 255, 255, 255, 0, 0, 0);
-Lights1 D_800E4638 = gdSPDefLights1(85, 85, 85, 255, 255, 255, 0, -120, 0);
-
-Lights1 D_800E4650 = gdSPDefLights1(85, 85, 0, 255, 255, 0, 0, 120, 0);
-
-Lights1 D_800E4668 = gdSPDefLights1(85, 85, 85, 255, 255, 255, -66, 82, -55);
-
-Lights1 D_800E4680 = gdSPDefLights1(85, 85, 85, 255, 255, 255, 0, 0, 120);
-
-Lights1 D_800E4698 = gdSPDefLights1(85, 85, 85, 255, 255, 255, 0, 0, 120);
-
Lights1 D_800E46B0 = gdSPDefLights1(85, 85, 85, 255, 255, 255, 0, 0, 120);
Lights1 D_800E46C8 = gdSPDefLights1(85, 85, 85, 255, 255, 255, 0, 0, 120);
@@ -3757,127 +3747,6 @@ void render_lakitu(s32 cameraId) {
}
}
-void translate_thwomp_lights(UNUSED s32 arg0) {
- func_800419F8();
- D_800E4638.l[0].l.dir[0] = D_80165840[0];
- D_800E4638.l[0].l.dir[1] = D_80165840[1];
- D_800E4638.l[0].l.dir[2] = D_80165840[2];
-}
-
-void thwomp_lights(s32 objectIndex) {
- // Why these don't just use `gSPSetLights1` calls...
- switch (gObjectList[objectIndex].type) { // hmm very strange 80165C18
- case 0:
- gSPLight(gDisplayListHead++, &D_800E4638.l[0], LIGHT_1);
- gSPLight(gDisplayListHead++, &D_800E4638.a, LIGHT_2);
- break;
- case 1:
- gSPLight(gDisplayListHead++, &D_800E4650.l[0], LIGHT_1);
- gSPLight(gDisplayListHead++, &D_800E4650.a, LIGHT_2);
- break;
- case 2:
- gSPLight(gDisplayListHead++, &D_800E4668.l[0], LIGHT_1);
- gSPLight(gDisplayListHead++, &D_800E4668.a, LIGHT_2);
- break;
- case 3:
- gSPLight(gDisplayListHead++, &D_800E4680.l[0], LIGHT_1);
- gSPLight(gDisplayListHead++, &D_800E4680.a, LIGHT_2);
- break;
- case 4:
- gSPLight(gDisplayListHead++, &D_800E4698.l[0], LIGHT_1);
- gSPLight(gDisplayListHead++, &D_800E4698.a, LIGHT_2);
- break;
- default:
- break;
- }
-}
-
-void render_object_thwomps_model(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].orientation,
- gObjectList[objectIndex].sizeScaling);
- thwomp_lights(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].model);
- }
-}
-
-void render_object_thwomps(s32 cameraId) {
- s32 objectIndex = 0;
- s32 i;
- UNUSED s32 stackPadding0;
- s16 minusone, plusone;
- Camera* camera;
- Object* object;
- // Lights1 *D_800E4668l = (Lights1 *) LOAD_ASSET(D_800E4668);
-
- camera = &camera1[cameraId];
- if (cameraId == PLAYER_ONE) {
- for (i = 0; i < gNumActiveThwomps; i++) {
- objectIndex = indexObjectList1[i];
- set_object_flag_status_false(objectIndex, 0x00070000);
- func_800722CC(objectIndex, 0x00000110);
- }
- }
-
- translate_thwomp_lights(objectIndex);
- for (i = 0; i < gNumActiveThwomps; i++) {
- objectIndex = indexObjectList1[i];
- minusone = gObjectList[objectIndex].unk_0DF - 1;
- plusone = gObjectList[objectIndex].unk_0DF + 1;
- if (gGamestate != CREDITS_SEQUENCE) {
- if ((D_8018CF68[cameraId] >= minusone) && (plusone >= D_8018CF68[cameraId]) &&
- (is_object_visible_on_camera(objectIndex, camera, 0x8000U) != 0)) {
- render_object_thwomps_model(objectIndex);
- }
- } else { // CREDITS_SEQUENCE
- render_object_thwomps_model(objectIndex);
- }
- }
- gSPDisplayList(gDisplayListHead++, D_0D0079C8);
- gDPSetCombineMode(gDisplayListHead++, G_CC_MODULATEIA, G_CC_MODULATEIA);
- gSPNumLights(gDisplayListHead++, 1);
- gSPLight(gDisplayListHead++, &D_800E4668.l[0], LIGHT_1);
- gSPLight(gDisplayListHead++, &D_800E4668.a, LIGHT_2);
- gSPClearGeometryMode(gDisplayListHead++, G_CULL_BOTH);
- gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
- load_texture_block_rgba16_mirror(d_course_bowsers_castle_thwomp_side, 0x00000020, 0x00000020);
- for (i = 0; i < gObjectParticle3_SIZE; i++) {
- objectIndex = gObjectParticle3[i];
- if (objectIndex != NULL_OBJECT_ID) {
- object = &gObjectList[objectIndex];
- 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);
- }
- }
- }
- gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
- gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
- gSPTexture(gDisplayListHead++, 0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF);
- gSPDisplayList(gDisplayListHead++, D_0D007AE0);
- load_texture_block_ia8_nomirror(D_8018D490, 0x00000020, 0x00000020);
- func_8004B3C8(0);
- D_80183E80[0] = 0;
- D_80183E80[2] = 0x8000;
- for (i = 0; i < gObjectParticle2_SIZE; i++) {
- objectIndex = gObjectParticle2[i];
- if (objectIndex != NULL_OBJECT_ID) {
- object = &gObjectList[objectIndex];
- if ((object->state >= 2) && (object->unk_0D5 == 2) && (gMatrixHudCount <= MTX_HUD_POOL_SIZE_MAX)) {
- func_8004B138(0x000000FF, 0x000000FF, 0x000000FF, (s32) object->primAlpha);
- D_80183E80[1] = func_800418AC(object->pos[0], object->pos[2], camera->pos);
- func_800431B0(object->pos, D_80183E80, object->sizeScaling, D_0D005AE0);
- }
- }
- }
-}
-
void func_80053D74(s32 objectIndex, UNUSED s32 arg1, s32 vertexIndex) {
Object* object;