/* ** xSDL.c for in /home/gayot_o/prog/minesweeper/src ** ** Made by olivier gayot ** Login ** ** Started on Wed Apr 25 23:40:24 2012 olivier gayot ** Last update Wed Apr 25 23:40:24 2012 olivier gayot */ #include "minesweeper.h" int xSDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dest, SDL_Rect *dstrect) { int ret; if (dest != scr) ret = SDL_BlitSurface(src, srcrect, dest, dstrect); else { if (SDL_mutexP(mutex) == -1) fprintf(stderr, "Error during SDL_mutexP: %s\n", SDL_GetError()); ret = SDL_BlitSurface(src, srcrect, dest, dstrect); if (SDL_mutexV(mutex) == -1) fprintf(stderr, "Error during SDL_mutexV: %s\n", SDL_GetError()); } return (ret); } void xSDL_Flip(SDL_Surface *surf) { if (surf == scr) SDL_mutexP(mutex); SDL_Flip(surf); if (surf == scr) SDL_mutexV(mutex); }