|
OpenTTD Source 20260712-master-gcf48f866eb
|
NewGRF Action 0x0D handler. More...
#include "../stdafx.h"#include "../debug.h"#include "../newgrf.h"#include "../newgrf_engine.h"#include "../newgrf_cargo.h"#include "../timer/timer_game_calendar.h"#include "../error.h"#include "../engine_func.h"#include "../vehicle_base.h"#include "../rail.h"#include "../road.h"#include "newgrf_bytereader.h"#include "newgrf_internal.h"#include "table/strings.h"#include "../safeguards.h"Go to the source code of this file.
Functions | |
| void | ResetGRM () |
| static void | SafeParamSet (ByteReader &buf) |
| static uint32_t | GetPatchVariable (uint8_t param) |
| static uint32_t | PerformGRM (std::span< GrfID > grm, uint16_t count, uint8_t op, uint8_t target, std::string_view type) |
| Performs the GRF Resource Management, where NewGRFs can cooperatively manage sprite resources. | |
| static void | ParamSet (ByteReader &buf) |
| Action 0x0D - Set parameter. | |
Variables | |
| static std::array< GrfID, 256 > | _grm_engines {} |
| Contains the GRF ID of the owner of a vehicle if it has been reserved. | |
| static std::array< GrfID, NUM_CARGO *2 > | _grm_cargoes {} |
| Contains the GRF ID of the owner of a cargo if it has been reserved. | |
NewGRF Action 0x0D handler.
Definition in file newgrf_actd.cpp.
|
static |
Definition at line 58 of file newgrf_actd.cpp.
|
static |
Action 0x0D - Set parameter.
| buf | Reader of the NewGRF. |
Definition at line 198 of file newgrf_actd.cpp.
References _grm_cargoes, _grm_engines, _misc_grf_features, _networking, _settings_game, Activation, Aircraft, Cargoes, RailTypeInfo::cost_multiplier, Disabled, DisableGrf(), DisableStaticNewGRFInfluencingNonStaticNewGRFs(), GRFConfig::flags, GB(), GetFileByGRFID(), GetGRFConfig(), GetOriginalEngineCount(), GetOriginalEngineOffset(), GRFFile::GetParam(), GetVehicleType(), GlobalVar, HasBit(), PerformGRM(), RAILTYPE_ELECTRIC, RAILTYPE_END, RAILTYPE_MAGLEV, RAILTYPE_MONO, RAILTYPE_RAIL, ByteReader::ReadByte(), ByteReader::ReadDWord(), Reserve, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), RoadVehicles, SecondRockyTileSet, Ships, Static, GRFConfig::status, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Trains, TrainWidth32Pixels, and GRFConfig::version.
Referenced by GrfActionHandler< TAction >::Activation(), GrfActionHandler< TAction >::Init(), and GrfActionHandler< TAction >::Reserve().
|
static |
Performs the GRF Resource Management, where NewGRFs can cooperatively manage sprite resources.
| grm | Mapping to the NewGRF linked with a resource. |
| count | The number of elements to process. |
| op | The operation to perform. |
| target | The target for the operation. |
| type | Name of type for debug messages. |
Definition at line 144 of file newgrf_actd.cpp.
References DisableGrf().
Referenced by ParamSet().
| void ResetGRM | ( | ) |
Definition at line 37 of file newgrf_actd.cpp.
|
static |
Definition at line 44 of file newgrf_actd.cpp.
Contains the GRF ID of the owner of a cargo if it has been reserved.
Definition at line 35 of file newgrf_actd.cpp.
Referenced by ParamSet().
|
static |
Contains the GRF ID of the owner of a vehicle if it has been reserved.
GRM for vehicles is only used if dynamic engine allocation is disabled, so 256 is the number of original engines.
Definition at line 32 of file newgrf_actd.cpp.
Referenced by ParamSet().