aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-21 19:18:56 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-21 19:18:56 +0100
commit923c81cda77e9a50daa4a2747e28062d5f612ebc (patch)
tree0b2d11b6e409983d56f442e7408f5a1e695d6976
parentI can't believe it worked (diff)
download42-cub3d-923c81cda77e9a50daa4a2747e28062d5f612ebc.tar.gz
42-cub3d-923c81cda77e9a50daa4a2747e28062d5f612ebc.tar.bz2
42-cub3d-923c81cda77e9a50daa4a2747e28062d5f612ebc.tar.xz
42-cub3d-923c81cda77e9a50daa4a2747e28062d5f612ebc.tar.zst
42-cub3d-923c81cda77e9a50daa4a2747e28062d5f612ebc.zip
Get recaled
-rw-r--r--src/ft_draw_life_bar.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/ft_draw_life_bar.c b/src/ft_draw_life_bar.c
index 85db1ec..25d5ebe 100644
--- a/src/ft_draw_life_bar.c
+++ b/src/ft_draw_life_bar.c
@@ -19,19 +19,19 @@ static void
{
const int16_t scl = cl->mlist.scale;
- cl->img.ptr[(x + (int16_t)((cl->mlist.map_w * scl)
- + 10 + ((32 * scl) / 4))) * 4 + (cl->img.sizeline * (y +
- cl->wlist.y_size - (cl->mlist.map_h * scl) - 10))] =
+ 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))] =
(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 + ((32 * scl) / 4))) * 4 + (cl->img.sizeline * (y +
- cl->wlist.y_size - (cl->mlist.map_h * scl) - 10)) + 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)) + 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 + ((32 * scl) / 4))) * 4 + (cl->img.sizeline * (y +
- cl->wlist.y_size - (cl->mlist.map_h * scl) - 10)) + 2] =
+ 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] =
(uint8_t)cl->tnum[id].ptr[cl->tnum[id].tex_x * 4 + 4 *
cl->tnum[id].img_w * cl->tnum[id].tex_y + 2];
}
@@ -43,7 +43,6 @@ static void
int32_t y_ratio;
int16_t x;
int16_t y;
- /* const int16_t scl = cl->mlist.scale; */
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;
@@ -51,10 +50,7 @@ static void
while (y < cl->h)
{
cl->tnum[n - 48].tex_y = ((y * y_ratio) >> 16);
- /* x = ((cl->mlist.map_w * scl) + 20); */
x = 0;
- /* while (x < (int16_t)((cl->mlist.map_w * scl) */
- /* + 10 + ((32 * scl) / 4))) */
while (x < cl->w)
{
cl->tnum[n - 48].tex_x = ((x * x_ratio) >> 16);