aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_draw_sprite.c')
-rw-r--r--src/ft_draw_sprite.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c
index 03d3ca7..701587f 100644
--- a/src/ft_draw_sprite.c
+++ b/src/ft_draw_sprite.c
@@ -21,6 +21,7 @@ void
ft_draw_sprite(t_cub *cl, t_sprite *sprite)
{
int32_t d;
+
sprite->x = sprite->drawstartx;
while (sprite->x < sprite->drawendx)
{
@@ -31,14 +32,15 @@ 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) /
- sprite->spriteheight) / 256;
+ sprite->spriteheight) / 128;
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.ptr[sprite->x + sprite->y *
+ cl->img.sizeline / 4] =
*(cl->tlist[4].ptr + sprite->tex_x + sprite->tex_y * cl->tlist[4].sizeline / 4);
sprite->y++;
}