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;
......
...@@ -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