src/table/autorail.h
author rubidium
Sun, 24 Aug 2008 08:41:38 +0000
changeset 9994 f9d5859f6aee
parent 9111 48ce04029fe4
permissions -rw-r--r--
(svn r14151) -Codechange: make it possible to choose between the DOS and Windows graphics packs while retaining the possibility to override the palette.
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
9111
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8224
diff changeset
     3
/** @file autorail.h Highlight/sprite information for autorail. */
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8224
diff changeset
     4
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
     5
/* Rail selection types (directions):
4549
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
 * \/  /  \  \/  \   /  \===/ \|  / \  |/
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4253
diff changeset
     9
 *  \ /    \ /    \ /    \ /   \ /   \ /
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4253
diff changeset
    10
 *   0      1      2      3     4     5
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4253
diff changeset
    11
 */
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    12
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    13
// mark invalid tiles red
5669
631901f52707 (svn r8129) -Codechange: Change data tables to use split off palette map. And
peter1138
parents: 5475
diff changeset
    14
#define RED(c) -c
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    15
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    16
// 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
    17
// invalid entries are required to make sure that this array can be quickly accessed
2752
55e04dee346d (svn r3297) Staticise
tron
parents: 2710
diff changeset
    18
static const int _AutorailTilehSprite[][6] = {
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    19
// type   0        1        2        3        4        5
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    20
	{       0,       8,      16,      25,      34,      42 }, // tileh = 0
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    21
	{       5,      13, RED(22), RED(31),      35,      42 }, // tileh = 1
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    22
	{       5,      10,      16,      26, RED(38), RED(46) }, // tileh = 2
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    23
	{       5,       9, RED(23),      26,      35, RED(46) }, // tileh = 3
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    24
	{       2,      10, RED(19), RED(28),      34,      43 }, // tileh = 4
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    25
	{       1,       9,      17,      26,      35,      43 }, // tileh = 5
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    26
	{       1,      10, RED(20),      26, RED(38),      43 }, // tileh = 6
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    27
	{       1,       9,      17,      26,      35,      43 }, // tileh = 7
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    28
	{       2,      13,      17,      25, RED(40), RED(48) }, // tileh = 8
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    29
	{       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
    30
	{       1,       9,      17,      26,      35,      43 }, // tileh = 10
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    31
	{       1,       9,      17,      26,      35,      43 }, // tileh = 11
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    32
	{       2,       9,      17, RED(29), RED(40),      43 }, // tileh = 12
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    33
	{       1,       9,      17,      26,      35,      43 }, // tileh = 13
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    34
	{       1,       9,      17,      26,      35,      43 }, // tileh = 14
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    35
	{       0,       1,       2,       3,       4,       5 }, // invalid (15)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    36
	{       0,       1,       2,       3,       4,       5 }, // invalid (16)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    37
	{       0,       1,       2,       3,       4,       5 }, // invalid (17)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    38
	{       0,       1,       2,       3,       4,       5 }, // invalid (18)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    39
	{       0,       1,       2,       3,       4,       5 }, // invalid (19)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    40
	{       0,       1,       2,       3,       4,       5 }, // invalid (20)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    41
	{       0,       1,       2,       3,       4,       5 }, // invalid (21)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    42
	{       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
    43
	{       6,      11,      17,      27, RED(39), RED(47) }, // tileh = 23
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    44
	{       0,       1,       2,       3,       4,       5 }, // invalid (24)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    45
	{       0,       1,       2,       3,       4,       5 }, // invalid (25)
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    46
	{       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
    47
	{       7,      15, RED(24), RED(33),      36,      44 }, // tileh = 27
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    48
	{       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
    49
	{       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
    50
	{       4,      12, RED(21), RED(30),      37,      45 }  // tileh = 30
1070
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
#undef RED
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    53
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    54
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    55
// maps each pixel of a tile (16x16) to a selection type
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    56
// (0,0) is the top corner, (16,16) the bottom corner
8224
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    57
static const HighLightStyle _autorail_piece[][16] = {
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    58
	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    59
	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    60
	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    61
	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    62
	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    63
	{ HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    64
	{ HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_Y, HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y  },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    65
	{ HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y, HT_DIR_X, HT_DIR_Y, HT_DIR_Y, HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y  },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    66
	{ HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y, HT_DIR_Y, HT_DIR_X, HT_DIR_Y, HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y  },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    67
	{ HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y,  HT_DIR_Y  },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    68
	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    69
	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    70
	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    71
	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    72
	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL },
c5a64d87cc54 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 5669
diff changeset
    73
	{ HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_VL, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL, HT_DIR_HL }
1070
bd31ed783fd3 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff changeset
    74
};