elrail.c
changeset 3449 d45c8d0bf848
parent 3445 972e0aa84c51
child 3451 0e8ccac68fdf
equal deleted inserted replaced
3448:bc96e486627d 3449:d45c8d0bf848
     1 /* $Id$ */
     1 /* $Id$ */
     2 /** @file elrail.c
     2 /** @file elrail.c
     3   * This file deals with displaying wires and pylons for electric railway systems.
     3   This file deals with displaying wires and pylons for electric railways.
     4 <h2>Basics</h2>
     4 <h2>Basics</h2>
     5 
     5 
     6 <h3>Tile Types</h3>
     6 <h3>Tile Types</h3>
     7 
     7 
     8 We have two different types of tiles in the drawing code:
     8 We have two different types of tiles in the drawing code:
    20 
    20 
    21 <h3>Pylon Points</h3>
    21 <h3>Pylon Points</h3>
    22 <h4>Control Points</h4>
    22 <h4>Control Points</h4>
    23 A Pylon Control Point (PCP) is a position where a wire (or rather two)
    23 A Pylon Control Point (PCP) is a position where a wire (or rather two)
    24 is mounted onto a pylon.
    24 is mounted onto a pylon.
    25 Each NRT does contain 4 PCPs which are mapped to a byte
    25 Each NRT does contain 4 PCPs which are bitmapped to a byte
    26 variable and are represented by the DiagDirection enum:
    26 variable and are represented by the DiagDirection enum
    27 
    27 
    28 A wire that ends on the PCP has a dark ending, otherwise the end is bright.<p>
    28 Each track ends on two PCPs and thus requires one pylon on each end. However,
    29 
    29 there is one exception: Straight-and-level tracks only have one pylon every
    30 Now on each edge there are two PCPs: One from each adjacent tile. Both PCPs are merged
    30 other tile.
    31 using an OR matrix (i. e. if one tile needs a PCP at the postion in question, both
    31 
    32 tiles get it).
    32 Now on each edge there are two PCPs: One from each adjacent tile. Both PCPs
       
    33 are merged using an OR operation (i. e. if one tile needs a PCP at the postion
       
    34 in question, both tiles get it).
    33 
    35 
    34 <h4>Position Points</h4>
    36 <h4>Position Points</h4>
    35 A Pylon Position Point (PPP) is a position where a pylon is located on the ground.
    37 A Pylon Position Point (PPP) is a position where a pylon is located on the
    36 Each PCP owns 8 in (45 degree steps) PPPs that are located around it. PPPs are numbered
    38 ground.  Each PCP owns 8 in (45 degree steps) PPPs that are located around
    37 0 to 7 with 0 starting north and numbering in clockwise direction. Each track bit has PPPs
    39 it. PPPs are represented using the Direction enum. Each track bit has PPPs
    38 that are impossible (because the pylon would be situated on the track), preferred (because
    40 that are impossible (because the pylon would be situated on the track) and
    39 the pylon would be rectangular to the track). PPPs are represented by the Direction enum.
    41 some that are preferred (because the pylon would be rectangular to the track).
    40 
    42 
    41 <img src="../../elrail_tile.png">
    43 <img src="../../elrail_tile.png">
    42 <img src="../../elrail_track.png">
    44 <img src="../../elrail_track.png">
    43 
    45 
    44   */
    46   */