summaryrefslogtreecommitdiff
path: root/MapLoading.cpp
diff options
context:
space:
mode:
authorJapa Illo2012-02-22 08:26:47 +0530
committerJapa Illo2012-02-22 08:26:47 +0530
commit6a2241742561931aa6347c3d72529d976a82ee4d (patch)
tree0037edc47bc147de2168210a446d4048955ed0ec /MapLoading.cpp
parentce5ec6c3f87fe5d0fb2bf5c50f097057e58aa039 (diff)
downloadstonesense-6a2241742561931aa6347c3d72529d976a82ee4d.tar.gz
stonesense-6a2241742561931aa6347c3d72529d976a82ee4d.tar.bz2
stonesense-6a2241742561931aa6347c3d72529d976a82ee4d.tar.xz
Made the function that follows the DF window actually follow using the center of the view, instead of the center of the worldsegment, which is more useful.
Signed-off-by: Japa Illo <japa.mala.illo@gmail.com>
Diffstat (limited to 'MapLoading.cpp')
-rw-r--r--MapLoading.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/MapLoading.cpp b/MapLoading.cpp
index d433737..fa5037c 100644
--- a/MapLoading.cpp
+++ b/MapLoading.cpp
@@ -1239,9 +1239,10 @@ void FollowCurrentDFCenter()
{
Pos->getWindowSize(viewsizex,viewsizey);
Pos->getViewCoords(newviewx,newviewy,newviewz);
-
- parms.x = newviewx + (viewsizex/2) - (config.segmentSize.x / 2) + config.viewXoffset;
- parms.y = newviewy + (viewsizey/2) - (config.segmentSize.y / 2) + config.viewYoffset;
+ int screenx, screeny, screenz;
+ ScreenToPoint(config.screenWidth/2, config.screenHeight/2, screenx, screeny, screenz);
+ parms.x = newviewx + (viewsizex/2) - screenx + config.viewXoffset;
+ parms.y = newviewy + (viewsizey/2) - screeny + config.viewYoffset;
parms.z = newviewz + config.viewZoffset + 1;
}
else