OpenTTD: src/newgrf_industrytiles.h File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Data Structures | Enumerations | Functions
newgrf_industrytiles.h File Reference

NewGRF handling of industry tiles. More...

`#include "newgrf_animation_type.h"`
`#include "newgrf_industries.h"`
`#include "core/random_func.hpp"`

Go to the source code of this file.

## Data Structures
struct | IndustryTileScopeResolver
| Resolver for the industry tiles scope. More...
struct | IndustryTileResolverObject
| Resolver for industry tiles. More...

## Enumerations
enum | IndustryTileTrigger { INDTILE_TRIGGER_TILE_LOOP = 0x01, INDUSTRY_TRIGGER_INDUSTRY_TICK = 0x02, INDUSTRY_TRIGGER_RECEIVED_CARGO = 0x04 }
| Available industry tile triggers. More...

## Functions
bool | DrawNewIndustryTile (TileInfo *ti, Industry *i, IndustryGfx gfx, const IndustryTileSpec *inds)
uint16 | GetIndustryTileCallback (CallbackID callback, uint32 param1, uint32 param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile)
CommandCost | PerformIndustryTileSlopeCheck (TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type)
| Check the slope of a tile of a new industry.
void | AnimateNewIndustryTile (TileIndex tile)
bool | StartStopIndustryTileAnimation (TileIndex tile, IndustryAnimationTrigger iat, uint32 random=Random())
bool | StartStopIndustryTileAnimation (const Industry *ind, IndustryAnimationTrigger iat)
void | TriggerIndustryTile (TileIndex t, IndustryTileTrigger trigger)
| Trigger a random trigger for a single industry tile.
void | TriggerIndustry (Industry *ind, IndustryTileTrigger trigger)
| Trigger a random trigger for all industry tiles.

## Detailed Description

NewGRF handling of industry tiles.

Definition in file newgrf_industrytiles.h.

## Enumeration Type Documentation

enum IndustryTileTrigger

Available industry tile triggers.

Enumerator:

  INDTILE_TRIGGER_TILE_LOOP | The tile of the industry has been triggered during the tileloop.
  INDUSTRY_TRIGGER_INDUSTRY_TICK | The industry has been triggered via its tick.
  INDUSTRY_TRIGGER_RECEIVED_CARGO | Cargo has been delivered.

Definition at line 68 of file newgrf_industrytiles.h.

## Function Documentation

CommandCost PerformIndustryTileSlopeCheck | ( | TileIndex | ind_base_tile,
|  | TileIndex | ind_tile,
|  | const IndustryTileSpec * | its,
|  | IndustryType | type,
|  | IndustryGfx | gfx,
|  | uint | itspec_index,
|  | uint16 | initial_random_bits,
|  | Owner | founder,
|  | IndustryAvailabilityCallType | creation_type
| ) |  |

Check the slope of a tile of a new industry.

Parameters

  ind_base_tile | Base tile of the industry.
  ind_tile | Tile to check.
  its | Tile specification.
  type | Industry type.
  gfx | Gfx of the tile.
  itspec_index | Layout.
  initial_random_bits | Random bits of industry after construction
  founder | Industry founder
  creation_type | The circumstances the industry is created under.

Returns
  Succeeded or failed command.

Definition at line 221 of file newgrf_industrytiles.cpp.

References CALLBACK_FAILED, CBID_INDTILE_SHAPE_CHECK, Industry::founder, GetErrorMessageFromLocationCallbackResult(), GetTileSlope(), IndustryTileSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Industry::location, Industry::random, return_cmd_error, IndustryTileSpec::slopes_refused, OrthogonalTileArea::tile, Industry::type, and OrthogonalTileArea::w.

Referenced by CheckIfIndustryTilesAreFree().

void TriggerIndustry | ( | Industry * | ind,
|  | IndustryTileTrigger | trigger
| ) |  |

Trigger a random trigger for all industry tiles.

Parameters

  ind | Industry to trigger.
  trigger | Trigger to trigger.

Definition at line 363 of file newgrf_industrytiles.cpp.

References DoReseedIndustry(), DoTriggerIndustryTile(), Industry::location, TILE_AREA_LOOP, and Industry::TileBelongsToIndustry().

Referenced by TriggerIndustryProduction().

void TriggerIndustryTile | ( | TileIndex | tile,
|  | IndustryTileTrigger | trigger
| ) |  |

Trigger a random trigger for a single industry tile.

Parameters

  tile | Industry tile to trigger.
  trigger | Trigger to trigger.

Definition at line 350 of file newgrf_industrytiles.cpp.

References DoReseedIndustry(), DoTriggerIndustryTile(), and Industry::GetByTile().