diff options
author | celestar <celestar@openttd.org> | 2006-04-05 08:28:03 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-04-05 08:28:03 +0000 |
commit | 4acb8d5364fbd6fbb69468c14beb57b751a7e2e4 (patch) | |
tree | 15f4d1b016b2816ba40d016adeb348bac6819b69 /elrail.c | |
parent | 8362990f8c6d02791b5edcadf09e4a37150e1144 (diff) | |
download | openttd-4acb8d5364fbd6fbb69468c14beb57b751a7e2e4.tar.xz |
(svn r4281) -Cleanup: Begun cleaning up elrail code a bit, mostly comments and enum/array alignment
Diffstat (limited to 'elrail.c')
-rw-r--r-- | elrail.c | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -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. <h2>Basics</h2> <h3>Tile Types</h3> @@ -22,21 +22,23 @@ Group 3: Tiles with both an odd X and Y coordnate. <h4>Control Points</h4> 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.<p> +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). <h4>Position Points</h4> -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). <img src="../../elrail_tile.png"> <img src="../../elrail_track.png"> |