diff 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
line wrap: on
line diff
--- a/src/video/SDL_pixels.c	Wed Feb 18 03:57:13 2004 +0000
+++ b/src/video/SDL_pixels.c	Thu Feb 19 21:13:24 2004 +0000
@@ -246,7 +246,12 @@
  */
 void SDL_FormatChanged(SDL_Surface *surface)
 {
-	surface->format_version++;
+	static int format_version = 0;
+	++format_version;
+	if ( format_version < 0 ) { /* It wrapped... */
+		format_version = 1;
+	}
+	surface->format_version = format_version;
 	SDL_InvalidateMap(surface->map);
 }
 /*