diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-04-05 21:27:49 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-04-05 21:27:49 +0000 |
commit | 454b4b759345ce1fed0d2ee61733975fe3d84017 (patch) | |
tree | 1c20e4c78d7b84ced44b6542d748eddf6c077abd /src/main.cpp | |
parent | f381620a6bdbc956cbfdd7f7e29f6539f6ce58c9 (diff) | |
download | mana-454b4b759345ce1fed0d2ee61733975fe3d84017.tar.gz mana-454b4b759345ce1fed0d2ee61733975fe3d84017.tar.bz2 mana-454b4b759345ce1fed0d2ee61733975fe3d84017.tar.xz mana-454b4b759345ce1fed0d2ee61733975fe3d84017.zip |
Cleaning and fixing setup window
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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); } |