From 454b4b759345ce1fed0d2ee61733975fe3d84017 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Tue, 5 Apr 2005 21:27:49 +0000 Subject: Cleaning and fixing setup window --- src/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index d1e43560..3e9d1adf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -65,6 +65,7 @@ char map_name[16]; unsigned char state; unsigned char screen_mode; char *dir = NULL; +int displayFlags, screenW, screenH, bitDepth; Sound sound; @@ -189,7 +190,7 @@ void init_engine() SDL_WM_SetCaption("The Mana World", NULL); - int displayFlags = SDL_ANYFORMAT; + displayFlags = SDL_ANYFORMAT; if ((int)config.getValue("screen", 0) == 1) { displayFlags |= SDL_FULLSCREEN; @@ -207,10 +208,15 @@ void init_engine() SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); #endif - screen = SDL_SetVideoMode(800, 600, 16, displayFlags); + // TODO: the following variables should be loaded from config file + screenW = 800; + screenH = 600; + bitDepth = 16; + + screen = SDL_SetVideoMode(screenW, screenH, bitDepth, displayFlags); if (screen == NULL) { - std::cerr << "Couldn't set 800x600x16 video mode: " << - SDL_GetError() << std::endl; + std::cerr << "Couldn't set " << screenW << "x" << screenH << "x" << + bitDepth << " video mode: " << SDL_GetError() << std::endl; exit(1); } -- cgit v1.2.3-70-g09d2