mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-03 08:40:26 +02: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:
@ -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 ) ) )
|
||||
{
|
||||
|
Reference in New Issue
Block a user