summaryrefslogtreecommitdiff
path: root/src/resources/ambientlayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-02 21:25:21 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-02 21:25:21 +0300
commit0534847df83047f1ce2605187d45a762ffeae11e (patch)
tree92365ee5ec086b3c65f024096df9d63bd05b31d4 /src/resources/ambientlayer.cpp
parent4f390339f8107c376a10151a2cae889c0ec01089 (diff)
downloadmv-0534847df83047f1ce2605187d45a762ffeae11e.tar.gz
mv-0534847df83047f1ce2605187d45a762ffeae11e.tar.bz2
mv-0534847df83047f1ce2605187d45a762ffeae11e.tar.xz
mv-0534847df83047f1ce2605187d45a762ffeae11e.zip
Add const to more classes.
Diffstat (limited to 'src/resources/ambientlayer.cpp')
-rw-r--r--src/resources/ambientlayer.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp
index e51160efe..9e919297b 100644
--- a/src/resources/ambientlayer.cpp
+++ b/src/resources/ambientlayer.cpp
@@ -29,8 +29,9 @@
#include "debug.h"
-AmbientLayer::AmbientLayer(Image *img, float parallax,
- float speedX, float speedY, bool keepRatio):
+AmbientLayer::AmbientLayer(Image *const img, const float parallax,
+ const float speedX, const float speedY,
+ const bool keepRatio) :
mImage(img), mParallax(parallax),
mPosX(0), mPosY(0),
mSpeedX(speedX), mSpeedY(speedY),
@@ -47,7 +48,7 @@ AmbientLayer::AmbientLayer(Image *img, float parallax,
{
// Rescale the overlay to keep the ratio as if we were on
// the default resolution...
- Image *rescaledOverlay = ResourceManager::getInstance()->
+ Image *const rescaledOverlay = ResourceManager::getInstance()->
getRescaled(mImage, static_cast<int>(mImage->mBounds.w)
/ defaultScreenWidth * mainGraphics->mWidth,
static_cast<int>(mImage->mBounds.h)
@@ -73,7 +74,7 @@ AmbientLayer::~AmbientLayer()
}
}
-void AmbientLayer::update(int timePassed, float dx, float dy)
+void AmbientLayer::update(const int timePassed, const float dx, const float dy)
{
if (!mImage)
return;
@@ -86,8 +87,8 @@ void AmbientLayer::update(int timePassed, float dx, float dy)
mPosX += dx * mParallax;
mPosY += dy * mParallax;
- int imgW = mImage->mBounds.w;
- int imgH = mImage->mBounds.h;
+ const int imgW = mImage->mBounds.w;
+ const int imgH = mImage->mBounds.h;
// Wrap values
while (mPosX > imgW)
@@ -101,7 +102,7 @@ void AmbientLayer::update(int timePassed, float dx, float dy)
mPosY += static_cast<float>(imgH);
}
-void AmbientLayer::draw(Graphics *graphics, int x, int y)
+void AmbientLayer::draw(Graphics *const graphics, const int x, const int y) const
{
if (!mImage)
return;