OpenTTD Source: src/newgrf/newgrf_act0_industries.cpp File Reference

OpenTTD Source 15.0-RC2

Functions
newgrf_act0_industries.cpp File Reference

NewGRF Action 0x00 handler for industries and industrytiles. More...

`#include "../stdafx.h"`
`#include "../debug.h"`
`#include "../newgrf_cargo.h"`
`#include "../industry.h"`
`#include "../industrytype.h"`
`#include "../industry_map.h"`
`#include "../newgrf_industries.h"`
`#include "newgrf_bytereader.h"`
`#include "newgrf_internal.h"`
`#include "newgrf_stringmapping.h"`
`#include "table/strings.h"`
`#include "../table/build_industry.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Functions
static ChangeInfoResult | IgnoreIndustryTileProperty (int prop, ByteReader &buf)
| Ignore an industry tile property.
static ChangeInfoResult | IndustrytilesChangeInfo (uint first, uint last, int prop, ByteReader &buf)
| Define properties for industry tiles.
static ChangeInfoResult | IgnoreIndustryProperty (int prop, ByteReader &buf)
| Ignore an industry property.
static bool | ValidateIndustryLayout (const IndustryTileLayout &layout)
| Validate the industry layout; e.g.
static ChangeInfoResult | IndustriesChangeInfo (uint first, uint last, int prop, ByteReader &buf)
| Define properties for industries.

## Detailed Description

NewGRF Action 0x00 handler for industries and industrytiles.

Definition in file newgrf_act0_industries.cpp.

## Function Documentation

## ◆ IgnoreIndustryProperty()

static ChangeInfoResult IgnoreIndustryProperty | ( | int | prop,
|  | ByteReader & | buf
| ) |  |
| static

Ignore an industry property.

Parameters

  prop | The property to ignore.
  buf | The property value.

Returns
  ChangeInfoResult.

Definition at line 210 of file newgrf_act0_industries.cpp.

References CIR_SUCCESS, CIR_UNKNOWN, INDUSTRY_ORIGINAL_NUM_INPUTS, ByteReader::ReadByte(), ByteReader::ReadDWord(), ByteReader::ReadWord(), and SkipBadgeList().

Referenced by IndustriesChangeInfo().

## ◆ IgnoreIndustryTileProperty()

static ChangeInfoResult IgnoreIndustryTileProperty | ( | int | prop,
|  | ByteReader & | buf
| ) |  |
| static

Ignore an industry tile property.

Parameters

  prop | The property to ignore.
  buf | The property value.

Returns
  ChangeInfoResult.

Definition at line 32 of file newgrf_act0_industries.cpp.

References CIR_SUCCESS, CIR_UNKNOWN, ByteReader::ReadByte(), and ByteReader::ReadWord().

Referenced by IndustrytilesChangeInfo().

## ◆ IndustriesChangeInfo()

static ChangeInfoResult IndustriesChangeInfo | ( | uint | first,
|  | uint | last,
|  | int | prop,
|  | ByteReader & | buf
| ) |  |
| static

Define properties for industries.

Parameters

  first | Local ID of the first industry.
  last | Local ID of the last industry.
  prop | The property to change.
  buf | The property value.

Returns
  ChangeInfoResult.

Definition at line 337 of file newgrf_act0_industries.cpp.

References _settings_game, OverrideManagerBase::Add(), AddStringForMapping(), CHECK_NOTHING, CIR_DISABLED, CIR_INVALID_ID, CIR_SUCCESS, CIR_UNKNOWN, CT_INVALID, DisableGrf(), IndustrySpec::enabled, GameSettings::game_creation, GB(), GetCargoTranslation(), OverrideManagerBase::GetID(), GFX_WATERTILE_SPECIALCHECK, GrfProcessingState::grffile, IgnoreIndustryProperty(), INDUSTRY_ORIGINAL_NUM_INPUTS, INDUSTRY_ORIGINAL_NUM_OUTPUTS, INVALID_INDUSTRYTILE, GameCreationSettings::landscape, lengthof, NEW_INDUSTRYOFFSET, NUM_INDUSTRYTYPES_PER_GRF, GRFError::param_value, ReadBadgeList(), ByteReader::ReadByte(), ByteReader::ReadDWord(), ByteReader::ReadWord(), SB(), to_underlying(), ValidateIndustryLayout(), TileIndexDiffC::x, and TileIndexDiffC::y.

## ◆ IndustrytilesChangeInfo()

static ChangeInfoResult IndustrytilesChangeInfo | ( | uint | first,
|  | uint | last,
|  | int | prop,
|  | ByteReader & | buf
| ) |  |
| static

Define properties for industry tiles.

Parameters

  first | Local ID of the first industry tile.
  last | Local ID of the last industry tile.
  prop | The property to change.
  buf | The property value.

Returns
  ChangeInfoResult.

Definition at line 72 of file newgrf_act0_industries.cpp.

References OverrideManagerBase::Add(), OverrideManagerBase::AddEntityID(), CIR_DISABLED, CIR_INVALID_ID, CIR_SUCCESS, CIR_UNKNOWN, Clamp(), CT_INVALID, DisableGrf(), GB(), GetCargoTranslation(), GrfProcessingState::grffile, IgnoreIndustryTileProperty(), INDUSTRYTILE_NOANIM, NEW_INDUSTRYTILEOFFSET, NUM_INDUSTRYTILES_PER_GRF, GRFError::param_value, ReadBadgeList(), ByteReader::ReadByte(), and ByteReader::ReadWord().

## ◆ ValidateIndustryLayout()

static bool ValidateIndustryLayout | ( | const IndustryTileLayout & | layout | ) |
| static

Validate the industry layout; e.g.

to prevent duplicate tiles.

Parameters

  layout | The layout to check.

Returns
  True if the layout is deemed valid.

Definition at line 304 of file newgrf_act0_industries.cpp.

References GFX_WATERTILE_SPECIALCHECK.

Referenced by IndustriesChangeInfo().