OpenTTD Source 20260711-master-g3fb3006dff
newgrf_act7_9.cpp File Reference

NewGRF Action 0x07 and Action 0x09 handler. More...

#include "../stdafx.h"
#include "../debug.h"
#include "../genworld.h"
#include "../network/network.h"
#include "../newgrf_engine.h"
#include "../newgrf_cargo.h"
#include "../rail.h"
#include "../road.h"
#include "../settings_type.h"
#include "newgrf_bytereader.h"
#include "newgrf_internal.h"
#include "../safeguards.h"

Go to the source code of this file.

Functions

static bool IsSignalSideOnTrafficSide ()
 Checks whether the train signals are on the same side as the road vehicles are driving.
void InitializePatchFlags ()
 Initialize the TTDPatch flags.
uint32_t GetParamVal (uint8_t param, uint32_t *cond_val)
static void SkipIf (ByteReader &buf)

Variables

static std::array< uint32_t, 8 > _ttdpatch_flags
 32 * 8 = 256 flags.

Detailed Description

NewGRF Action 0x07 and Action 0x09 handler.

Definition in file newgrf_act7_9.cpp.

Function Documentation

◆ GetParamVal()

uint32_t GetParamVal ( uint8_t param,
uint32_t * cond_val )

Definition at line 131 of file newgrf_act7_9.cpp.

◆ InitializePatchFlags()

void InitializePatchFlags ( )

Initialize the TTDPatch flags.

Definition at line 43 of file newgrf_act7_9.cpp.

References _generating_world, _settings_game, _ttdpatch_flags, and IsSignalSideOnTrafficSide().

Referenced by LoadNewGRF().

◆ IsSignalSideOnTrafficSide()

bool IsSignalSideOnTrafficSide ( )
static

Checks whether the train signals are on the same side as the road vehicles are driving.

This is a flag that can be checked by NewGRFs (TTDPatchFlags bit 0x3B).

Returns
true iff the road vehicles drive on the same side as signals are drawn.

Definition at line 32 of file newgrf_act7_9.cpp.

References _settings_game, Left, Right, and RoadVehicleDrivingSide.

Referenced by InitializePatchFlags().

◆ SkipIf()

void SkipIf ( ByteReader & buf)
static

Definition at line 177 of file newgrf_act7_9.cpp.

Variable Documentation

◆ _ttdpatch_flags

std::array<uint32_t, 8> _ttdpatch_flags
static

32 * 8 = 256 flags.

Apparently TTDPatch uses this many..

Definition at line 25 of file newgrf_act7_9.cpp.

Referenced by InitializePatchFlags().