Always set entity size.
This commit is contained in:
parent
19f7afcf0e
commit
3d2000e818
|
@ -91,7 +91,6 @@ static void action(void)
|
|||
static void animate(void)
|
||||
{
|
||||
Sprite *s;
|
||||
SDL_Rect *r;
|
||||
|
||||
s = self->sprite[self->facing];
|
||||
|
||||
|
@ -107,11 +106,6 @@ static void animate(void)
|
|||
self->spriteTime = self->sprite[self->facing]->times[self->spriteFrame];
|
||||
}
|
||||
}
|
||||
|
||||
r = &self->sprite[self->facing]->frames[self->spriteFrame]->rect;
|
||||
|
||||
self->w = r->w;
|
||||
self->h = r->h;
|
||||
}
|
||||
|
||||
static float bounce(float x)
|
||||
|
|
|
@ -59,6 +59,7 @@ void doEntities(void)
|
|||
{
|
||||
Entity *prev, *oldSelf;
|
||||
int camMidX, camMidY, flicker, i;
|
||||
SDL_Rect *r;
|
||||
|
||||
memset(riders, 0, sizeof(Entity*) * MAX_RIDERS);
|
||||
|
||||
|
@ -75,6 +76,11 @@ void doEntities(void)
|
|||
|
||||
for (self = world.entityHead.next ; self != NULL ; self = self->next)
|
||||
{
|
||||
r = &self->sprite[self->facing]->frames[self->spriteFrame]->rect;
|
||||
|
||||
self->w = r->w;
|
||||
self->h = r->h;
|
||||
|
||||
removeFromQuadtree(self, &world.quadtree);
|
||||
|
||||
self->isOnScreen = 0;
|
||||
|
|
Loading…
Reference in New Issue