road.h
author bjarni
Sat, 26 Aug 2006 22:28:40 +0000
changeset 4408 db2afc41002a
parent 3900 2c84ed52709d
child 4666 172a0cdf28a6
permissions -rw-r--r--
(svn r6161) -Feature: List of vehicles with the same shared orders
the list is available in the orders window and looks like the list buttons from the station windows (small vehicle)
The button is disabled if the vehicle do not have any shared orders or it got shared orders, but an empty order list
based on a patch by nycom, thought it ended up getting heavily modified
Thanks to TrueLight for proofreading and suggestions
3518
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
     1
/* $Id$ */
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
     2
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
     3
#ifndef ROAD_H
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
     4
#define ROAD_H
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
     5
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
     6
typedef enum RoadBits {
3795
45a8b78417d2 (svn r4791) - Codechange: Mark road bits as unsigned. Fixes warning with older gcc versions.
peter1138
parents: 3518
diff changeset
     7
	ROAD_NW  = 1U,
45a8b78417d2 (svn r4791) - Codechange: Mark road bits as unsigned. Fixes warning with older gcc versions.
peter1138
parents: 3518
diff changeset
     8
	ROAD_SW  = 2U,
45a8b78417d2 (svn r4791) - Codechange: Mark road bits as unsigned. Fixes warning with older gcc versions.
peter1138
parents: 3518
diff changeset
     9
	ROAD_SE  = 4U,
45a8b78417d2 (svn r4791) - Codechange: Mark road bits as unsigned. Fixes warning with older gcc versions.
peter1138
parents: 3518
diff changeset
    10
	ROAD_NE  = 8U,
3518
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    11
	ROAD_X   = ROAD_SW | ROAD_NE,
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    12
	ROAD_Y   = ROAD_NW | ROAD_SE,
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    13
	ROAD_ALL = ROAD_X  | ROAD_Y
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    14
} RoadBits;
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    15
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    16
static inline RoadBits ComplementRoadBits(RoadBits r)
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    17
{
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents: 3795
diff changeset
    18
	return (RoadBits)(ROAD_ALL ^ r);
3518
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    19
}
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    20
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    21
static inline RoadBits DiagDirToRoadBits(DiagDirection d)
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    22
{
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents: 3795
diff changeset
    23
	return (RoadBits)(1U << (3 ^ d));
3518
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    24
}
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    25
c1e19f08fc25 (svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
tron
parents:
diff changeset
    26
#endif