mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-05 01:40:44 +01:00
Code cleanup
Prefer static_cast to reinterpret_cast. Declare variables later with init values to avoid having uninitialized variables around. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6161 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
42b881ee74
commit
4cb289fc91
|
@ -203,17 +203,15 @@ void CGUIFont::setMaxHeight()
|
|||
return;
|
||||
|
||||
MaxHeight = 0;
|
||||
s32 t;
|
||||
|
||||
core::array< core::rect<s32> >& p = SpriteBank->getPositions();
|
||||
|
||||
for (u32 i=0; i<p.size(); ++i)
|
||||
{
|
||||
t = p[i].getHeight();
|
||||
const s32 t = p[i].getHeight();
|
||||
if (t>MaxHeight)
|
||||
MaxHeight = t;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CGUIFont::pushTextureCreationFlags(bool(&flags)[3])
|
||||
|
|
|
@ -754,10 +754,7 @@ bool CGUITreeView::OnEvent( const SEvent &event )
|
|||
void CGUITreeView::mouseAction( s32 xpos, s32 ypos, bool onlyHover /*= false*/ )
|
||||
{
|
||||
IGUITreeViewNode* oldSelected = Selected;
|
||||
IGUITreeViewNode* hitNode = 0;
|
||||
s32 selIdx=-1;
|
||||
s32 n;
|
||||
IGUITreeViewNode* node;
|
||||
SEvent event;
|
||||
|
||||
event.EventType = EET_GUI_EVENT;
|
||||
|
@ -774,9 +771,9 @@ void CGUITreeView::mouseAction( s32 xpos, s32 ypos, bool onlyHover /*= false*/ )
|
|||
selIdx = ( ( ypos - 1 ) + scrollBarVPos ) / ItemHeight;
|
||||
}
|
||||
|
||||
hitNode = 0;
|
||||
node = Root->getFirstChild();
|
||||
n = 0;
|
||||
IGUITreeViewNode* hitNode = 0;
|
||||
IGUITreeViewNode* node = Root->getFirstChild();
|
||||
s32 n = 0;
|
||||
while( node )
|
||||
{
|
||||
if( selIdx == n )
|
||||
|
@ -1024,7 +1021,7 @@ void CGUITreeView::draw()
|
|||
iconWidth += ImageList->getImageSize().Width + 3;
|
||||
textRect.UpperLeftCorner.X += ImageList->getImageSize().Width + 3;
|
||||
}
|
||||
else if( ( IconFont && reinterpret_cast<CGUITreeViewNode*>( node )->Icon.size() )
|
||||
else if( ( IconFont && static_cast<CGUITreeViewNode*>( node )->Icon.size() )
|
||||
&& ( ( ImageLeftOfIcon && n == 1 )
|
||||
|| ( !ImageLeftOfIcon && n == 0 ) ) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user