From 9824ccf5946c86df1cf497b797c5f3da5d481d28 Mon Sep 17 00:00:00 2001 From: "madcamel@gmail.com" Date: Sat, 16 Oct 2010 14:35:24 +0200 Subject: 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. --- src/resources/image.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/resources/image.cpp') 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 #include @@ -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; -- cgit v1.2.3-70-g09d2