From 0a79bc83578bddf4325aa30f4b542eb470340137 Mon Sep 17 00:00:00 2001 From: celestar Date: Wed, 5 Apr 2006 08:28:03 +0000 Subject: (svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment --- elrail.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'elrail.c') diff --git a/elrail.c b/elrail.c index 5b4a628fc..ef0a44cbe 100644 --- a/elrail.c +++ b/elrail.c @@ -1,6 +1,6 @@ /* $Id$ */ /** @file elrail.c - * This file deals with displaying wires and pylons for electric railway systems. + This file deals with displaying wires and pylons for electric railways.

Basics

Tile Types

@@ -22,21 +22,23 @@ Group 3: Tiles with both an odd X and Y coordnate.

Control Points

A Pylon Control Point (PCP) is a position where a wire (or rather two) is mounted onto a pylon. -Each NRT does contain 4 PCPs which are mapped to a byte -variable and are represented by the DiagDirection enum: +Each NRT does contain 4 PCPs which are bitmapped to a byte +variable and are represented by the DiagDirection enum -A wire that ends on the PCP has a dark ending, otherwise the end is bright.

+Each track ends on two PCPs and thus requires one pylon on each end. However, +there is one exception: Straight-and-level tracks only have one pylon every +other tile. -Now on each edge there are two PCPs: One from each adjacent tile. Both PCPs are merged -using an OR matrix (i. e. if one tile needs a PCP at the postion in question, both -tiles get it). +Now on each edge there are two PCPs: One from each adjacent tile. Both PCPs +are merged using an OR operation (i. e. if one tile needs a PCP at the postion +in question, both tiles get it).

Position Points

-A Pylon Position Point (PPP) is a position where a pylon is located on the ground. -Each PCP owns 8 in (45 degree steps) PPPs that are located around it. PPPs are numbered -0 to 7 with 0 starting north and numbering in clockwise direction. Each track bit has PPPs -that are impossible (because the pylon would be situated on the track), preferred (because -the pylon would be rectangular to the track). PPPs are represented by the Direction enum. +A Pylon Position Point (PPP) is a position where a pylon is located on the +ground. Each PCP owns 8 in (45 degree steps) PPPs that are located around +it. PPPs are represented using the Direction enum. Each track bit has PPPs +that are impossible (because the pylon would be situated on the track) and +some that are preferred (because the pylon would be rectangular to the track). -- cgit v1.2.3-54-g00ecf