Use SDL_DOUBLEBUF in all SDL_SetVideoMode() calls, and don't force 16 bits.

By forcing 16 bits for full screen mode, performs drops dramatically on
displays where SDL has to do conversion.
This commit is contained in:
Guus Sliepen 2011-08-24 20:34:26 +02:00
parent f46bbcef69
commit 212b03fa68
3 changed files with 5 additions and 5 deletions

View File

@ -184,7 +184,7 @@ void initSystem()
SDL_WM_SetIcon(loadImage("gfx/alienDevice.png"), NULL); SDL_WM_SetIcon(loadImage("gfx/alienDevice.png"), NULL);
if (currentGame.fullScreen) if (currentGame.fullScreen)
graphics.screen = SDL_SetVideoMode(800, 600, 16, SDL_DOUBLEBUF|SDL_HWPALETTE|SDL_FULLSCREEN); graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_DOUBLEBUF|SDL_HWPALETTE|SDL_FULLSCREEN);
else else
graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_DOUBLEBUF|SDL_HWPALETTE); graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_DOUBLEBUF|SDL_HWPALETTE);

View File

@ -428,7 +428,7 @@ void showOptions(SDL_Surface *optionsSurface)
#if LINUX #if LINUX
SDL_WM_ToggleFullScreen(graphics.screen); SDL_WM_ToggleFullScreen(graphics.screen);
#else #else
graphics.screen = SDL_SetVideoMode(800, 600, 16, SDL_HWSURFACE|SDL_HWPALETTE|SDL_FULLSCREEN); graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_DOUBLEBUF|SDL_HWSURFACE|SDL_HWPALETTE|SDL_FULLSCREEN);
graphics.drawBackground(); graphics.drawBackground();
flushBuffer(); flushBuffer();
#endif #endif
@ -443,7 +443,7 @@ void showOptions(SDL_Surface *optionsSurface)
#if LINUX #if LINUX
SDL_WM_ToggleFullScreen(graphics.screen); SDL_WM_ToggleFullScreen(graphics.screen);
#else #else
graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_HWSURFACE|SDL_HWPALETTE); graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_DOUBLEBUF|SDL_HWSURFACE|SDL_HWPALETTE);
graphics.drawBackground(); graphics.drawBackground();
flushBuffer(); flushBuffer();
#endif #endif

View File

@ -414,9 +414,9 @@ int doTitle()
SDL_WM_ToggleFullScreen(graphics.screen); SDL_WM_ToggleFullScreen(graphics.screen);
#else #else
if (currentGame.fullScreen) if (currentGame.fullScreen)
graphics.screen = SDL_SetVideoMode(800, 600, 16, SDL_HWSURFACE|SDL_HWPALETTE|SDL_FULLSCREEN); graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_DOUBLEBUF|SDL_HWSURFACE|SDL_HWPALETTE|SDL_FULLSCREEN);
else else
graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_HWSURFACE|SDL_HWPALETTE); graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_DOUBLEBUF|SDL_HWSURFACE|SDL_HWPALETTE);
graphics.drawBackground(); graphics.drawBackground();
flushBuffer(); flushBuffer();