aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite.c
diff options
context:
space:
mode:
authorsalaaad2 <arthudurant263@gmail.com>2020-02-26 12:19:10 +0100
committersalaaad2 <arthudurant263@gmail.com>2020-02-26 12:19:10 +0100
commit903fe03f0f6b1f70faa3139b57db24cb6c51b0a6 (patch)
tree548db2a9a7ca7a10f6e577a40ee7c4f0a8bc1561 /src/ft_draw_sprite.c
parentgee (diff)
download42-cub3d-903fe03f0f6b1f70faa3139b57db24cb6c51b0a6.tar.gz
42-cub3d-903fe03f0f6b1f70faa3139b57db24cb6c51b0a6.tar.bz2
42-cub3d-903fe03f0f6b1f70faa3139b57db24cb6c51b0a6.tar.xz
42-cub3d-903fe03f0f6b1f70faa3139b57db24cb6c51b0a6.tar.zst
42-cub3d-903fe03f0f6b1f70faa3139b57db24cb6c51b0a6.zip
only one floating sprite, one line / 2 correct, start and end seems flawed
Diffstat (limited to 'src/ft_draw_sprite.c')
-rw-r--r--src/ft_draw_sprite.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c
index 701587f..c81e72b 100644
--- a/src/ft_draw_sprite.c
+++ b/src/ft_draw_sprite.c
@@ -22,6 +22,7 @@ void
{
int32_t d;
+ printf("start x : %d\nstart y : %d\nend x : %d\nend y : %d\n", sprite->drawstartx, sprite->drawstarty, sprite->drawendy, sprite->drawendy);
sprite->x = sprite->drawstartx;
while (sprite->x < sprite->drawendx)
{
@@ -32,7 +33,6 @@ void
sprite->x < (int32_t)cl->wlist->x_size)
while (sprite->y < sprite->drawendy)
{
- puts("qwe");
d = (sprite->y) * 256 - cl->wlist->y_size * 128 +
sprite->spriteheight * 128;
sprite->tex_y = ((d * cl->tlist[4].img_h) /
@@ -40,7 +40,7 @@ void
if (*(cl->tlist[4].ptr + sprite->tex_x + sprite->tex_y *
cl->tlist[4].sizeline / 4))
cl->img.ptr[sprite->x + sprite->y *
- cl->img.sizeline / 4] =
+ cl->img.sizeline] =
*(cl->tlist[4].ptr + sprite->tex_x + sprite->tex_y * cl->tlist[4].sizeline / 4);
sprite->y++;
}