From c54c9a1e5cc170729d766f466ba45b9ec0b33387 Mon Sep 17 00:00:00 2001 From: Alfred Eriksson Date: Sat, 8 Nov 2008 15:44:22 +0000 Subject: [PATCH] gfx_get_video_modes now returns the right number of modes --- src/engine/client/ec_gfx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c index f12174023..46047c4a1 100644 --- a/src/engine/client/ec_gfx.c +++ b/src/engine/client/ec_gfx.c @@ -357,7 +357,7 @@ VIDEO_MODE fakemodes[] = { int gfx_get_video_modes(VIDEO_MODE *list, int maxcount) { - int num_modes = 0; + int num_modes = sizeof(fakemodes)/sizeof(VIDEO_MODE); SDL_Rect **modes; if(config.gfx_display_all_modes) @@ -375,6 +375,7 @@ int gfx_get_video_modes(VIDEO_MODE *list, int maxcount) if(modes == NULL) { /* no modes */ + num_modes = 0; } else if(modes == (SDL_Rect**)-1) { @@ -383,6 +384,7 @@ int gfx_get_video_modes(VIDEO_MODE *list, int maxcount) else { int i; + num_modes = 0; for(i = 0; modes[i]; ++i) { if(num_modes == maxcount) @@ -396,7 +398,7 @@ int gfx_get_video_modes(VIDEO_MODE *list, int maxcount) } } - return 1; /* TODO: SDL*/ + return num_modes; } void gfx_set_vsync(int val)