summaryrefslogtreecommitdiff
path: root/src/resources/map/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/map/map.cpp')
-rw-r--r--src/resources/map/map.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index 4927485d4..e016654e8 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -341,7 +341,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY)
// Make sure actors are sorted ascending by Y-coordinate
// so that they overlap correctly
BLOCK_START("Map::draw sort")
- mActors.sort(actorCompare);
+ mActors.sort(actorCompare);
BLOCK_END("Map::draw sort")
// update scrolling of all ambient layers
@@ -404,20 +404,27 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY)
{
if (mCachedDraw)
{
- FOR_EACH (Layers::iterator, it, mDrawUnderLayers)
+ if (updateFlag)
{
- MapLayer *const layer = *it;
- if (updateFlag)
+ FOR_EACH (Layers::iterator, it, mDrawUnderLayers)
{
- layer->updateOGL(graphics,
+ (*it)->updateOGL(graphics,
+ startX, startY,
+ endX, endY,
+ scrollX, scrollY);
+ }
+ FOR_EACH (Layers::iterator, it, mDrawOverLayers)
+ {
+ (*it)->updateOGL(graphics,
startX, startY,
endX, endY,
scrollX, scrollY);
}
-
- layer->drawOGL(graphics);
}
+ FOR_EACH (Layers::iterator, it, mDrawUnderLayers)
+ (*it)->drawOGL(graphics);
+
if (mFringeLayer)
{
mFringeLayer->setSpecialLayer(mSpecialLayer);
@@ -430,18 +437,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY)
}
FOR_EACH (Layers::iterator, it, mDrawOverLayers)
- {
- MapLayer *const layer = *it;
- if (updateFlag)
- {
- layer->updateOGL(graphics,
- startX, startY,
- endX, endY,
- scrollX, scrollY);
- }
-
- layer->drawOGL(graphics);
- }
+ (*it)->drawOGL(graphics);
}
else
{