author | Darkvater |
Sun, 26 Mar 2006 22:41:56 +0000 | |
changeset 3346 | a0d4def7d934 |
parent 2752 | 55e04dee346d |
child 4246 | 6dcc0e44a367 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
1070
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
3 |
/* Rail selection types (directions): |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
4 |
/ \ / \ / \ / \ / \ / \ |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
5 |
/ /\ /\ \ /===\ / \ /| \ / |\ |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
6 |
\/ / \ \/ \ / \===/ \| / \ |/ |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
7 |
\ / \ / \ / \ / \ / \ / |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
8 |
0 1 2 3 4 5 |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
9 |
*/ |
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 | 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) |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
41 |
{ RED(6), RED(11), RED(17), RED(27), RED(39), RED(47) }, // tileh = 23 |
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) |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
45 |
{ RED(7), RED(15), RED(24), RED(33), RED(36), RED(44) }, // tileh = 27 |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
46 |
{ 0, 1, 2, 3, 4, 5 }, // invalid (28) |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
47 |
{ RED(3), RED(14), RED(18), RED(26), RED(41), RED(49) }, // tileh = 29 |
bd31ed783fd3
(svn r1571) Feature: Visually enhanced autorail placing
dominik
parents:
diff
changeset
|
48 |
{ RED(4), RED(12), RED(21), RED(30), RED(37), RED(45) }, // tileh = 30 |
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 | 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 |
}; |