From 39ea054b214612ae7d56a01884904dcb63181598 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 17 Jan 2005 23:57:16 +0000 Subject: Added support for hwaccel option. --- src/main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index df5cbeec..758e18f3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -197,11 +197,18 @@ void init_engine() { SDL_WM_SetCaption("The Mana World", NULL); - int displayFlags = SDL_SWSURFACE | SDL_ANYFORMAT; + int displayFlags = SDL_ANYFORMAT; if ((int)config.getValue("screen", 0)) { displayFlags |= SDL_FULLSCREEN; } + if ((int)config.getValue("hwaccel", 0)) { + std::cout << "Attempting to use hardware acceleration.\n"; + displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF; + } + else { + displayFlags |= SDL_SWSURFACE; + } screen = SDL_SetVideoMode(800, 600, 16, displayFlags); if (screen == NULL) { @@ -210,10 +217,6 @@ void init_engine() { exit(1); } - //if (set_gfx_mode((unsigned char)config.getValue("screen", 0), 800, 600, - // 0, 0)) { - //} - // Create the graphics context graphics = new Graphics(); -- cgit v1.2.3-70-g09d2