road.h
author peter1138
Fri, 28 Apr 2006 21:32:59 +0000
changeset 3688 fa1326dee4e3
parent 3518 c1e19f08fc25
child 3795 45a8b78417d2
permissions -rw-r--r--
(svn r4613) - NewGRF: fix two struct declarations
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 {
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
     7
	ROAD_NW  = 1,
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
     8
	ROAD_SW  = 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
     9
	ROAD_SE  = 4,
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
    10
	ROAD_NE  = 8,
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
{
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
    18
	return ROAD_ALL ^ 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
    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
{
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
    23
	return 1 << (3 ^ 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
    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