From 6f6d061b23c6c70c632fb3ec6aa3735325f701e0 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Sun, 27 Aug 2006 19:05:07 +0000 Subject: Implemented pixel-grained movements. --- src/engine.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/engine.cpp') diff --git a/src/engine.cpp b/src/engine.cpp index f3aff6ce..eda154f3 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -176,8 +176,8 @@ void Engine::draw(Graphics *graphics) } } - camera_x = map_x / 32; - camera_y = map_y / 32; + camera_x = map_x; + camera_y = map_y; // Draw tiles and sprites if (mCurrentMap != NULL) @@ -202,11 +202,11 @@ void Engine::draw(Graphics *graphics) int mouseX, mouseY; SDL_GetMouseState(&mouseX, &mouseY); - int mouseTileX = mouseX / 32 + camera_x; - int mouseTileY = mouseY / 32 + camera_y; + int mouseTileX = (mouseX + map_x) / 32; + int mouseTileY = (mouseY + map_y) / 32; Path debugPath = mCurrentMap->findPath( - player_node->mX, player_node->mY, + player_node->mX / 32, player_node->mY / 32, mouseTileX, mouseTileY); graphics->setColor(gcn::Color(255, 0, 0)); -- cgit v1.2.3-70-g09d2