Mercurial > hg > openttd
changeset 12876:6f97f7fe9a93 draft
(svn r17368) -Codechange: remove pointless passing of 'this' as parameter
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 02 Sep 2009 07:22:09 +0000 |
parents | e78169f1844c |
children | e63af9c28034 |
files | src/depot_gui.cpp |
diffstat | 1 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -267,7 +267,7 @@ * @param x Left side of the box to draw in * @param y Top of the box to draw in */ - void DrawVehicleInDepot(Window *w, const Vehicle *v, int x, int y) + void DrawVehicleInDepot(const Vehicle *v, int x, int y) { bool free_wagon = false; int sprite_y = y + this->resize.step_height - GetVehicleListHeight(v->type); @@ -317,7 +317,7 @@ } } - void DrawDepotWindow(Window *w) + void DrawDepotWindow() { TileIndex tile = this->window_number; int x, y, maxval; @@ -349,10 +349,10 @@ max_width = max(max_width, width); } /* Always have 1 empty row, so people can change the setting of the train */ - SetVScrollCount(w, this->vehicle_list.Length() + this->wagon_list.Length() + 1); - SetHScrollCount(w, max_width); + SetVScrollCount(this, this->vehicle_list.Length() + this->wagon_list.Length() + 1); + SetHScrollCount(this, max_width); } else { - SetVScrollCount(w, (this->vehicle_list.Length() + this->hscroll.cap - 1) / this->hscroll.cap); + SetVScrollCount(this, (this->vehicle_list.Length() + this->hscroll.cap - 1) / this->hscroll.cap); } /* locate the depot struct */ @@ -365,7 +365,7 @@ SetDParam(0, depot->town_index); } - w->DrawWidgets(); + this->DrawWidgets(); uint16 num = this->vscroll.pos * boxes_in_each_row; maxval = min(this->vehicle_list.Length(), num + (rows_in_display * boxes_in_each_row)); @@ -376,7 +376,7 @@ for (i = 0; i < boxes_in_each_row && num < maxval; i++, num++, x += this->resize.step_width) { /* Draw all vehicles in the current row */ const Vehicle *v = this->vehicle_list[num]; - DrawVehicleInDepot(w, v, x, y); + this->DrawVehicleInDepot(v, x, y); } } @@ -385,7 +385,7 @@ /* draw the train wagons, that do not have an engine in front */ for (; num < maxval; num++, y += 14) { const Vehicle *v = this->wagon_list[num - this->vehicle_list.Length()]; - DrawVehicleInDepot(w, v, x, y); + this->DrawVehicleInDepot(v, x, y); } } @@ -573,9 +573,9 @@ ResetObjectToPlace(); } - void ResizeDepotButtons(Window *w) + void ResizeDepotButtons() { - ResizeButtons(w, DEPOT_WIDGET_BUILD, DEPOT_WIDGET_LOCATION); + ResizeButtons(this, DEPOT_WIDGET_BUILD, DEPOT_WIDGET_LOCATION); if (this->type == VEH_TRAIN) { /* Divide the size of DEPOT_WIDGET_SELL into two equally big buttons so DEPOT_WIDGET_SELL and DEPOT_WIDGET_SELL_CHAIN will get the same size. @@ -693,7 +693,7 @@ DEPOT_WIDGET_SELL_CHAIN, WIDGET_LIST_END); - ResizeDepotButtons(this); + this->ResizeDepotButtons(); } virtual void OnInvalidateData(int data) @@ -710,7 +710,7 @@ this->generate_list = false; DepotSortList(&this->vehicle_list); } - DrawDepotWindow(this); + this->DrawDepotWindow(); } virtual void OnClick(Point pt, int widget) @@ -948,7 +948,7 @@ this->vscroll.cap += delta.y / (int)this->resize.step_height; this->hscroll.cap += delta.x / (int)this->resize.step_width; this->widget[DEPOT_WIDGET_MATRIX].data = (this->vscroll.cap << MAT_ROW_START) + ((this->type == VEH_TRAIN ? 1 : this->hscroll.cap) << MAT_COL_START); - ResizeDepotButtons(this); + this->ResizeDepotButtons(); } virtual EventState OnCTRLStateChange()