Page 1 of 1

Client: Image Alpha

Posted: 04 Jun 2008, 19:40
by leeor_net
Hello, again.

I've been making a few changes to the codebase for LoM and came across an... interesting... problem. In particular, I can't seem to get image Alpha's to look/work properly. To describe the problem further:

I've been working a bit on the GUI framework, particularly Windows to allow for skinning support. This required that I modify the static member variable 'ImageRect border;' to 'Image *border[9];'. This works -- but the image transparency broke. So despite the fact that the code is indeed setting the image alpha using image->setAlpha(float) but clearly the transparency isn't working properly.

I have a logger message printing out information regarding all of this and it tells me that the alpha value for the image is indeed at the value I set it to:

Code: Select all

[19:14:49.97] Window::setGuiAlpha: Alpha Value 0.745055
[19:14:49.97] Window::setGuiAlpha: Border[0] Alpha: 0.745055
[19:14:49.97] Window::setGuiAlpha: Border[1] Alpha: 0.745055
[19:14:49.97] Window::setGuiAlpha: Border[2] Alpha: 0.745055
[19:14:49.97] Window::setGuiAlpha: Border[3] Alpha: 0.745055
[19:14:49.97] Window::setGuiAlpha: Border[4] Alpha: 0.745055
[19:14:49.97] Window::setGuiAlpha: Border[5] Alpha: 0.745055
[19:14:49.97] Window::setGuiAlpha: Border[6] Alpha: 0.745055
[19:14:49.97] Window::setGuiAlpha: Border[7] Alpha: 0.745055
[19:14:49.97] Window::setGuiAlpha: Border[8] Alpha: 0.745055
Now, I've looked around at the code including that in MiniMap (minimap.cpp, Line 65: mMapImage->setAlpha(0.7);) which appears to do exactly the same thing my code does: (window.cpp, Line 572: border->setAlpha(config.getValue("guialpha", 0.8));)... yet the alpha doesn't work.

Any clues?

P.S.
These are links to the SVN code on SourceForge. It may be useful to find an explanation for why it isn't working properly:
window.cpp
window.h

Re: Client: Image Alpha

Posted: 14 Jun 2008, 00:30
by leeor_net
lol -- you're not going to believe this, but I solved my own problem by accident. It never occured to me that software mode doesn't render images with an alpha channel... OpenGL mode on, image alpha's working perfectly.

Talk about a <slap forehead> moment!