summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-03-23 22:41:21 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-03-23 22:41:21 +0000
commitfa8b0a19084c0c2d369cda199b87c03fe838fa79 (patch)
treebee92807a496dcc2494d9fdfbf7afb59cbca736b /src/net
parent9dd811b55587aeb76344b835006cb4a01601bb5d (diff)
downloadmana-fa8b0a19084c0c2d369cda199b87c03fe838fa79.tar.gz
mana-fa8b0a19084c0c2d369cda199b87c03fe838fa79.tar.bz2
mana-fa8b0a19084c0c2d369cda199b87c03fe838fa79.tar.xz
mana-fa8b0a19084c0c2d369cda199b87c03fe838fa79.zip
Merged revisions 3828-3829,3831-3838,3841,3843-3844,3847-3872,3874,3876-3900 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/branches/0.0 ........ r3828 | crush_tmw | 2007-12-31 17:14:27 +0100 (Mon, 31 Dec 2007) | 1 line Added config options to set the scroll center. Retained scroll offset during map change for smoother map transitions. ........ r3859 | b_lindeijer | 2008-01-26 20:38:43 +0100 (Sat, 26 Jan 2008) | 3 lines Fixed a GCC 4.3 compile error and constified the usage of auto_ptr, since that's the way in which we are using them. ........ r3876 | crush_tmw | 2008-02-11 20:00:43 +0100 (Mon, 11 Feb 2008) | 1 line Added music and overlay to snake dungeon. ........ r3883 | crush_tmw | 2008-02-12 15:00:22 +0100 (Tue, 12 Feb 2008) | 1 line Particle emitters are now activated after the parent particle has moved instead of before (small change which allows a little trick to create polar emitters) ........ r3887 | umperio | 2008-02-12 20:49:37 +0100 (Tue, 12 Feb 2008) | 1 line Made pathfinding not halt on collision destination tile, made moving around with mouse smoother. Added possibility to pass through players with key controls. ........ r3888 | crush_tmw | 2008-02-13 21:49:55 +0100 (Wed, 13 Feb 2008) | 1 line Added new headgears by Black Don (thanks to QOAL for testing and implementation) ........ r3891 | umperio | 2008-02-18 09:52:06 +0100 (Mon, 18 Feb 2008) | 1 line Fixed image name. ........ r3892 | umperio | 2008-02-18 11:00:45 +0100 (Mon, 18 Feb 2008) | 1 line Forgot a %s ........ r3899 | crush_tmw | 2008-02-19 14:23:34 +0100 (Tue, 19 Feb 2008) | 1 line Map fixes at snake dungeon by QOAL ........ r3900 | crush_tmw | 2008-02-19 14:32:24 +0100 (Tue, 19 Feb 2008) | 1 line More map fixes at snake dungeon by QOAL ........
Diffstat (limited to 'src/net')
-rw-r--r--src/net/playerhandler.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp
index b908eae5..ea581095 100644
--- a/src/net/playerhandler.cpp
+++ b/src/net/playerhandler.cpp
@@ -34,11 +34,13 @@
#include "../gui/buy.h"
#include "../gui/chat.h"
+#include "../gui/gui.h"
#include "../gui/npclistdialog.h"
#include "../gui/npc_text.h"
#include "../gui/ok_dialog.h"
#include "../gui/sell.h"
#include "../gui/skill.h"
+#include "../gui/viewport.h"
// TODO Move somewhere else
OkDialog *weightNotice = NULL;
@@ -289,9 +291,9 @@ void PlayerHandler::handleMessage(MessageIn &msg)
void
PlayerHandler::handleMapChangeMessage(MessageIn &msg)
{
- std::string mapName = msg.readString();
- unsigned short x = msg.readInt16();
- unsigned short y = msg.readInt16();
+ const std::string mapName = msg.readString();
+ const unsigned short x = msg.readInt16();
+ const unsigned short y = msg.readInt16();
logger->log("Changing map to %s (%d, %d)", mapName.c_str(), x, y);
@@ -300,6 +302,13 @@ PlayerHandler::handleMapChangeMessage(MessageIn &msg)
current_npc = 0;
+ const float scrollOffsetX = x - player_node->mX;
+ const float scrollOffsetY = y - player_node->mY;
+
player_node->setAction(Being::STAND);
player_node->setPositionInPixels(x, y);
+
+ logger->log("Adjust scrolling by %d,%d", (int) scrollOffsetX,
+ (int) scrollOffsetY);
+ viewport->scrollBy(scrollOffsetX, scrollOffsetY);
}