Client: Image Alpha

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: 03 Feb 2008, 09:17
Location: Ohio, USA
Contact:

Client: Image Alpha

Post 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
- Leeor

"Oh, no thanks. I ate a boulder on the way in." - Shrek
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: 03 Feb 2008, 09:17
Location: Ohio, USA
Contact:

Re: Client: Image Alpha

Post 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!
- Leeor

"Oh, no thanks. I ate a boulder on the way in." - Shrek
Post Reply