X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=SFont.c;h=9665d989e099770944678c0bb0e25ae05e91be48;hp=7e750bf1b5daa1df9105e5d1b4e179967bff4729;hb=76c0b11e970a4f5b73b97cd83a119bff0ea6c1f4;hpb=6f82bba8833f187abebab53375ac87905487cf8c diff --git a/SFont.c b/SFont.c index 7e750bf..9665d98 100644 --- a/SFont.c +++ b/SFont.c @@ -1,7 +1,6 @@ /* SFont: a simple font library that uses special images as fonts Copyright (C) 2003 Karl Bartel - License: GPL or LGPL (at your choice) WWW: http://www.linux-games.com/sfont/ This program is free software; you can redistribute it and/or modify @@ -80,7 +79,7 @@ SFont_InitFont(SDL_Surface* Surface) Font = (SFont_Font *) malloc(sizeof(SFont_Font)); Font->Surface = Surface; - SDL_LockSurface(Surface); + if(SDL_MUSTLOCK(Surface)) { SDL_LockSurface(Surface); } pink = SDL_MapRGB(Surface->format, 255, 0, 255); while (x < Surface->w) { @@ -95,7 +94,7 @@ SFont_InitFont(SDL_Surface* Surface) Font->MaxPos = x-1; pixel = GetPixel(Surface, 0, Surface->h-1); - SDL_UnlockSurface(Surface); + if(SDL_MUSTLOCK(Surface)) { SDL_UnlockSurface(Surface); } SDL_SetColorKey(Surface, SDL_SRCCOLORKEY, pixel); return Font;