aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_life_bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_draw_life_bar.c')
-rw-r--r--src/ft_draw_life_bar.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ft_draw_life_bar.c b/src/ft_draw_life_bar.c
index b16b681..436b13a 100644
--- a/src/ft_draw_life_bar.c
+++ b/src/ft_draw_life_bar.c
@@ -31,16 +31,17 @@ static void
int32_t y_ratio;
int16_t x;
int16_t y;
+ const int16_t scl = cl->mlist.scale;
- x_ratio = (int)((cl->tnum[10].img_w << 16) / w) + 1;
- y_ratio = (int)((cl->tnum[10].img_h << 16) / h) + 1;
- y = cl->wlist.y_size - (cl->mlist.map_h * cl->mlist.scale) - 10;
+ x_ratio = (int)(((cl->tnum[10].img_w) << 16) / w) + 1;
+ y_ratio = (int)(((cl->tnum[10].img_h) << 16) / h) + 1;
+ /* y = cl->wlist.y_size - (cl->mlist.map_h * scl) - 10; */
+ y = 0;
while (y < (int32_t)(cl->wlist.y_size - 10))
{
cl->tnum[10].tex_y = ((y * y_ratio) >> 16);
- x = ((cl->mlist.map_w * cl->mlist.scale) + 20) + (32 * cl->mlist.scale) - ((32 * cl->mlist.scale) / 4);
- while (x < (int32_t)((cl->mlist.map_w * cl->mlist.scale)
- + 10 + ((32 * cl->mlist.scale))))
+ x = ((cl->mlist.map_w * scl) + 20) + (32 * scl) - ((32 * scl) / 4);
+ while (x < (int32_t)((cl->mlist.map_w * scl) + 10 + ((32 * scl))))
{
cl->tnum[10].tex_x = ((x * x_ratio) >> 16);
if (cl->tnum[10].ptr[cl->tnum[10].tex_x * 4 + 4 *
@@ -70,16 +71,16 @@ static void
const int16_t scl = cl->mlist.scale;
y = cl->wlist.y_size - (cl->mlist.map_h * scl) - 10;
- while (y < (int32_t)(cl->wlist.y_size - 10))
+ while (y < (int16_t)(cl->wlist.y_size - 10))
{
x = ((cl->mlist.map_w * scl) + 20) + (32 * scl) - ((32 * scl) / 4);
- while (x < (int32_t)((cl->mlist.map_w * scl) + 10 + ((32 * scl))))
+ while (x < (int16_t)((cl->mlist.map_w * scl) + 10 + ((32 * scl))))
x++;
y++;
}
/* y -= cl->wlist.y_size - (cl->mlist.map_h * scl); */
x -= ((cl->mlist.map_w * scl) + 20) + (32 * scl) - ((32 * scl) / 4);
- ft_printf("y %hu | x %hu\n", y, x);
+ ft_printf("h %hu | w %hu\n", y, x);
ft_put_percent_image(y, x, cl);
}