diff options
author | peter1138 <peter1138@openttd.org> | 2006-04-23 22:25:33 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-04-23 22:25:33 +0000 |
commit | 7555d8528b5e12cc9d73c810d89f9bbaf8d8fd87 (patch) | |
tree | 28cddf5dd52d151cd3f987efd80935ebf740f84c /newgrf_engine.c | |
parent | fd2a005139eb3a94db9e6dbe0effd5e26e853381 (diff) | |
download | openttd-7555d8528b5e12cc9d73c810d89f9bbaf8d8fd87.tar.xz |
(svn r4559) - NewGRF: keep a record of which grf an engine is defined in. Will be used in the future.
Diffstat (limited to 'newgrf_engine.c')
-rw-r--r-- | newgrf_engine.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/newgrf_engine.c b/newgrf_engine.c index e6f878a7c..965aa696a 100644 --- a/newgrf_engine.c +++ b/newgrf_engine.c @@ -99,6 +99,7 @@ void UnloadWagonOverrides(void) // may appear in future - however it's more convenient to store it like this in // memory. --pasky) static SpriteGroup *engine_custom_sprites[TOTAL_NUM_ENGINES][NUM_GLOBAL_CID]; +static uint32 _engine_grf[TOTAL_NUM_ENGINES]; void SetCustomEngineSprites(EngineID engine, byte cargo, SpriteGroup *group) { @@ -121,9 +122,23 @@ void UnloadCustomEngineSprites(void) for (cargo = 0; cargo < NUM_GLOBAL_CID; cargo++) { engine_custom_sprites[engine][cargo] = NULL; } + _engine_grf[engine] = 0; } } +void SetEngineGRF(EngineID engine, uint32 grfid) +{ + assert(engine < TOTAL_NUM_ENGINES); + _engine_grf[engine] = grfid; +} + +uint32 GetEngineGRFID(EngineID engine) +{ + assert(engine < TOTAL_NUM_ENGINES); + return _engine_grf[engine]; +} + + static int MapOldSubType(const Vehicle *v) { if (v->type != VEH_Train) return v->subtype; |