diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 4d7f88e8e..781052ee2 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -1999,6 +1999,8 @@ void Game::mouseMove(int x, int y, const MouseState *ms) { lastMousePos.x = mouseX; lastMousePos.y = mouseY; + Renderer::getInstance().computePosition(Vec2i(mouseX, mouseY), mouseCellPos); + } catch(const exception &ex) { char szBuf[4096]=""; @@ -2629,6 +2631,11 @@ void Game::render2d(){ if( renderer.getShowDebugUI() == true || (perfLogging == true && difftime(time(NULL),lastRenderLog2d) >= 1)) { str+= "MouseXY: " + intToStr(mouseX) + "," + intToStr(mouseY)+"\n"; + + if(world.getMap()->isInsideSurface(world.getMap()->toSurfCoords(mouseCellPos)) == true) { + str+= "MouseXY cell coords: " + intToStr(mouseCellPos.x) + "," + intToStr(mouseCellPos.y)+"\n"; + } + str+= "PosObjWord: " + intToStr(gui.getPosObjWorld().x) + "," + intToStr(gui.getPosObjWorld().y)+"\n"; str+= "Render FPS: " + intToStr(lastRenderFps) + "[" + intToStr(avgRenderFps) + "]\n"; str+= "Update FPS: " + intToStr(lastUpdateFps) + "[" + intToStr(avgUpdateFps) + "]\n"; diff --git a/source/glest_game/game/game.h b/source/glest_game/game/game.h index 4944a37cc..bede98a6e 100644 --- a/source/glest_game/game/game.h +++ b/source/glest_game/game/game.h @@ -78,7 +78,10 @@ private: Checksum checksum; string loadingText; int mouse2d; - int mouseX, mouseY; //coords win32Api + int mouseX; + int mouseY; //coords win32Api + Vec2i mouseCellPos; + int updateFps, lastUpdateFps, avgUpdateFps; int totalRenderFps, renderFps, lastRenderFps, avgRenderFps,currentAvgRenderFpsTotal; Uint64 tickCount;