comparison src/video/SDL_pixels.c @ 845:333db1d87876

Fixed a bug in detecting surface mapping changes
author Sam Lantinga <slouken@libsdl.org>
date Thu, 19 Feb 2004 21:13:24 +0000
parents b8d311d90021
children 3bf4103b2b89
comparison
equal deleted inserted replaced
844:cd0c77df70a4 845:333db1d87876
244 /* 244 /*
245 * Change any previous mappings from/to the new surface format 245 * Change any previous mappings from/to the new surface format
246 */ 246 */
247 void SDL_FormatChanged(SDL_Surface *surface) 247 void SDL_FormatChanged(SDL_Surface *surface)
248 { 248 {
249 surface->format_version++; 249 static int format_version = 0;
250 ++format_version;
251 if ( format_version < 0 ) { /* It wrapped... */
252 format_version = 1;
253 }
254 surface->format_version = format_version;
250 SDL_InvalidateMap(surface->map); 255 SDL_InvalidateMap(surface->map);
251 } 256 }
252 /* 257 /*
253 * Free a previously allocated format structure 258 * Free a previously allocated format structure
254 */ 259 */