diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-20 18:25:17 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-20 18:25:17 +0100 |
commit | 658997a30b6324fcf5b517b78148958b4a1e0e66 (patch) | |
tree | 1dcffd115bd44282e43f0f8cbbe0ff14f24895de /src/ft_draw_life_bar.c | |
parent | Bounce it (diff) | |
download | 42-cub3d-658997a30b6324fcf5b517b78148958b4a1e0e66.tar.gz 42-cub3d-658997a30b6324fcf5b517b78148958b4a1e0e66.tar.bz2 42-cub3d-658997a30b6324fcf5b517b78148958b4a1e0e66.tar.xz 42-cub3d-658997a30b6324fcf5b517b78148958b4a1e0e66.tar.zst 42-cub3d-658997a30b6324fcf5b517b78148958b4a1e0e66.zip |
it's not working at all
Diffstat (limited to '')
-rw-r--r-- | src/ft_draw_life_bar.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/ft_draw_life_bar.c b/src/ft_draw_life_bar.c index b90daa1..687e3a7 100644 --- a/src/ft_draw_life_bar.c +++ b/src/ft_draw_life_bar.c @@ -15,17 +15,17 @@ #include <stdint.h> static void - ft_draw_tnum(t_img num, int16_t y, int16_t x, t_cub *cl) + ft_draw_tnum(int8_t id, int16_t y, int16_t x, t_cub *cl) { *(cl->img.ptr + x * 4 + (cl->img.sizeline * y)) = - (uint8_t)*(num.ptr + num.tex_x * 4 + 4 * - num.img_w * num.tex_y); + (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 * 4 + (cl->img.sizeline * y) + 1) = - (uint8_t)*(num.ptr + num.tex_x * 4 + 4 * - num.img_w * num.tex_y + 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 * 4 + (cl->img.sizeline * y) + 2) = - (uint8_t)*(num.ptr + num.tex_x * 4 + 4 * - num.img_w * num.tex_y + 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); } /* static void */ @@ -41,22 +41,22 @@ static void int16_t x; int16_t y; - x_ratio = (int)((cl->tnum[10].img_w << 16) / (7 * cl->mlist.scale)) + 1; + x_ratio = (int)((cl->tnum[10].img_w << 16) / (8 * cl->mlist.scale)) + 1; y_ratio = (int)((cl->tnum[10].img_h << 16) / - ((cl->mlist.map_h * cl->mlist.scale) - 20)) + 1; + ((cl->mlist.map_h * cl->mlist.scale))) + 1; y = cl->wlist.y_size - (cl->mlist.map_h * cl->mlist.scale) - 10; while (y < (int16_t)cl->wlist.y_size - 10) { cl->tnum[10].tex_y = (y * y_ratio) >> 16; - x = ((cl->mlist.map_w * cl->mlist.scale) + 20 + ((28 * cl->mlist.scale) - - ((28 * cl->mlist.scale) / 4))); + x = ((cl->mlist.map_w * cl->mlist.scale) + 20 + ((32 * cl->mlist.scale) + - ((32 * cl->mlist.scale) / 4))); while (x < (int16_t)((cl->mlist.map_w * cl->mlist.scale) - + 10 + ((28 * cl->mlist.scale)))) + + 10 + ((32 * cl->mlist.scale)))) { cl->tnum[10].tex_x = (x * x_ratio) >> 16; /* if (cl->tnum[10].ptr[cl->tnum[10].tex_x * 4 + 4 * */ /* cl->tnum[10].img_h * cl->tnum[10].tex_y]) */ - ft_draw_tnum(cl->tnum[10], y, x, cl); + ft_draw_tnum(10, y, x, cl); x++; } y++; |