diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-27 19:05:07 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-27 19:05:07 +0000 |
commit | 6f6d061b23c6c70c632fb3ec6aa3735325f701e0 (patch) | |
tree | a0d57853d826ebca0abe9ec86973c64bec688427 /src/gui/gui.cpp | |
parent | a544d1b3bf1d133d5877aa97d59d7128555e69fc (diff) | |
download | mana-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.tar.gz mana-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.tar.bz2 mana-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.tar.xz mana-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.zip |
Implemented pixel-grained movements.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index a3ec299b..5df26d63 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -245,8 +245,8 @@ Gui::mousePress(int mx, int my, int button) if (current_npc) return; - int tilex = mx / 32 + camera_x; - int tiley = my / 32 + camera_y; + int tilex = (mx + camera_x) / 32; + int tiley = (my + camera_y) / 32; // Right click might open a popup if (button == gcn::MouseInput::RIGHT) @@ -313,7 +313,7 @@ Gui::mousePress(int mx, int my, int button) Uint8 *keys = SDL_GetKeyState(NULL); if (!(keys[SDLK_LSHIFT] || keys[SDLK_RSHIFT])) { - player_node->setDestination(tilex * 32 + 16, tiley * 32 + 16); + player_node->setDestination(mx + camera_x, my + camera_y); player_node->stopAttack(); } } |