summaryrefslogtreecommitdiff
path: root/src/engine/objects/Crab.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/Crab.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/Crab.cpp')
-rw-r--r--src/engine/objects/Crab.cpp35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/engine/objects/Crab.cpp b/src/engine/objects/Crab.cpp
index 82d2b9330..98c781b5a 100644
--- a/src/engine/objects/Crab.cpp
+++ b/src/engine/objects/Crab.cpp
@@ -4,7 +4,6 @@
#include <vector>
#include "CoreMath.h"
-
#include "port/Game.h"
extern "C" {
@@ -55,19 +54,29 @@ void OCrab::Tick(void) {
}
}
+Vtx common_vtx_crab[] = {
+ { { { -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 OCrab::Draw(s32 cameraId) {
Camera* camera;
s32 objectIndex = _objectIndex;
if (gObjectList[objectIndex].state >= 2) {
- Vtx* vtx = (Vtx*) LOAD_ASSET_RAW(common_vtx_hedgehog);
camera = &camera1[cameraId];
func_8004A6EC(objectIndex, 0.5f);
gObjectList[objectIndex].orientation[1] =
func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
- draw_2d_texture_at(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation,
- gObjectList[objectIndex].sizeScaling, (u8*) gObjectList[objectIndex].activeTLUT,
- (uint8_t*)gObjectList[objectIndex].activeTexture, vtx, 64, 64,
- 64, 32);
+ rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation,
+ 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) common_vtx_crab, 4, 0);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display);
+ gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
}
}
@@ -76,14 +85,22 @@ void OCrab::DrawModel(s32 cameraId) {
s32 objectIndex = _objectIndex;
func_8008A364(objectIndex, cameraId, 0x2AABU, 800);
if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) {
- Camera *camera;
+ Camera* camera;
s32 objectIndex;
if (gObjectList[objectIndex].state >= 2) {
camera = &camera1[cameraId];
func_8004A6EC(objectIndex, 0.5f);
- gObjectList[objectIndex].orientation[1] = func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
- draw_2d_texture_at(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation, gObjectList[objectIndex].sizeScaling, (u8*) gObjectList[objectIndex].activeTLUT, (u8*)gObjectList[objectIndex].activeTexture, (Vtx*)common_vtx_hedgehog, 0x00000040, 0x00000040, 0x00000040, 0x00000020);
+ gObjectList[objectIndex].orientation[1] =
+ func_800418AC(gObjectList[objectIndex].pos[0], gObjectList[objectIndex].pos[2], camera->pos);
+ rsp_set_matrix_transformation(gObjectList[objectIndex].pos, gObjectList[objectIndex].orientation,
+ 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) common_vtx_crab, 4, 0);
+ gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display);
+ gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
}
}
}