summaryrefslogtreecommitdiff
path: root/src/resources/image.cpp
diff options
context:
space:
mode:
authormadcamel@gmail.com <madcamel@gmail.com>2010-10-16 14:35:24 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-10-17 00:35:41 +0200
commit9824ccf5946c86df1cf497b797c5f3da5d481d28 (patch)
treee4fde49c98b6352c5336e4a16d551417fcf256cd /src/resources/image.cpp
parentbc409be3aa785f3646ad0f2372a3da9cf0783c77 (diff)
downloadmana-client-9824ccf5946c86df1cf497b797c5f3da5d481d28.tar.gz
mana-client-9824ccf5946c86df1cf497b797c5f3da5d481d28.tar.bz2
mana-client-9824ccf5946c86df1cf497b797c5f3da5d481d28.tar.xz
mana-client-9824ccf5946c86df1cf497b797c5f3da5d481d28.zip
Added Low CPU Mode toggle in video setup. Defaults to On.
This disables the Image::setAlpha() function, which uses 60% of the client's CPU cycles. When enabled, visual quality is slightly decreased, especially with the particle system. Toggling this setting On from an Off state requires a client restart or the graphics look quite funny. Bertram's addition: - Renamed 'Low CPU' to 'Disable transparency (Low CPU)' in the gui for better understanding. - Removed the sprite display with 30% opacity when disabling transparency since it made monsters and drops be drawn above all layers at full opacity. - Made the OpenGL mode disable the 'low CPU mode'. - Fixed the GUI logic as much as possible. Please note that the GUI opacity slider stays enabled when transparency is disabled even if told to be disabled in that case. Reviewed-by: CodyMartin, 4144, MadCamel.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r--src/resources/image.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index cd6bda15..42a6ab56 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -29,6 +29,7 @@
#endif
#include "log.h"
+#include "configuration.h"
#include <SDL_image.h>
#include <SDL_rotozoom.h>
@@ -242,6 +243,9 @@ SDL_Surface *Image::getByAlpha(float alpha)
void Image::setAlpha(float alpha)
{
+ if (config.getValue("lowcpu", true) == true)
+ return;
+
if (mAlpha == alpha)
return;