mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-20 12:09:32 +01:00
(svn r12457) -Codechange: Move signal enums on their own header.
This commit is contained in:
parent
64797f06eb
commit
79f033c78f
@ -1255,6 +1255,10 @@
|
|||||||
RelativePath=".\..\src\signal_func.h"
|
RelativePath=".\..\src\signal_func.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\..\src\signal_type.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\..\src\signs.h"
|
RelativePath=".\..\src\signs.h"
|
||||||
>
|
>
|
||||||
|
@ -1252,6 +1252,10 @@
|
|||||||
RelativePath=".\..\src\signal_func.h"
|
RelativePath=".\..\src\signal_func.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\..\src\signal_type.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\..\src\signs.h"
|
RelativePath=".\..\src\signs.h"
|
||||||
>
|
>
|
||||||
|
@ -222,6 +222,7 @@ settings_internal.h
|
|||||||
settings_type.h
|
settings_type.h
|
||||||
ship.h
|
ship.h
|
||||||
signal_func.h
|
signal_func.h
|
||||||
|
signal_type.h
|
||||||
signs.h
|
signs.h
|
||||||
slope_func.h
|
slope_func.h
|
||||||
slope_type.h
|
slope_type.h
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "direction_func.h"
|
#include "direction_func.h"
|
||||||
#include "track_func.h"
|
#include "track_func.h"
|
||||||
#include "tile_map.h"
|
#include "tile_map.h"
|
||||||
|
#include "signal_type.h"
|
||||||
|
|
||||||
|
|
||||||
/** Different types of Rail-related tiles */
|
/** Different types of Rail-related tiles */
|
||||||
@ -201,14 +202,6 @@ static inline WaypointID GetWaypointIndex(TileIndex t)
|
|||||||
return (WaypointID)_m[t].m2;
|
return (WaypointID)_m[t].m2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Type of signal, i.e. how does the signal behave? */
|
|
||||||
enum SignalType {
|
|
||||||
SIGTYPE_NORMAL = 0, ///< normal signal
|
|
||||||
SIGTYPE_ENTRY = 1, ///< presignal block entry
|
|
||||||
SIGTYPE_EXIT = 2, ///< presignal block exit
|
|
||||||
SIGTYPE_COMBO = 3 ///< presignal inter-block
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline SignalType GetSignalType(TileIndex t, Track track)
|
static inline SignalType GetSignalType(TileIndex t, Track track)
|
||||||
{
|
{
|
||||||
assert(GetRailTileType(t) == RAIL_TILE_SIGNALS);
|
assert(GetRailTileType(t) == RAIL_TILE_SIGNALS);
|
||||||
@ -244,12 +237,6 @@ static inline void CycleSignalSide(TileIndex t, Track track)
|
|||||||
SB(_m[t].m3, pos, 2, sig);
|
SB(_m[t].m3, pos, 2, sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Variant of the signal, i.e. how does the signal look? */
|
|
||||||
enum SignalVariant {
|
|
||||||
SIG_ELECTRIC = 0, ///< Light signal
|
|
||||||
SIG_SEMAPHORE = 1 ///< Old-fashioned semaphore signal
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline SignalVariant GetSignalVariant(TileIndex t, Track track)
|
static inline SignalVariant GetSignalVariant(TileIndex t, Track track)
|
||||||
{
|
{
|
||||||
byte pos = (track == TRACK_LOWER || track == TRACK_RIGHT) ? 6 : 2;
|
byte pos = (track == TRACK_LOWER || track == TRACK_RIGHT) ? 6 : 2;
|
||||||
|
24
src/signal_type.h
Normal file
24
src/signal_type.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/** @file signal_type.h Types and classes related to signals. */
|
||||||
|
|
||||||
|
#ifndef SIGNAL_TYPE_H
|
||||||
|
#define SIGNAL_TYPE_H
|
||||||
|
|
||||||
|
/** Variant of the signal, i.e. how does the signal look? */
|
||||||
|
enum SignalVariant {
|
||||||
|
SIG_ELECTRIC = 0, ///< Light signal
|
||||||
|
SIG_SEMAPHORE = 1 ///< Old-fashioned semaphore signal
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** Type of signal, i.e. how does the signal behave? */
|
||||||
|
enum SignalType {
|
||||||
|
SIGTYPE_NORMAL = 0, ///< normal signal
|
||||||
|
SIGTYPE_ENTRY = 1, ///< presignal block entry
|
||||||
|
SIGTYPE_EXIT = 2, ///< presignal block exit
|
||||||
|
SIGTYPE_COMBO = 3 ///< presignal inter-block
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* SIGNAL_TYPE_H */
|
Loading…
Reference in New Issue
Block a user