summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-11 20:03:02 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-11 20:03:02 +0300
commit91fa2122a536770924bb2819bec4b79e76393d08 (patch)
tree93c0e191249b2158cf92a564630a4b16e9ccdcaa /src/gui/viewport.cpp
parent1a524dc9468fe532bc060a73ef736a68687aadca (diff)
downloadmanaplus-91fa2122a536770924bb2819bec4b79e76393d08.tar.gz
manaplus-91fa2122a536770924bb2819bec4b79e76393d08.tar.bz2
manaplus-91fa2122a536770924bb2819bec4b79e76393d08.tar.xz
manaplus-91fa2122a536770924bb2819bec4b79e76393d08.zip
Fix code style and small perfomance issues.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index b9abb4952..f30ebaecd 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -897,8 +897,8 @@ void Viewport::moveCameraToActor(const int actorId, const int x, const int y)
const Actor *const actor = actorSpriteManager->findBeing(actorId);
if (!actor)
return;
- const Vector actorPos = actor->getPosition();
- const Vector playerPos = player_node->getPosition();
+ const Vector &actorPos = actor->getPosition();
+ const Vector &playerPos = player_node->getPosition();
mCameraMode = 1;
mCameraRelativeX = actorPos.x - playerPos.x + x;
mCameraRelativeY = actorPos.y - playerPos.y + y;
@@ -909,7 +909,7 @@ void Viewport::moveCameraToPosition(const int x, const int y)
if (!player_node)
return;
- const Vector playerPos = player_node->getPosition();
+ const Vector &playerPos = player_node->getPosition();
mCameraMode = 1;
mCameraRelativeX = x - playerPos.x;