X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=sprite.c;h=6a20442a4080d993ca30e2aa52112f044f1461e0;hp=36ca546bec9dc63e6ac04fad88237b50b1fe6205;hb=100372ba9cc83542b9d9894001d70f40e28f8f4b;hpb=2cd765cf4e0de31198729cafee801c205e77bdc3 diff --git a/sprite.c b/sprite.c index 36ca546..6a20442 100644 --- a/sprite.c +++ b/sprite.c @@ -48,7 +48,7 @@ get_shape(Sprite *s) 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; @@ -62,7 +62,7 @@ get_shape(Sprite *s) } 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); } }