changeset 8994:e4c3087abbde draft

(svn r12789) -Codechange: rename AssignWindowViewport to InitializeWindowViewport because the viewport is now part of the window struct. Patch by Alberth.
author rubidium <rubidium@openttd.org>
date Sat, 19 Apr 2008 13:17:19 +0000
parents 1b2c82dc4d69
children 3e58e70db5ad
files src/industry_gui.cpp src/main_gui.cpp src/news_gui.cpp src/smallmap_gui.cpp src/town_gui.cpp src/vehicle_gui.cpp src/viewport.cpp src/viewport_func.h
diffstat 8 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -631,7 +631,7 @@
 		WP(w, indview_d).editbox_line = 0;
 		WP(w, indview_d).clicked_line = 0;
 		WP(w, indview_d).clicked_button = 0;
-		AssignWindowViewport(w, 3, 17, 0xFE, 0x56, GetIndustry(w->window_number)->xy + TileDiffXY(1, 1), ZOOM_LVL_INDUSTRY);
+		InitializeWindowViewport(w, 3, 17, 254, 86, GetIndustry(w->window_number)->xy + TileDiffXY(1, 1), ZOOM_LVL_INDUSTRY);
 	}
 }
 
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -412,7 +412,7 @@
 	int height = _screen.height;
 
 	Window *w = AllocateWindow(0, 0, width, height, MainWindowWndProc, WC_MAIN_WINDOW, NULL);
-	AssignWindowViewport(w, 0, 0, width, height, TileXY(32, 32), ZOOM_LVL_VIEWPORT);
+	InitializeWindowViewport(w, 0, 0, width, height, TileXY(32, 32), ZOOM_LVL_VIEWPORT);
 
 	/* XXX: these are not done */
 	switch (_game_mode) {
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -442,7 +442,7 @@
 			_news_type13_desc.top = top;
 			w = AllocateWindowDesc(&_news_type13_desc);
 			if (ni->flags & NF_VIEWPORT) {
-				AssignWindowViewport(w, 2, 58, 0x1AA, 0x6E,
+				InitializeWindowViewport(w, 2, 58, 426, 110,
 					ni->data_a | (ni->flags & NF_VEHICLE ? 0x80000000 : 0), ZOOM_LVL_NEWS);
 			}
 			break;
@@ -451,7 +451,7 @@
 			_news_type2_desc.top = top;
 			w = AllocateWindowDesc(&_news_type2_desc);
 			if (ni->flags & NF_VIEWPORT) {
-				AssignWindowViewport(w, 2, 58, 0x1AA, 0x46,
+				InitializeWindowViewport(w, 2, 58, 426, 70,
 					ni->data_a | (ni->flags & NF_VEHICLE ? 0x80000000 : 0), ZOOM_LVL_NEWS);
 			}
 			break;
@@ -460,7 +460,7 @@
 			_news_type0_desc.top = top;
 			w = AllocateWindowDesc(&_news_type0_desc);
 			if (ni->flags & NF_VIEWPORT) {
-				AssignWindowViewport(w, 3, 17, 0x112, 0x2F,
+				InitializeWindowViewport(w, 3, 17, 274, 47,
 					ni->data_a | (ni->flags & NF_VEHICLE ? 0x80000000 : 0), ZOOM_LVL_NEWS);
 			}
 			break;
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1110,7 +1110,7 @@
 	switch (e->event) {
 	case WE_CREATE: // Disable zoom in button
 		/* New viewport start at (zero,zero) */
-		AssignWindowViewport(w, 3, 17, w->widget[4].right - w->widget[4].left - 1, w->widget[4].bottom - w->widget[4].top - 1, 0, ZOOM_LVL_VIEWPORT);
+		InitializeWindowViewport(w, 3, 17, w->widget[4].right - w->widget[4].left - 1, w->widget[4].bottom - w->widget[4].top - 1, 0, ZOOM_LVL_VIEWPORT);
 
 		w->DisableWidget(5);
 		break;
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -396,7 +396,7 @@
 
 	if (w != NULL) {
 		w->flags4 |= WF_DISABLE_VP_SCROLL;
-		AssignWindowViewport(w, 3, 17, 0xFE, 0x56, GetTown(town)->xy, ZOOM_LVL_TOWN);
+		InitializeWindowViewport(w, 3, 17, 254, 86, GetTown(town)->xy, ZOOM_LVL_TOWN);
 	}
 }
 
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1751,7 +1751,7 @@
 
 	if (w != NULL) {
 		w->caption_color = v->owner;
-		AssignWindowViewport(w, VV_VIEWPORT_X, VV_VIEWPORT_Y, VV_INITIAL_VIEWPORT_WIDTH,
+		InitializeWindowViewport(w, VV_VIEWPORT_X, VV_VIEWPORT_Y, VV_INITIAL_VIEWPORT_WIDTH,
 												 (v->type == VEH_TRAIN) ? VV_INITIAL_VIEWPORT_HEIGHT_TRAIN : VV_INITIAL_VIEWPORT_HEIGHT,
 												 w->window_number | (1 << 31), _vehicle_view_zoom_levels[v->type]);
 	}
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -170,7 +170,7 @@
  *        - If bit 31 is clear, it is a tile position.
  * @param zoom Zoomlevel to display
  */
-void AssignWindowViewport(Window *w, int x, int y,
+void InitializeWindowViewport(Window *w, int x, int y,
 	int width, int height, uint32 follow_flags, ZoomLevel zoom)
 {
 	assert(w->viewport == NULL);
--- a/src/viewport_func.h
+++ b/src/viewport_func.h
@@ -13,7 +13,7 @@
 void SetSelectionRed(bool);
 
 void DeleteWindowViewport(Window *w);
-void AssignWindowViewport(Window *w, int x, int y, int width, int height, uint32 follow_flags, ZoomLevel zoom);
+void InitializeWindowViewport(Window *w, int x, int y, int width, int height, uint32 follow_flags, ZoomLevel zoom);
 ViewPort *IsPtInWindowViewport(const Window *w, int x, int y);
 Point GetTileBelowCursor();
 void UpdateViewportPosition(Window *w);