cpp functions order changed

This commit is contained in:
Henrique 2011-08-28 16:51:34 -03:00
parent 4bd701f94c
commit 7242dfc9ee
1 changed files with 29 additions and 29 deletions

View File

@ -32,6 +32,30 @@ Item::Item() : Thing(Otc::Item)
m_lastTicks = g_platform.getTicks(); 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) void Item::setCount(int count)
{ {
int oldCount = m_count; int oldCount = m_count;
@ -39,6 +63,11 @@ void Item::setCount(int count)
onCountChange(oldCount); onCountChange(oldCount);
} }
const ThingAttributes& Item::getAttributes()
{
return g_dat.getItemAttributes(m_id);
}
void Item::onPositionChange(const Position&) void Item::onPositionChange(const Position&)
{ {
const ThingAttributes& attributes = g_dat.getItemAttributes(m_id); 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);
}