diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-03-19 13:47:35 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-03-19 13:47:35 +0000 |
commit | d8bb10d04c8b0d42dd774bef8531564413267276 (patch) | |
tree | 6545b8d2fb771f1cc45a6b308054acbcb069b51d /src | |
parent | 0f7927ab8aadc2c6f42c70d2809b357efc4ddb2f (diff) | |
download | mana-d8bb10d04c8b0d42dd774bef8531564413267276.tar.gz mana-d8bb10d04c8b0d42dd774bef8531564413267276.tar.bz2 mana-d8bb10d04c8b0d42dd774bef8531564413267276.tar.xz mana-d8bb10d04c8b0d42dd774bef8531564413267276.zip |
Added config option for GUI alpha.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/window.cpp | 8 | ||||
-rw-r--r-- | src/gui/window.h | 1 | ||||
-rw-r--r-- | src/main.cpp | 6 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp index a04836a2..13f0cc9a 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -24,6 +24,7 @@ #include "window.h" #include "../resources/resourcemanager.h" #include "../log.h" +#include "../main.h" WindowContainer *Window::windowContainer = NULL; @@ -77,6 +78,9 @@ Window::Window(const std::string& text, bool modal, Window *parent): else { throw GCN_EXCEPTION("Window::Window. no windowContainer set"); } + + // Load GUI alpha setting + guiAlpha = config.getValue("guialpha", 0.8f); } Window::~Window() @@ -101,8 +105,8 @@ void Window::draw(gcn::Graphics* graphics) int x, y; getAbsolutePosition(x, y); - dBackground->setAlpha(0.8f); - dBorders->setAlpha(0.8f); + dBackground->setAlpha(guiAlpha); + dBorders->setAlpha(guiAlpha); ((Graphics*)graphics)->drawImageRect(x, y, getWidth(), getHeight(), border); diff --git a/src/gui/window.h b/src/gui/window.h index 143c8235..deb00583 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -50,6 +50,7 @@ class Window : public gcn::Container, public gcn::MouseListener gcn::Color titlebarColor; /**< Title bar color */ int titlebarHeight; /**< Height of title bar */ int padding; /**< Space between contents and border */ + float guiAlpha; /**< Opacity of GUI windows */ Image *dBackground; /**< Left side of title bar */ Image *dBorders; /**< Middle of title bar */ diff --git a/src/main.cpp b/src/main.cpp index a48b184b..8d36531d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,14 +33,11 @@ #include <iostream> #include <guichan.hpp> -#include <SDL/SDL.h> #include <physfs.h> #include <libxml/xmlversion.h> #include <libxml/parser.h> - -#ifdef USE_OPENGL +#include <SDL.h> #include <SDL_opengl.h> -#endif #ifdef __USE_UNIX98 #include <sys/stat.h> @@ -174,6 +171,7 @@ void init_engine() config.setValue("hwaccel", 0); config.setValue("screen", 0); config.setValue("sound", 1); + config.setValue("guialpha", 0.8f); #ifdef __USE_UNIX98 char *chatlogFilename = new char[400]; sprintf(chatlogFilename, "%s/.manaworld/chatlog.txt", userHome); |