summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-16 20:54:00 +0100
committerIra Rice <irarice@gmail.com>2009-02-16 14:49:03 -0700
commit4924e4a50ae31c30f783285f6e10ac3651c1e6e8 (patch)
tree6c0250fa3d53fc24fe4547cb55268aecf6fd5544
parent5216cdc6569b9c7db80529ae9b4c00ea0d14abbc (diff)
downloadmana-4924e4a50ae31c30f783285f6e10ac3651c1e6e8.tar.gz
mana-4924e4a50ae31c30f783285f6e10ac3651c1e6e8.tar.bz2
mana-4924e4a50ae31c30f783285f6e10ac3651c1e6e8.tar.xz
mana-4924e4a50ae31c30f783285f6e10ac3651c1e6e8.zip
Fixed GUI opacity in SDL mode
By using indexed instead of alpha-layered images, the GUI opacity can also be supported in software mode.
-rw-r--r--data/graphics/gui/button.pngbin481 -> 360 bytes
-rw-r--r--data/graphics/gui/button_disabled.pngbin358 -> 222 bytes
-rw-r--r--data/graphics/gui/buttonhi.pngbin480 -> 360 bytes
-rw-r--r--data/graphics/gui/buttonpress.pngbin424 -> 344 bytes
-rw-r--r--data/graphics/gui/close_button.pngbin637 -> 471 bytes
-rw-r--r--data/graphics/gui/deepbox.pngbin307 -> 219 bytes
-rw-r--r--data/graphics/gui/default.pngbin1461 -> 832 bytes
-rw-r--r--data/graphics/gui/hscroll_left_default.pngbin402 -> 339 bytes
-rw-r--r--data/graphics/gui/hscroll_left_highlight.pngbin381 -> 300 bytes
-rw-r--r--data/graphics/gui/hscroll_left_pressed.pngbin356 -> 323 bytes
-rw-r--r--data/graphics/gui/hscroll_right_default.pngbin346 -> 325 bytes
-rw-r--r--data/graphics/gui/hscroll_right_highlight.pngbin379 -> 330 bytes
-rw-r--r--data/graphics/gui/hscroll_right_pressed.pngbin351 -> 325 bytes
-rw-r--r--data/graphics/gui/item_shortcut_bgr.pngbin1366 -> 810 bytes
-rw-r--r--data/graphics/gui/radioin.pngbin438 -> 460 bytes
-rw-r--r--data/graphics/gui/radioout.pngbin346 -> 310 bytes
-rw-r--r--data/graphics/gui/resize.pngbin518 -> 417 bytes
-rw-r--r--data/graphics/gui/slider.pngbin615 -> 472 bytes
-rw-r--r--data/graphics/gui/speech_bubble.pngbin2031 -> 1139 bytes
-rw-r--r--data/graphics/gui/tab.pngbin427 -> 330 bytes
-rw-r--r--data/graphics/gui/tabselected.pngbin407 -> 309 bytes
-rw-r--r--data/graphics/gui/vscroll_blue.pngbin476 -> 338 bytes
-rw-r--r--data/graphics/gui/vscroll_down_default.pngbin350 -> 330 bytes
-rw-r--r--data/graphics/gui/vscroll_down_highlight.pngbin378 -> 339 bytes
-rw-r--r--data/graphics/gui/vscroll_down_pressed.pngbin369 -> 333 bytes
-rw-r--r--data/graphics/gui/vscroll_grey.pngbin452 -> 334 bytes
-rw-r--r--data/graphics/gui/vscroll_red.pngbin471 -> 338 bytes
-rw-r--r--data/graphics/gui/vscroll_up_default.pngbin359 -> 329 bytes
-rw-r--r--data/graphics/gui/vscroll_up_highlight.pngbin381 -> 338 bytes
-rw-r--r--data/graphics/gui/vscroll_up_pressed.pngbin345 -> 314 bytes
-rw-r--r--src/gui/checkbox.cpp14
-rw-r--r--src/gui/progressbar.cpp11
32 files changed, 10 insertions, 15 deletions
diff --git a/data/graphics/gui/button.png b/data/graphics/gui/button.png
index ff50a908..77123707 100644
--- a/data/graphics/gui/button.png
+++ b/data/graphics/gui/button.png
Binary files differ
diff --git a/data/graphics/gui/button_disabled.png b/data/graphics/gui/button_disabled.png
index cb5a1b01..00cdb650 100644
--- a/data/graphics/gui/button_disabled.png
+++ b/data/graphics/gui/button_disabled.png
Binary files differ
diff --git a/data/graphics/gui/buttonhi.png b/data/graphics/gui/buttonhi.png
index da30f283..a308c6c0 100644
--- a/data/graphics/gui/buttonhi.png
+++ b/data/graphics/gui/buttonhi.png
Binary files differ
diff --git a/data/graphics/gui/buttonpress.png b/data/graphics/gui/buttonpress.png
index 4c45a45f..439634aa 100644
--- a/data/graphics/gui/buttonpress.png
+++ b/data/graphics/gui/buttonpress.png
Binary files differ
diff --git a/data/graphics/gui/close_button.png b/data/graphics/gui/close_button.png
index a0a6d144..4c0356fb 100644
--- a/data/graphics/gui/close_button.png
+++ b/data/graphics/gui/close_button.png
Binary files differ
diff --git a/data/graphics/gui/deepbox.png b/data/graphics/gui/deepbox.png
index 0980f57e..39ee2032 100644
--- a/data/graphics/gui/deepbox.png
+++ b/data/graphics/gui/deepbox.png
Binary files differ
diff --git a/data/graphics/gui/default.png b/data/graphics/gui/default.png
index 29353df8..93877ad8 100644
--- a/data/graphics/gui/default.png
+++ b/data/graphics/gui/default.png
Binary files differ
diff --git a/data/graphics/gui/hscroll_left_default.png b/data/graphics/gui/hscroll_left_default.png
index 6d21e7c0..eac8bc59 100644
--- a/data/graphics/gui/hscroll_left_default.png
+++ b/data/graphics/gui/hscroll_left_default.png
Binary files differ
diff --git a/data/graphics/gui/hscroll_left_highlight.png b/data/graphics/gui/hscroll_left_highlight.png
index 1dd79658..fa37f442 100644
--- a/data/graphics/gui/hscroll_left_highlight.png
+++ b/data/graphics/gui/hscroll_left_highlight.png
Binary files differ
diff --git a/data/graphics/gui/hscroll_left_pressed.png b/data/graphics/gui/hscroll_left_pressed.png
index 92478ec8..c893406a 100644
--- a/data/graphics/gui/hscroll_left_pressed.png
+++ b/data/graphics/gui/hscroll_left_pressed.png
Binary files differ
diff --git a/data/graphics/gui/hscroll_right_default.png b/data/graphics/gui/hscroll_right_default.png
index 94c0efeb..04bcec2f 100644
--- a/data/graphics/gui/hscroll_right_default.png
+++ b/data/graphics/gui/hscroll_right_default.png
Binary files differ
diff --git a/data/graphics/gui/hscroll_right_highlight.png b/data/graphics/gui/hscroll_right_highlight.png
index ef56538f..598f7f29 100644
--- a/data/graphics/gui/hscroll_right_highlight.png
+++ b/data/graphics/gui/hscroll_right_highlight.png
Binary files differ
diff --git a/data/graphics/gui/hscroll_right_pressed.png b/data/graphics/gui/hscroll_right_pressed.png
index 36cff58a..da9113d1 100644
--- a/data/graphics/gui/hscroll_right_pressed.png
+++ b/data/graphics/gui/hscroll_right_pressed.png
Binary files differ
diff --git a/data/graphics/gui/item_shortcut_bgr.png b/data/graphics/gui/item_shortcut_bgr.png
index 01f1643a..cdc12dd4 100644
--- a/data/graphics/gui/item_shortcut_bgr.png
+++ b/data/graphics/gui/item_shortcut_bgr.png
Binary files differ
diff --git a/data/graphics/gui/radioin.png b/data/graphics/gui/radioin.png
index 9034f469..de43c28a 100644
--- a/data/graphics/gui/radioin.png
+++ b/data/graphics/gui/radioin.png
Binary files differ
diff --git a/data/graphics/gui/radioout.png b/data/graphics/gui/radioout.png
index 4e088943..26287484 100644
--- a/data/graphics/gui/radioout.png
+++ b/data/graphics/gui/radioout.png
Binary files differ
diff --git a/data/graphics/gui/resize.png b/data/graphics/gui/resize.png
index 9890f83f..327787a0 100644
--- a/data/graphics/gui/resize.png
+++ b/data/graphics/gui/resize.png
Binary files differ
diff --git a/data/graphics/gui/slider.png b/data/graphics/gui/slider.png
index 32adf4f7..c0a3b6f2 100644
--- a/data/graphics/gui/slider.png
+++ b/data/graphics/gui/slider.png
Binary files differ
diff --git a/data/graphics/gui/speech_bubble.png b/data/graphics/gui/speech_bubble.png
index 3e678099..3f17af8c 100644
--- a/data/graphics/gui/speech_bubble.png
+++ b/data/graphics/gui/speech_bubble.png
Binary files differ
diff --git a/data/graphics/gui/tab.png b/data/graphics/gui/tab.png
index 71de8c8b..b277a5f8 100644
--- a/data/graphics/gui/tab.png
+++ b/data/graphics/gui/tab.png
Binary files differ
diff --git a/data/graphics/gui/tabselected.png b/data/graphics/gui/tabselected.png
index 98dd41c6..d84fabc7 100644
--- a/data/graphics/gui/tabselected.png
+++ b/data/graphics/gui/tabselected.png
Binary files differ
diff --git a/data/graphics/gui/vscroll_blue.png b/data/graphics/gui/vscroll_blue.png
index 295ca1a5..95708aba 100644
--- a/data/graphics/gui/vscroll_blue.png
+++ b/data/graphics/gui/vscroll_blue.png
Binary files differ
diff --git a/data/graphics/gui/vscroll_down_default.png b/data/graphics/gui/vscroll_down_default.png
index 4bf696b0..5c4c30cd 100644
--- a/data/graphics/gui/vscroll_down_default.png
+++ b/data/graphics/gui/vscroll_down_default.png
Binary files differ
diff --git a/data/graphics/gui/vscroll_down_highlight.png b/data/graphics/gui/vscroll_down_highlight.png
index a7459745..47c9d155 100644
--- a/data/graphics/gui/vscroll_down_highlight.png
+++ b/data/graphics/gui/vscroll_down_highlight.png
Binary files differ
diff --git a/data/graphics/gui/vscroll_down_pressed.png b/data/graphics/gui/vscroll_down_pressed.png
index e6238024..dfea0eb8 100644
--- a/data/graphics/gui/vscroll_down_pressed.png
+++ b/data/graphics/gui/vscroll_down_pressed.png
Binary files differ
diff --git a/data/graphics/gui/vscroll_grey.png b/data/graphics/gui/vscroll_grey.png
index 4d950a32..8bb4180e 100644
--- a/data/graphics/gui/vscroll_grey.png
+++ b/data/graphics/gui/vscroll_grey.png
Binary files differ
diff --git a/data/graphics/gui/vscroll_red.png b/data/graphics/gui/vscroll_red.png
index 0e50513c..bcc45c89 100644
--- a/data/graphics/gui/vscroll_red.png
+++ b/data/graphics/gui/vscroll_red.png
Binary files differ
diff --git a/data/graphics/gui/vscroll_up_default.png b/data/graphics/gui/vscroll_up_default.png
index c08a2b2a..2556998f 100644
--- a/data/graphics/gui/vscroll_up_default.png
+++ b/data/graphics/gui/vscroll_up_default.png
Binary files differ
diff --git a/data/graphics/gui/vscroll_up_highlight.png b/data/graphics/gui/vscroll_up_highlight.png
index 2f5ffade..3cbcd861 100644
--- a/data/graphics/gui/vscroll_up_highlight.png
+++ b/data/graphics/gui/vscroll_up_highlight.png
Binary files differ
diff --git a/data/graphics/gui/vscroll_up_pressed.png b/data/graphics/gui/vscroll_up_pressed.png
index 102bac86..8762d118 100644
--- a/data/graphics/gui/vscroll_up_pressed.png
+++ b/data/graphics/gui/vscroll_up_pressed.png
Binary files differ
diff --git a/src/gui/checkbox.cpp b/src/gui/checkbox.cpp
index 7a3e2fde..413c28d0 100644
--- a/src/gui/checkbox.cpp
+++ b/src/gui/checkbox.cpp
@@ -46,13 +46,10 @@ CheckBox::CheckBox(const std::string& caption, bool selected):
checkBoxChecked = checkBox->getSubImage(9, 0, 9, 10);
checkBoxDisabled = checkBox->getSubImage(18, 0, 9, 10);
checkBoxDisabledChecked = checkBox->getSubImage(27, 0, 9, 10);
- if (config.getValue("opengl", 0))
- {
- checkBoxNormal->setAlpha(mAlpha);
- checkBoxChecked->setAlpha(mAlpha);
- checkBoxDisabled->setAlpha(mAlpha);
- checkBoxDisabledChecked->setAlpha(mAlpha);
- }
+ checkBoxNormal->setAlpha(mAlpha);
+ checkBoxChecked->setAlpha(mAlpha);
+ checkBoxDisabled->setAlpha(mAlpha);
+ checkBoxDisabledChecked->setAlpha(mAlpha);
checkBox->decRef();
}
@@ -88,8 +85,7 @@ void CheckBox::drawBox(gcn::Graphics* graphics)
else
box = checkBoxDisabled;
- if (config.getValue("guialpha", 0.8) != mAlpha &&
- config.getValue("opengl", 0))
+ if (config.getValue("guialpha", 0.8) != mAlpha)
{
mAlpha = config.getValue("guialpha", 0.8);
checkBoxNormal->setAlpha(mAlpha);
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index 7463d4cc..bec86bb1 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -104,10 +104,7 @@ void ProgressBar::draw(gcn::Graphics *graphics)
{
if (config.getValue("guialpha", 0.8) != mAlpha)
{
- if (config.getValue("opengl", 0))
- mAlpha = config.getValue("guialpha", 0.8);
- else
- mAlpha = 1.0f;
+ mAlpha = config.getValue("guialpha", 0.8);
for (int i = 0; i < 9; i++)
{
mBorder.grid[i]->setAlpha(mAlpha);
@@ -120,7 +117,8 @@ void ProgressBar::draw(gcn::Graphics *graphics)
const int alpha = (int)(mAlpha * 255.0f);
// The bar
- if (mProgress > 0) {
+ if (mProgress > 0)
+ {
graphics->setColor(gcn::Color(mRed, mGreen, mBlue, alpha));
graphics->fillRectangle(gcn::Rectangle(4, 4,
@@ -129,7 +127,8 @@ void ProgressBar::draw(gcn::Graphics *graphics)
}
// The label
- if (!mText.empty()) {
+ if (!mText.empty())
+ {
gcn::Font *f = boldFont;
const int textX = getWidth() / 2;
const int textY = (getHeight() - f->getHeight()) / 2;