X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=sprite.c;h=3898123ab222ff02c50d1f4c613a2a0c577a8f44;hp=447e4827525329005a673f07b098d5115227d902;hb=e3edccb30438fa531aca19132a7ca532d3ac5dc9;hpb=9a9572d121946fef90a24ea5514a0c3ca33b1ae5 diff --git a/sprite.c b/sprite.c index 447e482..3898123 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); } }