summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-01 22:30:44 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-01 22:30:44 +0300
commitd13de51121a332cf8613a38d7ed5468f971c999f (patch)
tree253c2911e291303fd90eb5d61c23076630782a11 /src/gui/viewport.cpp
parent6915c38ca9c35bfb9a5ea05fe957463d644a75de (diff)
downloadplus-d13de51121a332cf8613a38d7ed5468f971c999f.tar.gz
plus-d13de51121a332cf8613a38d7ed5468f971c999f.tar.bz2
plus-d13de51121a332cf8613a38d7ed5468f971c999f.tar.xz
plus-d13de51121a332cf8613a38d7ed5468f971c999f.zip
replace tile size from 32 to mapTitleSize.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 5e855bea5..958fd3587 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -147,7 +147,7 @@ void Viewport::draw(gcn::Graphics *gcnGraphics)
int cnt = 0;
// Apply lazy scrolling
- while (lastTick < tick_time && cnt < 32)
+ while (lastTick < tick_time && cnt < mapTileSize)
{
if (player_x > mPixelViewX + mScrollRadius)
{
@@ -309,9 +309,9 @@ void Viewport::_drawDebugPath(Graphics *const graphics)
const Vector &playerPos = player_node->getPosition();
debugPath = mMap->findPath(
- static_cast<int>(playerPos.x - 16) / 32,
- static_cast<int>(playerPos.y - 32) / 32,
- mousePosX / 32, mousePosY / 32,
+ static_cast<int>(playerPos.x - mapTileSize / 2) / mapTileSize,
+ static_cast<int>(playerPos.y - mapTileSize) / mapTileSize,
+ mousePosX / mapTileSize, mousePosY / mapTileSize,
player_node->getWalkMask(),
500);
lastMouseDestination = mouseDestination;
@@ -345,8 +345,8 @@ void Viewport::_drawPath(Graphics *const graphics, const Path &path,
int cnt = 1;
FOR_EACH (Path::const_iterator, i, path)
{
- const int squareX = i->x * 32 - mPixelViewX + 12;
- const int squareY = i->y * 32 - mPixelViewY + 12;
+ const int squareX = i->x * mapTileSize - mPixelViewX + 12;
+ const int squareY = i->y * mapTileSize - mPixelViewY + 12;
graphics->fillRectangle(gcn::Rectangle(squareX, squareY, 8, 8));
if (mMap)
@@ -371,7 +371,7 @@ void Viewport::_drawPath(Graphics *const graphics, const Path &path,
if (mMap)
{
const std::string str = toString(mMap->getMetaTile(
- i->x / 32, i->y / 32)->Gcost);
+ i->x / mapTileSize, i->y / mapTileSize)->Gcost);
font->drawString(graphics, str,
squareX + 4 - font->getWidth(text) / 2, squareY + 12);
}