summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-05-15 16:08:46 +0000
committertruelight <truelight@openttd.org>2007-05-15 16:08:46 +0000
commit765c466b8d5f9a534f785a14b4c41e36e07ae014 (patch)
tree839525ed601a24ac844e1fb9f64be11f2890b982 /src/misc_gui.cpp
parentd4963476cb0226490143e9843df897f792feacb2 (diff)
downloadopenttd-765c466b8d5f9a534f785a14b4c41e36e07ae014.tar.xz
(svn r9846) -Codechange: introduced ZOOM_LVL_MIN and ZOOM_LVL_MAX for the obvious reasons
-Codechange: introduced ZOOM_LVL_DETAIL to show/remove details -Codechange: changed << and >> operator with ZoomLevel to a simple wrapper (that in theory also allows zoom-in besides the current zoom-out) -Fix r9845: missed some int -> ZoomLevel
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index c63e3d6bd..2336d5332 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -579,11 +579,11 @@ void ShowErrorMessage(StringID msg_1, StringID msg_2, int x, int y)
vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
/* move x pos to opposite corner */
- pt.x = ((pt.x - vp->virtual_left) >> vp->zoom) + vp->left;
+ pt.x = UnScaleByZoom(pt.x - vp->virtual_left, vp->zoom) + vp->left;
pt.x = (pt.x < (_screen.width >> 1)) ? _screen.width - 260 : 20;
/* move y pos to opposite corner */
- pt.y = ((pt.y - vp->virtual_top) >> vp->zoom) + vp->top;
+ pt.y = UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top;
pt.y = (pt.y < (_screen.height >> 1)) ? _screen.height - 80 : 100;
} else {
@@ -595,8 +595,8 @@ void ShowErrorMessage(StringID msg_1, StringID msg_2, int x, int y)
if ( (x|y) != 0) {
pt = RemapCoords2(x, y);
vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
- pt.x = clamp(((pt.x - vp->virtual_left) >> vp->zoom) + vp->left - (334/2), 0, _screen.width - 334);
- pt.y = clamp(((pt.y - vp->virtual_top) >> vp->zoom) + vp->top - (137/2), 22, _screen.height - 137);
+ pt.x = clamp(UnScaleByZoom(pt.x - vp->virtual_left, vp->zoom) + vp->left - (334/2), 0, _screen.width - 334);
+ pt.y = clamp(UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top - (137/2), 22, _screen.height - 137);
} else {
pt.x = (_screen.width - 334) >> 1;
pt.y = (_screen.height - 137) >> 1;