diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-16 15:07:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-16 15:31:05 +0300 |
commit | 0bfeccc16c5606cec5979b49c5d6b3bd298912fb (patch) | |
tree | 6294d19e429c3c6e9386f0e70260607bdfb7f315 /src/resources/map/map.cpp | |
parent | 407a4233221c2280ef2a92914c8d23e463aa665c (diff) | |
download | mv-0bfeccc16c5606cec5979b49c5d6b3bd298912fb.tar.gz mv-0bfeccc16c5606cec5979b49c5d6b3bd298912fb.tar.bz2 mv-0bfeccc16c5606cec5979b49c5d6b3bd298912fb.tar.xz mv-0bfeccc16c5606cec5979b49c5d6b3bd298912fb.zip |
Improve a bit map layers draw.
Also fix issue with some map draw modes.
Diffstat (limited to 'src/resources/map/map.cpp')
-rw-r--r-- | src/resources/map/map.cpp | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index aa7248c8d..49006a5b2 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -394,7 +394,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY) mFringeLayer->setSpecialLayer(mSpecialLayer); mFringeLayer->setTempLayer(mTempLayer); mFringeLayer->drawFringe(graphics, startX, startY, endX, endY, - scrollX, scrollY, &mActors, mDrawLayersFlags, mActorFixY); + scrollX, scrollY, &mActors, mActorFixY); } } else @@ -406,8 +406,10 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY) MapLayer *const layer = *it; if (updateFlag) { - layer->updateOGL(graphics, startX, startY, - endX, endY, scrollX, scrollY, mDrawLayersFlags); + layer->updateOGL(graphics, + startX, startY, + endX, endY, + scrollX, scrollY); } layer->drawOGL(graphics); @@ -417,8 +419,12 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY) { mFringeLayer->setSpecialLayer(mSpecialLayer); mFringeLayer->setTempLayer(mTempLayer); - mFringeLayer->drawFringe(graphics, startX, startY, endX, endY, - scrollX, scrollY, &mActors, mDrawLayersFlags, mActorFixY); + mFringeLayer->drawFringe(graphics, + startX, startY, + endX, endY, + scrollX, scrollY, + &mActors, + mActorFixY); } FOR_EACH (Layers::iterator, it, mDrawOverLayers) @@ -426,8 +432,10 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY) MapLayer *const layer = *it; if (updateFlag) { - layer->updateOGL(graphics, startX, startY, - endX, endY, scrollX, scrollY, mDrawLayersFlags); + layer->updateOGL(graphics, + startX, startY, + endX, endY, + scrollX, scrollY); } layer->drawOGL(graphics); @@ -437,22 +445,28 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY) { FOR_EACH (Layers::iterator, it, mDrawUnderLayers) { - (*it)->draw(graphics, startX, startY, endX, endY, - scrollX, scrollY, mDrawLayersFlags); + (*it)->draw(graphics, + startX, startY, + endX, endY, + scrollX, scrollY); } if (mFringeLayer) { mFringeLayer->setSpecialLayer(mSpecialLayer); mFringeLayer->setTempLayer(mTempLayer); - mFringeLayer->drawFringe(graphics, startX, startY, endX, endY, - scrollX, scrollY, &mActors, mDrawLayersFlags, mActorFixY); + mFringeLayer->drawFringe(graphics, + startX, startY, + endX, endY, + scrollX, scrollY, + &mActors, mActorFixY); } FOR_EACH (Layers::iterator, it, mDrawOverLayers) { - (*it)->draw(graphics, startX, startY, endX, endY, - scrollX, scrollY, mDrawLayersFlags); + (*it)->draw(graphics, startX, startY, + endX, endY, + scrollX, scrollY); } } } @@ -1538,6 +1552,9 @@ void Map::updateDrawLayersList() mDrawUnderLayers.push_back(layer); } + if (mDrawLayersFlags == MapType::SPECIAL2) + return; + for (; layers != layers_end; ++ layers) { MapLayer *const layer = *layers; @@ -1588,4 +1605,9 @@ void Map::setDrawLayersFlags(const MapType::MapType &n) mDrawOnlyFringe = false; } updateDrawLayersList(); + FOR_EACH (Layers::iterator, it, mLayers) + { + MapLayer *const layer = *it; + layer->setDrawLayerFlags(mDrawLayersFlags); + } } |