src/engine_gui.cpp
changeset 9720 2a0354eea879
parent 9607 5a5728fb702a
child 9744 a1964a9acb91
equal deleted inserted replaced
9719:15e207edea1a 9720:2a0354eea879
   135 	const RailVehicleInfo *rvi = RailVehInfo(engine);
   135 	const RailVehicleInfo *rvi = RailVehInfo(engine);
   136 	int multihead = (rvi->railveh_type == RAILVEH_MULTIHEAD) ? 1 : 0;
   136 	int multihead = (rvi->railveh_type == RAILVEH_MULTIHEAD) ? 1 : 0;
   137 
   137 
   138 	SetDParam(0, (_price.build_railvehicle >> 3) * GetEngineProperty(engine, 0x17, rvi->base_cost) >> 5);
   138 	SetDParam(0, (_price.build_railvehicle >> 3) * GetEngineProperty(engine, 0x17, rvi->base_cost) >> 5);
   139 	SetDParam(2, GetEngineProperty(engine, 0x09, rvi->max_speed) * 10 / 16);
   139 	SetDParam(2, GetEngineProperty(engine, 0x09, rvi->max_speed) * 10 / 16);
   140 	SetDParam(3, GetEngineProperty(engine, 0x0B, rvi->power) << multihead);
   140 	SetDParam(3, GetEngineProperty(engine, 0x0B, rvi->power));
   141 	SetDParam(1, GetEngineProperty(engine, 0x16, rvi->weight) << multihead);
   141 	SetDParam(1, GetEngineProperty(engine, 0x16, rvi->weight) << multihead);
   142 
   142 
   143 	SetDParam(4, GetEngineProperty(engine, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8 << multihead);
   143 	SetDParam(4, GetEngineProperty(engine, 0x0D, rvi->running_cost) * GetPriceByIndex(rvi->running_cost_class) >> 8);
   144 
   144 
   145 	uint capacity = GetTotalCapacityOfArticulatedParts(engine, VEH_TRAIN);
   145 	uint capacity = GetTotalCapacityOfArticulatedParts(engine, VEH_TRAIN);
   146 	if (capacity != 0) {
   146 	if (capacity != 0) {
   147 		SetDParam(5, rvi->cargo_type);
   147 		SetDParam(5, rvi->cargo_type);
   148 		SetDParam(6, capacity << multihead);
   148 		SetDParam(6, capacity);
   149 	} else {
   149 	} else {
   150 		SetDParam(5, CT_INVALID);
   150 		SetDParam(5, CT_INVALID);
   151 	}
   151 	}
   152 	DrawStringMultiCenter(x, y, STR_VEHICLE_INFO_COST_WEIGHT_SPEED_POWER, maxw);
   152 	DrawStringMultiCenter(x, y, STR_VEHICLE_INFO_COST_WEIGHT_SPEED_POWER, maxw);
   153 }
   153 }