summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-19 13:17:19 +0000
committerrubidium <rubidium@openttd.org>2008-04-19 13:17:19 +0000
commit51c7ba39a4875272b420918e91e36c9b40f2f1a2 (patch)
tree348fbfb9f47ee42508b8c42686b7eeb304b7f0ab /src
parent99733b2b3e98728368ef1c5685c4ddbe6b59daf4 (diff)
downloadopenttd-51c7ba39a4875272b420918e91e36c9b40f2f1a2.tar.xz
(svn r12789) -Codechange: rename AssignWindowViewport to InitializeWindowViewport because the viewport is now part of the window struct. Patch by Alberth.
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp2
-rw-r--r--src/main_gui.cpp2
-rw-r--r--src/news_gui.cpp6
-rw-r--r--src/smallmap_gui.cpp2
-rw-r--r--src/town_gui.cpp2
-rw-r--r--src/vehicle_gui.cpp2
-rw-r--r--src/viewport.cpp2
-rw-r--r--src/viewport_func.h2
8 files changed, 10 insertions, 10 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 1e6567dbe..958ab5a97 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -631,7 +631,7 @@ void ShowIndustryViewWindow(int industry)
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);
}
}
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 6fe53a425..bf8ba3b7c 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -412,7 +412,7 @@ void SetupColorsAndInitialWindow()
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) {
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 49a86cbea..88495f4eb 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -442,7 +442,7 @@ static void ShowNewspaper(NewsItem *ni)
_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 @@ static void ShowNewspaper(NewsItem *ni)
_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 @@ static void ShowNewspaper(NewsItem *ni)
_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;
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 6430c7798..93086d1ff 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1110,7 +1110,7 @@ static void ExtraViewPortWndProc(Window *w, WindowEvent *e)
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;
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 4c563db34..64767290e 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -396,7 +396,7 @@ void ShowTownViewWindow(TownID town)
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);
}
}
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 092020989..55f824a97 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1751,7 +1751,7 @@ void ShowVehicleViewWindow(const Vehicle *v)
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]);
}
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 582943b64..39aff812d 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -170,7 +170,7 @@ void DeleteWindowViewport(Window *w)
* - 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);
diff --git a/src/viewport_func.h b/src/viewport_func.h
index a9d491b45..de088b6c1 100644
--- 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);