10 #include "../stdafx.h"
11 #include "../rail_map.h"
17 #include "../safeguards.h"
21 "NE",
"SE",
"UE",
"LE",
"LS",
"RS",
"rne",
"rse",
22 "SW",
"NW",
"UW",
"LW",
"LN",
"RN",
"rsw",
"rnw",
40 "NE",
"SE",
"SW",
"NW",
52 "NORMAL",
"ENTRY",
"EXIT",
"COMBO",
"PBS",
"NOENTRY",
66 ss <<
"0x" << std::setfill(
'0') << std::setw(4) << std::hex << tile.base();
67 ss <<
" (" <<
TileX(tile) <<
", " <<
TileY(tile) <<
")";
75 static size_t last_type_id = 0;
109 if (num_spaces > 0) {
110 m_out += std::string(num_spaces,
' ');
118 m_out += name +
" = " + std::to_string(value) +
"\n";
125 m_out += name +
" = " + value_str +
"\n";
142 if (!cur_name.empty()) {
155 m_out += name +
" = {\n";
static const char *const diagdir_names[]
DiagDirection short names.
std::string ValueStr(Trackdir td)
Return name of given Trackdir.
std::string TileStr(TileIndex tile)
Translate TileIndex into string.
static const char *const trackdir_names[]
Trackdir & TrackdirBits short names.
static const char *const signal_type_names[]
SignalType short names.
Functions to be used for debug printings.
ArrayT< T >::Item ItemAtT(E idx, const T &t, typename ArrayT< T >::Item t_unk)
Helper template function that returns item of array at given index or t_unk when index is out of boun...
std::string ComposeNameT(E value, T &t, const char *t_unk, E val_inv, const char *name_inv)
Helper template function that returns compound bitfield name that is concatenation of names of each s...
DiagDirection
Enumeration for diagonal directions.
@ INVALID_DIAGDIR
Flag for an invalid DiagDirection.
static debug_inline uint TileY(TileIndex tile)
Get the Y component of a tile.
static debug_inline uint TileX(TileIndex tile)
Get the X component of a tile.
SignalType
Type of signal, i.e.
Used as a key into map of known object instances.
int m_indent
current indent/nesting level
std::string m_out
the output string
void WriteValue(const std::string &name, int value)
Write 'name = value' with indent and new-line.
std::stack< std::string > m_cur_struct
here we will track the current structure name
void BeginStruct(size_t type_id, const std::string &name, const void *ptr)
Open new structure (one level deeper than the current one) 'name = {<LF>'.
std::string GetCurrentStructName()
Return structured name of the current class/structure.
KNOWN_NAMES m_known_names
map of known object instances and their structured names
bool FindKnownName(size_t type_id, const void *ptr, std::string &name)
Find the given instance in our anti-recursion repository.
void WriteTile(const std::string &name, TileIndex t)
Write name & TileIndex to the output.
void WriteIndent()
Write some leading spaces into the output.
static size_t & LastTypeId()
Keep track of the last assigned type_id.
void EndStruct()
Close structure '}<LF>'.
Trackdir
Enumeration for tracks and directions.
@ INVALID_TRACKDIR
Flag for an invalid trackdir.
TrackdirBits
Allow incrementing of Trackdir variables.
@ INVALID_TRACKDIR_BIT
Flag for an invalid trackdirbit value.