(svn r18126) -Codechange: remove duplicate (since r18119) scrollbar capacity/matrix initialisation

This commit is contained in:
rubidium
2009-11-16 20:34:57 +00:00
parent 242bf23835
commit a13fd6ddce
18 changed files with 4 additions and 75 deletions

View File

@@ -225,6 +225,8 @@ struct DepotWindow : Window {
DepotWindow(const WindowDesc *desc, TileIndex tile, VehicleType type) : Window()
{
assert(IsCompanyBuildableVehicleType(type)); // ensure that we make the call with a valid type
this->sel = INVALID_VEHICLE;
this->generate_list = true;
this->type = type;
@@ -234,7 +236,8 @@ struct DepotWindow : Window {
this->FinishInitNested(desc, tile);
this->owner = GetTileOwner(tile);
this->CreateDepotListWindow(type);
_backup_orders_tile = 0;
}
~DepotWindow()
@@ -593,21 +596,6 @@ struct DepotWindow : Window {
}
}
void CreateDepotListWindow(VehicleType type)
{
_backup_orders_tile = 0;
assert(IsCompanyBuildableVehicleType(type)); // ensure that we make the call with a valid type
/* Set the number of blocks in each direction */
this->hscroll.SetCapacity(_resize_cap[type].width);
this->vscroll.SetCapacity(_resize_cap[type].height);
this->GetWidget<NWidgetCore>(DEPOT_WIDGET_MATRIX)->widget_data =
(this->vscroll.GetCapacity() << MAT_ROW_START) // number of rows to draw on the background
+ ((type == VEH_TRAIN ? 1 : this->hscroll.GetCapacity()) << MAT_COL_START); // number of boxes in each row. Trains always have just one
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize)
{
switch (widget) {