summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/gui/gui.cpp40
-rw-r--r--src/gui/gui.h14
3 files changed, 16 insertions, 43 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ea70824..f118329b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-27 Björn Steinbrink <B.Steinbrink@gmx.de>
+
+ * src/gui/gui.cpp, src/gui/gui.h: Removed continous mouse
+ movement, that implementation wasn't suitable for a release.
+
2005-07-26 Björn Steinbrink <B.Steinbrink@gmx.de>
* src/being.cpp, src/being.h, src/engine.cpp, src/game.cpp,
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index ca5c8133..1e101c5b 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -50,9 +50,7 @@ gcn::ImageFont *speechFont;
Gui::Gui(Graphics *graphics):
mHostImageLoader(NULL),
mMouseCursor(NULL),
- mCustomCursor(false),
- mMouseWalk(false),
- mMouseX(0), mMouseY(0)
+ mCustomCursor(false)
{
// Set graphics
guiGraphics = graphics;
@@ -209,19 +207,6 @@ void Gui::logic()
// Work around Guichan bug of only applying focus on mouse or keyboard
// events.
mFocusHandler->applyChanges();
-
- if (mMouseWalk) {
- Map *tiledMap = engine->getCurrentMap();
- int tilex = mMouseX / 32 + camera_x;
- int tiley = mMouseY / 32 + camera_y;
-
- if (state == GAME && tiledMap->getWalk(tilex, tiley)) {
- walk(tilex, tiley, 0);
- player_node->setDestination(tilex, tiley);
-
- autoTarget = NULL;
- }
- }
}
void Gui::draw()
@@ -256,24 +241,21 @@ void Gui::mousePress(int mx, int my, int button)
{
// Mouse pressed on window container (basically, the map)
- // When conditions for walking are met, start moving by mouse
+ // When conditions for walking are met, set new player destination
if (player_node && player_node->action != DEAD && current_npc == 0 &&
button == gcn::MouseInput::LEFT)
{
- mMouseWalk = true;
- }
-}
+ Map *tiledMap = engine->getCurrentMap();
+ int tilex = mx / 32 + camera_x;
+ int tiley = my / 32 + camera_y;
-void Gui::mouseRelease(int x, int y, int button)
-{
- gcn::MouseListener::mouseRelease(x, y, button);
- mMouseWalk = false;
-}
+ if (state == GAME && tiledMap->getWalk(tilex, tiley)) {
+ walk(tilex, tiley, 0);
+ player_node->setDestination(tilex, tiley);
-void Gui::mouseMotion(int mx, int my)
-{
- mMouseX = mx;
- mMouseY = my;
+ autoTarget = NULL;
+ }
+ }
}
gcn::ImageFont *Gui::getFont()
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 6264a116..02ea7caa 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -76,18 +76,6 @@ class Gui : public gcn::Gui, public gcn::MouseListener, ConfigListener
mousePress(int mx, int my, int button);
/**
- * Handles mouse releases on map.
- */
- void
- mouseRelease(int mx, int my, int button);
-
- /**
- * Handles mouse motion on map.
- */
- void
- mouseMotion(int mx, int my);
-
- /**
* Return game font
*/
gcn::ImageFont*
@@ -111,8 +99,6 @@ class Gui : public gcn::Gui, public gcn::MouseListener, ConfigListener
gcn::ImageFont *mGuiFont; /**< The global GUI font */
Image *mMouseCursor; /**< Mouse cursor image */
bool mCustomCursor; /**< Show custom cursor */
- bool mMouseWalk; /**< Move to the mouse cursor */
- int mMouseX, mMouseY; /**< Mouse coordinates */
};
extern Gui *gui; /**< The GUI system */