diff options
author | belugas <belugas@openttd.org> | 2007-05-29 17:41:59 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2007-05-29 17:41:59 +0000 |
commit | 0cb8413a8f00d04d47a9139cd6bb353a70c2725a (patch) | |
tree | 1aeb23997834a9c170eaccd145921f1387c70451 /src/industry.h | |
parent | 0af97d4ab2fea4f9aef04d8eb1c77b80c2f1d5c6 (diff) | |
download | openttd-0cb8413a8f00d04d47a9139cd6bb353a70c2725a.tar.xz |
(svn r9976) -Codechange: Declare a writable array of specs for industry and industry tiles.
It will be initialized by the original data upon game start.
Rename some enums to be more consistent too
Diffstat (limited to 'src/industry.h')
-rw-r--r-- | src/industry.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/industry.h b/src/industry.h index ab5a54f9b..df29a7189 100644 --- a/src/industry.h +++ b/src/industry.h @@ -12,10 +12,14 @@ typedef byte IndustryGfx; typedef uint8 IndustryType; enum { - INVALID_INDUSTRY = 0xFFFF, - NUM_INDUSTRYTYPES = 37, - INDUTILE_NOANIM = 0xFF, ///< flag to mark industry tiles as having no animation - INVALID_INDUSTRYTYPE = NUM_INDUSTRYTYPES, ///< one above amount is considered invalid + INVALID_INDUSTRY = 0xFFFF, + NEW_INDUSTRYOFFSET = 37, ///< original number of industries + NUM_INDUSTRYTYPES = 37, ///< total number of industries, new and old + INDUSTRYTILE_NOANIM = 0xFF, ///< flag to mark industry tiles as having no animation + NEW_INDUSTRYTILEOFFSET = 175, ///< original number of tiles + INVALID_INDUSTRYTYPE = NUM_INDUSTRYTYPES, ///< one above amount is considered invalid + NUM_INDUSTRYTILES = NEW_INDUSTRYTILEOFFSET, ///< total number of industry tiles, new and old + INVALID_INDUSTRYTILE = NUM_INDUSTRYTILES, ///< one above amount is considered invalid }; enum IndustryLifeType { @@ -147,17 +151,21 @@ struct IndustryTileSpec { bool anim_state; ///< When true, the tile has to be drawn using the animation ///< state instead of the construction state /* Newgrf data */ - uint8 callback_flags; ///< Flags telling which grf callback is set + uint8 callback_flags; ///< Flags telling which grf callback is set bool enabled; ///< entity still avaible (by default true).newgrf can disable it, though struct GRFFileProps grf_prop; }; /* industry_cmd.cpp*/ -const IndustrySpec *GetIndustrySpec(IndustryType thistype); ///< Array of industries default data -const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx); ///< Array of industry tiles default data +const IndustrySpec *GetIndustrySpec(IndustryType thistype); ///< Array of industries data +const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx); ///< Array of industry tiles data void ResetIndustries(); void PlantRandomFarmField(const Industry *i); +/* writable arrays of specs */ +extern IndustrySpec _industry_specs[NUM_INDUSTRYTYPES]; +extern IndustryTileSpec _industry_tile_specs[NUM_INDUSTRYTILES]; + /* smallmap_gui.cpp */ void BuildIndustriesLegend(); |