exit(1);
}
- SDL_LockSurface(s->image);
+ if(SDL_MUSTLOCK(s->image)) { SDL_LockSurface(s->image); }
px = s->image->pixels;
transp = s->image->format->colorkey;
p = s->mask;
}
px = (uint16_t *) ((uint8_t *) px + s->image->pitch - 2*s->image->w);
}
- SDL_UnlockSurface(s->image);
+ if(SDL_MUSTLOCK(s->image)) { SDL_UnlockSurface(s->image); }
}
}
void
-move_sprite(Sprite *s)
+move_sprite(Sprite *s, float ticks)
{
if(s->flags & MOVE) {
- s->x += (s->dx - screendx)*t_frame;
- s->y += (s->dy - screendy)*t_frame;
+ s->x += (s->dx - screendx)*ticks;
+ s->y += (s->dy - screendy)*ticks;
}
}
}
void
-move_sprites(void)
+move_sprites(float ticks)
{
int sq;
Sprite **head;
head=&sprites[set][sq];
while(*head) {
Sprite *s = remove_sprite(head);
- move_sprite(s); sort_sprite(s);
+ move_sprite(s, ticks); sort_sprite(s);
}
}
set = 1-set; // switch to other set of sprites.