summaryrefslogtreecommitdiff
path: root/src/maplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-04 23:47:11 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-04 23:47:11 +0300
commitf24ddad3fa0f843eb29a281426151cf1a5f31f4b (patch)
tree6f3faaf38f069f1e88435b7c976ff4070b7a1dcb /src/maplayer.cpp
parent3a407bb6b73a186eafd99bcec570f88097c4b2e1 (diff)
downloadmv-f24ddad3fa0f843eb29a281426151cf1a5f31f4b.tar.gz
mv-f24ddad3fa0f843eb29a281426151cf1a5f31f4b.tar.bz2
mv-f24ddad3fa0f843eb29a281426151cf1a5f31f4b.tar.xz
mv-f24ddad3fa0f843eb29a281426151cf1a5f31f4b.zip
add const to more classes,
fix other small style issues.
Diffstat (limited to 'src/maplayer.cpp')
-rw-r--r--src/maplayer.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/maplayer.cpp b/src/maplayer.cpp
index 13ded2f83..f7db290b6 100644
--- a/src/maplayer.cpp
+++ b/src/maplayer.cpp
@@ -115,7 +115,7 @@ void MapLayer::draw(Graphics *const graphics,
const int x32 = x * 32;
int c = 0;
- Image *const img = *tilePtr;
+ const Image *const img = *tilePtr;
if (img)
{
const int px = x32 + dx;
@@ -378,7 +378,7 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
{
const int px1 = x * 32 - scrollX;
- MapItem *item = mSpecialLayer->mTiles[ptr + x];
+ const MapItem *item = mSpecialLayer->mTiles[ptr + x];
if (item)
item->draw(graphics, px1, py1, 32, 32);
@@ -400,7 +400,7 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
const int px1 = x32 - scrollX;
int c = 0;
- Image *const img = *tilePtr;
+ const Image *const img = *tilePtr;
if (img)
{
const int px = x32 + dx;
@@ -437,8 +437,10 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
for (int x1 = 0; x1 < c1 + 1; x1 ++)
{
- MapItem *const item1 = mSpecialLayer->mTiles[ptr + x1];
- MapItem *const item2 = mTempLayer->mTiles[ptr + x1];
+ const MapItem *const item1
+ = mSpecialLayer->mTiles[ptr + x1];
+ const MapItem *const item2
+ = mTempLayer->mTiles[ptr + x1];
if (item1 || item2)
{
const int px2 = px1 + (x1 * 32);
@@ -604,7 +606,7 @@ void SpecialLayer::addRoad(Path road)
}
}
-void SpecialLayer::clean()
+void SpecialLayer::clean() const
{
if (!mTiles)
return;
@@ -619,7 +621,7 @@ void SpecialLayer::clean()
void SpecialLayer::draw(Graphics *const graphics, int startX, int startY,
int endX, int endY,
- const int scrollX, const int scrollY)
+ const int scrollX, const int scrollY) const
{
if (startX < 0)
startX = 0;
@@ -640,7 +642,7 @@ void SpecialLayer::draw(Graphics *const graphics, int startX, int startY,
void SpecialLayer::itemDraw(Graphics *const graphics, const int x, const int y,
const int scrollX, const int scrollY) const
{
- MapItem *const item = getTile(x, y);
+ const MapItem *const item = getTile(x, y);
if (item)
{
const int px = x * 32 - scrollX;