table/elrail_data.h
author tron
Mon, 05 Jun 2006 18:10:43 +0000
changeset 3971 2116cd6db7fd
parent 3451 86ff1ac451d8
child 4344 5d0e40cd67b9
permissions -rw-r--r--
(svn r5136) Fix various style bugs:
- Trailing whitespace
- Trailing empty lines
- Missing newline at EOF
- Missing svn:eol-style native
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
     1
/* $Id */
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
     2
/** @file elrail_data.h Stores all the data for overhead wire and pylon drawing.
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
     3
  @see elrail.c */
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
     4
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
     5
#ifndef ELRAIL_DATA_H
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
     6
#define ELRAIL_DATA_H
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
     7
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
     8
/** Tile Location group.
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
     9
  This defines whether the X and or Y coordinate of a tile is even */
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    10
typedef enum TLG {
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    11
	XEVEN_YEVEN = 0,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    12
	XEVEN_YODD  = 1,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    13
	XODD_YEVEN  = 2,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    14
	XODD_YODD   = 3,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    15
	TLG_END
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    16
} TLG;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    17
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    18
/** When determining the pylon configuration on the edge, two tiles are taken
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    19
  into account: the tile being drawn itself (the home tile, the one in
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    20
  ti->tile), and the neighbouring tile */
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    21
typedef enum {
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    22
	TS_HOME      = 0,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    23
	TS_NEIGHBOUR = 1,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    24
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    25
	TS_END
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    26
} TileSource;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    27
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    28
enum {
3451
86ff1ac451d8 (svn r4283) -Cleanup: More elrail housekeeping, remove code dublication, more meaningful variable names, simplify control flow..
celestar
parents: 3450
diff changeset
    29
	NUM_TRACKS_AT_PCP = 6
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    30
};
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    31
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    32
/** Which PPPs are possible at all on a given PCP */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    33
static byte AllowedPPPonPCP[DIAGDIR_END] = {
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    34
	1 << DIR_N | 1 << DIR_E  | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W  | 1 << DIR_NW,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    35
	1 << DIR_N | 1 << DIR_NE | 1 << DIR_E  | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    36
	1 << DIR_N | 1 << DIR_E  | 1 << DIR_SE | 1 << DIR_S | 1 << DIR_W  | 1 << DIR_NW,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    37
	1 << DIR_N | 1 << DIR_NE | 1 << DIR_E  | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    38
};
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    39
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    40
/** Which of the PPPs are inside the tile. For the two PPPs on the tile border
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    41
  the following system is used: if you rotate the PCP so that it is in the
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    42
  north, the eastern PPP belongs to the tile. */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    43
static byte OwnedPPPonPCP[DIAGDIR_END] = {
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    44
	1 << DIR_SE | 1 << DIR_S  | 1 << DIR_SW | 1 << DIR_W,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    45
	1 << DIR_N  | 1 << DIR_SW | 1 << DIR_W  | 1 << DIR_NW,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    46
	1 << DIR_N  | 1 << DIR_NE | 1 << DIR_E  | 1 << DIR_NW,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    47
	1 << DIR_NE | 1 << DIR_E  | 1 << DIR_SE | 1 << DIR_S
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    48
};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    49
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    50
/** Maps a track bit onto two PCP positions */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    51
static const DiagDirection PCPpositions[TRACK_END][2] = {
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    52
	{DIAGDIR_NE, DIAGDIR_SW}, /* X */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    53
	{DIAGDIR_SE, DIAGDIR_NW}, /* Y */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    54
	{DIAGDIR_NW, DIAGDIR_NE}, /* UPPER */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    55
	{DIAGDIR_SE, DIAGDIR_SW}, /* LOWER */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    56
	{DIAGDIR_SW, DIAGDIR_NW}, /* LEFT */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    57
	{DIAGDIR_NE, DIAGDIR_SE}, /* RIGHT */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    58
};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    59
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    60
#define PCP_NOT_ON_TRACK 0xFF
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    61
/** Preferred points of each trackbit. Those are the ones perpendicular to the
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    62
  track, plus the point in extension of the track (to mark end-of-track). PCPs
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    63
  which are not on either end of the track are fully preferred.
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    64
  @see PCPpositions */
3451
86ff1ac451d8 (svn r4283) -Cleanup: More elrail housekeeping, remove code dublication, more meaningful variable names, simplify control flow..
celestar
parents: 3450
diff changeset
    65
static byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    66
	{    /* X */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    67
		1 << DIR_NE | 1 << DIR_SE | 1 << DIR_NW, /* NE */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    68
		PCP_NOT_ON_TRACK,                        /* SE */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    69
		1 << DIR_SE | 1 << DIR_SW | 1 << DIR_NW, /* SW */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    70
		PCP_NOT_ON_TRACK                         /* NE */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    71
	}, { /* Y */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    72
		PCP_NOT_ON_TRACK,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    73
		1 << DIR_NE | 1 << DIR_SE | 1 << DIR_SW,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    74
		PCP_NOT_ON_TRACK,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    75
		1 << DIR_SW | 1 << DIR_NW | 1 << DIR_NE
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    76
	}, { /* UPPER */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    77
		1 << DIR_E | 1 << DIR_N | 1 << DIR_S,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    78
		PCP_NOT_ON_TRACK,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    79
		PCP_NOT_ON_TRACK,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    80
		1 << DIR_W | 1 << DIR_N | 1 << DIR_S
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    81
	}, { /* LOWER */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    82
		PCP_NOT_ON_TRACK,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    83
		1 << DIR_E | 1 << DIR_N | 1 << DIR_S,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    84
		1 << DIR_W | 1 << DIR_N | 1 << DIR_S,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    85
		PCP_NOT_ON_TRACK
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    86
	}, { /* LEFT */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    87
		PCP_NOT_ON_TRACK,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    88
		PCP_NOT_ON_TRACK,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    89
		1 << DIR_S | 1 << DIR_E | 1 << DIR_W,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    90
		1 << DIR_N | 1 << DIR_E | 1 << DIR_W
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    91
	}, { /* RIGHT */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    92
		1 << DIR_N | 1 << DIR_E | 1 << DIR_W,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    93
		1 << DIR_S | 1 << DIR_E | 1 << DIR_W,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    94
		PCP_NOT_ON_TRACK,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    95
		PCP_NOT_ON_TRACK
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    96
	}
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    97
};
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
    98
#undef PCP_NOT_ON_TRACK
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
    99
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   100
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   101
#define NUM_IGNORE_GROUPS 3
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   102
#define IGNORE_NONE 0xFF
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   103
/** In case we have a staight line, we place pylon only every two tiles,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   104
  so there are certain tiles which we ignore. A straight line is found if
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   105
  we have exactly two PPPs. */
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   106
static byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   107
	{   /* Ignore group 1, X and Y tracks */
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   108
		{     /* X even, Y even */
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   109
			IGNORE_NONE,
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   110
			1 << DIR_NE | 1 << DIR_SW,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   111
			1 << DIR_NW | 1 << DIR_SE,
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   112
			IGNORE_NONE
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   113
		}, { /* X even, Y odd  */
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   114
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   115
			IGNORE_NONE,
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   116
			1 << DIR_NW | 1 << DIR_SE,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   117
			1 << DIR_NE | 1 << DIR_SW
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   118
		}, { /* X odd,  Y even */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   119
			1 << DIR_NW | 1 << DIR_SE,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   120
			1 << DIR_NE | 1 << DIR_SW,
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   121
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   122
			IGNORE_NONE
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   123
		}, { /* X odd,  Y odd  */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   124
			1 << DIR_NW | 1 << DIR_SE,
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   125
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   126
			IGNORE_NONE,
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   127
			1 << DIR_NE | 1 << DIR_SW
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   128
		}
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   129
	},
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   130
	{   /* Ignore group 2, LEFT and RIGHT tracks */
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   131
		{
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   132
			1 << DIR_E | 1 << DIR_W,
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   133
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   134
			IGNORE_NONE,
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   135
			1 << DIR_E | 1 << DIR_W
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   136
		}, {
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   137
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   138
			1 << DIR_E | 1 << DIR_W,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   139
			1 << DIR_E | 1 << DIR_W,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   140
			IGNORE_NONE
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   141
		}, {
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   142
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   143
			1 << DIR_E | 1 << DIR_W,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   144
			1 << DIR_E | 1 << DIR_W,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   145
			IGNORE_NONE
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   146
		}, {
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   147
			1 << DIR_E | 1 << DIR_W,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   148
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   149
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   150
			1 << DIR_E | 1 << DIR_W
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   151
		}
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   152
	},
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   153
	{   /* Ignore group 3, UPPER and LOWER tracks */
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   154
		{
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   155
			1 << DIR_N | 1 << DIR_S,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   156
			1 << DIR_N | 1 << DIR_S,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   157
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   158
			IGNORE_NONE
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   159
		}, {
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   160
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   161
			IGNORE_NONE,
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   162
			1 << DIR_N | 1 << DIR_S,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   163
			1 << DIR_N | 1 << DIR_S
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   164
		}, {
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   165
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   166
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   167
			1 << DIR_N | 1 << DIR_S ,
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   168
			1 << DIR_N | 1 << DIR_S
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   169
		}, {
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   170
			1 << DIR_N | 1 << DIR_S,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   171
			1 << DIR_N | 1 << DIR_S,
3450
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   172
			IGNORE_NONE,
3b067aa1c08c (svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
celestar
parents: 3449
diff changeset
   173
			IGNORE_NONE
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   174
		}
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   175
	}
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   176
};
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   177
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   178
#undef NO_IGNORE
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   179
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   180
/** Which pylons can definately NOT be built */
3451
86ff1ac451d8 (svn r4283) -Cleanup: More elrail housekeeping, remove code dublication, more meaningful variable names, simplify control flow..
celestar
parents: 3450
diff changeset
   181
static byte DisallowedPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   182
	{1 << DIR_SW | 1 << DIR_NE, 0,           1 << DIR_SW | 1 << DIR_NE, 0          }, /* X */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   183
	{0,           1 << DIR_NW | 1 << DIR_SE, 0,           1 << DIR_NW | 1 << DIR_SE}, /* Y */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   184
	{1 << DIR_W | 1 << DIR_E,  0,           0,           1 << DIR_W | 1 << DIR_E }, /* UPPER */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   185
	{0,           1 << DIR_W | 1 << DIR_E,  1 << DIR_W | 1 << DIR_E,  0          }, /* LOWER */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   186
	{0,           0,           1 << DIR_S | 1 << DIR_N,  1 << DIR_N | 1 << DIR_S }, /* LEFT */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   187
	{1 << DIR_S | 1 << DIR_N,  1 << DIR_S | 1 << DIR_N,  0,           0,         }, /* RIGHT */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   188
};
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   189
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   190
/* This array stores which track bits can meet at a tile edge */
3451
86ff1ac451d8 (svn r4283) -Cleanup: More elrail housekeeping, remove code dublication, more meaningful variable names, simplify control flow..
celestar
parents: 3450
diff changeset
   191
static const Track TracksAtPCP[DIAGDIR_END][NUM_TRACKS_AT_PCP] = {
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   192
	{TRACK_X, TRACK_X, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT},
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   193
	{TRACK_Y, TRACK_Y, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT},
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   194
	{TRACK_X, TRACK_X, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT},
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   195
	{TRACK_Y, TRACK_Y, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT},
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   196
};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   197
3451
86ff1ac451d8 (svn r4283) -Cleanup: More elrail housekeeping, remove code dublication, more meaningful variable names, simplify control flow..
celestar
parents: 3450
diff changeset
   198
/* takes each of the 6 track bits from the array above and
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   199
   assigns it to the home tile or neighbour tile */
3451
86ff1ac451d8 (svn r4283) -Cleanup: More elrail housekeeping, remove code dublication, more meaningful variable names, simplify control flow..
celestar
parents: 3450
diff changeset
   200
static const TileSource TrackSourceTile[DIAGDIR_END][NUM_TRACKS_AT_PCP] = {
3449
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   201
	{TS_HOME, TS_NEIGHBOUR, TS_HOME     , TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME     },
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   202
	{TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME     , TS_NEIGHBOUR, TS_HOME     },
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   203
	{TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME     , TS_HOME     , TS_NEIGHBOUR},
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   204
	{TS_HOME, TS_NEIGHBOUR, TS_HOME     , TS_NEIGHBOUR, TS_HOME     , TS_NEIGHBOUR},
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   205
};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   206
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   207
/* Several PPPs maybe exist, here they are sorted in order of preference. */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   208
static const Direction PPPorder[DIAGDIR_END][TLG_END][DIR_END] = {    /*  X  -  Y  */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   209
	{   /* PCP 0 */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   210
		{DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_N, DIR_E, DIR_S, DIR_W}, /* evn - evn */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   211
		{DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_S, DIR_W, DIR_N, DIR_E}, /* evn - odd */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   212
		{DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_S, DIR_W, DIR_N, DIR_E}, /* odd - evn */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   213
		{DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_N, DIR_E, DIR_S, DIR_W}, /* odd - odd */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   214
	}, {/* PCP 1 */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   215
		{DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_S, DIR_E, DIR_N, DIR_W}, /* evn - evn */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   216
		{DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_N, DIR_W, DIR_S, DIR_E}, /* evn - odd */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   217
		{DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_N, DIR_W, DIR_S, DIR_E}, /* odd - evn */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   218
		{DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_S, DIR_E, DIR_N, DIR_W}, /* odd - odd */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   219
	}, {/* PCP 2 */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   220
		{DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_S, DIR_W, DIR_N, DIR_E}, /* evn - evn */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   221
		{DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_N, DIR_E, DIR_S, DIR_W}, /* evn - odd */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   222
		{DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_N, DIR_E, DIR_S, DIR_W}, /* odd - evn */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   223
		{DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_S, DIR_W, DIR_N, DIR_E}, /* odd - odd */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   224
	}, {/* PCP 3 */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   225
		{DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_N, DIR_W, DIR_S, DIR_E}, /* evn - evn */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   226
		{DIR_NE, DIR_SE, DIR_SW, DIR_NW, DIR_S, DIR_E, DIR_N, DIR_W}, /* evn - odd */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   227
		{DIR_SW, DIR_NW, DIR_NE, DIR_SE, DIR_S, DIR_E, DIR_N, DIR_W}, /* odd - evn */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   228
		{DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_N, DIR_W, DIR_S, DIR_E}, /* odd - odd */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   229
	}
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   230
};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   231
/* Geometric placement of the PCP relative to the tile origin */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   232
static const int8 x_pcp_offsets[DIAGDIR_END] = {0,  8, 15, 8};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   233
static const int8 y_pcp_offsets[DIAGDIR_END] = {8, 15,  8, 0};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   234
/* Geometric placement of the PPP relative to the PCP*/
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   235
static const int8 x_ppp_offsets[DIR_END] = {-3, -4, -3,  0, +3, +4, +3,  0};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   236
static const int8 y_ppp_offsets[DIR_END] = {-3,  0, +3, +4, +3,  0, -3, -4};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   237
/* The type of pylon to draw at each PPP */
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   238
static const SpriteID pylons_normal[] = {
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   239
	SPR_PYLON_EW_N,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   240
	SPR_PYLON_Y_NE,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   241
	SPR_PYLON_NS_E,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   242
	SPR_PYLON_X_SE,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   243
	SPR_PYLON_EW_S,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   244
	SPR_PYLON_Y_SW,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   245
	SPR_PYLON_NS_W,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   246
	SPR_PYLON_X_NW
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   247
};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   248
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   249
static const SpriteID pylons_bridge[] = {
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   250
	SPR_PYLON_X_NW,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   251
	SPR_PYLON_X_SE,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   252
	SPR_PYLON_Y_NE,
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   253
	SPR_PYLON_Y_SW
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   254
};
677afbebac23 (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
celestar
parents: 3446
diff changeset
   255
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   256
typedef struct {
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   257
	SpriteID image;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   258
	int8 x_offset;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   259
	int8 y_offset;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   260
	int8 x_size;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   261
	int8 y_size;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   262
	int8 z_size;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   263
	int8 z_offset;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   264
} SortableSpriteStruct;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   265
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   266
enum {
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   267
	/** Distance between wire and rail */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   268
	ELRAIL_ELEVATION = 8,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   269
	/** Corrects an off-by-one error in some places (tileh 12 and 9) (TODO -- find source of error) */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   270
	ELRAIL_ELEV_CORR = ELRAIL_ELEVATION + 1,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   271
	/** Wires that a draw one level higher than the north corner. */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   272
	ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   273
};
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   274
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   275
static const SortableSpriteStruct CatenarySpriteData[] = {
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   276
/* X direction */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   277
	/* Flat tiles: */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   278
		/* Wires */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   279
	{ SPR_WIRE_X_SW,          0,  8, 16,  1,  1, ELRAIL_ELEVATION }, //! 0: Wire in X direction, pylon on the SW end only
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   280
	{ SPR_WIRE_X_NE,          0,  8, 16,  1,  1, ELRAIL_ELEVATION }, //! 1: Wire in X direction, pylon on the NE end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   281
	{ SPR_WIRE_X_SHORT,       0,  8, 16,  1,  1, ELRAIL_ELEVATION }, //! 2: Wire in X direction, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   282
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   283
	/* "up" tiles */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   284
		/* Wires */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   285
	{ SPR_WIRE_X_SW_UP,       0,  8, 16,  8,  1, ELRAIL_ELEVRAISE }, //! 3: Wire in X pitch up, pylon on the SW end only
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   286
	{ SPR_WIRE_X_NE_UP,       0,  8, 16,  8,  1, ELRAIL_ELEVRAISE }, //! 4: Wire in X pitch up, pylon on the NE end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   287
	{ SPR_WIRE_X_SHORT_UP,    0,  8, 16,  8,  1, ELRAIL_ELEVRAISE }, //! 5: Wire in X pitch up, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   288
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   289
	/* "down" tiles */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   290
		/* Wires */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   291
	{ SPR_WIRE_X_SW_DOWN,     0,  8, 16,  8,  1, ELRAIL_ELEV_CORR }, //! 6: Wire in X pitch down, pylon on the SW end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   292
	{ SPR_WIRE_X_NE_DOWN,     0,  8, 16,  8,  1, ELRAIL_ELEV_CORR }, //! 7: Wire in X pitch down, pylon on the NE end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   293
	{ SPR_WIRE_X_SHORT_DOWN,  0,  8, 16,  8,  1, ELRAIL_ELEV_CORR }, //! 8: Wire in X pitch down, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   294
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   295
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   296
/* Y direction */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   297
	/* Flat tiles: */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   298
		/* Wires */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   299
	{ SPR_WIRE_Y_SE,          8,  0,  1, 16,  1, ELRAIL_ELEVATION }, //! 9: Wire in Y direction, pylon on the SE end only
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   300
	{ SPR_WIRE_Y_NW,          8,  0,  1, 16,  1, ELRAIL_ELEVATION }, //!10: Wire in Y direction, pylon on the NW end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   301
	{ SPR_WIRE_Y_SHORT,       8,  0,  1, 16,  1, ELRAIL_ELEVATION }, //!11: Wire in Y direction, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   302
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   303
	/* "up" tiles */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   304
		/* Wires */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   305
	{ SPR_WIRE_Y_SE_UP,       8,  0,  8, 16,  1, ELRAIL_ELEVRAISE }, //!12: Wire in Y pitch up, pylon on the SE end only
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   306
	{ SPR_WIRE_Y_NW_UP,       8,  0,  8, 16,  1, ELRAIL_ELEVRAISE }, //!13: Wire in Y pitch up, pylon on the NW end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   307
	{ SPR_WIRE_Y_SHORT_UP,    8,  0,  8, 16,  1, ELRAIL_ELEVRAISE }, //!14: Wire in Y pitch up, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   308
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   309
	/* "down" tiles */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   310
		/* Wires */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   311
	{ SPR_WIRE_Y_SE_DOWN,     8,  0,  8, 16,  1, ELRAIL_ELEV_CORR }, //!15: Wire in Y pitch down, pylon on the SE end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   312
	{ SPR_WIRE_Y_NW_DOWN,     8,  0,  8, 16,  1, ELRAIL_ELEV_CORR }, //!16: Wire in Y pitch down, pylon on the NW end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   313
	{ SPR_WIRE_Y_SHORT_DOWN,  8,  0,  8, 16,  1, ELRAIL_ELEV_CORR }, //!17: Wire in Y pitch down, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   314
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   315
/* NS Direction */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   316
	{ SPR_WIRE_NS_SHORT,      8,  0,  8,  8,  1, ELRAIL_ELEVATION }, //!18: LEFT  trackbit wire, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   317
	{ SPR_WIRE_NS_SHORT,      0,  8,  8,  8,  1, ELRAIL_ELEVATION }, //!19: RIGHT trackbit wire, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   318
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   319
	{ SPR_WIRE_NS_N,          8,  0,  8,  8,  1, ELRAIL_ELEVATION }, //!20: LEFT  trackbit wire, pylon on N end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   320
	{ SPR_WIRE_NS_N,          0,  8,  8,  8,  1, ELRAIL_ELEVATION }, //!21: RIGHT trackbit wire, pylon on N end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   321
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   322
	{ SPR_WIRE_NS_S,          8,  0,  8,  8,  1, ELRAIL_ELEVATION }, //!22: LEFT  trackbit wire, pylon on S end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   323
	{ SPR_WIRE_NS_S,          0,  8,  8,  8,  1, ELRAIL_ELEVATION }, //!23: RIGHT trackbit wire, pylon on S end
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   324
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   325
/* EW Direction */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   326
	{ SPR_WIRE_EW_SHORT,      8,  0,  8,  8,  1, ELRAIL_ELEVATION }, //!24: UPPER trackbit wire, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   327
	{ SPR_WIRE_EW_SHORT,     16,  8,  8,  8,  1, ELRAIL_ELEVATION }, //!25: LOWER trackbit wire, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   328
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   329
	{ SPR_WIRE_EW_W,          8,  0,  8,  8,  1, ELRAIL_ELEVATION }, //!28: UPPER trackbit wire, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   330
	{ SPR_WIRE_EW_W,         16,  8,  8,  8,  1, ELRAIL_ELEVATION }, //!29: LOWER trackbit wire, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   331
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   332
	{ SPR_WIRE_EW_E,          8,  0,  8,  8,  1, ELRAIL_ELEVATION }, //!32: UPPER trackbit wire, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   333
	{ SPR_WIRE_EW_E,         16,  8,  8,  8,  1, ELRAIL_ELEVATION }, //!33: LOWER trackbit wire, pylon on both ends
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   334
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   335
/* Depots */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   336
	{ SPR_WIRE_DEPOT_SW,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //!36: Wire for SW depot exit
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   337
	{ SPR_WIRE_DEPOT_NW,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }, //!37: Wire for NW depot exit
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   338
	{ SPR_WIRE_DEPOT_NE,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //!38: Wire for NE depot exit
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   339
	{ SPR_WIRE_DEPOT_SE,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }, //!39: Wire for SE depot exit
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   340
};
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   341
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   342
/** Refers to a certain element of the catenary.
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   343
  * Identifiers for Wires:
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   344
  * <ol><li>Direction of the wire</li>
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   345
  * <li>Slope of the tile for diagonals, placement inside the track for horiz/vertical pieces</li>
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   346
  * <li>Place where a pylon shoule be</li></ol>
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   347
  * Identifiers for Pylons:
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   348
  * <ol><li>Direction of the wire</li>
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   349
  * <li>Slope of the tile</li>
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   350
  * <li>Position of the Pylon relative to the track</li>
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   351
  * <li>Position of the Pylon inside the tile</li></ol>
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   352
  */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   353
typedef enum {
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   354
	WIRE_X_FLAT_SW,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   355
	WIRE_X_FLAT_NE,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   356
	WIRE_X_FLAT_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   357
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   358
	WIRE_X_UP_SW,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   359
	WIRE_X_UP_NE,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   360
	WIRE_X_UP_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   361
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   362
	WIRE_X_DOWN_SW,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   363
	WIRE_X_DOWN_NE,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   364
	WIRE_X_DOWN_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   365
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   366
	WIRE_Y_FLAT_SE,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   367
	WIRE_Y_FLAT_NW,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   368
	WIRE_Y_FLAT_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   369
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   370
	WIRE_Y_UP_SE,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   371
	WIRE_Y_UP_NW,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   372
	WIRE_Y_UP_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   373
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   374
	WIRE_Y_DOWN_SE,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   375
	WIRE_Y_DOWN_NW,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   376
	WIRE_Y_DOWN_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   377
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   378
	WIRE_NS_W_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   379
	WIRE_NS_E_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   380
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   381
	WIRE_NS_W_N,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   382
	WIRE_NS_E_N,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   383
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   384
	WIRE_NS_W_S,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   385
	WIRE_NS_E_S,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   386
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   387
	WIRE_EW_N_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   388
	WIRE_EW_S_BOTH,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   389
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   390
	WIRE_EW_N_W,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   391
	WIRE_EW_S_W,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   392
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   393
	WIRE_EW_N_E,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   394
	WIRE_EW_S_E,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   395
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   396
	WIRE_DEPOT_SW,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   397
	WIRE_DEPOT_NW,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   398
	WIRE_DEPOT_NE,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   399
	WIRE_DEPOT_SE,
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   400
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   401
	INVALID_CATENARY = 0xFF
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   402
} CatenarySprite;
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   403
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   404
/* Selects a Wire (with white and grey ends) depending on whether:
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   405
   a) none (should never happen)
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   406
   b) the first
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   407
   c) the second
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   408
   d) both
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   409
   PCP exists.*/
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   410
static const CatenarySprite Wires[5][TRACK_END][4] = {
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   411
	{ /* Tileh == 0 */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   412
		{INVALID_CATENARY, WIRE_X_FLAT_NE, WIRE_X_FLAT_SW, WIRE_X_FLAT_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   413
		{INVALID_CATENARY, WIRE_Y_FLAT_SE, WIRE_Y_FLAT_NW, WIRE_Y_FLAT_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   414
		{INVALID_CATENARY, WIRE_EW_N_W, WIRE_EW_N_E, WIRE_EW_N_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   415
		{INVALID_CATENARY, WIRE_EW_S_E, WIRE_EW_S_W, WIRE_EW_S_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   416
		{INVALID_CATENARY, WIRE_NS_W_S, WIRE_NS_W_N, WIRE_NS_W_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   417
		{INVALID_CATENARY, WIRE_NS_E_N, WIRE_NS_E_S, WIRE_NS_E_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   418
	}, { /* Tileh == 3 */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   419
		{INVALID_CATENARY, WIRE_X_UP_NE, WIRE_X_UP_SW, WIRE_X_UP_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   420
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   421
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   422
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   423
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   424
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   425
	}, { /* Tileh == 6 */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   426
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   427
		{INVALID_CATENARY, WIRE_Y_UP_SE, WIRE_Y_UP_NW, WIRE_Y_UP_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   428
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   429
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   430
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   431
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   432
	}, { /* Tileh == 9 */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   433
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   434
		{INVALID_CATENARY, WIRE_Y_DOWN_SE, WIRE_Y_DOWN_NW, WIRE_Y_DOWN_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   435
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   436
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   437
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   438
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   439
	}, { /* Tileh == 12 */
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   440
		{INVALID_CATENARY, WIRE_X_DOWN_NE, WIRE_X_DOWN_SW, WIRE_X_DOWN_BOTH},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   441
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   442
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   443
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   444
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   445
		{INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY, INVALID_CATENARY},
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   446
	}
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   447
};
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   448
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents:
diff changeset
   449
#endif /* ELRAIL_DATA_H */