From 57b7512db978db8ba128927598680c215a59b317 Mon Sep 17 00:00:00 2001 From: bgk Date: Wed, 27 Aug 2008 15:48:36 +0000 Subject: [PATCH] SDL : - The filter is now stored as a decimal value in the config file instead of an hexadecimal value as it was undocumented and confused users. Thanks to fhorse for the patch. - Removed an unused variable --- src/sdl/SDL.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sdl/SDL.cpp b/src/sdl/SDL.cpp index 1d7e99bf..36064e2e 100644 --- a/src/sdl/SDL.cpp +++ b/src/sdl/SDL.cpp @@ -420,6 +420,13 @@ u32 sdlFromHex(char *s) return value; } +u32 sdlFromDec(char *s) +{ + u32 value; + sscanf(s, "%u", &value); + return value; +} + #ifdef __MSC__ #define stat _stat #define S_IFDIR _S_IFDIR @@ -740,7 +747,7 @@ void sdlReadPreferences(FILE *f) } else if(!strcmp(key, "gbBiosFile")) { strcpy(gbBiosFileName, value); } else if(!strcmp(key, "filter")) { - filter = (Filter)sdlFromHex(value); + filter = (Filter)sdlFromDec(value); if(filter < kStretch1x || filter >= kInvalidFilter) filter = kStretch2x; } else if(!strcmp(key, "disableStatus")) { @@ -1739,7 +1746,6 @@ void sdlPollEvents() case SDLK_f: if(!(event.key.keysym.mod & MOD_NOCTRL) && (event.key.keysym.mod & KMOD_CTRL)) { - int flags = 0; fullscreen = !fullscreen; sdlInitVideo(); }