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