OpenTTD
Data Structures | Macros | Functions | Variables
newgrf_debug_data.h File Reference

Data 'tables' for NewGRF debugging. More...

#include "../newgrf_house.h"
#include "../newgrf_engine.h"

Go to the source code of this file.

Data Structures

class  NIHVehicle
 
class  NIHStation
 
class  NIHHouse
 
class  NIHIndustryTile
 
class  NIHIndustry
 
class  NIHObject
 
class  NIHRailType
 
class  NIHAirportTile
 
class  NIHTown
 

Macros

#define NIP(prop, base, variable, type, name)   { name, (ptrdiff_t)cpp_offsetof(base, variable), cpp_sizeof(base, variable), prop, type }
 
#define NIP_END()   { NULL, 0, 0, 0, 0 }
 
#define NIC(cb_id, base, variable, bit)   { #cb_id, (ptrdiff_t)cpp_offsetof(base, variable), cpp_sizeof(base, variable), bit, cb_id }
 
#define NIC_END()   { NULL, 0, 0, 0, 0 }
 
#define NIV(var, name)   { name, var }
 
#define NIV_END()   { NULL, 0 }
 
#define NICV(cb_id, bit)   NIC(cb_id, Engine, info.callback_mask, bit)
 
#define NICS(cb_id, bit)   NIC(cb_id, StationSpec, callback_mask, bit)
 
#define NICH(cb_id, bit)   NIC(cb_id, HouseSpec, callback_mask, bit)
 
#define NICIT(cb_id, bit)   NIC(cb_id, IndustryTileSpec, callback_mask, bit)
 
#define NICI(cb_id, bit)   NIC(cb_id, IndustrySpec, callback_mask, bit)
 
#define NICO(cb_id, bit)   NIC(cb_id, ObjectSpec, callback_mask, bit)
 
#define NICAT(cb_id, bit)   NIC(cb_id, AirportTileSpec, callback_mask, bit)
 

Functions

 assert_compile (lengthof(_nifeatures)==GSF_FAKE_END)
 

Variables

static const NICallback _nic_vehicles []
 
static const NIVariable _niv_vehicles []
 
static const NIFeature _nif_vehicle
 
static const NICallback _nic_stations []
 
static const NIVariable _niv_stations []
 
static const NIFeature _nif_station
 
static const NICallback _nic_house []
 
static const NIVariable _niv_house []
 
static const NIFeature _nif_house
 
static const NICallback _nic_industrytiles []
 
static const NIVariable _niv_industrytiles []
 
static const NIFeature _nif_industrytile
 
static const NIProperty _nip_industries []
 
static const NICallback _nic_industries []
 
static const NIVariable _niv_industries []
 
static const NIFeature _nif_industry
 
static const NICallback _nic_objects []
 
static const NIVariable _niv_objects []
 
static const NIFeature _nif_object
 
static const NIVariable _niv_railtypes []
 
static const NIFeature _nif_railtype
 
static const NICallback _nic_airporttiles []
 
static const NIFeature _nif_airporttile
 
static const NIVariable _niv_towns []
 
static const NIFeature _nif_town
 
static const NIFeature *const _nifeatures []
 Table with all NIFeatures. More...
 

Detailed Description

Data 'tables' for NewGRF debugging.

Definition in file newgrf_debug_data.h.

Variable Documentation

◆ _nic_airporttiles

const NICallback _nic_airporttiles[]
static
Initial value:
= {
}
Called to determine airport tile next animation frame.
decides animation speed
decides if default foundations need to be drawn
decides next animation frame
static const int CBM_NO_BIT
Mask to show no bit needs to be enabled for the callback.
Called to determine the type (if any) of foundation to draw for an airport tile.
Called to indicate how long the current animation frame should last.
Called for periodically starting or stopping the animation.

Definition at line 448 of file newgrf_debug_data.h.

◆ _nic_house

const NICallback _nic_house[]
static
Initial value:
= {
}
decides accepted types
Called to determine if one can alter the ground below a house tile.
Called periodically to determine if a house should be destroyed.
Called to indicate how long the current animation frame should last.
change animation when construction state changes
Called to determine whether a town building can be destroyed.
Called to determine which cargoes a town building should accept.
decides animation speed
decides amount of cargo acceptance
Called to determine the type (if any) of foundation to draw for house tile.
Called to determine the colour of a town building.
Called on the Get Tile Description for an house tile.
Called when a cargo type specified in property 20 is accepted.
custom cargo production
trigger destruction of building
decide the colour of the building
decides allowance of autosloping
decides next animation frame
periodically start/stop the animation
Called whenever the construction state of a house changes.
Determine whether the house can be built on the specified tile.
static const int CBM_NO_BIT
Mask to show no bit needs to be enabled for the callback.
Called for periodically starting or stopping the animation.
decides if default foundations need to be drawn
conditional protection
Determine the next animation frame for a house.
Called to determine how much cargo a town building produces.
decide whether the house can be built on a given tile
Called to decide how much cargo a town building can accept.

Definition at line 160 of file newgrf_debug_data.h.

◆ _nic_industries

const NICallback _nic_industries[]
static
Initial value:
= {
}
customize the cargoes the industry produces
initialise production level on construction
Called to determine if the given industry can be built on specific area.
Customize the input cargo types of a newly build industry.
Called monthly on production changes, so it can be adjusted more frequently.
check industry construction on given area
control special effects
Called to determine more text in the fund industry window.
Customize the output cargo types of a newly build industry.
Called to determine if the given industry type is available.
controls random production change
additional text in industry window
customize the cargoes the industry requires
additional text in fund window
Called to determine if the industry can still accept or refuse more cargo arrival.
Called to determine the colour of an industry.
industry availability/probability callback
controls monthly random production change
option out of accepting cargo
cargo sub-type display
Called to determine text to display after cargo name.
Called to determine more text in the industry window.
Called to determine industry special effects.
Called when industry is built to set initial production level.
Called on production changes, so it can be adjusted.
give a custom colour to newly build industries

Definition at line 284 of file newgrf_debug_data.h.

◆ _nic_industrytiles

const NICallback _nic_industrytiles[]
static
Initial value:
= {
}
Called to determine if the given industry tile can be built on specific tile.
Called for periodically starting or stopping the animation.
Called to indicate how long the current animation frame should last.
decides allowance of autosloping
decides if default foundations need to be drawn
Called to determine if industry can alter the ground below industry tile.
Called to determine the type (if any) of foundation to draw for industry tile.
decides amount of cargo acceptance
decides animation speed
decides accepted types
Called to determine which cargoes an industry should accept.
static const int CBM_NO_BIT
Mask to show no bit needs to be enabled for the callback.
Called to determine industry tile next animation frame.
decides next animation frame
Called to query the cargo acceptance of the industry tile.
decides slope suitability

Definition at line 225 of file newgrf_debug_data.h.

◆ _nic_objects

const NICallback _nic_objects[]
static
Initial value:
= {
}
decides next animation frame
decides animation speed
Called to determine more text in the fund object window.
additional text in fund window
Determine the next animation frame for a house.
Callback done for each tile of an object to check the slope.
Called to indicate how long the current animation frame should last.
decide the colour of the building
decides slope suitability
static const int CBM_NO_BIT
Mask to show no bit needs to be enabled for the callback.
decides allowance of autosloping
Called to determine the colour of a town building.
Called to determine if one can alter the ground below an object tile.
Called for periodically starting or stopping the animation.

Definition at line 357 of file newgrf_debug_data.h.

◆ _nic_stations

const NICallback _nic_stations[]
static
Initial value:
= {
}
Use callback to select a sprite layout to use.
Use a custom next frame callback.
Determine whether a newstation should be made available to build.
Callback done for each tile of a station to check the slope.
Called to indicate how long the current animation frame should last.
Customize the animation speed of the station.
Called for periodically starting or stopping the animation.
Called when building a station to customize the tile layout.
static const int CBM_NO_BIT
Mask to show no bit needs to be enabled for the callback.
Availability of station in construction window.
Called to determine station tile next animation frame.
Choose a sprite layout to draw, instead of the standard 0-7 range.
Check slope of new station tiles.

Definition at line 98 of file newgrf_debug_data.h.

◆ _nic_vehicles

const NICallback _nic_vehicles[]
static
Initial value:
= {
}
Builds articulated engines for trains and RVs.
Return the vehicles this given vehicle can be "upgraded" to.
Called when the company (or AI) tries to start or stop a vehicle.
Cargo capacity after refit.
Determine whether a wagon can be attached to an already existing train.
Visual effects and wagon power.
Determine the cargo "suffixes" for each refit possibility of a cargo.
Vehicle uses custom sound effects.
This callback is called from vehicle purchase lists.
Called to play a special sound effect.
Called to modify various vehicle properties.
Show suffix after cargo name.
Vehicle length (trains and road vehicles)
Change colour mapping of vehicle.
Called to determine if a specific colour map should be used for a vehicle instead of the default live...
Add articulated engines (trains and road vehicles)
static const int CBM_NO_BIT
Mask to show no bit needs to be enabled for the callback.
Called for every vehicle every 32 days (not all on same date though).
Determine the amount of cargo to load per unit of time when using gradual loading.
Refit capacity, the passed vehicle needs to have its ->cargo_type set to the cargo we are refitting t...
Vehicle length, returns the amount of 1/8's the vehicle is shorter for trains and RVs...
Visual effects and wagon power (trains, road vehicles and ships)

Definition at line 31 of file newgrf_debug_data.h.

◆ _nif_airporttile

const NIFeature _nif_airporttile
static
Initial value:
= {
NULL,
_nic_airporttiles,
_niv_industrytiles,
}

Definition at line 471 of file newgrf_debug_data.h.

◆ _nif_house

const NIFeature _nif_house
static
Initial value:
= {
NULL,
_nic_house,
_niv_house,
new NIHHouse(),
}

Definition at line 214 of file newgrf_debug_data.h.

◆ _nif_industry

const NIFeature _nif_industry
static
Initial value:
= {
_nip_industries,
_nic_industries,
_niv_industries,
new NIHIndustry(),
}

Definition at line 346 of file newgrf_debug_data.h.

◆ _nif_industrytile

const NIFeature _nif_industrytile
static
Initial value:
= {
NULL,
_nic_industrytiles,
_niv_industrytiles,
}

Definition at line 264 of file newgrf_debug_data.h.

◆ _nif_object

const NIFeature _nif_object
static
Initial value:
= {
NULL,
_nic_objects,
_niv_objects,
new NIHObject(),
}

Definition at line 401 of file newgrf_debug_data.h.

◆ _nif_railtype

const NIFeature _nif_railtype
static
Initial value:
= {
NULL,
NULL,
_niv_railtypes,
new NIHRailType(),
}

Definition at line 437 of file newgrf_debug_data.h.

◆ _nif_station

const NIFeature _nif_station
static
Initial value:
= {
NULL,
_nic_stations,
_niv_stations,
new NIHStation(),
}

Definition at line 149 of file newgrf_debug_data.h.

◆ _nif_town

const NIFeature _nif_town
static
Initial value:
= {
NULL,
NULL,
_niv_towns,
new NIHTown(),
}

Definition at line 523 of file newgrf_debug_data.h.

◆ _nif_vehicle

const NIFeature _nif_vehicle
static
Initial value:
= {
NULL,
_nic_vehicles,
_niv_vehicles,
new NIHVehicle(),
}

Definition at line 87 of file newgrf_debug_data.h.

◆ _nifeatures

const NIFeature* const _nifeatures[]
static
Initial value:
= {
&_nif_vehicle,
&_nif_vehicle,
&_nif_vehicle,
&_nif_vehicle,
&_nif_station,
NULL,
NULL,
&_nif_house,
NULL,
&_nif_industrytile,
&_nif_industry,
NULL,
NULL,
NULL,
NULL,
&_nif_object,
&_nif_railtype,
&_nif_airporttile,
&_nif_town,
}

Table with all NIFeatures.

Definition at line 531 of file newgrf_debug_data.h.

Referenced by GetFeature().

◆ _nip_industries

const NIProperty _nip_industries[]
static
Initial value:
= {
NIP(0x10, Industry, produced_cargo[0], NIT_CARGO, "produced cargo 0"),
NIP(0x10, Industry, produced_cargo[1], NIT_CARGO, "produced cargo 1"),
NIP(0x11, Industry, accepts_cargo[0], NIT_CARGO, "accepted cargo 0"),
NIP(0x11, Industry, accepts_cargo[1], NIT_CARGO, "accepted cargo 1"),
NIP(0x11, Industry, accepts_cargo[2], NIT_CARGO, "accepted cargo 2"),
}
Defines the internal data of a functional industry.
Definition: industry.h:39
The property is a cargo.

Definition at line 274 of file newgrf_debug_data.h.

◆ _niv_house

const NIVariable _niv_house[]
static
Initial value:
= {
NIV(0x40, "construction state of tile and pseudo-random value"),
NIV(0x41, "age of building in years"),
NIV(0x42, "town zone"),
NIV(0x43, "terrain type"),
NIV(0x44, "building counts"),
NIV(0x45, "town expansion bits"),
NIV(0x46, "current animation frame"),
NIV(0x47, "xy coordinate of the building"),
NIV(0x60, "other building counts (old house type)"),
NIV(0x61, "other building counts (new house type)"),
NIV(0x62, "land info of nearby tiles"),
NIV(0x63, "current animation frame of nearby house tile"),
NIV(0x64, "cargo acceptance history of nearby stations"),
NIV(0x65, "distance of nearest house matching a given criterion"),
NIV(0x66, "class and ID of nearby house tile"),
NIV(0x67, "GRFID of nearby house tile"),
}

Definition at line 179 of file newgrf_debug_data.h.

◆ _niv_industries

const NIVariable _niv_industries[]
static
Initial value:
= {
NIV(0x40, "waiting cargo 0"),
NIV(0x41, "waiting cargo 1"),
NIV(0x42, "waiting cargo 2"),
NIV(0x43, "distance to closest dry/land tile"),
NIV(0x44, "layout number"),
NIV(0x45, "player info"),
NIV(0x46, "industry construction date"),
NIV(0x60, "get industry tile ID at offset"),
NIV(0x61, "get random tile bits at offset"),
NIV(0x62, "land info of nearby tiles"),
NIV(0x63, "animation stage of nearby tiles"),
NIV(0x64, "distance on nearest industry with given type"),
NIV(0x65, "get town zone and Manhattan distance of closest town"),
NIV(0x66, "get square of Euclidean distance of closes town"),
NIV(0x67, "count of industry and distance of closest instance"),
NIV(0x68, "count of industry and distance of closest instance with layout filter"),
}

Definition at line 301 of file newgrf_debug_data.h.

◆ _niv_industrytiles

const NIVariable _niv_industrytiles[]
static
Initial value:
= {
NIV(0x40, "construction state of tile"),
NIV(0x41, "ground type"),
NIV(0x42, "current town zone in nearest town"),
NIV(0x43, "relative position"),
NIV(0x44, "animation frame"),
NIV(0x60, "land info of nearby tiles"),
NIV(0x61, "animation stage of nearby tiles"),
NIV(0x62, "get industry or airport tile ID at offset"),
}

Definition at line 237 of file newgrf_debug_data.h.

◆ _niv_objects

const NIVariable _niv_objects[]
static
Initial value:
= {
NIV(0x40, "relative position"),
NIV(0x41, "tile information"),
NIV(0x42, "construction date"),
NIV(0x43, "animation counter"),
NIV(0x44, "object founder"),
NIV(0x45, "get town zone and Manhattan distance of closest town"),
NIV(0x46, "get square of Euclidean distance of closes town"),
NIV(0x47, "colour"),
NIV(0x48, "view"),
NIV(0x60, "get object ID at offset"),
NIV(0x61, "get random tile bits at offset"),
NIV(0x62, "land info of nearby tiles"),
NIV(0x63, "animation stage of nearby tiles"),
NIV(0x64, "distance on nearest object with given type"),
}

Definition at line 368 of file newgrf_debug_data.h.

◆ _niv_railtypes

const NIVariable _niv_railtypes[]
static
Initial value:
= {
NIV(0x40, "terrain type"),
NIV(0x41, "enhanced tunnels"),
NIV(0x42, "level crossing status"),
NIV(0x43, "construction date"),
NIV(0x44, "town zone"),
}

Definition at line 411 of file newgrf_debug_data.h.

◆ _niv_stations

const NIVariable _niv_stations[]
static
Initial value:
= {
NIV(0x40, "platform info and relative position"),
NIV(0x41, "platform info and relative position for individually built sections"),
NIV(0x42, "terrain and track type"),
NIV(0x43, "player info"),
NIV(0x44, "path signalling info"),
NIV(0x45, "rail continuation info"),
NIV(0x46, "platform info and relative position from middle"),
NIV(0x47, "platform info and relative position from middle for individually built sections"),
NIV(0x48, "bitmask of accepted cargoes"),
NIV(0x49, "platform info and relative position of same-direction section"),
NIV(0x4A, "current animation frame"),
NIV(0x60, "amount of cargo waiting"),
NIV(0x61, "time since last cargo pickup"),
NIV(0x62, "rating of cargo"),
NIV(0x63, "time spent on route"),
NIV(0x64, "information about last vehicle picking cargo up"),
NIV(0x65, "amount of cargo acceptance"),
NIV(0x66, "animation frame of nearby tile"),
NIV(0x67, "land info of nearby tiles"),
NIV(0x68, "station info of nearby tiles"),
NIV(0x69, "information about cargo accepted in the past"),
}

Definition at line 109 of file newgrf_debug_data.h.

◆ _niv_towns

const NIVariable _niv_towns[]
static
Initial value:
= {
NIV(0x40, "larger town effect on this town"),
NIV(0x41, "town index"),
NIV(0x82, "population"),
NIV(0x94, "zone radius 0"),
NIV(0x96, "zone radius 1"),
NIV(0x98, "zone radius 2"),
NIV(0x9A, "zone radius 3"),
NIV(0x9C, "zone radius 4"),
NIV(0xB6, "number of buildings"),
}

Definition at line 481 of file newgrf_debug_data.h.

◆ _niv_vehicles

const NIVariable _niv_vehicles[]
static
Initial value:
= {
NIV(0x40, "position in consist and length"),
NIV(0x41, "position and length of chain of same vehicles"),
NIV(0x42, "transported cargo types"),
NIV(0x43, "player info"),
NIV(0x44, "aircraft info"),
NIV(0x45, "curvature info"),
NIV(0x46, "motion counter"),
NIV(0x47, "vehicle cargo info"),
NIV(0x48, "vehicle type info"),
NIV(0x49, "year of construction"),
NIV(0x4A, "current rail type info"),
NIV(0x4B, "long date of last service"),
NIV(0x4C, "current max speed"),
NIV(0x4D, "position in articulated vehicle"),
NIV(0x60, "count vehicle id occurrences"),
NIV(0x62, "Curvature/position difference to other vehicle"),
}

Definition at line 50 of file newgrf_debug_data.h.