OpenTTD Source 20241224-master-gee860a5c8e
dbg_helpers.cpp File Reference

Helpers for outputting debug information. More...

#include "../stdafx.h"
#include "../rail_map.h"
#include "dbg_helpers.h"
#include <sstream>
#include <iomanip>
#include "../safeguards.h"

Go to the source code of this file.

Functions

std::string ValueStr (Trackdir td)
 Return name of given Trackdir.
 
std::string ValueStr (TrackdirBits td_bits)
 Return composed name of given TrackdirBits.
 
std::string ValueStr (DiagDirection dd)
 Return name of given DiagDirection.
 
std::string ValueStr (SignalType t)
 Return name of given SignalType.
 
std::string TileStr (TileIndex tile)
 Translate TileIndex into string.
 

Variables

static const char *const trackdir_names []
 Trackdir & TrackdirBits short names.
 
static const char *const diagdir_names []
 DiagDirection short names.
 
static const char *const signal_type_names []
 SignalType short names.
 

Detailed Description

Helpers for outputting debug information.

Definition in file dbg_helpers.cpp.

Function Documentation

◆ TileStr()

std::string TileStr ( TileIndex  tile)

Translate TileIndex into string.

Definition at line 63 of file dbg_helpers.cpp.

References TileX(), and TileY().

Referenced by DumpTarget::WriteTile().

◆ ValueStr() [1/4]

std::string ValueStr ( DiagDirection  dd)

Return name of given DiagDirection.

Definition at line 44 of file dbg_helpers.cpp.

References diagdir_names, INVALID_DIAGDIR, and ItemAtT().

◆ ValueStr() [2/4]

std::string ValueStr ( SignalType  t)

Return name of given SignalType.

Definition at line 56 of file dbg_helpers.cpp.

References ItemAtT(), and signal_type_names.

◆ ValueStr() [3/4]

std::string ValueStr ( Trackdir  td)

Return name of given Trackdir.

Definition at line 26 of file dbg_helpers.cpp.

References INVALID_TRACKDIR, ItemAtT(), and trackdir_names.

Referenced by DumpTarget::WriteEnumT().

◆ ValueStr() [4/4]

std::string ValueStr ( TrackdirBits  td_bits)

Return composed name of given TrackdirBits.

Definition at line 32 of file dbg_helpers.cpp.

References ComposeNameT(), INVALID_TRACKDIR_BIT, and trackdir_names.

Variable Documentation

◆ diagdir_names

const char* const diagdir_names[]
static
Initial value:
= {
"NE", "SE", "SW", "NW",
}

DiagDirection short names.

Definition at line 39 of file dbg_helpers.cpp.

Referenced by ValueStr().

◆ signal_type_names

const char* const signal_type_names[]
static
Initial value:
= {
"NORMAL", "ENTRY", "EXIT", "COMBO", "PBS", "NOENTRY",
}

SignalType short names.

Definition at line 51 of file dbg_helpers.cpp.

Referenced by ValueStr().

◆ trackdir_names

const char* const trackdir_names[]
static
Initial value:
= {
"NE", "SE", "UE", "LE", "LS", "RS", "rne", "rse",
"SW", "NW", "UW", "LW", "LN", "RN", "rsw", "rnw",
}

Trackdir & TrackdirBits short names.

Definition at line 20 of file dbg_helpers.cpp.

Referenced by ValueStr(), and ValueStr().