fix some elevation issues
This commit is contained in:
parent
8c8749520d
commit
30330d1d2e
|
@ -216,8 +216,9 @@ void MapView::updateVisibleTilesCache(int start)
|
||||||
for(int iz = m_cachedLastVisibleFloor; iz >= m_cachedFirstVisibleFloor && !stop; --iz) {
|
for(int iz = m_cachedLastVisibleFloor; iz >= m_cachedFirstVisibleFloor && !stop; --iz) {
|
||||||
if(m_viewRange <= FAR_VIEW) {
|
if(m_viewRange <= FAR_VIEW) {
|
||||||
const int numDiagonals = m_drawDimension.width() + m_drawDimension.height() - 1;
|
const int numDiagonals = m_drawDimension.width() + m_drawDimension.height() - 1;
|
||||||
for(int diagonal = 0; diagonal < numDiagonals && !stop; ++diagonal) {
|
|
||||||
// loop through / diagonals beginning at top left and going to top right
|
// loop through / diagonals beginning at top left and going to top right
|
||||||
|
for(int diagonal = 0; diagonal < numDiagonals && !stop; ++diagonal) {
|
||||||
|
// loop current diagonal tiles
|
||||||
for(int iy = std::min(diagonal, m_drawDimension.width() - 1), ix = std::max(diagonal - m_drawDimension.width() + 1, 0); iy >= 0 && ix < m_drawDimension.width() && !stop; --iy, ++ix) {
|
for(int iy = std::min(diagonal, m_drawDimension.width() - 1), ix = std::max(diagonal - m_drawDimension.width() + 1, 0); iy >= 0 && ix < m_drawDimension.width() && !stop; --iy, ++ix) {
|
||||||
// only start really looking tiles in the desired start
|
// only start really looking tiles in the desired start
|
||||||
if(count < start) {
|
if(count < start) {
|
||||||
|
|
|
@ -109,21 +109,21 @@ void Tile::draw(const Point& dest, float scaleFactor, int drawFlags)
|
||||||
for(auto it = m_things.rbegin(); it != m_things.rend(); ++it) {
|
for(auto it = m_things.rbegin(); it != m_things.rend(); ++it) {
|
||||||
CreaturePtr creature = (*it)->asCreature();
|
CreaturePtr creature = (*it)->asCreature();
|
||||||
if(creature && (!creature->isWalking() || !animate))
|
if(creature && (!creature->isWalking() || !animate))
|
||||||
creature->draw(dest - m_drawElevation, scaleFactor, animate);
|
creature->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// effects
|
// effects
|
||||||
if(drawFlags & Otc::DrawEffects) {
|
if(drawFlags & Otc::DrawEffects) {
|
||||||
for(const EffectPtr& effect : m_effects)
|
for(const EffectPtr& effect : m_effects)
|
||||||
effect->draw(dest, scaleFactor, animate);
|
effect->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// top items
|
// top items
|
||||||
if(drawFlags & Otc::DrawOnTop) {
|
if(drawFlags & Otc::DrawOnTop) {
|
||||||
for(const ThingPtr& thing : m_things) {
|
for(const ThingPtr& thing : m_things) {
|
||||||
if(thing->isOnTop())
|
if(thing->isOnTop())
|
||||||
thing->draw(dest - m_drawElevation, scaleFactor, animate);
|
thing->draw(dest, scaleFactor, animate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue