|
|
|
@ -34,62 +34,58 @@ Tile::Tile(const Position& position)
|
|
|
|
|
m_position = position;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Tile::draw(int x, int y, int step)
|
|
|
|
|
void Tile::draw(int x, int y)
|
|
|
|
|
{
|
|
|
|
|
if(step == 0) {
|
|
|
|
|
m_drawNextOffset = 0;
|
|
|
|
|
m_drawNextOffset = 0;
|
|
|
|
|
|
|
|
|
|
if(m_ground)
|
|
|
|
|
m_ground->draw(x, y);
|
|
|
|
|
if(m_ground)
|
|
|
|
|
m_ground->draw(x, y);
|
|
|
|
|
|
|
|
|
|
for(auto it = m_itemsTop.rbegin(), end = m_itemsTop.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
const ThingAttributes& thingAttributes = thing->getAttributes();
|
|
|
|
|
for(auto it = m_itemsTop.rbegin(), end = m_itemsTop.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
const ThingAttributes& thingAttributes = thing->getAttributes();
|
|
|
|
|
|
|
|
|
|
if(thingAttributes.alwaysOnTopOrder == 1) {
|
|
|
|
|
thing->draw(x - m_drawNextOffset, y - m_drawNextOffset);
|
|
|
|
|
m_drawNextOffset += thingAttributes.drawNextOffset;
|
|
|
|
|
}
|
|
|
|
|
if(thingAttributes.alwaysOnTopOrder == 1) {
|
|
|
|
|
thing->draw(x - m_drawNextOffset, y - m_drawNextOffset);
|
|
|
|
|
m_drawNextOffset += thingAttributes.drawNextOffset;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(auto it = m_itemsTop.rbegin(), end = m_itemsTop.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
const ThingAttributes& thingAttributes = thing->getAttributes();
|
|
|
|
|
|
|
|
|
|
if(thingAttributes.alwaysOnTopOrder == 2) {
|
|
|
|
|
thing->draw(x - m_drawNextOffset, y - m_drawNextOffset);
|
|
|
|
|
m_drawNextOffset += thingAttributes.drawNextOffset;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for(auto it = m_itemsTop.rbegin(), end = m_itemsTop.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
const ThingAttributes& thingAttributes = thing->getAttributes();
|
|
|
|
|
|
|
|
|
|
for(auto it = m_itemsBottom.rbegin(), end = m_itemsBottom.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
const ThingAttributes& thingAttributes = thing->getAttributes();
|
|
|
|
|
if(thingAttributes.alwaysOnTopOrder == 2) {
|
|
|
|
|
thing->draw(x - m_drawNextOffset, y - m_drawNextOffset);
|
|
|
|
|
m_drawNextOffset += thingAttributes.drawNextOffset;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(auto it = m_creatures.rbegin(), end = m_creatures.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
thing->draw(x - m_drawNextOffset, y - m_drawNextOffset);
|
|
|
|
|
}
|
|
|
|
|
for(auto it = m_itemsBottom.rbegin(), end = m_itemsBottom.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
const ThingAttributes& thingAttributes = thing->getAttributes();
|
|
|
|
|
thing->draw(x - m_drawNextOffset, y - m_drawNextOffset);
|
|
|
|
|
m_drawNextOffset += thingAttributes.drawNextOffset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(auto it = m_effects.rbegin(), end = m_effects.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
thing->draw(x - m_drawNextOffset, y - m_drawNextOffset);
|
|
|
|
|
}
|
|
|
|
|
for(auto it = m_creatures.rbegin(), end = m_creatures.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
thing->draw(x - m_drawNextOffset, y - m_drawNextOffset);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(auto it = m_itemsTop.rbegin(), end = m_itemsTop.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
const ThingAttributes& thingAttributes = thing->getAttributes();
|
|
|
|
|
for(auto it = m_effects.rbegin(), end = m_effects.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
thing->draw(x - m_drawNextOffset, y - m_drawNextOffset);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(thingAttributes.alwaysOnTopOrder == 3) {
|
|
|
|
|
thing->draw(x, y);
|
|
|
|
|
}
|
|
|
|
|
for(auto it = m_itemsTop.rbegin(), end = m_itemsTop.rend(); it != end; ++it) {
|
|
|
|
|
const ThingPtr& thing = *it;
|
|
|
|
|
const ThingAttributes& thingAttributes = thing->getAttributes();
|
|
|
|
|
|
|
|
|
|
if(thingAttributes.alwaysOnTopOrder == 3) {
|
|
|
|
|
thing->draw(x, y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(step == 1) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Tile::addThing(ThingPtr thing, int stackpos)
|
|
|
|
|