From 212b03fa6868bc410cf2ab164f92fbf4b93343f2 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Wed, 24 Aug 2011 20:34:26 +0200 Subject: [PATCH] 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. --- code/init.cpp | 2 +- code/intermission.cpp | 4 ++-- code/title.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/init.cpp b/code/init.cpp index 629e728..f4cc051 100644 --- a/code/init.cpp +++ b/code/init.cpp @@ -184,7 +184,7 @@ void initSystem() SDL_WM_SetIcon(loadImage("gfx/alienDevice.png"), NULL); 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 graphics.screen = SDL_SetVideoMode(800, 600, 0, SDL_DOUBLEBUF|SDL_HWPALETTE); diff --git a/code/intermission.cpp b/code/intermission.cpp index 0d55092..7dbd803 100644 --- a/code/intermission.cpp +++ b/code/intermission.cpp @@ -428,7 +428,7 @@ void showOptions(SDL_Surface *optionsSurface) #if LINUX SDL_WM_ToggleFullScreen(graphics.screen); #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(); flushBuffer(); #endif @@ -443,7 +443,7 @@ void showOptions(SDL_Surface *optionsSurface) #if LINUX SDL_WM_ToggleFullScreen(graphics.screen); #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(); flushBuffer(); #endif diff --git a/code/title.cpp b/code/title.cpp index 5dd8da9..38d25be 100644 --- a/code/title.cpp +++ b/code/title.cpp @@ -414,9 +414,9 @@ int doTitle() SDL_WM_ToggleFullScreen(graphics.screen); #else 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 - 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(); flushBuffer();