/* 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
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) {
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;