OpenTTD Source 20250331-master-g3c15e0c889
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
propThe property to ignore.
bufThe 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
propThe property to ignore.
bufThe 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()

◆ IndustrytilesChangeInfo()

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

Define properties for industry tiles.

Parameters
firstLocal ID of the first industry tile.
lastLocal ID of the last industry tile.
propThe property to change.
bufThe 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
layoutThe 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().