|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
10 #ifndef INDUSTRY_MAP_H
11 #define INDUSTRY_MAP_H
23 GFX_COAL_MINE_TOWER_NOT_ANIMATED = 0,
24 GFX_COAL_MINE_TOWER_ANIMATED = 1,
25 GFX_POWERPLANT_CHIMNEY = 8,
26 GFX_POWERPLANT_SPARKS = 10,
32 GFX_OILWELL_NOT_ANIMATED = 29,
33 GFX_OILWELL_ANIMATED_1 = 30,
34 GFX_OILWELL_ANIMATED_2 = 31,
35 GFX_OILWELL_ANIMATED_3 = 32,
36 GFX_COPPER_MINE_TOWER_NOT_ANIMATED = 47,
37 GFX_COPPER_MINE_TOWER_ANIMATED = 48,
38 GFX_COPPER_MINE_CHIMNEY = 49,
39 GFX_GOLD_MINE_TOWER_NOT_ANIMATED = 79,
40 GFX_GOLD_MINE_TOWER_ANIMATED = 88,
41 GFX_TOY_FACTORY = 143,
42 GFX_PLASTIC_FOUNTAIN_ANIMATED_1 = 148,
43 GFX_PLASTIC_FOUNTAIN_ANIMATED_2 = 149,
44 GFX_PLASTIC_FOUNTAIN_ANIMATED_3 = 150,
45 GFX_PLASTIC_FOUNTAIN_ANIMATED_4 = 151,
46 GFX_PLASTIC_FOUNTAIN_ANIMATED_5 = 152,
47 GFX_PLASTIC_FOUNTAIN_ANIMATED_6 = 153,
48 GFX_PLASTIC_FOUNTAIN_ANIMATED_7 = 154,
49 GFX_PLASTIC_FOUNTAIN_ANIMATED_8 = 155,
50 GFX_BUBBLE_GENERATOR = 161,
51 GFX_BUBBLE_CATCHER = 162,
52 GFX_TOFFEE_QUARY = 165,
53 GFX_SUGAR_MINE_SIEVE = 174,
91 SB(tile.
m1(), 7, 1, 1);
115 SB(tile.
m1(), 0, 2, value);
128 return t.
m5() | (
GB(t.
m6(), 2, 1) << 8);
152 t.
m5() =
GB(gfx, 0, 8);
153 SB(t.
m6(), 2, 1,
GB(gfx, 8, 1));
165 return GB(tile.
m1(), 2, 2);
177 SB(tile.
m1(), 2, 2, value);
190 SB(tile.
m1(), 0, 4, 0);
191 SB(tile.
m1(), 7, 1, 0);
253 return GB(tile.
m6(), 3, 3);
267 SB(tile.
m6(), 3, 3, triggers);
void SetIndustryTriggers(Tile tile, byte triggers)
Set the activated triggers bits for this industry tile Used for grf callbacks.
byte GetIndustryConstructionStage(Tile tile)
Returns the industry construction stage of the specified tile.
IndustryGraphics
The following enums are indices used to know what to draw for this industry tile.
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
IndustryGfx GetIndustryGfx(Tile t)
Get the industry graphics ID for the given industry tile.
debug_inline byte & m6()
General purpose.
Wrapper class to abstract away the way the tiles are stored.
@ MP_INDUSTRY
Part of an industry.
debug_inline byte & m5()
General purpose.
debug_inline byte & m1()
Primarily used for ownership information.
@ GFX_WATERTILE_SPECIALCHECK
not really a tile, but rather a very special check
debug_inline byte & m4()
General purpose.
IndustryType GetIndustryType(Tile tile)
Retrieve the type for this industry.
void SetIndustryCompleted(Tile tile)
Set if the industry that owns the tile as under construction or not.
static const int INDUSTRY_COMPLETED
final stage of industry construction.
debug_inline byte & m7()
Primarily used for newgrf support.
void SetIndustryAnimationLoop(Tile tile, byte count)
Set the animation loop number.
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
void SetIndustryGfx(Tile t, IndustryGfx gfx)
Set the industry graphics ID for the given industry tile.
IndustryID GetIndustryIndex(Tile t)
Get the industry ID of the given tile.
void SetWaterClass(Tile t, WaterClass wc)
Set the water class at a tile.
IndustryGfx GetCleanIndustryGfx(Tile t)
Get the industry graphics ID for the given industry tile as stored in the without translation.
void ResetIndustryConstructionStage(Tile tile)
Reset the construction stage counter of the industry, as well as the completion bit.
void SetIndustryConstructionStage(Tile tile, byte value)
Sets the industry construction stage of the specified tile.
void MakeIndustry(Tile t, IndustryID index, IndustryGfx gfx, uint8_t random, WaterClass wc)
Make the given tile an industry tile.
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
byte GetIndustryAnimationLoop(Tile tile)
Get the animation loop number.
void SetIndustryConstructionCounter(Tile tile, byte value)
Sets this industry tile's construction counter value.
void SetIndustryRandomBits(Tile tile, byte bits)
Set the random bits for this tile.
byte GetIndustryTriggers(Tile tile)
Get the activated triggers bits for this industry tile Used for grf callbacks.
byte GetIndustryRandomBits(Tile tile)
Get the random bits for this tile.
byte GetIndustryConstructionCounter(Tile tile)
Returns this industry tile's construction counter value.
constexpr T SB(T &x, const uint8_t s, const uint8_t n, const U d)
Set n bits in x starting at bit s to d.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
debug_inline byte & m3()
General purpose.
bool IsIndustryCompleted(Tile t)
Is this industry tile fully built?
IndustryGfx GetTranslatedIndustryTileID(IndustryGfx gfx)
Do industry gfx ID translation for NewGRFs.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.