diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2024-08-03 20:57:07 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-03 20:57:07 -0600 |
| commit | c270c11c9bee22a2c6fd9395f21f389e18c8afed (patch) | |
| tree | 390538449d09a778c6f85931fffdeb2e1b0f066d /src/render_objects.c | |
| parent | 016b16a4845d51d32bbff97c29dbcf5509471e55 (diff) | |
Lakitu fix (#35)
* Fix menu bug
* Fix undefined behaviour
* Fix kart textures
* Fix boost texture
* Rename as per review
* Fix buffer overflows
* Fix lakitu progress
* Fix race starter character
---------
Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/render_objects.c')
| -rw-r--r-- | src/render_objects.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/render_objects.c b/src/render_objects.c index 6d454b508..411ce3008 100644 --- a/src/render_objects.c +++ b/src/render_objects.c @@ -612,17 +612,17 @@ void func_80047068(u8 *tlut, u8 *texture, Vtx *arg2, UNUSED s32 arg3, s32 arg4, gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); } -void draw_rectangle_texture_overlap(u8 *tlut, u8 *texture, Vtx *arg2, UNUSED s32 arg3, s32 arg4, s32 width, s32 height) { +void draw_rectangle_texture_overlap(u8 *tlut, u8 *texture, Vtx *arg2, UNUSED s32 w, s32 height, s32 width, s32 heighthalf) { s32 heightIndex; s32 vertexIndex = 0; - u8 *img = texture; + u8 *img = (u8 *) LOAD_ASSET(texture); gDPLoadTLUT_pal256(gDisplayListHead++, tlut); - for (heightIndex = 0; heightIndex < arg4 / height; heightIndex++) { - rsp_load_texture(img, width, height); + for (heightIndex = 0; heightIndex < height / heighthalf; heightIndex++) { + rsp_load_texture(img, width, heighthalf); gSPVertex(gDisplayListHead++, &arg2[vertexIndex], 4, 0); gSPDisplayList(gDisplayListHead++, common_rectangle_display); - img += width * (height - 1); + img += width * (heighthalf - 1); vertexIndex += 4; } gSPTexture(gDisplayListHead++, 1, 1, 0, G_TX_RENDERTILE, G_OFF); @@ -761,10 +761,10 @@ UNUSED void func_80048038(Vec3f arg0, Vec3su arg1, f32 arg2, u8 *tlut, u8 *textu func_80047068(tlut, texture, arg5, arg6, arg7, arg8, arg9); } -void draw_2d_texture_at(Vec3f arg0, Vec3su arg1, f32 arg2, u8 *tlut, u8 *texture, Vtx *arg5, s32 arg6, s32 arg7, s32 arg8, s32 arg9) { +void draw_2d_texture_at(Vec3f arg0, Vec3su arg1, f32 arg2, u8 *tlut, u8 *texture, Vtx *arg5, s32 width, s32 height, s32 width2, s32 height2) { rsp_set_matrix_transformation(arg0, arg1, arg2); gSPDisplayList(gDisplayListHead++, D_0D007D78); - draw_rectangle_texture_overlap(tlut, texture, arg5, arg6, arg7, arg8, arg9); + draw_rectangle_texture_overlap(tlut, texture, arg5, width, height, width2, height2); } void func_80048130(Vec3f arg0, Vec3su arg1, f32 arg2, u8 *tlut, u8 *texture, Vtx *arg5, s32 arg6, s32 arg7, s32 arg8, s32 arg9, s32 argA) { |
