src/depot_gui.cpp
branchgamebalance
changeset 9911 0b8b245a2391
parent 9910 0b2aebc8283e
child 9912 1ac8aac92385
equal deleted inserted replaced
9910:0b2aebc8283e 9911:0b8b245a2391
   135 	switch(GetVehicle(p1)->type) {
   135 	switch(GetVehicle(p1)->type) {
   136 		case VEH_TRAIN:    CcCloneTrain(   true, tile, p1, p2); break;
   136 		case VEH_TRAIN:    CcCloneTrain(   true, tile, p1, p2); break;
   137 		case VEH_ROAD:     CcCloneRoadVeh( true, tile, p1, p2); break;
   137 		case VEH_ROAD:     CcCloneRoadVeh( true, tile, p1, p2); break;
   138 		case VEH_SHIP:     CcCloneShip(    true, tile, p1, p2); break;
   138 		case VEH_SHIP:     CcCloneShip(    true, tile, p1, p2); break;
   139 		case VEH_AIRCRAFT: CcCloneAircraft(true, tile, p1, p2); break;
   139 		case VEH_AIRCRAFT: CcCloneAircraft(true, tile, p1, p2); break;
       
   140 		default: NOT_REACHED();
   140 	}
   141 	}
   141 }
   142 }
   142 
   143 
   143 static inline void ShowVehicleViewWindow(const Vehicle *v)
   144 static inline void ShowVehicleViewWindow(const Vehicle *v)
   144 {
   145 {
   654 {
   655 {
   655 	_block_sizes[VEH_ROAD][0] = 56;
   656 	_block_sizes[VEH_ROAD][0] = 56;
   656 	_block_sizes[VEH_ROAD][1] = GetVehicleListHeight(VEH_ROAD);
   657 	_block_sizes[VEH_ROAD][1] = GetVehicleListHeight(VEH_ROAD);
   657 }
   658 }
   658 
   659 
   659 static void ResizeDefaultWindowSize(byte type)
   660 static void ResizeDefaultWindowSize(VehicleType type)
   660 {
   661 {
   661 	EngineID engine;
   662 	EngineID engine;
   662 	uint max_width  = 0;
   663 	uint max_width  = 0;
   663 	uint max_height = 0;
   664 	uint max_height = 0;
   664 
   665 
   694 	ResizeDefaultWindowSizeForRoadVehicles();
   695 	ResizeDefaultWindowSizeForRoadVehicles();
   695 	ResizeDefaultWindowSize(VEH_SHIP);
   696 	ResizeDefaultWindowSize(VEH_SHIP);
   696 	ResizeDefaultWindowSize(VEH_AIRCRAFT);
   697 	ResizeDefaultWindowSize(VEH_AIRCRAFT);
   697 }
   698 }
   698 
   699 
   699 static void CreateDepotListWindow(Window *w, byte type)
   700 static void CreateDepotListWindow(Window *w, VehicleType type)
   700 {
   701 {
   701 	WP(w, depot_d).type = type;
   702 	WP(w, depot_d).type = type;
   702 	_backup_orders_tile = 0;
   703 	_backup_orders_tile = 0;
   703 
   704 
   704 	assert(IsPlayerBuildableVehicleType(type)); // ensure that we make the call with a valid type
   705 	assert(IsPlayerBuildableVehicleType(type)); // ensure that we make the call with a valid type
   972 
   973 
   973 /** Opens a depot window
   974 /** Opens a depot window
   974  * @param tile The tile where the depot/hangar is located
   975  * @param tile The tile where the depot/hangar is located
   975  * @param type The type of vehicles in the depot
   976  * @param type The type of vehicles in the depot
   976  */
   977  */
   977 void ShowDepotWindow(TileIndex tile, byte type)
   978 void ShowDepotWindow(TileIndex tile, VehicleType type)
   978 {
   979 {
   979 	Window *w;
   980 	Window *w;
   980 
   981 
   981 	switch (type) {
   982 	switch (type) {
   982 		default: NOT_REACHED();
   983 		default: NOT_REACHED();