summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-02 03:40:40 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-02 03:41:04 +0300
commit9a441d3bf00ac6aafd8c3c48160112af2459fa0e (patch)
treee370ab36a26bc40af2d3cea6a50b75966137767f
parent41cf7b087a45eddffb9bad3387ff77547d391e9f (diff)
downloadplus-9a441d3bf00ac6aafd8c3c48160112af2459fa0e.tar.gz
plus-9a441d3bf00ac6aafd8c3c48160112af2459fa0e.tar.bz2
plus-9a441d3bf00ac6aafd8c3c48160112af2459fa0e.tar.xz
plus-9a441d3bf00ac6aafd8c3c48160112af2459fa0e.zip
Add some more debug info in camera moving.
-rw-r--r--src/gui/viewport.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index a5b541a8e..b2e9d8d20 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -185,15 +185,20 @@ void Viewport::draw(gcn::Graphics *gcnGraphics)
- player_y > graphics->getHeight() / 2 || player_y
- static_cast<int>(mPixelViewY) > graphics->getHeight() / 2)
{
- mPixelViewX = static_cast<float>(player_x);
- mPixelViewY = static_cast<float>(player_y);
if (player_x <= 0 || player_y <= 0)
{
if (debugChatTab)
debugChatTab->chatLog("incorrect player position!");
- logger->log("incorrect player position: %d, %d",
- player_x, player_y);
+ logger->log("incorrect player position: %d, %d, %d, %d",
+ player_x, player_y, (int)mPixelViewX, (int)mPixelViewY);
+ if (player_node)
+ {
+ logger->log("tile position: %d, %d",
+ player_node->getTileX(), player_node->getTileY());
+ }
}
+ mPixelViewX = static_cast<float>(player_x);
+ mPixelViewY = static_cast<float>(player_y);
};
// Don't move camera so that the end of the map is on screen