diff options
author | peter1138 <peter1138@openttd.org> | 2006-02-28 08:13:15 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-02-28 08:13:15 +0000 |
commit | 2e2ed81e40f961677c3aa2d7f93d3dece969dec5 (patch) | |
tree | 23faff9bd7226a7ee120438c523c31cdefeb8091 | |
parent | ff102fd115be51556a7b16f438c106b098531b84 (diff) | |
download | openttd-2e2ed81e40f961677c3aa2d7f93d3dece969dec5.tar.xz |
(svn r3684) - NewGRF: Support loading of miscellaneous flags (not used yet)
-rw-r--r-- | engine.h | 1 | ||||
-rw-r--r-- | newgrf.c | 31 |
2 files changed, 24 insertions, 8 deletions
@@ -79,6 +79,7 @@ typedef struct EngineInfo { byte railtype:4; byte climates:4; uint32 refit_mask; + byte misc_flags; } EngineInfo; typedef struct Engine { @@ -382,7 +382,7 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf break; case 0x1D: /* Refit cargo */ - FOR_EACH_OBJECT _engine_info[engine + i].refit_mask = grf_load_dword(&buf); + FOR_EACH_OBJECT ei[i].refit_mask = grf_load_dword(&buf); break; case 0x1E: /* Callback */ @@ -414,6 +414,10 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf } break; + case 0x27: /* Miscellaneous flags */ + FOR_EACH_OBJECT ei[i].misc_flags = grf_load_byte(&buf); + break; + case 0x28: /* Cargo classes allowed */ FOR_EACH_OBJECT cargo_allowed[engine + i] = grf_load_word(&buf); break; @@ -429,7 +433,6 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf case 0x20: /* Air drag */ case 0x25: /* User-defined bit mask to set when checking veh. var. 42 */ case 0x26: /* Retire vehicle early */ - case 0x27: /* Miscellaneous flags */ /* TODO */ FOR_EACH_OBJECT grf_load_byte(&buf); ret = true; @@ -445,6 +448,7 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **bufp, int len) { + EngineInfo *ei = &_engine_info[ROAD_ENGINES_INDEX + engine]; RoadVehicleInfo *rvi = &_road_vehicle_info[engine]; byte *buf = *bufp; int i; @@ -513,13 +517,17 @@ static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf break; case 0x16: /* Cargos available for refitting */ - FOR_EACH_OBJECT _engine_info[ROAD_ENGINES_INDEX + engine + i].refit_mask = grf_load_dword(&buf); + FOR_EACH_OBJECT ei[i].refit_mask = grf_load_dword(&buf); break; case 0x17: /* Callback mask */ FOR_EACH_OBJECT rvi[i].callbackmask = grf_load_byte(&buf); break; + case 0x1C: /* Miscellaneous flags */ + FOR_EACH_OBJECT ei[i].misc_flags = grf_load_byte(&buf); + break; + case 0x1D: /* Cargo classes allowed */ FOR_EACH_OBJECT cargo_allowed[ROAD_ENGINES_INDEX + engine + i] = grf_load_word(&buf); break; @@ -532,7 +540,6 @@ static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf case 0x19: /* Air drag */ case 0x1A: /* Refit cost */ case 0x1B: /* Retire vehicle early */ - case 0x1C: /* Miscellaneous flags */ /* TODO */ FOR_EACH_OBJECT grf_load_byte(&buf); ret = true; @@ -549,6 +556,7 @@ static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf static bool ShipVehicleChangeInfo(uint engine, int numinfo, int prop, byte **bufp, int len) { + EngineInfo *ei = &_engine_info[SHIP_ENGINES_INDEX + engine]; ShipVehicleInfo *svi = &_ship_vehicle_info[engine]; byte *buf = *bufp; int i; @@ -613,13 +621,17 @@ static bool ShipVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf break; case 0x11: /* Cargos available for refitting */ - FOR_EACH_OBJECT _engine_info[SHIP_ENGINES_INDEX + engine + i].refit_mask = grf_load_dword(&buf); + FOR_EACH_OBJECT ei[i].refit_mask = grf_load_dword(&buf); break; case 0x12: /* Callback mask */ FOR_EACH_OBJECT svi[i].callbackmask = grf_load_byte(&buf); break; + case 0x17: /* Miscellaneous flags */ + FOR_EACH_OBJECT ei[i].misc_flags = grf_load_byte(&buf); + break; + case 0x18: /* Cargo classes allowed */ FOR_EACH_OBJECT cargo_allowed[SHIP_ENGINES_INDEX + engine + i] = grf_load_word(&buf); break; @@ -632,7 +644,6 @@ static bool ShipVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf case 0x14: /* Ocean speed fraction */ case 0x15: /* Canal speed fraction */ case 0x16: /* Retire vehicle early */ - case 0x17: /* Miscellaneous flags */ /* TODO */ FOR_EACH_OBJECT grf_load_byte(&buf); ret = true; @@ -649,6 +660,7 @@ static bool ShipVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf static bool AircraftVehicleChangeInfo(uint engine, int numinfo, int prop, byte **bufp, int len) { + EngineInfo *ei = &_engine_info[AIRCRAFT_ENGINES_INDEX + engine]; AircraftVehicleInfo *avi = &_aircraft_vehicle_info[engine]; byte *buf = *bufp; int i; @@ -706,13 +718,17 @@ static bool AircraftVehicleChangeInfo(uint engine, int numinfo, int prop, byte * break; case 0x13: /* Cargos available for refitting */ - FOR_EACH_OBJECT _engine_info[AIRCRAFT_ENGINES_INDEX + engine + i].refit_mask = grf_load_dword(&buf); + FOR_EACH_OBJECT ei[i].refit_mask = grf_load_dword(&buf); break; case 0x14: /* Callback mask */ FOR_EACH_OBJECT avi[i].callbackmask = grf_load_byte(&buf); break; + case 0x17: /* Miscellaneous flags */ + FOR_EACH_OBJECT ei[i].misc_flags = grf_load_byte(&buf); + break; + case 0x18: /* Cargo classes allowed */ FOR_EACH_OBJECT cargo_allowed[AIRCRAFT_ENGINES_INDEX + engine + i] = grf_load_word(&buf); break; @@ -723,7 +739,6 @@ static bool AircraftVehicleChangeInfo(uint engine, int numinfo, int prop, byte * case 0x15: /* Refit cost */ case 0x16: /* Retire vehicle early */ - case 0x17: /* Miscellaneous flags */ /* TODO */ FOR_EACH_OBJECT grf_load_byte(&buf); ret = true; |