Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bumped version number
[vor.git]
/
sprite.c
diff --git
a/sprite.c
b/sprite.c
index
36ca546
..
3898123
100644
(file)
--- a/
sprite.c
+++ b/
sprite.c
@@
-48,7
+48,7
@@
get_shape(Sprite *s)
exit(1);
}
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 = s->image->pixels;
transp = s->image->format->colorkey;
p = s->mask;
@@
-62,7
+62,7
@@
get_shape(Sprite *s)
}
px = (uint16_t *) ((uint8_t *) px + s->image->pitch - 2*s->image->w);
}
}
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); }
}
}
@@
-128,11
+128,11
@@
reset_sprites(void)
}
void
}
void
-move_sprite(Sprite *s, float ticks)
+move_sprite(Sprite *s)
{
if(s->flags & MOVE) {
{
if(s->flags & MOVE) {
- s->x += (s->dx - screendx)*ticks;
- s->y += (s->dy - screendy)*ticks;
+ s->x += (s->dx - screendx)*t_frame;
+ s->y += (s->dy - screendy)*t_frame;
}
}
}
}
@@
-148,7
+148,7
@@
sort_sprite(Sprite *s)
}
void
}
void
-move_sprites(float ticks)
+move_sprites(void)
{
int sq;
Sprite **head;
{
int sq;
Sprite **head;
@@
-158,7
+158,7
@@
move_sprites(float ticks)
head=&sprites[set][sq];
while(*head) {
Sprite *s = remove_sprite(head);
head=&sprites[set][sq];
while(*head) {
Sprite *s = remove_sprite(head);
- move_sprite(s, ticks); sort_sprite(s);
+ move_sprite(s); sort_sprite(s);
}
}
set = 1-set; // switch to other set of sprites.
}
}
set = 1-set; // switch to other set of sprites.