diff options
Diffstat (limited to 'src/ft_draw_life_bar.c')
-rw-r--r-- | src/ft_draw_life_bar.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ft_draw_life_bar.c b/src/ft_draw_life_bar.c index c2aa68f..955f20d 100644 --- a/src/ft_draw_life_bar.c +++ b/src/ft_draw_life_bar.c @@ -21,17 +21,17 @@ static void cl->img.ptr[(x + (int16_t)((cl->mlist.map_w * scl) + 10)) * 4 + (cl->img.sizeline * (y + cl->wlist.y_size - (cl->mlist.map_h * scl) - - 10))] = + + 40))] = (uint8_t)cl->tnum[id].ptr[cl->tnum[id].tex_x * 4 + 4 * cl->tnum[id].img_w * cl->tnum[id].tex_y]; cl->img.ptr[(x + (int16_t)((cl->mlist.map_w * scl) + 10)) * 4 + (cl->img.sizeline * (y + cl->wlist.y_size - (cl->mlist.map_h * scl) - - 10)) + 1] = + + 40)) + 1] = (uint8_t)cl->tnum[id].ptr[cl->tnum[id].tex_x * 4 + 4 * cl->tnum[id].img_w * cl->tnum[id].tex_y + 1]; cl->img.ptr[(x + (int16_t)((cl->mlist.map_w * scl) + 10)) * 4 + (cl->img.sizeline * (y + cl->wlist.y_size - (cl->mlist.map_h * scl) - - 10)) + 2] = + + 40)) + 2] = (uint8_t)cl->tnum[id].ptr[cl->tnum[id].tex_x * 4 + 4 * cl->tnum[id].img_w * cl->tnum[id].tex_y + 2]; } @@ -44,14 +44,14 @@ static void int16_t x; int16_t y; - x_ratio = (int)(((cl->tnum[n - 48].img_w) << 16) / cl->w) + 1; - y_ratio = (int)(((cl->tnum[n - 48].img_h) << 16) / cl->h) + 1; + x_ratio = (int)(((cl->tnum[n - 48].img_w) << 16) / cl->life_num_w) + 1; + y_ratio = (int)(((cl->tnum[n - 48].img_h) << 16) / cl->life_num_h) + 1; y = 0; - while (y < cl->h) + while (y < cl->life_num_h) { cl->tnum[n - 48].tex_y = ((y * y_ratio) >> 16); x = 0; - while (x < cl->w) + while (x < cl->life_num_w) { cl->tnum[n - 48].tex_x = ((x * x_ratio) >> 16); if (cl->tnum[n - 48].ptr[cl->tnum[n - 48].tex_x * 4 + 4 * @@ -94,7 +94,7 @@ static void x = ((cl->mlist.map_w * scl) + 20) + (24 * scl) - ((24 * scl) / 4); y = cl->wlist.y_size - (cl->mlist.map_h * scl) - 10; - while (y < (int16_t)(cl->wlist.y_size - 10)) + while (y < (int16_t)(cl->wlist.y_size - 50)) { x = ((cl->mlist.map_w * scl) + 20) + (24 * scl) - ((24 * scl) / 4); while (x < (int16_t)((cl->mlist.map_w * scl) + 10 + ((24 * scl)))) @@ -103,10 +103,10 @@ static void } y -= cl->wlist.y_size - (cl->mlist.map_h * scl) - 10; x -= ((cl->mlist.map_w * scl) + 20) + (24 * scl) - ((24 * scl) / 4); - y = (y == 0) ? (1) : (y); - x = (x == 0) ? (1) : (x); - cl->h = y; - cl->w = x; + y = (y <= 0) ? (1) : (y); + x = (x <= 0) ? (1) : (x); + cl->life_num_h = y; + cl->life_num_w = x; } void |