diff options
| author | Alfred Eriksson <somerunce@gmail.com> | 2008-11-08 15:44:22 +0000 |
|---|---|---|
| committer | Alfred Eriksson <somerunce@gmail.com> | 2008-11-08 15:44:22 +0000 |
| commit | c54c9a1e5cc170729d766f466ba45b9ec0b33387 (patch) | |
| tree | 71b980d5853e4ae42afcf4c01ae50e3057b1f5c0 | |
| parent | 579065bb222743715ebc305cb090e7e21e39d225 (diff) | |
| download | zcatch-c54c9a1e5cc170729d766f466ba45b9ec0b33387.tar.gz zcatch-c54c9a1e5cc170729d766f466ba45b9ec0b33387.zip | |
gfx_get_video_modes now returns the right number of modes
| -rw-r--r-- | src/engine/client/ec_gfx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c index f1217402..46047c4a 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) |