/******************************/ ENGINES.H /******************************/ /** * Writes the properties of a road vehicle into the RoadVehicleInfo struct. * @see RoadVehicleInfo * @param a image_index * @param b cost_factor * @param c running_cost * @param d sound effect * @param e max_speed (1 unit = 1/3.2 mph = 0.5 km-ish/h) * @param f capacity (persons, bags, tons, pieces, items, cubic metres, ...) * @param g weight (1/4 ton) * @param h power (10 hp) * @param i roadtype * Tractive effort coefficient by default is the same as TTDPatch, 0.30*256=76 * Air drag value depends on the top speed of the vehicle. */ #define ROV(a, b, c, d, e, f, g, h, i) { a, b, c, PR_RUNNING_ROADVEH, d, e, f, g, h, 76, 0, VE_DEFAULT, 0, i } #define R ROADTYPE_ROAD #define T ROADTYPE_TRAM static const RoadVehicleInfo _orig_road_vehicle_info[] = { /* image_index sfx max_speed power * | cost_factor | | capacity | roadtype * | | running_cost | | weight | * | | | | | | | | |*/ ROV( 0, 120, 91, SND_19_BUS_START_PULL_AWAY, 112, 31, 42, 9, R), // 0 MPS Regal Bus /******************************/ ENGINE_TYPE.H /******************************/ /** Information about a road vehicle. */ struct RoadVehicleInfo { byte image_index; byte cost_factor; byte running_cost; Price running_cost_class; SoundID sfx; uint16 max_speed; ///< Maximum speed (1 unit = 1/3.2 mph = 0.5 km-ish/h) byte capacity; uint8 weight; ///< Weight in 1/4t units uint8 power; ///< Power in 10hp units uint8 tractive_effort; ///< Coefficient of tractive effort uint8 air_drag; ///< Coefficient of air drag byte visual_effect; ///< Bitstuffed NewGRF visual effect data byte shorten_factor; ///< length on main map for this type is 8 - shorten_factor RoadTypeByte roadtype; }; /******************************/ NEWGRF.CPP /******************************/ EngineInfo *ei = &e->info; RoadVehicleInfo *rvi = &e->u.road; rvi->roadtype = ROADTYPE_ROAD; // default <- get from proper newgrfspec