diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2023-11-24 17:06:55 -0500 |
|---|---|---|
| committer | louist103 <35883445+louist103@users.noreply.github.com> | 2023-11-24 17:06:55 -0500 |
| commit | bf7e50aadb5c1c0e416e3eaac1b2e2ab116e810e (patch) | |
| tree | 2467f9aaa3e28ab57180d35e52248f1ab99ee943 | |
| parent | cd8e619eb4254d2f9f0bd20041aa51a6f61e63b7 (diff) | |
Ammo Digits.
| -rw-r--r-- | mm/src/code/z_parameter.c | 11 | ||||
| -rw-r--r-- | mm/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c | 6 |
2 files changed, 12 insertions, 5 deletions
diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c index fedf860a6..c626e66db 100644 --- a/mm/src/code/z_parameter.c +++ b/mm/src/code/z_parameter.c @@ -4138,10 +4138,15 @@ void Interface_DrawItemIconTexture(PlayState* play, TexturePtr texture, s16 butt s16 D_801BFB04[] = { 0xA2, 0xE4, 0xFA, 0x110 }; s16 D_801BFB0C[] = { 0x23, 0x23, 0x33, 0x23 }; +// Not static so its visible in z_kaleido_item +const char* gAmmoDigitTextures[10] = { + gAmmoDigit0Tex, gAmmoDigit1Tex, gAmmoDigit2Tex, gAmmoDigit3Tex, gAmmoDigit4Tex, + gAmmoDigit5Tex, gAmmoDigit6Tex, gAmmoDigit7Tex, gAmmoDigit8Tex, gAmmoDigit9Tex, +}; + void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { u8 i; u16 ammo; - return; // BENTODO OPEN_DISPS(play->state.gfxCtx); i = ((void)0, GET_CUR_FORM_BTN_ITEM(button)); @@ -4190,12 +4195,12 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { // Draw upper digit (tens) if ((u32)i != 0) { - OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, ((u8*)gAmmoDigit0Tex + ((8 * 8) * i)), 8, 8, + OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, gAmmoDigitTextures[i], 8, 8, D_801BFB04[button], D_801BFB0C[button], 8, 8, 1 << 10, 1 << 10); } // Draw lower digit (ones) - OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, ((u8*)gAmmoDigit0Tex + ((8 * 8) * ammo)), 8, 8, + OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, gAmmoDigitTextures[i], 8, 8, D_801BFB04[button] + 6, D_801BFB0C[button], 8, 8, 1 << 10, 1 << 10); } diff --git a/mm/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c b/mm/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c index 36e19faa8..8f007d974 100644 --- a/mm/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c +++ b/mm/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_item.c @@ -175,6 +175,8 @@ s16 sAmmoRectHeight[] = { 150, // SLOT_PICTOGRAPH_BOX }; +extern const char* gAmmoDigitTextures[10]; + void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, s16 item, u16 ammoIndex) { s16 ammoUpperDigit; s16 ammo; @@ -224,13 +226,13 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx, // Draw upper digit if (ammoUpperDigit != 0) { POLY_OPA_DISP = - Gfx_DrawTexRectIA8(POLY_OPA_DISP, ((u8*)gAmmoDigit0Tex + (8 * 8 * ammoUpperDigit)), 8, 8, + Gfx_DrawTexRectIA8(POLY_OPA_DISP,gAmmoDigitTextures[ammoUpperDigit], 8, 8, sAmmoRectLeft[ammoIndex], sAmmoRectHeight[ammoIndex], 8, 8, 1 << 10, 1 << 10); } // Draw lower digit POLY_OPA_DISP = - Gfx_DrawTexRectIA8(POLY_OPA_DISP, ((u8*)gAmmoDigit0Tex + (8 * 8 * ammo)), 8, 8, sAmmoRectLeft[ammoIndex] + 6, + Gfx_DrawTexRectIA8(POLY_OPA_DISP, gAmmoDigitTextures[ammo], 8, 8, sAmmoRectLeft[ammoIndex] + 6, sAmmoRectHeight[ammoIndex], 8, 8, 1 << 10, 1 << 10); CLOSE_DISPS(gfxCtx); |
