OpenTTD Source: src/newgrf_industrytiles.h File Reference

OpenTTD Source 15.3

Data Structures | Functions
newgrf_industrytiles.h File Reference

NewGRF handling of industry tiles. More...

`#include "newgrf_animation_type.h"`
`#include "newgrf_industries.h"`

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...

## Functions
bool | DrawNewIndustryTile (TileInfo *ti, Industry *i, IndustryGfx gfx, const IndustryTileSpec *inds)
uint16_t | GetIndustryTileCallback (CallbackID callback, uint32_t param1, uint32_t param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile, std::span< int32_t > regs100={})
CommandCost | PerformIndustryTileSlopeCheck (TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, size_t layout_index, uint16_t initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type)
| Check the slope of a tile of a new industry.
void | AnimateNewIndustryTile (TileIndex tile)
bool | TriggerIndustryTileAnimation (TileIndex tile, IndustryAnimationTrigger iat)
bool | TriggerIndustryTileAnimation_ConstructionStageChanged (TileIndex tile, bool first_call)
bool | TriggerIndustryAnimation (const Industry *ind, IndustryAnimationTrigger iat)
void | TriggerIndustryTileRandomisation (TileIndex t, IndustryRandomTrigger trigger)
| Trigger a random trigger for a single industry tile.
void | TriggerIndustryRandomisation (Industry *ind, IndustryRandomTrigger trigger)
| Trigger a random trigger for all industry tiles.

## Detailed Description

NewGRF handling of industry tiles.

Definition in file newgrf_industrytiles.h.

## Function Documentation

## ◆ AnimateNewIndustryTile()

void AnimateNewIndustryTile | ( | TileIndex | tile | ) |

Definition at line 271 of file newgrf_industrytiles.cpp.

## ◆ DrawNewIndustryTile()

bool DrawNewIndustryTile | ( | TileInfo * | ti,
|  | Industry * | i,
|  | IndustryGfx | gfx,
|  | const IndustryTileSpec * | inds
| ) |  |

Definition at line 191 of file newgrf_industrytiles.cpp.

## ◆ GetIndustryTileCallback()

uint16_t GetIndustryTileCallback | ( | CallbackID | callback,
|  | uint32_t | param1,
|  | uint32_t | param2,
|  | IndustryGfx | gfx_id,
|  | Industry * | industry,
|  | TileIndex | tile,
|  | std::span< int32_t > | regs100 = `{}`
| ) |  |

Definition at line 182 of file newgrf_industrytiles.cpp.

## ◆ PerformIndustryTileSlopeCheck()

CommandCost PerformIndustryTileSlopeCheck | ( | TileIndex | ind_base_tile,
|  | TileIndex | ind_tile,
|  | const IndustryTileSpec * | its,
|  | IndustryType | type,
|  | IndustryGfx | gfx,
|  | size_t | layout_index,
|  | uint16_t | 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.
  layout_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 232 of file newgrf_industrytiles.cpp.

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

Referenced by CheckIfIndustryTileSlopes().

## ◆ TriggerIndustryAnimation()

bool TriggerIndustryAnimation | ( | const Industry * | ind,
|  | IndustryAnimationTrigger | iat
| ) |  |

Definition at line 300 of file newgrf_industrytiles.cpp.

## ◆ TriggerIndustryRandomisation()

void TriggerIndustryRandomisation | ( | Industry * | ind,
|  | IndustryRandomTrigger | trigger
| ) |  |

Trigger a random trigger for all industry tiles.

Parameters

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

Definition at line 388 of file newgrf_industrytiles.cpp.

References DoReseedIndustry(), DoTriggerIndustryTileRandomisation(), Industry::location, and Industry::TileBelongsToIndustry().

Referenced by TriggerIndustryProduction().

## ◆ TriggerIndustryTileAnimation()

bool TriggerIndustryTileAnimation | ( | TileIndex | tile,
|  | IndustryAnimationTrigger | iat
| ) |  |

Definition at line 294 of file newgrf_industrytiles.cpp.

## ◆ TriggerIndustryTileAnimation_ConstructionStageChanged()

bool TriggerIndustryTileAnimation_ConstructionStageChanged | ( | TileIndex | tile,
|  | bool | first_call
| ) |  |

Definition at line 288 of file newgrf_industrytiles.cpp.

## ◆ TriggerIndustryTileRandomisation()

void TriggerIndustryTileRandomisation | ( | TileIndex | tile,
|  | IndustryRandomTrigger | trigger
| ) |  |

Trigger a random trigger for a single industry tile.

Parameters

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

Definition at line 375 of file newgrf_industrytiles.cpp.

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