summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-10-18 18:39:48 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-10-18 18:39:48 +0000
commit86441fda9c561dd264039edc68ddabbf7cb54ce2 (patch)
treef9d15edf9587bc149a42399369bfcf3b9d5c5b27 /src/main.cpp
parentd3ab0ef7be4c1f0098acc08748c308091e75dfff (diff)
downloadmana-86441fda9c561dd264039edc68ddabbf7cb54ce2.tar.gz
mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.tar.bz2
mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.tar.xz
mana-86441fda9c561dd264039edc68ddabbf7cb54ce2.zip
Merged removal of dependency on Guichan OpenGL from trunk to 0.0 branch,
including optimization of OpenGL memory usage on modern OpenGL drivers. Patches by Guillaume Melquiond.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c6544017..be36ac4f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -288,17 +288,18 @@ void init_engine(const Options &options)
graphics = new Graphics();
#endif
- int width = (int)config.getValue("screenwidth", 800);
- int height = (int)config.getValue("screenheight", 600);
+ int width = (int) config.getValue("screenwidth", defaultScreenWidth);
+ int height = (int) config.getValue("screenheight", defaultScreenHeight);
int bpp = 0;
- bool fullscreen = ((int)config.getValue("screen", 0) == 1);
- bool hwaccel = ((int)config.getValue("hwaccel", 0) == 1);
+ bool fullscreen = ((int) config.getValue("screen", 0) == 1);
+ bool hwaccel = ((int) config.getValue("hwaccel", 0) == 1);
// Try to set the desired video mode
if (!graphics->setVideoMode(width, height, bpp, fullscreen, hwaccel))
{
- std::cerr << "Couldn't set " << width << "x" << height << "x" <<
- bpp << " video mode: " << SDL_GetError() << std::endl;
+ std::cerr << "Couldn't set "
+ << width << "x" << height << "x" << bpp << " video mode: "
+ << SDL_GetError() << std::endl;
exit(1);
}
@@ -316,8 +317,10 @@ void init_engine(const Options &options)
if (config.getValue("sound", 0) == 1) {
sound.init();
}
- sound.setSfxVolume((int) config.getValue("sfxVolume", 100));
- sound.setMusicVolume((int) config.getValue("musicVolume", 60));
+ sound.setSfxVolume((int) config.getValue("sfxVolume",
+ defaultSfxVolume));
+ sound.setMusicVolume((int) config.getValue("musicVolume",
+ defaultMusicVolume));
}
catch (const char *err) {
state = ERROR_STATE;