From 76989faabfbf88e548d4606e7a0781e986efc909 Mon Sep 17 00:00:00 2001 From: Cooliokid956 <68075390+Cooliokid956@users.noreply.github.com> Date: Wed, 13 Sep 2023 05:05:22 -0500 Subject: [PATCH] offset djui power meter textures (#465) the functions were missing the offset present in the original, so i've gone ahead and added it here --- src/pc/lua/utils/smlua_misc_utils.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pc/lua/utils/smlua_misc_utils.c b/src/pc/lua/utils/smlua_misc_utils.c index fbdda7ea..000f129b 100644 --- a/src/pc/lua/utils/smlua_misc_utils.c +++ b/src/pc/lua/utils/smlua_misc_utils.c @@ -168,10 +168,10 @@ void hud_render_power_meter(s32 health, f32 x, f32 y, f32 width, f32 height) { { (u8*)texture_power_meter_full, 8, 32, 32 }, }; djui_hud_render_texture(&sPowerMeterTexturesInfo[0], x, y, width / 64, height / 64); - djui_hud_render_texture(&sPowerMeterTexturesInfo[1], x + width / 2, y, width / 64, height / 64); + djui_hud_render_texture(&sPowerMeterTexturesInfo[1], x + (width - 2) / 2, y, width / 64, height / 64); s32 numWedges = MIN(MAX(health >> 8, 0), 8); if (numWedges != 0) { - djui_hud_render_texture(&sPowerMeterTexturesInfo[numWedges + 1], x + width / 4, y + height / 4, width / 64, height / 64); + djui_hud_render_texture(&sPowerMeterTexturesInfo[numWedges + 1], x + (width - 4) / 4, y + height / 4, width / 64, height / 64); } } void hud_render_power_meter_interpolated(s32 health, f32 prevX, f32 prevY, f32 prevWidth, f32 prevHeight, f32 x, f32 y, f32 width, f32 height) { @@ -203,14 +203,14 @@ void hud_render_power_meter_interpolated(s32 health, f32 prevX, f32 prevY, f32 p x, y, width / 64, height / 64); djui_hud_render_texture_interpolated(&sPowerMeterTexturesInfo[1], - prevX + prevWidth / 2, prevY, prevWidth / 64, prevHeight / 64, - x + width / 2, y, width / 64, height / 64); + prevX + (prevWidth - 2) / 2, prevY, prevWidth / 64, prevHeight / 64, + x + (width - 2) / 2, y, width / 64, height / 64); s32 numWedges = MIN(MAX(health >> 8, 0), 8); if (numWedges != 0) { djui_hud_render_texture_interpolated(&sPowerMeterTexturesInfo[numWedges + 1], - prevX + prevWidth / 4, prevY + prevHeight / 4, prevWidth / 64, prevHeight / 64, - x + width / 4, y + height / 4, width / 64, height / 64); + prevX + (prevWidth - 4) / 4, prevY + prevHeight / 4, prevWidth / 64, prevHeight / 64, + x + (width - 4) / 4, y + height / 4, width / 64, height / 64); } }