author | rubidium |
Tue, 25 Dec 2007 23:42:52 +0000 | |
changeset 8634 | 5ffca02f9115 |
parent 8619 | src/rail.h@c2434269c3eb |
child 8734 | b7fc8c6fd379 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
8634
5ffca02f9115
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents:
8619
diff
changeset
|
3 |
/** @file signal_func.h Functions related to signals. */ |
2274
d94004c14b6c
(svn r2798) -Codechange: Unified the rail toolbars into one that is modified by
celestar
parents:
2254
diff
changeset
|
4 |
|
8634
5ffca02f9115
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents:
8619
diff
changeset
|
5 |
#ifndef SIGNAL_FUNC_H |
5ffca02f9115
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents:
8619
diff
changeset
|
6 |
#define SIGNAL_FUNC_H |
2254
72f8883ff3ac
(svn r2774) -Codechange: Removed TRACKTYPE_SPRITE_PITCH globally and replaced it by a member of RailtypeInfo
celestar
parents:
2236
diff
changeset
|
7 |
|
8634
5ffca02f9115
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents:
8619
diff
changeset
|
8 |
#include "track_type.h" |
1942
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
9 |
|
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
10 |
/** |
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
11 |
* Maps a trackdir to the bit that stores its status in the map arrays, in the |
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
12 |
* direction along with the trackdir. |
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
13 |
*/ |
6488
07bbbafd4f70
(svn r8912) -Codechange: coding style cleanup and moving of two global externs into the functions that use them.
rubidium
parents:
6482
diff
changeset
|
14 |
static inline byte SignalAlongTrackdir(Trackdir trackdir) |
07bbbafd4f70
(svn r8912) -Codechange: coding style cleanup and moving of two global externs into the functions that use them.
rubidium
parents:
6482
diff
changeset
|
15 |
{ |
07bbbafd4f70
(svn r8912) -Codechange: coding style cleanup and moving of two global externs into the functions that use them.
rubidium
parents:
6482
diff
changeset
|
16 |
extern const byte _signal_along_trackdir[TRACKDIR_END]; |
07bbbafd4f70
(svn r8912) -Codechange: coding style cleanup and moving of two global externs into the functions that use them.
rubidium
parents:
6482
diff
changeset
|
17 |
return _signal_along_trackdir[trackdir]; |
07bbbafd4f70
(svn r8912) -Codechange: coding style cleanup and moving of two global externs into the functions that use them.
rubidium
parents:
6482
diff
changeset
|
18 |
} |
1942
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
19 |
|
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
20 |
/** |
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
21 |
* Maps a trackdir to the bit that stores its status in the map arrays, in the |
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
22 |
* direction against the trackdir. |
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
23 |
*/ |
6488
07bbbafd4f70
(svn r8912) -Codechange: coding style cleanup and moving of two global externs into the functions that use them.
rubidium
parents:
6482
diff
changeset
|
24 |
static inline byte SignalAgainstTrackdir(Trackdir trackdir) |
07bbbafd4f70
(svn r8912) -Codechange: coding style cleanup and moving of two global externs into the functions that use them.
rubidium
parents:
6482
diff
changeset
|
25 |
{ |
1948
e5f34b543a3c
(svn r2454) * Codechange: Move #include "stdafx.h" and "openttd.h" from rail.h to rail.c
matthijs
parents:
1947
diff
changeset
|
26 |
extern const byte _signal_against_trackdir[TRACKDIR_END]; |
e5f34b543a3c
(svn r2454) * Codechange: Move #include "stdafx.h" and "openttd.h" from rail.h to rail.c
matthijs
parents:
1947
diff
changeset
|
27 |
return _signal_against_trackdir[trackdir]; |
e5f34b543a3c
(svn r2454) * Codechange: Move #include "stdafx.h" and "openttd.h" from rail.h to rail.c
matthijs
parents:
1947
diff
changeset
|
28 |
} |
1942
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
29 |
|
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
30 |
/** |
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
31 |
* Maps a Track to the bits that store the status of the two signals that can |
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
32 |
* be present on the given track. |
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
33 |
*/ |
6488
07bbbafd4f70
(svn r8912) -Codechange: coding style cleanup and moving of two global externs into the functions that use them.
rubidium
parents:
6482
diff
changeset
|
34 |
static inline byte SignalOnTrack(Track track) |
07bbbafd4f70
(svn r8912) -Codechange: coding style cleanup and moving of two global externs into the functions that use them.
rubidium
parents:
6482
diff
changeset
|
35 |
{ |
1948
e5f34b543a3c
(svn r2454) * Codechange: Move #include "stdafx.h" and "openttd.h" from rail.h to rail.c
matthijs
parents:
1947
diff
changeset
|
36 |
extern const byte _signal_on_track[TRACK_END]; |
e5f34b543a3c
(svn r2454) * Codechange: Move #include "stdafx.h" and "openttd.h" from rail.h to rail.c
matthijs
parents:
1947
diff
changeset
|
37 |
return _signal_on_track[track]; |
e5f34b543a3c
(svn r2454) * Codechange: Move #include "stdafx.h" and "openttd.h" from rail.h to rail.c
matthijs
parents:
1947
diff
changeset
|
38 |
} |
1942
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
39 |
|
8634
5ffca02f9115
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents:
8619
diff
changeset
|
40 |
#endif /* SIGNAL_FUNC_H */ |