Commit 787dc2f5 authored by bitplane's avatar bitplane

changed text "software device" to "software driver", fixed editbox crash when no font is available

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2236 dfc29bdd-3216-0410-991c-e03cc46cb475
parent b78345c7
......@@ -1158,10 +1158,14 @@ void CGUIEditBox::setTextRect(s32 line)
core::dimension2du d;
s32 lineCount = 1;
IGUIFont* font = OverrideFont;
IGUISkin* skin = Environment->getSkin();
if (!skin)
return;
IGUIFont* font = OverrideFont ? OverrideFont : skin->getFont();
if (!font)
font = skin->getFont();
return;
// get text dimension
if (WordWrap || MultiLine)
......@@ -1295,10 +1299,12 @@ void CGUIEditBox::calculateScrollPos()
if (!WordWrap)
{
// get cursor position
IGUIFont* font = OverrideFont;
IGUISkin* skin = Environment->getSkin();
if (!skin)
return;
IGUIFont* font = OverrideFont ? OverrideFont : skin->getFont();
if (!OverrideFont)
font = skin->getFont();
return;
core::stringw *txtLine = MultiLine ? &BrokenText[cursLine] : &Text;
s32 cPos = MultiLine ? CursorPos - BrokenTextPositions[cursLine] : CursorPos;
......
......@@ -1122,8 +1122,8 @@ IGUITreeView* CGUIEnvironment::addTreeView(const core::rect<s32>& rectangle,
bool drawBackground,
bool scrollBarVertical, bool scrollBarHorizontal)
{
IGUITreeView* b = new CGUITreeView(this, parent ? parent : this, id, rectangle,
true, drawBackground, scrollBarVertical, scrollBarHorizontal);
IGUITreeView* b = new CGUITreeView(this, parent ? parent : this, id, rectangle,
true, drawBackground, scrollBarVertical, scrollBarHorizontal);
b->setIconFont ( getBuiltInFont () );
b->drop();
......@@ -1465,18 +1465,18 @@ IGUIFont* CGUIEnvironment::getBuiltInFont() const
}
//! Creates the image list from the given texture.
IGUIImageList* CGUIEnvironment::createImageList( video::ITexture* texture,
core::dimension2d<s32> imageSize, bool useAlphaChannel )
{
CGUIImageList* imageList = new CGUIImageList( Driver );
if( !imageList->createImageList( texture, imageSize, useAlphaChannel ) )
{
imageList->drop();
return 0;
}
return imageList;
}
IGUIImageList* CGUIEnvironment::createImageList( video::ITexture* texture,
core::dimension2d<s32> imageSize, bool useAlphaChannel )
{
CGUIImageList* imageList = new CGUIImageList( Driver );
if( !imageList->createImageList( texture, imageSize, useAlphaChannel ) )
{
imageList->drop();
return 0;
}
return imageList;
}
//! Returns the root gui element.
IGUIElement* CGUIEnvironment::getRootGUIElement()
......
......@@ -858,7 +858,7 @@ void CSoftwareDriver::draw2DRectangle(const core::rect<s32>& pos,
//! driver, it would return "Direct3D8.1".
const wchar_t* CSoftwareDriver::getName() const
{
return L"Irrlicht Software Device 1.0";
return L"Irrlicht Software Driver 1.0";
}
......
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