From 7242dfc9ee8f22c0a3247ec940371820d58e6a38 Mon Sep 17 00:00:00 2001 From: Henrique Date: Sun, 28 Aug 2011 16:51:34 -0300 Subject: [PATCH] cpp functions order changed --- src/otclient/core/item.cpp | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/otclient/core/item.cpp b/src/otclient/core/item.cpp index c5a25464..85b33ab9 100644 --- a/src/otclient/core/item.cpp +++ b/src/otclient/core/item.cpp @@ -32,6 +32,30 @@ Item::Item() : Thing(Otc::Item) m_lastTicks = g_platform.getTicks(); } +void Item::draw(int x, int y) +{ + const ThingAttributes& attributes = g_dat.getItemAttributes(m_id); + + if(attributes.animcount > 1) { + if(g_platform.getTicks() - m_lastTicks > 500) { + if(m_animation+1 == attributes.animcount) + m_animation = 0; + else + m_animation++; + + m_lastTicks = g_platform.getTicks(); + } + } + + /*if(attributes.group == Otc::ThingSplashGroup || attributes.group == Otc::ThingFluidGroup) { + //xdiv = m_count % attributes.xdiv; + //ydiv = m_count / attributes.ydiv; + }*/ + + for(int b = 0; b < attributes.blendframes; b++) + internalDraw(x, y, b); +} + void Item::setCount(int count) { int oldCount = m_count; @@ -39,6 +63,11 @@ void Item::setCount(int count) onCountChange(oldCount); } +const ThingAttributes& Item::getAttributes() +{ + return g_dat.getItemAttributes(m_id); +} + void Item::onPositionChange(const Position&) { const ThingAttributes& attributes = g_dat.getItemAttributes(m_id); @@ -77,32 +106,3 @@ void Item::onCountChange(int) } } } - -void Item::draw(int x, int y) -{ - const ThingAttributes& attributes = g_dat.getItemAttributes(m_id); - - if(attributes.animcount > 1) { - if(g_platform.getTicks() - m_lastTicks > 500) { - if(m_animation+1 == attributes.animcount) - m_animation = 0; - else - m_animation++; - - m_lastTicks = g_platform.getTicks(); - } - } - - /*if(attributes.group == Otc::ThingSplashGroup || attributes.group == Otc::ThingFluidGroup) { - //xdiv = m_count % attributes.xdiv; - //ydiv = m_count / attributes.ydiv; - }*/ - - for(int b = 0; b < attributes.blendframes; b++) - internalDraw(x, y, b); -} - -const ThingAttributes& Item::getAttributes() -{ - return g_dat.getItemAttributes(m_id); -}