From 9a441d3bf00ac6aafd8c3c48160112af2459fa0e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 2 Sep 2011 03:40:40 +0300 Subject: Add some more debug info in camera moving. --- src/gui/viewport.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/gui') 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(mPixelViewY) > graphics->getHeight() / 2) { - mPixelViewX = static_cast(player_x); - mPixelViewY = static_cast(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(player_x); + mPixelViewY = static_cast(player_y); }; // Don't move camera so that the end of the map is on screen -- cgit v1.2.3-70-g09d2