Changeset - r3450:279b1b5bdf8b
[Not reviewed]
master
0 1 0
celestar - 19 years ago 2006-04-05 08:45:29
celestar@openttd.org
(svn r4282) -Cleanup: Re-arranged the ignore groups into a more readable arrangement
1 file changed with 45 insertions and 44 deletions:
0 comments (0 inline, 0 general)
table/elrail_data.h
Show inline comments
 
@@ -94,85 +94,86 @@ static byte PreferredPPPofTrackBitAtPCP[
 
		PCP_NOT_ON_TRACK,
 
		PCP_NOT_ON_TRACK
 
	}
 
};
 
#undef PCP_NOT_ON_TRACK
 

	
 

	
 
#define NUM_IGNORE_GROUPS 3
 
#define NO_IGNORE 0xFF
 
#define IGNORE_NONE 0xFF
 
/** In case we have a staight line, we place pylon only every two tiles,
 
  so there are certain tiles which we ignore. A straight line is found if
 
  we have exactly two preferred points.*/
 
  we have exactly two PPPs. */
 
static byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
 
	{   /* Ignore group 1 */
 
	{   /* Ignore group 1, X and Y tracks */
 
		{     /* X even, Y even */
 
			1 << DIR_N  | 1 << DIR_S,
 
			IGNORE_NONE,
 
			1 << DIR_NE | 1 << DIR_SW,
 
			1 << DIR_NW | 1 << DIR_SE,
 
			1 << DIR_W  | 1 << DIR_E
 
			IGNORE_NONE
 
		}, { /* X even, Y odd  */
 
			0xFF,
 
			1 << DIR_E  | 1 << DIR_W,
 
			IGNORE_NONE,
 
			IGNORE_NONE,
 
			1 << DIR_NW | 1 << DIR_SE,
 
			1 << DIR_NE | 1 << DIR_SW
 
		}, { /* X odd,  Y even */
 
			1 << DIR_NW | 1 << DIR_SE,
 
			1 << DIR_NE | 1 << DIR_SW,
 
			1 << DIR_N  | 1 << DIR_S ,
 
			0xFF
 
			IGNORE_NONE,
 
			IGNORE_NONE
 
		}, { /* X odd,  Y odd  */
 
			1 << DIR_NW | 1 << DIR_SE,
 
			0xFF,
 
			0xFF,
 
			IGNORE_NONE,
 
			IGNORE_NONE,
 
			1 << DIR_NE | 1 << DIR_SW
 
		}
 
	},
 
	{   /* Ignore group 2 */
 
	{   /* Ignore group 2, LEFT and RIGHT tracks */
 
		{
 
			1 << DIR_E | 1 << DIR_W,
 
			1 << DIR_N | 1 << DIR_S,
 
			0xFF,
 
			IGNORE_NONE,
 
			IGNORE_NONE,
 
			1 << DIR_E | 1 << DIR_W
 
		}, {
 
			0xFF,
 
			0xFF,
 
			IGNORE_NONE,
 
			1 << DIR_E | 1 << DIR_W,
 
			1 << DIR_E | 1 << DIR_W,
 
			IGNORE_NONE
 
		}, {
 
			IGNORE_NONE,
 
			1 << DIR_E | 1 << DIR_W,
 
			1 << DIR_E | 1 << DIR_W,
 
			IGNORE_NONE
 
		}, {
 
			1 << DIR_E | 1 << DIR_W,
 
			IGNORE_NONE,
 
			IGNORE_NONE,
 
			1 << DIR_E | 1 << DIR_W
 
		}
 
	},
 
	{   /* Ignore group 3, UPPER and LOWER tracks */
 
		{
 
			1 << DIR_N | 1 << DIR_S,
 
			1 << DIR_N | 1 << DIR_S,
 
			IGNORE_NONE,
 
			IGNORE_NONE
 
		}, {
 
			IGNORE_NONE,
 
			IGNORE_NONE,
 
			1 << DIR_N | 1 << DIR_S,
 
			1 << DIR_N | 1 << DIR_S
 
		}, {
 
			0xFF,
 
			1 << DIR_E | 1 << DIR_W,
 
			1 << DIR_E | 1 << DIR_W,
 
			IGNORE_NONE,
 
			IGNORE_NONE,
 
			1 << DIR_N | 1 << DIR_S ,
 
			1 << DIR_N | 1 << DIR_S
 
		}, {
 
			1 << DIR_N | 1 << DIR_S,
 
			1 << DIR_N | 1 << DIR_S,
 
			0xFF,
 
			1 << DIR_E | 1 << DIR_W
 
		}
 
	},
 
	{   /* Ignore group 3 */
 
		{
 
			0xFF,
 
			0xFF,
 
			0xFF,
 
			0xFF
 
		}, {
 
			0xFF,
 
			0xFF,
 
			1 << DIR_E | 1 << DIR_W,
 
			0xFF
 
		}, {
 
			0xFF,
 
			0xFF,
 
			0xFF,
 
			0xFF
 
		}, {
 
			1 << DIR_E | 1 << DIR_W,
 
			0xFF,
 
			0xFF,
 
			0xFF
 
			IGNORE_NONE,
 
			IGNORE_NONE
 
		}
 
	}
 
};
 

	
 
#undef NO_IGNORE
 

	
0 comments (0 inline, 0 general)