summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-10-22 12:52:35 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-10-22 12:52:35 +0200
commitdbac793645654ac6715e6adecfd9d4a4a1fd8551 (patch)
tree52550aeeb8caec936897a792236300f86aad3884 /src/client.cpp
parenta9bcae9f81d97f67ab21cd26a099449cf0746137 (diff)
downloadmana-client-dbac793645654ac6715e6adecfd9d4a4a1fd8551.tar.gz
mana-client-dbac793645654ac6715e6adecfd9d4a4a1fd8551.tar.bz2
mana-client-dbac793645654ac6715e6adecfd9d4a4a1fd8551.tar.xz
mana-client-dbac793645654ac6715e6adecfd9d4a4a1fd8551.zip
Turned the OpenGL and disable transparency options as static members.
- Now OpenGL and the transparency disabling are set at startup and not read again for displaying graphics, preventing graphic errors before startup. - We also agreed long time ago that SDL specific functions should have a SDL prefix. The header has been rearranged a bit to do so. - Also fixed a possible discrepancy in the hasAlphaChannel() function. Reviewed-by: CodyMartin. Resolves: Mana-Mantis: #260.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 2681a254..3ed3fb34 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -253,7 +253,7 @@ Client::Client(const Options &options):
"Exiting.", mLocalDataDir.c_str()));
}
- Image::setEnableAlphaCache(config.getValue("alphaCache", true));
+ Image::SDLsetEnableAlphaCache(config.getValue("alphaCache", true));
#if defined __APPLE__
CFBundleRef mainBundle = CFBundleGetMainBundle();
@@ -317,9 +317,14 @@ Client::Client(const Options &options):
}
#endif
-#ifdef USE_OPENGL
bool useOpenGL = !mOptions.noOpenGL && (config.getValue("opengl", 0) == 1);
+ // Set up the transparency option for low CPU when not using OpenGL.
+ if (!useOpenGL && (config.getValue("lowcpu", 0) == 1))
+ Image::SDLdisableTransparency();
+
+#ifdef USE_OPENGL
+
// Setup image loading for the right image format
Image::setLoadAsOpenGL(useOpenGL);