[fixed] Missing Icons in File Dialog Window

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
drewbacca
Posts: 38
Joined: Tue Jan 30, 2007 6:49 pm

[fixed] Missing Icons in File Dialog Window

Post by drewbacca »

Sometime after the Irrlicht 1.2 release, the file/directory icons next to the files disappeared unless you select a file. Thinking about things further, I figured that the colors just got swapped so I checked the source code. The code that draws the listbox is in CGUIListBox.cpp in draw() and the original code is:

Code: Select all

IconBank->draw2DSprite( (u32)Items[i].icon, iconPos, &clientClip, skin->getColor((i==Selected) ? EGDC_ICON_HIGH_LIGHT : EGDC_ICON), (i==Selected) ? selectTime : 0 , (i==Selected) ? os::Timer::getTime() : 0, false, true);

I recompiled the dll just swapping the EGDC_ICON_HIGH_LIGHT, EGDC_ICON values and the icons were properly visible again. Do the color definitions for these enums need to be swapped?
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

oops, yes you're right, I broke this :oops:
Problem is that the gui icons in the built-in font are white, and so is the background of the listbox. if changed and the icons were replaced by more colourful sprites, then the unselected icons would be painted black.
I guess the built-in font needs editing so that the icons have a nice colour (say with a black outline) in the first place, then they can change colour properly on selection.

edit:
okay I changed builtInFont.h so the icons have borders, and included the source bitmap. The skin value for highlighted icons now matches the text highlight, so colourful icons will be painted blue like in windows.
I also changed a couple of things in the old font loader, coloured fonts should now work (manually edit the bitmap file) and the background of the font texture won't shine through in the software driver when the gui is faded out. Hope I didn't break anything there.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply