Mercurial > hg > openttd
changeset 3006:10f0441416e3 draft
(svn r3586) - NewGRF: Load callback masks for all vehicle types.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Sat, 11 Feb 2006 07:34:05 +0000 |
parents | b548505d4678 |
children | a7ed369c9a72 |
files | engine.h newgrf.c table/engines.h |
diffstat | 3 files changed, 27 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/engine.h +++ b/engine.h @@ -40,6 +40,7 @@ byte running_cost; byte sfx; byte refittable; + byte callbackmask; } ShipVehicleInfo; typedef struct AircraftVehicleInfo { @@ -52,6 +53,7 @@ byte max_speed; byte mail_capacity; uint16 passenger_capacity; + byte callbackmask; } AircraftVehicleInfo; typedef struct RoadVehicleInfo { @@ -62,6 +64,7 @@ byte max_speed; byte capacity; byte cargo_type; + byte callbackmask; } RoadVehicleInfo; /** Information about a vehicle
--- a/newgrf.c +++ b/newgrf.c @@ -555,6 +555,13 @@ _engine_info[ROAD_ENGINES_INDEX + engine + i].refit_mask = refit_mask; } } break; + + case 0x17: // Callback mask + FOR_EACH_OBJECT { + rvi[i].callbackmask = grf_load_byte(&buf); + } + break; + case 0x1D: { /* Cargo classes allowed */ FOR_EACH_OBJECT { cargo_allowed[ROAD_ENGINES_INDEX + engine + i] = grf_load_word(&buf); @@ -565,7 +572,6 @@ cargo_disallowed[ROAD_ENGINES_INDEX + engine + i] = grf_load_word(&buf); } } break; - case 0x17: /* Callback */ case 0x18: /* Tractive effort */ case 0x19: /* Air drag */ case 0x1A: /* Refit cost */ @@ -676,6 +682,13 @@ _engine_info[SHIP_ENGINES_INDEX + engine + i].refit_mask = refit_mask; } } break; + + case 0x12: // Callback mask + FOR_EACH_OBJECT { + svi[i].callbackmask = grf_load_byte(&buf); + } + break; + case 0x18: { /* Cargo classes allowed */ FOR_EACH_OBJECT { cargo_allowed[SHIP_ENGINES_INDEX + engine + i] = grf_load_word(&buf); @@ -686,7 +699,6 @@ cargo_disallowed[SHIP_ENGINES_INDEX + engine + i] = grf_load_word(&buf); } } break; - case 0x12: /* Callback */ case 0x13: /* Refit cost */ case 0x14: /* Ocean speed fraction */ case 0x15: /* Canal speed fraction */ @@ -799,6 +811,13 @@ _engine_info[AIRCRAFT_ENGINES_INDEX + engine + i].refit_mask = refit_mask; } } break; + + case 0x14: // Callback mask + FOR_EACH_OBJECT { + avi[i].callbackmask = grf_load_byte(&buf); + } + break; + case 0x18: { /* Cargo classes allowed */ FOR_EACH_OBJECT { cargo_allowed[AIRCRAFT_ENGINES_INDEX + engine + i] = grf_load_word(&buf); @@ -809,7 +828,6 @@ cargo_disallowed[AIRCRAFT_ENGINES_INDEX + engine + i] = grf_load_word(&buf); } } break; - case 0x14: /* Callback */ case 0x15: /* Refit cost */ case 0x16: /* Retire vehicle early */ case 0x17: /* Miscellaneous flags */
--- a/table/engines.h +++ b/table/engines.h @@ -467,7 +467,7 @@ * @param g sound effect * @param h refittable */ -#define SVI(a, b, c, d, e, f, g, h) { a, b, c, d, e, f, g, h } +#define SVI(a, b, c, d, e, f, g, h) { a, b, c, d, e, f, g, h, 0 } const ShipVehicleInfo orig_ship_vehicle_info[NUM_SHIP_ENGINES] = { // image_index cargo_type cargo_amount refittable // | base_cost | | running_cost | @@ -499,7 +499,7 @@ * @param h mail_capacity * @param i passenger_capacity */ -#define AVI(a, b, c, d, e, f, g, h, i) { a, b, c, d, e, f, g, h, i } +#define AVI(a, b, c, d, e, f, g, h, i) { a, b, c, d, e, f, g, h, i, 0 } #define H 0 #define P 1 #define J 3 @@ -566,7 +566,7 @@ * @param f capacity * @param g cargo_type */ -#define RVI(a, b, c, d, e, f, g) { a, b, c, d, e, f, g } +#define RVI(a, b, c, d, e, f, g) { a, b, c, d, e, f, g, 0 } const RoadVehicleInfo orig_road_vehicle_info[NUM_ROAD_ENGINES] = { // image_index sfx max_speed // | base_cost | | capacity