fix bombkart and speedometer (#496)

* fix bombkart and speedometer

* make number more clear

---------

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
coco875
2025-07-21 18:43:15 +00:00
committed by GitHub
parent adc7dd050f
commit 8eecad6bc4
2 changed files with 50 additions and 17 deletions
+18 -10
View File
@@ -38,12 +38,20 @@ void PlayerBombKart::func_800563DC(s32 cameraId, s32 arg2) {
D_80183E80[1] = func_800418AC(pos.x, pos.z, camera->pos);
D_80183E80[2] = 0x8000;
rsp_set_matrix_transformation(D_80183E40, D_80183E80, 0.2f);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007E98);
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007E98);
func_8004B310(arg2);
draw_rectangle_texture_overlap((u8*) common_tlut_bomb, (u8*)common_texture_bomb[residue], (Vtx*)D_0D005AE0, 0x00000020,
0x00000020, 0x00000020, 0x00000020);
int heigh = 32;
int width = 32;
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_bomb);
rsp_load_texture((u8*) common_texture_bomb[residue], width, heigh);
gSPVertex(gDisplayListHead++, (uintptr_t) D_0D005AE0, 4, 0);
gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display);
gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
temp_s0 = D_8018D400;
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007B00);
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007B00);
func_8004B414(0, 0, 0, arg2);
D_80183E40[1] = D_80183E40[1] + 4.0;
D_80183E80[2] = 0;
@@ -58,22 +66,22 @@ void PlayerBombKart::func_800563DC(s32 cameraId, s32 arg2) {
}
void PlayerBombKart::func_8005669C(s32 arg2) {
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D0079E8);
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D0079E8);
func_8004B310(arg2);
load_texture_block_rgba16_mirror((u8*) D_0D02AA58, 0x00000010, 0x00000010);
D_80183E40[1] = pos.y - 2.0;
D_80183E40[0] = pos.x + 2.0;
D_80183E40[2] = pos.z + 2.0;
func_800431B0(D_80183E40, D_80183E80, 0.15f, (Vtx*)common_vtx_rectangle);
func_800431B0(D_80183E40, D_80183E80, 0.15f, (Vtx*) common_vtx_rectangle);
D_80183E40[0] = pos.x + 2.0;
D_80183E40[2] = pos.z - 2.0;
func_800431B0(D_80183E40, D_80183E80, 0.15f, (Vtx*)common_vtx_rectangle);
func_800431B0(D_80183E40, D_80183E80, 0.15f, (Vtx*) common_vtx_rectangle);
D_80183E40[0] = pos.x - 2.0;
D_80183E40[2] = pos.z - 2.0;
func_800431B0(D_80183E40, D_80183E80, 0.15f, (Vtx*)common_vtx_rectangle);
func_800431B0(D_80183E40, D_80183E80, 0.15f, (Vtx*) common_vtx_rectangle);
D_80183E40[0] = pos.x - 2.0;
D_80183E40[2] = pos.z + 2.0;
func_800431B0(D_80183E40, D_80183E80, 0.15f, (Vtx*)common_vtx_rectangle);
func_800431B0(D_80183E40, D_80183E80, 0.15f, (Vtx*) common_vtx_rectangle);
gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
}
@@ -91,5 +99,5 @@ void PlayerBombKart::func_800568A0(s32 cameraId) {
// G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
AddHudMatrix(mtx, G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
gSPDisplayList(gDisplayListHead++, (Gfx*)D_0D007B98);
gSPDisplayList(gDisplayListHead++, (Gfx*) D_0D007B98);
}
+32 -7
View File
@@ -1296,11 +1296,14 @@ void func_8004A258(s32 arg0, s32 arg1, u16 arg2, f32 arg3, u8* texture, Vtx* arg
}
void func_8004A2F4(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 red, s32 green, s32 blue, s32 alpha, u8* texture,
Vtx* arg9, s32 argA, s32 argB, s32 argC, s32 argD) {
Vtx* vtx, s32 argA, s32 argB, s32 width, s32 height) {
func_80042330(arg0, arg1, arg2, arg3);
gSPDisplayList(gDisplayListHead++, D_0D007A40);
func_8004B414(red, green, blue, alpha);
func_80049970(texture, arg9, argA, argB, argC, argD);
func_80044DA0(texture, argA, argB);
gSPVertex(gDisplayListHead++, vtx, 4, 0);
gSPDisplayList(gDisplayListHead++, common_rectangle_display);
gSPTexture(gDisplayListHead++, 0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF);
}
void func_8004A384(s32 arg0, s32 arg1, u16 arg2, f32 arg3, s32 red, s32 green, s32 blue, s32 alpha, u8* texture,
@@ -2713,13 +2716,20 @@ void render_digital_speedometer(s32 playerIdx) {
text_draw_wide(270, 224, str, 0, 0.5f, 0.5f);
}
Vtx speedometer_vtx[] = {
{ { { -32, -47, 0 }, 0, { 0, 0 }, { 255, 255, 255, 255 } } },
{ { { 31, -47, 0 }, 0, { 4032, 0 }, { 255, 255, 255, 255 } } },
{ { { 31, 47, 0 }, 0, { 4032, 6016 }, { 255, 255, 255, 255 } } },
{ { { -32, 47, 0 }, 0, { 0, 6016 }, { 255, 255, 255, 255 } } },
};
// render the speedometer for the player
void render_speedometer(s32 playerIdx) {
gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER);
func_8004A2F4(playerHUD[playerIdx].speedometerX, playerHUD[playerIdx].speedometerY, 0U, 1.0f,
// RGBA
CM_GetProps()->Minimap.Colour.r, CM_GetProps()->Minimap.Colour.g, CM_GetProps()->Minimap.Colour.b,
0xFF, LOAD_ASSET(common_texture_speedometer), LOAD_ASSET(D_0D0064B0), 64, 96, 64, 48);
0xFF, common_texture_speedometer, speedometer_vtx, 64, 96, 64, 48);
// x, y, needle rot
func_8004A258(D_8018CFEC, D_8018CFF4, D_8016579E, 1.0f, common_texture_speedometer_needle, D_0D005FF0, 0x40, 0x20,
0x40, 0x20);
@@ -4103,8 +4113,16 @@ void func_800563DC(s32 objectIndex, s32 cameraId, s32 arg2) {
rsp_set_matrix_transformation(D_80183E40, D_80183E80, 0.2f);
gSPDisplayList(gDisplayListHead++, D_0D007E98);
func_8004B310(arg2);
draw_rectangle_texture_overlap((u8*) common_tlut_bomb, common_texture_bomb[residue], D_0D005AE0, 0x00000020,
0x00000020, 0x00000020, 0x00000020);
int heigh = 32;
int width = 32;
gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_bomb);
rsp_load_texture((u8*) common_texture_bomb[residue], width, heigh);
gSPVertex(gDisplayListHead++, (uintptr_t) D_0D005AE0, 4, 0);
gSPDisplayList(gDisplayListHead++, (Gfx*) common_rectangle_display);
gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
temp_s0 = D_8018D400;
gSPDisplayList(gDisplayListHead++, D_0D007B00);
func_8004B414(0, 0, 0, arg2);
@@ -4208,8 +4226,15 @@ void func_80056BF0(s32 bombIndex) {
D_80183E40[0] = sp40.bombPos[0];
D_80183E40[1] = sp40.bombPos[1] + 1.0;
D_80183E40[2] = sp40.bombPos[2];
draw_2d_texture_at(D_80183E40, D_80183E80, 0.25f, (u8*) common_tlut_bomb, bombFrame, D_0D005AE0, 0x20, 0x20, 0x20,
0x20);
rsp_set_matrix_transformation(D_80183E40, D_80183E80, 0.25f);
gSPDisplayList(gDisplayListHead++, D_0D007D78);
gDPLoadTLUT_pal256(gDisplayListHead++, (u8*) common_tlut_bomb);
rsp_load_texture(bombFrame, 0x20, 0x20);
gSPVertex(gDisplayListHead++, D_0D005AE0, 4, 0);
gSPDisplayList(gDisplayListHead++, common_rectangle_display);
gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF);
temp_s0 = D_8018D400;
gSPDisplayList(gDisplayListHead++, D_0D007B00);
func_8004B414(0, 0, 0, 0xFF);