summaryrefslogtreecommitdiffstats
path: root/src/app/app.cpp
diff options
context:
space:
mode:
authorerihel <erihel@gmail.com>2012-12-25 21:36:50 +0100
committererihel <erihel@gmail.com>2012-12-25 21:36:50 +0100
commitc793d2d4c67a5556e39300988f42a630fc51e68d (patch)
tree899f076499966b06969399d758700991060ed7ce /src/app/app.cpp
parent1fa5f7a96fb4a1700847ebcf0b07a557da630b10 (diff)
downloadcolobot-c793d2d4c67a5556e39300988f42a630fc51e68d.tar.gz
colobot-c793d2d4c67a5556e39300988f42a630fc51e68d.tar.bz2
colobot-c793d2d4c67a5556e39300988f42a630fc51e68d.zip
* Changed Ret to Get methods in sound module
* Added video settings to profile * Resolution change is now posibble but restart is required
Diffstat (limited to 'src/app/app.cpp')
-rw-r--r--src/app/app.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp
index da4fca4..118e100 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -325,9 +325,6 @@ bool CApplication::Create()
GetLogger()->Debug("Testing gettext translation: '%s'\n", gettext("Colobot rules!"));
- // Temporarily -- only in windowed mode
- m_deviceConfig.fullScreen = false;
-
//Create the sound instance.
if (!GetProfile().InitCurrentDirectory()) {
GetLogger()->Warn("Config not found. Default values will be used!\n");
@@ -383,7 +380,20 @@ bool CApplication::Create()
m_exitCode = 3;
return false;
}
-
+
+ // load settings from profile
+ int iValue;
+ if ( GetProfile().GetLocalProfileInt("Setup", "Resolution", iValue) ) {
+ std::vector<Math::IntPoint> modes;
+ GetVideoResolutionList(modes, true, true);
+ if (static_cast<unsigned int>(iValue) < modes.size())
+ m_deviceConfig.size = modes.at(iValue);
+ }
+
+ if ( GetProfile().GetLocalProfileInt("Setup", "Fullscreen", iValue) ) {
+ m_deviceConfig.fullScreen = (iValue == 1);
+ }
+
if (! CreateVideoSurface())
return false; // dialog is in function
@@ -403,8 +413,7 @@ bool CApplication::Create()
// Don't generate joystick events
SDL_JoystickEventState(SDL_IGNORE);
-
-
+
// The video is ready, we can create and initalize the graphics device
m_device = new Gfx::CGLDevice(m_deviceConfig);
if (! m_device->Create() )