src/SDL_compat.c
changeset 3034 0e821769fc51
parent 3032 77c3e67f0740
child 3098 5f372cef955d
--- a/src/SDL_compat.c	Mon Jan 12 22:36:12 2009 +0000
+++ b/src/SDL_compat.c	Tue Jan 13 03:53:22 2009 +0000
@@ -114,7 +114,7 @@
 }
 
 SDL_Rect **
-SDL_ListModes(SDL_PixelFormat * format, Uint32 flags)
+SDL_ListModes(const SDL_PixelFormat * format, Uint32 flags)
 {
     int i, nmodes;
     SDL_Rect **modes;
@@ -127,6 +127,10 @@
         return (SDL_Rect **) (-1);
     }
 
+    if (!format) {
+        format = SDL_GetVideoInfo()->vfmt;
+    }
+
     /* Memory leak, but this is a compatibility function, who cares? */
     nmodes = 0;
     modes = NULL;