# newgrf_industrytiles.cpp File Reference

NewGRF handling of industry tiles. More...

`#include "stdafx.h"`
`#include "variables.h"`
`#include "debug.h"`
`#include "viewport_func.h"`
`#include "landscape.h"`
`#include "newgrf.h"`
`#include "newgrf_commons.h"`
`#include "newgrf_industries.h"`
`#include "newgrf_industrytiles.h"`
`#include "newgrf_sound.h"`
`#include "newgrf_text.h"`
`#include "industry.h"`
`#include "functions.h"`
`#include "town.h"`
`#include "command_func.h"`
`#include "animated_tile_func.h"`
`#include "water.h"`
`#include "sprite.h"`
`#include "table/strings.h"`

Go to the source code of this file.

## Functions
uint32 | GetNearbyIndustryTileInformation (byte parameter, TileIndex tile, IndustryID index, bool signed_offsets)
| Based on newhouses equivalent, but adapted for newindustries.
static uint32 | GetRelativePosition (TileIndex tile, TileIndex ind_tile)
| This is the position of the tile relative to the northernmost tile of the industry.
static uint32 | IndustryTileGetVariable (const ResolverObject *object, byte variable, byte parameter, bool *available)
static const SpriteGroup * | IndustryTileResolveReal (const ResolverObject *object, const RealSpriteGroup *group)
static uint32 | IndustryTileGetRandomBits (const ResolverObject *object)
static uint32 | IndustryTileGetTriggers (const ResolverObject *object)
static void | IndustryTileSetTriggers (const ResolverObject *object, int triggers)
static void | NewIndustryTileResolver (ResolverObject *res, IndustryGfx gfx, TileIndex tile, Industry *indus)
static void | IndustryDrawTileLayout (const TileInfo *ti, const TileLayoutSpriteGroup *group, byte rnd_colour, byte stage, IndustryGfx gfx)
uint16 | GetIndustryTileCallback (CallbackID callback, uint32 param1, uint32 param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile)
bool | DrawNewIndustryTile (TileInfo *ti, Industry *i, IndustryGfx gfx, const IndustryTileSpec *inds)
bool | IsSlopeRefused (Slope current, Slope refused)
bool | PerformIndustryTileSlopeCheck (TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index)
void | AnimateNewIndustryTile (TileIndex tile)
static void | ChangeIndustryTileAnimationFrame (const IndustryTileSpec *itspec, TileIndex tile, IndustryAnimationTrigger iat, uint32 random_bits, IndustryGfx gfx, Industry *ind)
bool | StartStopIndustryTileAnimation (TileIndex tile, IndustryAnimationTrigger iat, uint32 random)
bool | StartStopIndustryTileAnimation (const Industry *ind, IndustryAnimationTrigger iat)
static void | DoTriggerIndustryTile (TileIndex tile, IndustryTileTrigger trigger, Industry *ind)
void | TriggerIndustryTile (TileIndex tile, IndustryTileTrigger trigger)
void | TriggerIndustry (Industry *ind, IndustryTileTrigger trigger)

## Detailed Description

NewGRF handling of industry tiles.

Definition in file newgrf_industrytiles.cpp.

## Function Documentation

uint32 GetNearbyIndustryTileInformation | ( | byte | parameter,
|  | TileIndex | tile,
|  | IndustryID | index,
|  | bool | signed_offsets |
| ) |  |  |

Based on newhouses equivalent, but adapted for newindustries.

Parameters:

  | parameter | from callback. It's in fact a pair of coordinates
  | tile | TileIndex from which the callback was initiated
  | index | of the industry been queried for
  | signed_offsets | Are the x and y offset encoded in parameter signed?

Returns:
  a construction of bits obeying the newgrf format

Definition at line 41 of file newgrf_industrytiles.cpp.

References GetIndustryIndex(), GetNearbyTileInformation(), IsTileType(), and MP_INDUSTRY.

Referenced by IndustryGetVariable().

static uint32 GetRelativePosition | ( | TileIndex | tile,
|  | TileIndex | ind_tile |
| ) |  |  | `[static]`

This is the position of the tile relative to the northernmost tile of the industry.

Format: 00yxYYXX Variable Content x the x offset from the northernmost tile XX same, but stored in a byte instead of a nibble y the y offset from the northernmost tile YY same, but stored in a byte instead of a nibble

Parameters:

  | tile | TileIndex of the tile to evaluate
  | ind_tile | northernmost tile of the industry

Definition at line 59 of file newgrf_industrytiles.cpp.

References TileX(), and TileY().