You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
943 B

#include "item.h"
#include "tibiadat.h"
#include "tibiaspr.h"
#include <graphics/graphics.h>
#include "thing.h"
Item::Item()
{
m_type = Thing::TYPE_ITEM;
}
ThingAttributes *Item::getAttributes()
{
return g_tibiaDat.getItemAttributes(m_id);
}
void Item::draw(int x, int y)
{
ThingAttributes *itemAttributes = getAttributes();
int xdiv = 0, ydiv = 0, zdiv = 0, anim = 0;
if(itemAttributes->group == THING_GROUP_SPLASH || itemAttributes->group == THING_GROUP_FLUID || itemAttributes->stackable) {
//cDivX = subType % itemAttributes->xdiv;
//cDivY = subType / itemAttributes->xdiv;
}
else if(!itemAttributes->moveable) {
xdiv = m_position.x % itemAttributes->xdiv;
ydiv = m_position.y % itemAttributes->ydiv;
zdiv = m_position.z % itemAttributes->zdiv;
}
for(int b = 0; b < itemAttributes->blendframes; b++)
internalDraw(x, y, b, xdiv, ydiv, zdiv, anim);
}