(svn r12789) -Codechange: rename AssignWindowViewport to InitializeWindowViewport because the viewport is now part of the window struct. Patch by Alberth.

This commit is contained in:
rubidium 2008-04-19 13:17:19 +00:00
parent 1dcf912f06
commit 24b5c91039
8 changed files with 10 additions and 10 deletions

View File

@ -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);
}
}

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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]);
}

View File

@ -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);

View File

@ -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);