table/autorail.h
author bjarni
Tue, 05 Dec 2006 22:40:42 +0000
changeset 5255 b693a9941b8c
parent 4549 106ed18a7675
permissions -rw-r--r--
(svn r7385) -Fix: FS#418 Deleting Train in depot with autoreplace failes
This turned out to be due to continue to drag the old vehicle, that autoreplace sold
This could also be triggered if more than one player used the same company
Now deleting a vehicle will remove all depot highlights of that vehicle
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2023
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2023
diff changeset
     2
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
     3
/* Rail selection types (directions):
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4253
diff changeset
     4
 *  / \    / \    / \    / \   / \   / \
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4253
diff changeset
     5
 * /  /\  /\  \  /===\  /   \ /|  \ /  |\
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4253
diff changeset
     6
 * \/  /  \  \/  \   /  \===/ \|  / \  |/
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4253
diff changeset
     7
 *  \ /    \ /    \ /    \ /   \ /   \ /
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4253
diff changeset
     8
 *   0      1      2      3     4     5
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4253
diff changeset
     9
 */
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    10
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    11
// mark invalid tiles red
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    12
#define RED(c) c | PALETTE_SEL_TILE_RED
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    13
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    14
// table maps each of the six rail directions and tileh combinations to a sprite
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    15
// invalid entries are required to make sure that this array can be quickly accessed
2752
55e04dee346d (svn r3297) Staticise
tron
parents: 2710
diff changeset
    16
static const int _AutorailTilehSprite[][6] = {
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    17
// type   0        1        2        3        4        5
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    18
	{       0,       8,      16,      25,      34,      42 }, // tileh = 0
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    19
	{       5,      13, RED(22), RED(31),      35,      42 }, // tileh = 1
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    20
	{       5,      10,      16,      26, RED(38), RED(46) }, // tileh = 2
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    21
	{       5,       9, RED(23),      26,      35, RED(46) }, // tileh = 3
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    22
	{       2,      10, RED(19), RED(28),      34,      43 }, // tileh = 4
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    23
	{       1,       9,      17,      26,      35,      43 }, // tileh = 5
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    24
	{       1,      10, RED(20),      26, RED(38),      43 }, // tileh = 6
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    25
	{       1,       9,      17,      26,      35,      43 }, // tileh = 7
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    26
	{       2,      13,      17,      25, RED(40), RED(48) }, // tileh = 8
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    27
	{       1,      13,      17, RED(32),      35, RED(48) }, // tileh = 9
2710
44278abd3ef9 (svn r3254) - Fix: graphical glitch with autorail tool on a certain tile-type.
Darkvater
parents: 2186
diff changeset
    28
	{       1,       9,      17,      26,      35,      43 }, // tileh = 10
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    29
	{       1,       9,      17,      26,      35,      43 }, // tileh = 11
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    30
	{       2,       9,      17, RED(29), RED(40),      43 }, // tileh = 12
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    31
	{       1,       9,      17,      26,      35,      43 }, // tileh = 13
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    32
	{       1,       9,      17,      26,      35,      43 }, // tileh = 14
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    33
	{       0,       1,       2,       3,       4,       5 }, // invalid (15)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    34
	{       0,       1,       2,       3,       4,       5 }, // invalid (16)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    35
	{       0,       1,       2,       3,       4,       5 }, // invalid (17)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    36
	{       0,       1,       2,       3,       4,       5 }, // invalid (18)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    37
	{       0,       1,       2,       3,       4,       5 }, // invalid (19)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    38
	{       0,       1,       2,       3,       4,       5 }, // invalid (20)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    39
	{       0,       1,       2,       3,       4,       5 }, // invalid (21)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    40
	{       0,       1,       2,       3,       4,       5 }, // invalid (22)
4253
b468db807b66 (svn r5864) -Feature: Also allow horizontal and vertical rails on steep slopes
tron
parents: 4246
diff changeset
    41
	{       6,      11,      17,      27, RED(39), RED(47) }, // tileh = 23
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    42
	{       0,       1,       2,       3,       4,       5 }, // invalid (24)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    43
	{       0,       1,       2,       3,       4,       5 }, // invalid (25)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    44
	{       0,       1,       2,       3,       4,       5 }, // invalid (26)
4253
b468db807b66 (svn r5864) -Feature: Also allow horizontal and vertical rails on steep slopes
tron
parents: 4246
diff changeset
    45
	{       7,      15, RED(24), RED(33),      36,      44 }, // tileh = 27
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    46
	{       0,       1,       2,       3,       4,       5 }, // invalid (28)
4253
b468db807b66 (svn r5864) -Feature: Also allow horizontal and vertical rails on steep slopes
tron
parents: 4246
diff changeset
    47
	{       3,      14,      18,      26, RED(41), RED(49) }, // tileh = 29
b468db807b66 (svn r5864) -Feature: Also allow horizontal and vertical rails on steep slopes
tron
parents: 4246
diff changeset
    48
	{       4,      12, RED(21), RED(30),      37,      45 }  // tileh = 30
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    49
};
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    50
#undef RED
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    51
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    52
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    53
// maps each pixel of a tile (16x16) to a selection type
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    54
// (0,0) is the top corner, (16,16) the bottom corner
2752
55e04dee346d (svn r3297) Staticise
tron
parents: 2710
diff changeset
    55
static const byte _AutorailPiece[][16] = {
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    56
	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    57
	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    58
	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    59
	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    60
	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    61
	{ 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    62
	{ 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    63
	{ 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    64
	{ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    65
	{ 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    66
	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    67
	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    68
	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    69
	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    70
	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 },
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    71
	{ 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3 }
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    72
};