summaryrefslogtreecommitdiff
path: root/src/engine/objects/Snowman.cpp
diff options
context:
space:
mode:
authorcoco875 <59367621+coco875@users.noreply.github.com>2025-07-06 23:14:57 +0000
committerGitHub <noreply@github.com>2025-07-06 17:14:57 -0600
commita0b202cca4fc4a8aa7f5c24ef4f579018e1f34c6 (patch)
treed4cc18fb38e006d001811aed0306fa9612da36e4 /src/engine/objects/Snowman.cpp
parent4491c025a5e22624caa7dac3faf802de395db17a (diff)
fix some custom texture (#426)
* fix lakitu custom texture * finish fix lakitu * finish fix lakitu but also fix crab and snowman * Update Mole.cpp * fix texture around jumbotron --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/engine/objects/Snowman.cpp')
-rw-r--r--src/engine/objects/Snowman.cpp51
1 files changed, 40 insertions, 11 deletions
diff --git a/src/engine/objects/Snowman.cpp b/src/engine/objects/Snowman.cpp
index 7cbfc691d..cbb708fbf 100644
--- a/src/engine/objects/Snowman.cpp
+++ b/src/engine/objects/Snowman.cpp
@@ -129,17 +129,26 @@ void OSnowman::DrawHead(s32 cameraId) {
func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
D_80183E80[2] = (u16) gObjectList[objectIndex].orientation[2];
if (is_obj_flag_status_active(objectIndex, 0x00000010) != 0) {
- draw_2d_texture_at(gObjectList[objectIndex].pos, (u16*) D_80183E80,
- gObjectList[objectIndex].sizeScaling, (u8*) gObjectList[objectIndex].activeTLUT,
- (u8*) gObjectList[objectIndex].activeTexture, gObjectList[objectIndex].vertex,
- 0x00000040, 0x00000040, 0x00000040, 0x00000020);
+ rsp_set_matrix_transformation(gObjectList[objectIndex].pos, D_80183E80,
+ gObjectList[objectIndex].sizeScaling);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007D78);
+ gDPLoadTLUT_pal256(gDisplayListHead++, gObjectList[objectIndex].activeTLUT);
+ rsp_load_texture((u8*) gObjectList[objectIndex].activeTexture, 64, 64);
+ gSPVertex(gDisplayListHead++, (uintptr_t) gObjectList[objectIndex].vertex, 4, 0);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display);
+ gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
}
objectIndex = _headIndex;
D_80183E80[0] = (s16) gObjectList[objectIndex].orientation[0];
D_80183E80[2] = (u16) gObjectList[objectIndex].orientation[2];
- draw_2d_texture_at(gObjectList[objectIndex].pos, (u16*) D_80183E80, gObjectList[objectIndex].sizeScaling,
- (u8*) gObjectList[objectIndex].activeTLUT, (u8*) gObjectList[objectIndex].activeTexture,
- gObjectList[objectIndex].vertex, 0x00000040, 0x00000040, 0x00000040, 0x00000020);
+ rsp_set_matrix_transformation(gObjectList[objectIndex].pos, D_80183E80,
+ gObjectList[objectIndex].sizeScaling);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007D78);
+ gDPLoadTLUT_pal256(gDisplayListHead++, gObjectList[objectIndex].activeTLUT);
+ rsp_load_texture((u8*) gObjectList[objectIndex].activeTexture, 64, 64);
+ gSPVertex(gDisplayListHead++, (uintptr_t) gObjectList[objectIndex].vertex, 4, 0);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display);
+ gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
// @port Pop the transform id.
FrameInterpolation_RecordCloseChild();
@@ -229,13 +238,27 @@ void OSnowman::func_80083BE4(s32 objectIndex) {
object_calculate_new_pos_offset(objectIndex);
}
+Vtx common_vtx_snowman[] = {
+ {{{ -32, -31, -12}, 0, { 0, 0}, {255, 255, 255, 255}}},
+ {{{ 31, -31, -12}, 0, { 4032, 0}, {255, 255, 255, 255}}},
+ {{{ 31, 31, -12}, 0, { 4032, 3968}, {255, 255, 255, 255}}},
+ {{{ -32, 31, -12}, 0, { 0, 3968}, {255, 255, 255, 255}}},
+ {{{ -32, -31, 0}, 0, { 4032, 0}, {255, 255, 255, 255}}},
+ {{{ 31, -31, 0}, 0, { 0, 0}, {255, 255, 255, 255}}},
+ {{{ 31, 0, 0}, 0, { 0, 1984}, {255, 255, 255, 255}}},
+ {{{ -32, 0, 0}, 0, { 4032, 1984}, {255, 255, 255, 255}}},
+ {{{ -32, 0, 0}, 0, { 4032, 0}, {255, 255, 255, 255}}},
+ {{{ 31, 0, 0}, 0, { 0, 0}, {255, 255, 255, 255}}},
+ {{{ 31, 31, 0}, 0, { 0, 1984}, {255, 255, 255, 255}}},
+ {{{ -32, 31, 0}, 0, { 4032, 1984}, {255, 255, 255, 255}}},
+};
+
void OSnowman::func_80083868(s32 objectIndex) {
Object* object;
- Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(D_0D0061B0);
init_texture_object(objectIndex, (u8*) d_course_frappe_snowland_snowman_tlut, (const char**) sSnowmanHeadList,
0x40U, (u16) 0x00000040);
object = &gObjectList[objectIndex];
- object->vertex = vtx;
+ object->vertex = common_vtx_snowman;
object->sizeScaling = 0.1f;
object->textureListIndex = 0;
object_next_state(objectIndex);
@@ -302,11 +325,17 @@ void OSnowman::func_80083A94(s32 objectIndex) {
static const char* sSnowmanBodyList[] = { d_course_frappe_snowland_snowman_body };
+Vtx common_vtx_snowman2[] = {
+ { { { -32, -31, 0 }, 0, { 0, 0 }, { 255, 255, 255, 255 } } },
+ { { { 31, -31, 0 }, 0, { 4032, 0 }, { 255, 255, 255, 255 } } },
+ { { { 31, 31, 0 }, 0, { 4032, 3968 }, { 255, 255, 255, 255 } } },
+ { { { -32, 31, 0 }, 0, { 0, 3968 }, { 255, 255, 255, 255 } } },
+};
+
void OSnowman::func_80083B0C(s32 objectIndex) {
- Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_hedgehog);
init_texture_object(objectIndex, (u8*) d_course_frappe_snowland_snowman_tlut, (const char**) sSnowmanBodyList,
0x40U, (u16) 0x00000040);
- gObjectList[objectIndex].vertex = vtx;
+ gObjectList[objectIndex].vertex = common_vtx_snowman2;
gObjectList[objectIndex].sizeScaling = 0.1f;
gObjectList[objectIndex].textureListIndex = 0;
object_next_state(objectIndex);