Commit 5f21bbf8 authored by bitplane's avatar bitplane

added a black border around the icons in builtInFont.h, added the source...

added a black border around the icons in builtInFont.h, added the source bitmap. changed the way completely background transparency is handled in the bitmap font loader, the colour data for background is not kept.
changed default icon highlight value in the skin so the icons are highlighted in the same way as the text.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@755 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 40abacae
...@@ -3,7 +3,8 @@ Changes in version 1.4 (... 2007) ...@@ -3,7 +3,8 @@ Changes in version 1.4 (... 2007)
- createDevice now reports errors if the driverType is unknown, previously it - createDevice now reports errors if the driverType is unknown, previously it
created a window but populated it with a null driver without any warning. created a window but populated it with a null driver without any warning.
- Fixed a bug in CBillboardTextSceneNode::setText where the old text was not cleared. - Fixed a bug in CBillboardTextSceneNode::setText where the old text was not
cleared.
- Changed irrArray::linear_search to use the == operator rather than < - Changed irrArray::linear_search to use the == operator rather than <
This may be slower in some cases, but it no longer returns false positives This may be slower in some cases, but it no longer returns false positives
...@@ -30,6 +31,12 @@ Changes in version 1.4 (... 2007) ...@@ -30,6 +31,12 @@ Changes in version 1.4 (... 2007)
GUI: GUI:
- Fixed the default font icons so they have a black border and are not
invisible in default listboxes. Old font tool textures now keep their color
so colorful fonts are possible by editing the font's texture. The colors of
completely transparent areas are no longer kept when generating the texture
from an image. Added builtInFont.bmp for ease of editing.
- IGUIElement changes: - IGUIElement changes:
OnEvent no longer absorbs events by default. OnEvent no longer absorbs events by default.
Serialize/deserialize now call getter and setter functions, in case people Serialize/deserialize now call getter and setter functions, in case people
......
This diff is collapsed.
...@@ -976,12 +976,17 @@ IGUIListBox* CGUIEnvironment::addListBox(const core::rect<s32>& rectangle, ...@@ -976,12 +976,17 @@ IGUIListBox* CGUIEnvironment::addListBox(const core::rect<s32>& rectangle,
IGUIListBox* b = new CGUIListBox(this, parent ? parent : this, id, rectangle, IGUIListBox* b = new CGUIListBox(this, parent ? parent : this, id, rectangle,
true, drawBackground, false); true, drawBackground, false);
if (getBuiltInFont() && getBuiltInFont()->getType() == EGFT_BITMAP) if (CurrentSkin && CurrentSkin->getSpriteBank())
{
b->setSpriteBank(CurrentSkin->getSpriteBank());
}
else if (getBuiltInFont() && getBuiltInFont()->getType() == EGFT_BITMAP)
{
b->setSpriteBank( ((IGUIFontBitmap*)getBuiltInFont())->getSpriteBank()); b->setSpriteBank( ((IGUIFontBitmap*)getBuiltInFont())->getSpriteBank());
}
b->drop(); b->drop();
return b; return b;
} }
......
...@@ -284,16 +284,13 @@ void CGUIFont::readPositions32bit(video::IImage* image, s32& lowerRightPositions ...@@ -284,16 +284,13 @@ void CGUIFont::readPositions32bit(video::IImage* image, s32& lowerRightPositions
return; return;
} }
// TODO: Hack till it's getting better... // fix half alpha of top left pixel in some font textures
// Pixel(0,0) == half opacity assume font with alpha..
s32 truealphaFont = ( (p[0] & 0xFF000000) == 0x7f000000 );
p[0] |= 0xFF000000; p[0] |= 0xFF000000;
s32 colorTopLeft = p[0]; s32 colorTopLeft = p[0];
s32 colorLowerRight = *(p+1); s32 colorLowerRight = *(p+1);
s32 colorBackGround = *(p+2); s32 colorBackGround = *(p+2);
s32 colorBackGroundTransparent = 0x00FFFFFF & colorBackGround; s32 colorBackGroundTransparent = 0; // 0x00FFFFFF & colorBackGround;
s32 colorFont = 0xFFFFFFFF; s32 colorFont = 0xFFFFFFFF;
*(p+1) = colorBackGround; *(p+1) = colorBackGround;
...@@ -348,11 +345,6 @@ void CGUIFont::readPositions32bit(video::IImage* image, s32& lowerRightPositions ...@@ -348,11 +345,6 @@ void CGUIFont::readPositions32bit(video::IImage* image, s32& lowerRightPositions
{ {
*p = colorBackGroundTransparent; *p = colorBackGroundTransparent;
} }
else
if ( 0 == truealphaFont )
{
*p = colorFont;
}
++p; ++p;
} }
} }
...@@ -376,13 +368,13 @@ void CGUIFont::readPositions16bit(video::IImage* image, s32& lowerRightPositions ...@@ -376,13 +368,13 @@ void CGUIFont::readPositions16bit(video::IImage* image, s32& lowerRightPositions
return; return;
} }
s16 truealphaFont = ( (p[0] & 0x8000) == 0x8000 ); // fix half alpha of top left pixel in some font textures
p[0] |= 0x8000; p[0] |= 0x8000;
s16 colorTopLeft = p[0];; s16 colorTopLeft = p[0];
s16 colorLowerRight = *(p+1); s16 colorLowerRight = *(p+1);
s16 colorBackGround = *(p+2); s16 colorBackGround = *(p+2);
s16 colorBackGroundTransparent = 0x7FFF & colorBackGround; s16 colorBackGroundTransparent = 0; // 0x7FFF & colorBackGround;
u16 colorFont = 0xFFFF; u16 colorFont = 0xFFFF;
*(p+1) = colorBackGround; *(p+1) = colorBackGround;
...@@ -436,11 +428,6 @@ void CGUIFont::readPositions16bit(video::IImage* image, s32& lowerRightPositions ...@@ -436,11 +428,6 @@ void CGUIFont::readPositions16bit(video::IImage* image, s32& lowerRightPositions
else else
if (*p == colorBackGround) if (*p == colorBackGround)
*p = colorBackGroundTransparent; *p = colorBackGroundTransparent;
else
if ( 0 == truealphaFont )
{
*p = colorFont;
}
++p; ++p;
} }
} }
......
...@@ -45,7 +45,7 @@ CGUISkin::CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver) ...@@ -45,7 +45,7 @@ CGUISkin::CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver)
Colors[EGDC_WINDOW] = video::SColor(101,255,255,255); Colors[EGDC_WINDOW] = video::SColor(101,255,255,255);
Colors[EGDC_WINDOW_SYMBOL] = video::SColor(200,10,10,10); Colors[EGDC_WINDOW_SYMBOL] = video::SColor(200,10,10,10);
Colors[EGDC_ICON] = video::SColor(200,255,255,255); Colors[EGDC_ICON] = video::SColor(200,255,255,255);
Colors[EGDC_ICON_HIGH_LIGHT] = video::SColor(200,10,10,10); Colors[EGDC_ICON_HIGH_LIGHT] = video::SColor(200,8,36,107);
Sizes[EGDS_SCROLLBAR_SIZE] = 14; Sizes[EGDS_SCROLLBAR_SIZE] = 14;
Sizes[EGDS_MENU_HEIGHT] = 30; Sizes[EGDS_MENU_HEIGHT] = 30;
...@@ -84,7 +84,7 @@ CGUISkin::CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver) ...@@ -84,7 +84,7 @@ CGUISkin::CGUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver)
Colors[EGDC_WINDOW] = 0xf0f0f0f0; Colors[EGDC_WINDOW] = 0xf0f0f0f0;
Colors[EGDC_WINDOW_SYMBOL] = 0xd0161616; Colors[EGDC_WINDOW_SYMBOL] = 0xd0161616;
Colors[EGDC_ICON] = 0xd0161616; Colors[EGDC_ICON] = 0xd0161616;
Colors[EGDC_ICON_HIGH_LIGHT]= 0xd0e0e0e0; Colors[EGDC_ICON_HIGH_LIGHT]= 0xd0606060;
Sizes[EGDS_SCROLLBAR_SIZE] = 14; Sizes[EGDS_SCROLLBAR_SIZE] = 14;
Sizes[EGDS_MENU_HEIGHT] = 48; Sizes[EGDS_MENU_HEIGHT] = 48;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment