summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-05-11 15:08:44 +0000
committerglx <glx@openttd.org>2008-05-11 15:08:44 +0000
commitc708ab3b486a2ecf1f163c900ff71fd46764bdfa (patch)
treedfb592610399f3c49e4292af8aacfd992b50d368 /src/main_gui.cpp
parentc47926311b5f90086f0c7a44c30f3455748d524c (diff)
downloadopenttd-c708ab3b486a2ecf1f163c900ff71fd46764bdfa.tar.xz
(svn r13047) -Codechange: remove vp_d
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 5ad0c277f..8b4b1328d 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -166,27 +166,27 @@ bool DoZoomInOutWindow(int how, Window *w)
vp->virtual_width >>= 1;
vp->virtual_height >>= 1;
- WP(w, vp_d).scrollpos_x += vp->virtual_width >> 1;
- WP(w, vp_d).scrollpos_y += vp->virtual_height >> 1;
- WP(w, vp_d).dest_scrollpos_x = WP(w,vp_d).scrollpos_x;
- WP(w, vp_d).dest_scrollpos_y = WP(w,vp_d).scrollpos_y;
+ w->viewport->scrollpos_x += vp->virtual_width >> 1;
+ w->viewport->scrollpos_y += vp->virtual_height >> 1;
+ w->viewport->dest_scrollpos_x = w->viewport->scrollpos_x;
+ w->viewport->dest_scrollpos_y = w->viewport->scrollpos_y;
break;
case ZOOM_OUT:
if (vp->zoom == ZOOM_LVL_MAX) return false;
vp->zoom = (ZoomLevel)((int)vp->zoom + 1);
- WP(w, vp_d).scrollpos_x -= vp->virtual_width >> 1;
- WP(w, vp_d).scrollpos_y -= vp->virtual_height >> 1;
- WP(w, vp_d).dest_scrollpos_x = WP(w,vp_d).scrollpos_x;
- WP(w, vp_d).dest_scrollpos_y = WP(w,vp_d).scrollpos_y;
+ w->viewport->scrollpos_x -= vp->virtual_width >> 1;
+ w->viewport->scrollpos_y -= vp->virtual_height >> 1;
+ w->viewport->dest_scrollpos_x = w->viewport->scrollpos_x;
+ w->viewport->dest_scrollpos_y = w->viewport->scrollpos_y;
vp->virtual_width <<= 1;
vp->virtual_height <<= 1;
break;
}
if (vp != NULL) { // the vp can be null when how == ZOOM_NONE
- vp->virtual_left = WP(w, vp_d).scrollpos_x;
- vp->virtual_top = WP(w, vp_d).scrollpos_y;
+ vp->virtual_left = w->viewport->scrollpos_x;
+ vp->virtual_top = w->viewport->scrollpos_y;
}
w->SetDirty();
/* Update the windows that have zoom-buttons to perhaps disable their buttons */
@@ -380,10 +380,10 @@ static void MainWindowWndProc(Window *w, WindowEvent *e)
_scrolling_viewport = false;
}
- WP(w, vp_d).scrollpos_x += ScaleByZoom(e->we.scroll.delta.x, vp->zoom);
- WP(w, vp_d).scrollpos_y += ScaleByZoom(e->we.scroll.delta.y, vp->zoom);
- WP(w, vp_d).dest_scrollpos_x = WP(w, vp_d).scrollpos_x;
- WP(w, vp_d).dest_scrollpos_y = WP(w, vp_d).scrollpos_y;
+ w->viewport->scrollpos_x += ScaleByZoom(e->we.scroll.delta.x, vp->zoom);
+ w->viewport->scrollpos_y += ScaleByZoom(e->we.scroll.delta.y, vp->zoom);
+ w->viewport->dest_scrollpos_x = w->viewport->scrollpos_x;
+ w->viewport->dest_scrollpos_y = w->viewport->scrollpos_y;
} break;
case WE_MOUSEWHEEL: