Changeset - r3355:881cb92af87e
[Not reviewed]
master
0 35 7
celestar - 19 years ago 2006-03-29 16:30:26
celestar@openttd.org
(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.
17 files changed:
0 comments (0 inline, 0 general)
BUGS
Show inline comments
 
new file 100644
 
/* $Id */
 

	
 
KNOWN BUGS / PROBLEMS:
 

	
 
Normal and elrail depots look the same. Use 'X' (transparent buildings)
 
   to distinguish between them
 
Missing curors / icons for construction (currently using the conventional ones)
Makefile
Show inline comments
 
@@ -630,6 +630,7 @@ SRCS += dock_gui.c
 
SRCS += driver.c
 
SRCS += dummy_land.c
 
SRCS += economy.c
 
SRCS += elrail.c
 
SRCS += engine.c
 
SRCS += engine_gui.c
 
SRCS += fileio.c
ai/default/default.c
Show inline comments
 
@@ -126,7 +126,7 @@ static void AiStateVehLoop(Player *p)
 
	p->ai.state_counter = 0;
 
}
 

	
 
static EngineID AiChooseTrainToBuild(byte railtype, int32 money, byte flag, TileIndex tile)
 
static EngineID AiChooseTrainToBuild(RailType railtype, int32 money, byte flag, TileIndex tile)
 
{
 
	EngineID best_veh_index = INVALID_ENGINE;
 
	byte best_veh_score = 0;
 
@@ -137,7 +137,7 @@ static EngineID AiChooseTrainToBuild(byt
 
		const RailVehicleInfo *rvi = RailVehInfo(i);
 
		const Engine* e = GetEngine(i);
 

	
 
		if (e->railtype != railtype ||
 
		if (!IsCompatibleRail(e->railtype, railtype) ||
 
				rvi->flags & RVI_WAGON ||
 
				(rvi->flags & RVI_MULTIHEAD && flag & 1) ||
 
				!HASBIT(e->player_avail, _current_player) ||
 
@@ -2321,6 +2321,41 @@ static StationID AiGetStationIdByDef(Til
 
	return GetStationIndex(TILE_ADD(tile, ToTileIndexDiff(p->tileoffs)));
 
}
 

	
 
static EngineID AiFindBestWagon(CargoID cargo, RailType railtype)
 
{
 
	EngineID best_veh_index = INVALID_ENGINE;
 
	EngineID i;
 
	uint16 best_capacity = 0;
 
	uint16 best_speed    = 0;
 
	uint speed;
 

	
 
	for (i = 0; i < NUM_TRAIN_ENGINES; i++) {
 
		const RailVehicleInfo *rvi = RailVehInfo(i);
 
		const Engine* e = GetEngine(i);
 

	
 
		if (!IsCompatibleRail(e->railtype, railtype) ||
 
				!(rvi->flags & RVI_WAGON) ||
 
				!HASBIT(e->player_avail, _current_player)) {
 
			continue;
 
		}
 

	
 
		if (rvi->cargo_type != cargo) {
 
			continue;
 
		}
 

	
 
		/* max_speed of 0 indicates no speed limit */
 
		speed = rvi->max_speed == 0 ? 0xFFFF : rvi->max_speed;
 

	
 
		if (rvi->capacity >= best_capacity && speed >= best_speed) {
 
			best_capacity = rvi->capacity;
 
			best_speed    = best_speed;
 
			best_veh_index = i;
 
		}
 
	}
 

	
 
	return best_veh_index;
 
}
 

	
 
static void AiStateBuildRailVeh(Player *p)
 
{
 
	const AiDefaultBlockData *ptr;
 
@@ -2337,10 +2372,14 @@ static void AiStateBuildRailVeh(Player *
 

	
 
	tile = TILE_ADD(p->ai.src.use_tile, ToTileIndexDiff(ptr->tileoffs));
 

	
 

	
 
	cargo = p->ai.cargo_type;
 
	for (i = 0;;) {
 
		if (p->ai.wagon_list[i] == INVALID_VEHICLE) {
 
			veh = _cargoc.ai_railwagon[p->ai.railtype_to_use][cargo];
 
			veh = AiFindBestWagon(cargo, p->ai.railtype_to_use);
 
			/* veh will return INVALID_ENGINE if no suitable wagon is available.
 
			 * We shall treat this in the same way as having no money */
 
			if (veh == INVALID_ENGINE) goto handle_nocash;
 
			cost = DoCommandByTile(tile, veh, 0, DC_EXEC, CMD_BUILD_RAIL_VEHICLE);
 
			if (CmdFailed(cost)) goto handle_nocash;
 
			p->ai.wagon_list[i] = _new_wagon_id;
bridge.h
Show inline comments
 
@@ -22,4 +22,6 @@ typedef struct Bridge {
 
extern const Bridge orig_bridge[MAX_BRIDGES];
 
extern Bridge _bridge[MAX_BRIDGES];
 

	
 
uint GetBridgeFoundation(uint tileh, Axis axis);
 

	
 
#endif /* BRIDGE_H */
bridge_map.h
Show inline comments
 
@@ -127,6 +127,7 @@ TileIndex GetSouthernBridgeEnd(TileIndex
 
 */
 
TileIndex GetOtherBridgeEnd(TileIndex);
 

	
 
uint GetBridgeHeight(TileIndex t);
 

	
 
static inline void SetClearUnderBridge(TileIndex t)
 
{
data/elrailsw.grf
Show inline comments
 
new file 100644
 
binary diff not shown
docs/elrail.svg
Show inline comments
 
new file 100644
 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 
<!-- Created with Inkscape (http://www.inkscape.org/) -->
 
<svg
 
   xmlns:dc="http://purl.org/dc/elements/1.1/"
 
   xmlns:cc="http://web.resource.org/cc/"
 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 
   xmlns:svg="http://www.w3.org/2000/svg"
 
   xmlns="http://www.w3.org/2000/svg"
 
   xmlns:xlink="http://www.w3.org/1999/xlink"
 
   xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
 
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
 
   width="744.09448819"
 
   height="1052.3622047"
 
   id="svg2"
 
   sodipodi:version="0.32"
 
   inkscape:version="0.42.2"
 
   sodipodi:docbase="/home/vici/openttd/branch/elrail/docs"
 
   sodipodi:docname="elrail.svg">
 
  <defs
 
     id="defs4" />
 
  <sodipodi:namedview
 
     id="base"
 
     pagecolor="#ffffff"
 
     bordercolor="#666666"
 
     borderopacity="1.0"
 
     inkscape:pageopacity="1.0000000"
 
     inkscape:pageshadow="2"
 
     inkscape:zoom="3.6009318"
 
     inkscape:cx="144.00958"
 
     inkscape:cy="578.90292"
 
     inkscape:document-units="px"
 
     inkscape:current-layer="layer1"
 
     showguides="true"
 
     inkscape:guide-bbox="true"
 
     showgrid="true"
 
     inkscape:window-width="1131"
 
     inkscape:window-height="791"
 
     inkscape:window-x="1295"
 
     inkscape:window-y="46"
 
     inkscape:grid-points="false"
 
     inkscape:guide-points="false" />
 
  <metadata
 
     id="metadata7">
 
    <rdf:RDF>
 
      <cc:Work
 
         rdf:about="">
 
        <dc:format>image/svg+xml</dc:format>
 
        <dc:type
 
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
 
      </cc:Work>
 
    </rdf:RDF>
 
  </metadata>
 
  <g
 
     inkscape:label="Layer 1"
 
     inkscape:groupmode="layer"
 
     id="layer1">
 
    <rect
 
       style="opacity:1.0000000;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0067960;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       id="rect1306"
 
       width="159.49321"
 
       height="159.49657"
 
       x="227.17947"
 
       y="-24.569920"
 
       transform="matrix(0.707107,0.707107,-0.707107,0.707107,0.000000,0.000000)"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <rect
 
       y="272.36218"
 
       x="134.28571"
 
       height="100.00000"
 
       width="100.00000"
 
       id="rect2059"
 
       style="opacity:1.0000000;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-opacity:1.0000000;stroke-width:0.0000000;stroke-miterlimit:4.0000000;stroke-dasharray:none"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="177.84283"
 
       y="159.25369"
 
       id="text6598"
 
       sodipodi:linespacing="125%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6600"
 
         x="177.84283"
 
         y="159.25369"
 
         style="font-family:Bitstream Vera Sans;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:12.000000;text-anchor:middle;text-align:center;writing-mode:lr;line-height:125%">N</tspan></text>
 
    <path
 
       transform="translate(-192.0645,-106.5709)"
 
       d="M 213.86573 240.06183 A 4.8679605 4.8679605 0 1 1  204.12981,240.06183 A 4.8679605 4.8679605 0 1 1  213.86573 240.06183 z"
 
       sodipodi:ry="4.8679605"
 
       sodipodi:rx="4.8679605"
 
       sodipodi:cy="240.06183"
 
       sodipodi:cx="208.99777"
 
       id="use6604"
 
       style="opacity:1.0000000;fill:#9fb276;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.29899999;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="27.214844"
 
       y="135.69812"
 
       id="text6606"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6608"
 
         x="27.214844"
 
         y="135.69812"
 
         style="font-size:8.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">Pylon Control Point (PCP)</tspan></text>
 
    <g
 
       id="g6780"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397">
 
      <path
 
         transform="translate(-16.64392,10.04300)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6610"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-16.64392,-3.625430)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6612"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-2.975490,-3.625430)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6614"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(10.69294,-3.625430)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6616"
 
         style="opacity:1.0000000;fill:#ff0000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(10.69294,10.04300)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6620"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(10.69294,23.71143)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6622"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-2.975490,23.71143)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6624"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-16.64392,23.71143)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6626"
 
         style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#9fb276;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.29899999;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6732"
 
         sodipodi:cx="208.99777"
 
         sodipodi:cy="240.06183"
 
         sodipodi:rx="4.8679605"
 
         sodipodi:ry="4.8679605"
 
         d="M 213.86573 240.06183 A 4.8679605 4.8679605 0 1 1  204.12981,240.06183 A 4.8679605 4.8679605 0 1 1  213.86573 240.06183 z"
 
         transform="matrix(0.707107,-0.707107,0.707107,0.707107,-82.95220,177.5124)" />
 
    </g>
 
    <use
 
       x="0.0000000"
 
       y="0.0000000"
 
       xlink:href="#path6616"
 
       id="use6742"
 
       transform="translate(-222.0702,-28.15283)"
 
       width="744.09448"
 
       height="1052.3622"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="translate(-211.3773,-22.11155)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path6744"
 
       style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="translate(-211.3773,-12.44495)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path6746"
 
       style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="translate(-211.3773,-2.778260)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path6748"
 
       style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="32.279297"
 
       y="159.58745"
 
       id="text6750"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6752"
 
         x="32.279297"
 
         y="159.58745"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">not allowed, not owned</tspan></text>
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="32.279297"
 
       y="188.58745"
 
       id="text6754"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6756"
 
         x="32.279297"
 
         y="188.58745"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">not allowed, owned</tspan></text>
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="32.279297"
 
       y="178.92078"
 
       id="text6758"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6760"
 
         x="32.279297"
 
         y="178.92078"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">allowed, owned</tspan></text>
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="32.279297"
 
       y="169.25417"
 
       id="text6762"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6764"
 
         x="32.279297"
 
         y="169.25417"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">allowed, not owned</tspan></text>
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="27.214844"
 
       y="149.62065"
 
       id="text6766"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6768"
 
         x="27.214844"
 
         y="149.62065"
 
         style="font-size:8.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">Pylon Position Point (PPP)</tspan></text>
 
    <use
 
       x="0.0000000"
 
       y="0.0000000"
 
       xlink:href="#g6780"
 
       id="use6791"
 
       transform="matrix(-1.720846e-15,1.000000,-1.000000,-1.720846e-15,433.4807,78.77855)"
 
       width="744.09448"
 
       height="1052.3622"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <g
 
       id="g6793"
 
       transform="matrix(1.776357e-15,-1.000000,1.000000,1.776357e-15,-78.04526,434.0590)"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397">
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6795"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-16.64392,10.04300)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6797"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-16.64392,-3.625430)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6799"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-2.975490,-3.625430)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#ff0000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6801"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(10.69294,-3.625430)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6803"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(10.69294,10.04300)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6805"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(10.69294,23.71143)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6807"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-2.975490,23.71143)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6809"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-16.64392,23.71143)" />
 
      <path
 
         transform="matrix(0.707107,-0.707107,0.707107,0.707107,-82.95220,177.5124)"
 
         d="M 213.86573 240.06183 A 4.8679605 4.8679605 0 1 1  204.12981,240.06183 A 4.8679605 4.8679605 0 1 1  213.86573 240.06183 z"
 
         sodipodi:ry="4.8679605"
 
         sodipodi:rx="4.8679605"
 
         sodipodi:cy="240.06183"
 
         sodipodi:cx="208.99777"
 
         id="path6811"
 
         style="opacity:1.0000000;fill:#9fb276;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.29899999;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
    </g>
 
    <g
 
       id="g6813"
 
       transform="matrix(-1.000000,0.000000,0.000000,-1.000000,356.0752,512.3398)"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_tile.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397">
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6815"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-16.64392,10.04300)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6817"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-16.64392,-3.625430)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6819"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-2.975490,-3.625430)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#ff0000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6821"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(10.69294,-3.625430)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6823"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(10.69294,10.04300)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6825"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(10.69294,23.71143)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6827"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-2.975490,23.71143)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6829"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="translate(-16.64392,23.71143)" />
 
      <path
 
         transform="matrix(0.707107,-0.707107,0.707107,0.707107,-82.95220,177.5124)"
 
         d="M 213.86573 240.06183 A 4.8679605 4.8679605 0 1 1  204.12981,240.06183 A 4.8679605 4.8679605 0 1 1  213.86573 240.06183 z"
 
         sodipodi:ry="4.8679605"
 
         sodipodi:rx="4.8679605"
 
         sodipodi:cy="240.06183"
 
         sodipodi:cx="208.99777"
 
         id="path6831"
 
         style="opacity:1.0000000;fill:#9fb276;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.29899999;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
    </g>
 
    <use
 
       x="0.0000000"
 
       y="0.0000000"
 
       xlink:href="#path6616"
 
       id="use6841"
 
       transform="translate(-225.5836,232.1805)"
 
       width="744.09448"
 
       height="1052.3622"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="translate(-214.8907,238.2218)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path6843"
 
       style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="translate(-214.8907,247.8884)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path6845"
 
       style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="translate(-214.8907,257.5551)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path6847"
 
       style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="28.765947"
 
       y="419.92078"
 
       id="text6849"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6851"
 
         x="28.765947"
 
         y="419.92078"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">not allowed, but preferred (end of line marker)</tspan></text>
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="28.765947"
 
       y="448.92078"
 
       id="text6853"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6855"
 
         x="28.765947"
 
         y="448.92078"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">not allowed</tspan></text>
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="28.765947"
 
       y="439.25409"
 
       id="text6857"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6859"
 
         x="28.765947"
 
         y="439.25409"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">preferred, allowed</tspan></text>
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="28.765947"
 
       y="429.58746"
 
       id="text6861"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         x="28.765947"
 
         y="429.58746"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"
 
         id="tspan6933">allowed</tspan></text>
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="23.701494"
 
       y="409.95398"
 
       id="text6865"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan6867"
 
         x="23.701494"
 
         y="409.95398"
 
         style="font-size:8.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">Pylon Position Point (PPP)</tspan></text>
 
    <g
 
       id="g6989"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397">
 
      <path
 
         transform="translate(-103.1355,254.9297)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6871"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-103.1355,241.2613)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6873"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-89.46705,241.2613)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6875"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-75.79862,241.2613)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6877"
 
         style="opacity:1.0000000;fill:#ff0000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-75.79862,254.9297)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6879"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-75.79862,268.5982)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6881"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-89.46705,268.5982)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6883"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         transform="translate(-103.1355,268.5982)"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         sodipodi:ry="2.2717149"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:cy="189.43504"
 
         sodipodi:cx="237.55647"
 
         id="path6885"
 
         style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         sodipodi:type="arc" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6891"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="matrix(-1.000000,0.000000,0.000000,-1.000000,286.2275,747.1836)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6893"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="matrix(-1.000000,0.000000,0.000000,-1.000000,286.2275,760.8520)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6895"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="matrix(-1.000000,0.000000,0.000000,-1.000000,272.5591,760.8520)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#ff0000;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6897"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="matrix(-1.000000,0.000000,0.000000,-1.000000,258.8907,760.8520)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6899"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="matrix(-1.000000,0.000000,0.000000,-1.000000,258.8907,747.1836)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#00ffff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6901"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="matrix(-1.000000,0.000000,0.000000,-1.000000,258.8907,733.5153)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6903"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="matrix(-1.000000,0.000000,0.000000,-1.000000,272.5591,733.5153)" />
 
      <path
 
         sodipodi:type="arc"
 
         style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
         id="path6905"
 
         sodipodi:cx="237.55647"
 
         sodipodi:cy="189.43504"
 
         sodipodi:rx="2.2717149"
 
         sodipodi:ry="2.2717149"
 
         d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
         transform="matrix(-1.000000,0.000000,0.000000,-1.000000,286.2275,733.5153)" />
 
      <path
 
         id="path6931"
 
         d="M 35.005290,557.75123 L 148.46835,444.19631"
 
         style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" />
 
    </g>
 
    <g
 
       id="g7091"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397">
 
      <path
 
         sodipodi:nodetypes="ccc"
 
         id="path6935"
 
         d="M 143.36688,574.86732 L 185.00000,533.20050 L 241.50000,533.20050"
 
         style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000011px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000" />
 
      <g
 
         id="g7081">
 
        <path
 
           transform="matrix(-1.000000,0.000000,0.000000,-1.000000,436.0591,722.7997)"
 
           d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
           sodipodi:ry="2.2717149"
 
           sodipodi:rx="2.2717149"
 
           sodipodi:cy="189.43504"
 
           sodipodi:cx="237.55647"
 
           id="path6973"
 
           style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
           sodipodi:type="arc" />
 
        <path
 
           transform="matrix(-1.000000,0.000000,0.000000,-1.000000,436.0591,736.4681)"
 
           d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
           sodipodi:ry="2.2717149"
 
           sodipodi:rx="2.2717149"
 
           sodipodi:cy="189.43504"
 
           sodipodi:cx="237.55647"
 
           id="path6975"
 
           style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
           sodipodi:type="arc" />
 
        <path
 
           transform="matrix(-1.000000,0.000000,0.000000,-1.000000,422.3907,736.4681)"
 
           d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
           sodipodi:ry="2.2717149"
 
           sodipodi:rx="2.2717149"
 
           sodipodi:cy="189.43504"
 
           sodipodi:cx="237.55647"
 
           id="path6977"
 
           style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
           sodipodi:type="arc" />
 
        <path
 
           transform="matrix(-1.000000,0.000000,0.000000,-1.000000,408.7223,736.4681)"
 
           d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
           sodipodi:ry="2.2717149"
 
           sodipodi:rx="2.2717149"
 
           sodipodi:cy="189.43504"
 
           sodipodi:cx="237.55647"
 
           id="path6979"
 
           style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
           sodipodi:type="arc" />
 
        <path
 
           transform="matrix(-1.000000,0.000000,0.000000,-1.000000,408.7223,722.7997)"
 
           d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
           sodipodi:ry="2.2717149"
 
           sodipodi:rx="2.2717149"
 
           sodipodi:cy="189.43504"
 
           sodipodi:cx="237.55647"
 
           id="path6981"
 
           style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
           sodipodi:type="arc" />
 
        <path
 
           transform="matrix(-1.000000,0.000000,0.000000,-1.000000,408.7223,709.1314)"
 
           d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
           sodipodi:ry="2.2717149"
 
           sodipodi:rx="2.2717149"
 
           sodipodi:cy="189.43504"
 
           sodipodi:cx="237.55647"
 
           id="path6983"
 
           style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
           sodipodi:type="arc" />
 
        <path
 
           transform="matrix(-1.000000,0.000000,0.000000,-1.000000,422.3907,709.1314)"
 
           d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
           sodipodi:ry="2.2717149"
 
           sodipodi:rx="2.2717149"
 
           sodipodi:cy="189.43504"
 
           sodipodi:cx="237.55647"
 
           id="path6985"
 
           style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
           sodipodi:type="arc" />
 
        <path
 
           transform="matrix(-1.000000,0.000000,0.000000,-1.000000,436.0591,709.1314)"
 
           d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
           sodipodi:ry="2.2717149"
 
           sodipodi:rx="2.2717149"
 
           sodipodi:cy="189.43504"
 
           sodipodi:cx="237.55647"
 
           id="path6987"
 
           style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
           sodipodi:type="arc" />
 
      </g>
 
    </g>
 
    <path
 
       transform="matrix(-0.707107,0.707107,-0.707107,-0.707107,608.1528,439.3340)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path7037"
 
       style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="matrix(-0.707107,0.707107,-0.707107,-0.707107,617.8178,448.9990)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path7039"
 
       style="opacity:1.0000000;fill:#ff00ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="matrix(-0.707107,0.707107,-0.707107,-0.707107,608.1528,458.6640)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path7041"
 
       style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="matrix(-0.707107,0.707107,-0.707107,-0.707107,598.4878,468.3290)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path7043"
 
       style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="matrix(-0.707107,0.707107,-0.707107,-0.707107,588.8228,458.6640)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path7045"
 
       style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="matrix(-0.707107,0.707107,-0.707107,-0.707107,579.1578,448.9991)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path7047"
 
       style="opacity:1.0000000;fill:#ff00ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="matrix(-0.707107,0.707107,-0.707107,-0.707107,588.8229,439.3341)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path7049"
 
       style="opacity:1.0000000;fill:#0000ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="matrix(-0.707107,0.707107,-0.707107,-0.707107,598.4879,429.6690)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path7051"
 
       style="opacity:1.0000000;fill:#ffff00;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0000004px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
 
       d="M 296.56288,570.12631 L 296.49793,409.60031"
 
       id="path7053"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <path
 
       transform="translate(-214.8907,267.2614)"
 
       d="M 239.82819 189.43504 A 2.2717149 2.2717149 0 1 1  235.28476,189.43504 A 2.2717149 2.2717149 0 1 1  239.82819 189.43504 z"
 
       sodipodi:ry="2.2717149"
 
       sodipodi:rx="2.2717149"
 
       sodipodi:cy="189.43504"
 
       sodipodi:cx="237.55647"
 
       id="path7111"
 
       style="opacity:1.0000000;fill:#ff00ff;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.12500000;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
 
       sodipodi:type="arc"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397" />
 
    <text
 
       xml:space="preserve"
 
       style="font-size:12.000000px;font-style:normal;font-weight:normal;line-height:125.00000%;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Bitstream Vera Sans"
 
       x="28.765947"
 
       y="458.93326"
 
       id="text7113"
 
       sodipodi:linespacing="125.00000%"
 
       inkscape:export-filename="/home/vici/openttd/branch/elrail/docs/elrail_track.png"
 
       inkscape:export-xdpi="299.91397"
 
       inkscape:export-ydpi="299.91397"><tspan
 
         sodipodi:role="line"
 
         id="tspan7115"
 
         x="28.765947"
 
         y="458.93326"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans">preferred, allowed and</tspan><tspan
 
         sodipodi:role="line"
 
         x="28.765947"
 
         y="466.43326"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"
 
         id="tspan7117">can be ignored to create</tspan><tspan
 
         sodipodi:role="line"
 
         x="28.765947"
 
         y="473.93326"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"
 
         id="tspan7119">long wires (which span</tspan><tspan
 
         sodipodi:role="line"
 
         x="28.765947"
 
         y="481.43326"
 
         style="font-size:6.0000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans"
 
         id="tspan7121">2 tiles)</tspan></text>
 
  </g>
 
</svg>
docs/elrail_tile.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
docs/elrail_track.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
docs/landscape.html
Show inline comments
 
@@ -129,7 +129,7 @@ m5 bit 7 clear: railway track
 
<tr><td nowrap valign=top><tt>B</tt>&nbsp; </td><td align=left>fence on the N side (track in the S corner)</td></tr>
 
<tr><td nowrap valign=top><tt>C</tt>&nbsp; </td><td align=left>on snow or desert</td></tr>
 
</table></li>
 
<li>m3 bits 0..3 = <a name="TrackType">track type</a>: <tt>0</tt> - conventional railway, <tt>1</tt> - monorail, <tt>2</tt> - maglev
 
<li>m3 bits 0..3 = <a name="TrackType">track type</a>: <tt>0</tt> - conventional railway, <tt>1</tt> - electrified railway, <tt>2</tt> - monorail, <tt>3</tt> - maglev
 
</ul>
 
m5 bits 7 and 6 set: railway depot / checkpoints
 
<ul>
elrail.c
Show inline comments
 
new file 100644
 
/* $Id$ */
 
/** @file elrail.c
 
  * This file deals with displaying wires and pylons for electric railway systems.
 
<h2>Basics</h2>
 

	
 
<h3>Tile Types</h3>
 

	
 
We have two different types of tiles in the drawing code:
 
Normal Railway Tiles (NRTs) which can have more than one track on it, and
 
Special Railways tiles (SRTs) which have only one track (like crossings, depots
 
stations, etc).
 

	
 
<h3>Location Categories</h3>
 

	
 
All tiles are categorized into three location groups (TLG):
 
Group 0: Tiles with both an even X coordinate and an even Y coordinate
 
Group 1: Tiles with an even X and an odd Y coordinate
 
Group 2: Tiles with an odd X and an even Y coordinate
 
Group 3: Tiles with both an odd X and Y coordnate.
 

	
 
<h3>Pylon Points</h3>
 
<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:
 

	
 
A wire that ends on the PCP has a dark ending, otherwise the end is bright.<p>
 

	
 
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).
 

	
 
<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.
 

	
 
<img src="../../elrail_tile.png">
 
<img src="../../elrail_track.png">
 

	
 
  */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "tile.h"
 
#include "viewport.h"
 
#include "functions.h" /* We should REALLY get rid of this goddamn file, as it is butt-ugly */
 
#include "variables.h" /* ... same here */
 
#include "rail.h"
 
#include "debug.h"
 
#include "tunnel_map.h"
 
#include "road_map.h"
 
#include "bridge_map.h"
 
#include "bridge.h"
 
#include "rail_map.h"
 
#include "table/sprites.h"
 
#include "table/elrail_data.h"
 

	
 
static inline TLG GetTLG(TileIndex t)
 
{
 
	return (HASBIT(TileX(t), 0) << 1) + HASBIT(TileY(t), 0);
 
}
 

	
 
/** Finds which Rail Bits are present on a given tile. For bridge tiles,
 
  * returns track bits under the bridge
 
  */
 
static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
 
{
 
	switch (GetTileType(t)) {
 
		case MP_RAILWAY:
 
			if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
 
			switch (GetRailTileType(t)) {
 
				case RAIL_TYPE_NORMAL: case RAIL_TYPE_SIGNALS:
 
					return GetTrackBits(t);
 
				default:
 
					return 0;
 
			}
 
			break;
 
		case MP_TUNNELBRIDGE:
 
			if (IsTunnel(t)) {
 
				if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
 
				if (override != NULL) *override = 1 << GetTunnelDirection(t);
 
				return (_m[t].m5 & 1) ? TRACK_BIT_Y : TRACK_BIT_X;
 
			} else {
 
				if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
 
				if (
 
					IsBridgeMiddle(t) &&
 
					IsTransportUnderBridge(t) &&
 
					GetTransportTypeUnderBridge(t) == TRANSPORT_RAIL) {
 
					return GetRailBitsUnderBridge(t);
 
				} else {
 
					if (override != NULL && DistanceMax(t, GetOtherBridgeEnd(t)) > 1) *override = 1 << GetBridgeRampDirection(t);
 

	
 
					return GetBridgeAxis(t) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y;
 
				}
 
			}
 
		case MP_STREET:
 
			if ((_m[t].m4 & 0xF) != RAILTYPE_ELECTRIC) return 0;
 
			return GetCrossingRailBits(t);
 
		case MP_STATION:
 
			if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
 
			return _m[t].m5 & 1 ? TRACK_BIT_Y : TRACK_BIT_X;
 
		default:
 
			return 0;
 
	}
 
}
 

	
 
/** Draws wires and, if required, pylons on a given tile
 
  * @param ti The Tileinfo to draw the tile for
 
  * @todo Currently, each pylon is drawn twice (once for each neighbouring tiles use OwnedPPPonPCP for this)
 
  */
 
static void DrawCatenaryRailway(const TileInfo *ti)
 
{
 
	/* Pylons are placed on a tile edge, so we need to take into account
 
	   the track configuration of 2 adjacent tiles. trackconfig[0] stores the
 
	   current tile (home tile) while [1] holds the neighbour */
 
	TrackBits trackconfig[TS_END];
 
	bool isflat[TS_END];
 
	/* Note that ti->tileh has already been adjusted for Foundations */
 
	uint tileh[TS_END] = {ti->tileh, 0};
 

	
 
	TLG tlg = GetTLG(ti->tile);
 
	byte PCPstatus = 0;
 
	byte OverridePCP = 0;
 
	byte PPPpreferred[DIAGDIR_END] = {0xFF, 0xFF, 0xFF, 0xFF};
 
	byte PPPallowed[DIAGDIR_END] = {AllowedPPPonPCP[0], AllowedPPPonPCP[1], AllowedPPPonPCP[2], AllowedPPPonPCP[3]};
 
	byte PPPbuffer[DIAGDIR_END];
 
	DiagDirection i;
 
	Track t;
 

	
 
	/* Find which rail bits are present, and select the override points.
 
	   We don't draw a pylon:
 
	   1) INSIDE a tunnel (we wouldn't see it anyway)
 
	   2) on the "far" end of a bridge head (the one that connects to bridge middle),
 
	      because that one is drawn on the bridge. Exception is for length 0 bridges
 
	      which have no middle tiles */
 
	trackconfig[TS_HOME] = GetRailTrackBitsUniversal(ti->tile, &OverridePCP);
 
	/* If a track bit is present that is not in the main direction, the track is level */
 
	isflat[TS_HOME] = trackconfig[TS_HOME] & (TRACK_BIT_UPPER | TRACK_BIT_LOWER | TRACK_BIT_LEFT | TRACK_BIT_RIGHT);
 

	
 
	if (IsTunnelTile(ti->tile)) tileh[TS_HOME] = 0;
 
	if (IsBridgeTile(ti->tile) && IsBridgeRamp(ti->tile)) {
 
		if (tileh[TS_HOME] != 0) {
 
			tileh[TS_HOME] = 0;
 
		} else {
 
			switch (GetBridgeRampDirection(ti->tile)) {
 
				case DIAGDIR_NE: tileh[TS_HOME] = 12; break;
 
				case DIAGDIR_SE: tileh[TS_HOME] =  6; break;
 
				case DIAGDIR_SW: tileh[TS_HOME] =  3; break;
 
				case DIAGDIR_NW: tileh[TS_HOME] =  9; break;
 
				default: break;
 
			}
 
		}
 
	}
 

	
 
	for (i = DIAGDIR_NE; i < DIAGDIR_END; i++) {
 
		extern const TileIndexDiffC _tileoffs_by_dir[];
 
		TileIndex neighbour = ti->tile + TileOffsByDir(i);
 
		uint foundation = 0;
 
		int k;
 

	
 
		/* Here's one of the main headaches. GetTileSlope does not correct for possibly
 
		   existing foundataions, so we do have to do that manually later on.*/
 
		tileh[TS_NEIGHBOUR] = GetTileSlope(neighbour, NULL);
 
		trackconfig[TS_NEIGHBOUR] = GetRailTrackBitsUniversal(neighbour, NULL);
 
		isflat[TS_NEIGHBOUR] = trackconfig[TS_NEIGHBOUR] & (TRACK_BIT_UPPER | TRACK_BIT_LOWER | TRACK_BIT_LEFT | TRACK_BIT_RIGHT);
 

	
 
		/* We cycle through all the existing tracks at a PCP and see what
 
		   PPPs we want to have, or may not have at all */
 
		for (k = 0; k < TRACKS_AT_PCP; k++) {
 
			/* Next to us, we have a bridge head, don't worry about that one, if it shows away from us */
 
			if (
 
					trackorigin[i][k] == TS_NEIGHBOUR &&
 
					IsBridgeTile(neighbour) && IsBridgeRamp(neighbour) &&
 
					GetBridgeRampDirection(neighbour) == ReverseDiagDir(i)
 
			   ) continue;
 

	
 
			if (HASBIT(trackconfig[trackorigin[i][k]], PPPtracks[i][k])) {
 
				DiagDirection PCPpos = (trackorigin[i][k] == 0) ? i : ReverseDiagDir(i);
 
				PCPstatus |= 1 << i; /* This PCP is in use */
 
				PPPpreferred[i] &= PreferredPPPofTrackBitAtPCP[PPPtracks[i][k]][PCPpos];
 
				PPPallowed[i] &= ~DisallowedPPPofTrackBitAtPCP[PPPtracks[i][k]][PCPpos];
 
			}
 
		}
 

	
 
		/* Deactivate all PPPs if PCP is not used */
 
		PPPpreferred[i] *= HASBIT(PCPstatus, i);
 
		PPPallowed[i] *= HASBIT(PCPstatus, i);
 

	
 
		/* Station on a non-flat tile means foundation. add one height level and adjust tileh */
 
		if (IsTileType(neighbour, MP_STATION) && tileh[TS_NEIGHBOUR] != 0) tileh[TS_NEIGHBOUR] = 0;
 

	
 
		/* Read the foundataions if they are present, and adjust the tileh */
 
		if (IsTileType(neighbour, MP_RAILWAY)) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]);
 
		if (IsBridgeTile(neighbour) && IsBridgeRamp(neighbour)) foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], GetBridgeAxis(neighbour));
 
		if (foundation != 0) {
 
			if (foundation < 15) {
 
				tileh[TS_NEIGHBOUR] = 0;
 
			} else {
 
				tileh[TS_NEIGHBOUR] = _inclined_tileh[foundation - 15];
 
			}
 
		}
 

	
 
		/* Convert the real tileh into a pseudo-tileh for the track */
 
		if (IsTunnelTile(neighbour)) tileh[TS_NEIGHBOUR] = 0;
 
		if (IsBridgeTile(neighbour) && IsBridgeRamp(neighbour)) {
 
			if (tileh[TS_NEIGHBOUR] != 0) {
 
				tileh[TS_NEIGHBOUR] = 0;
 
			} else {
 
				switch (GetBridgeRampDirection(neighbour)) {
 
					case DIAGDIR_NE: tileh[TS_NEIGHBOUR] = 12; break;
 
					case DIAGDIR_SE: tileh[TS_NEIGHBOUR] =  6; break;
 
					case DIAGDIR_SW: tileh[TS_NEIGHBOUR] =  3; break;
 
					case DIAGDIR_NW: tileh[TS_NEIGHBOUR] =  9; break;
 
					default: break;
 
				}
 
			}
 
		}
 

	
 
		/* If we have a straight (and level) track, we want a pylon only every 2 tiles
 
		   Delete the PCP if this is the case. */
 
		/* Level means that the slope is the same, or the track is flat */
 
		if (tileh[TS_HOME] == tileh[TS_NEIGHBOUR] || (isflat[TS_HOME] && isflat[TS_NEIGHBOUR])) {
 
			for (k = 0; k < NUM_IGNORE_GROUPS; k++)
 
				if (PPPpreferred[i] == IgnoredPCP[k][tlg][i]) PCPstatus &= ~(1 << i);
 
		}
 

	
 
		/* Now decide where we draw our tiles. First try the preferred PPPs, but they may not exist.
 
		   In that case, we try the any of the allowed ones. if they don't exist either, don't draw
 
		   anything */
 
		if (PPPpreferred[i] != 0) {
 
			/* Some of the preferred PPPs (the ones in direct extension of the track bit)
 
			   have been used as an "end of line" marker. As these are not ALLOWED, this operation
 
			   cancles them out */
 
			PPPbuffer[i] = PPPpreferred[i] & PPPallowed[i];
 
			/* We haven't any buffer yet, so try something else. Fixes 90° curves */
 
			if (PPPbuffer[i] == 0) PPPbuffer[i] = PPPallowed[i];
 
		} else {
 
			PPPbuffer[i] = PPPallowed[i];
 
		}
 

	
 
		if (PPPbuffer[i] != 0 && HASBIT(PCPstatus, i) && !HASBIT(OverridePCP, i)) {
 
			for (k = 0; k < DIR_END; k++) {
 
				byte temp = PPPorder[i][GetTLG(ti->tile)][k];
 
				if (HASBIT(PPPbuffer[i], temp)) {
 
					uint x  = ti->x + x_pcp_offsets[i] + x_ppp_offsets[temp];
 
					uint y  = ti->y + y_pcp_offsets[i] + y_ppp_offsets[temp];
 

	
 
					/* Don't build the pylon if it would be outside the tile */
 
					if (!HASBIT(OwnedPPPonPCP[i], temp)) {
 
						/* We have a neighour that will draw it, bail out */
 
						if (trackconfig[TS_NEIGHBOUR] != 0) break;
 
						continue; /* No neighbour, go looking for a better position */
 
					}
 

	
 
					AddSortableSpriteToDraw(pylons_normal[temp], x, y, 1, 1, 10,
 
							GetSlopeZ(ti->x + x_pcp_offsets[i], ti->y + y_pcp_offsets[i]));
 
					break; /* We already have drawn a pylon, bail out */
 
				}
 
			}
 
		}
 
	}
 

	
 
	/* Drawing of pylons is finished, now draw the wires */
 
	for (t = 0; t < TRACK_END; t++) {
 
		if (HASBIT(trackconfig[TS_HOME], t)) {
 

	
 
			byte PCPconfig = HASBIT(PCPstatus, PCPpositions[t][0]) +
 
				(HASBIT(PCPstatus, PCPpositions[t][1]) << 1);
 

	
 
			const SortableSpriteStruct *sss;
 
			int tileh_selector = !(tileh[TS_HOME] % 3) * tileh[TS_HOME] / 3; /* tileh for the slopes, 0 otherwise */
 

	
 
			if ( /* We are not drawing a wire under a low bridge */
 
					IsBridgeTile(ti->tile) &&
 
					IsBridgeMiddle(ti->tile) &&
 
					!(_display_opt & DO_TRANS_BUILDINGS) &&
 
					GetBridgeHeight(t) <= TilePixelHeight(t)
 
			   ) return;
 

	
 
			assert(PCPconfig != 0); /* We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) */
 
			assert(!IsSteepTileh(tileh[TS_HOME]));
 
			sss = &CatenarySpriteData[Wires[tileh_selector][t][PCPconfig]];
 

	
 
			AddSortableSpriteToDraw( sss->image, ti->x + sss->x_offset, ti->y + sss->y_offset,
 
				sss->x_size, sss->y_size, sss->z_size, GetSlopeZ(ti->x + min(sss->x_offset, 15), ti->y + min(sss->y_offset, 15)) + sss->z_offset);
 
		}
 
	}
 
}
 

	
 
static void DrawCatenaryOnBridge(const TileInfo *ti)
 
{
 
	TileIndex start = GetOtherBridgeEnd(GetSouthernBridgeEnd(ti->tile));
 
	uint length = GetBridgeLength(GetSouthernBridgeEnd(ti->tile), GetOtherBridgeEnd(GetSouthernBridgeEnd(ti->tile)));
 
	uint num = DistanceMax(ti->tile, start);
 
	const SortableSpriteStruct *sss;
 
	Axis axis = GetBridgeAxis(ti->tile);
 
	TLG tlg = GetTLG(ti->tile);
 

	
 
	CatenarySprite offset = axis == AXIS_X ? 0 : WIRE_Y_FLAT_BOTH - WIRE_X_FLAT_BOTH;
 

	
 
	if ((length % 2) && num == length) {
 
		sss = &CatenarySpriteData[WIRE_X_FLAT_BOTH + offset];
 
	} else {
 
		sss = &CatenarySpriteData[WIRE_X_FLAT_SW + (num % 2) + offset];
 
	}
 

	
 
	if (num % 2) {
 
		if (axis == AXIS_X) {
 
			AddSortableSpriteToDraw( pylons_bridge[0 + HASBIT(tlg, 0)], ti->x, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, GetBridgeHeight(ti->tile) + 8);
 
		} else {
 
			AddSortableSpriteToDraw( pylons_bridge[2 + HASBIT(tlg, 1)], ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y, 1, 1, 10, GetBridgeHeight(ti->tile) + 8);
 
		}
 
	}
 

	
 
	if (DistanceMax(ti->tile, start) == length) { /* need a pylon here (the southern end) */
 
		if (axis == AXIS_X) {
 
			AddSortableSpriteToDraw( pylons_bridge[0 + HASBIT(tlg, 0)], ti->x + 16, ti->y + 4 + 8 * HASBIT(tlg, 0), 1, 1, 10, GetBridgeHeight(ti->tile) + 8);
 
		} else {
 
			AddSortableSpriteToDraw( pylons_bridge[2 + HASBIT(tlg, 1)], ti->x + 4 + 8 * HASBIT(tlg, 1), ti->y + 16, 1, 1, 10, GetBridgeHeight(ti->tile) + 8);
 
		}
 
	}
 

	
 
	AddSortableSpriteToDraw( sss->image, ti->x + sss->x_offset, ti->y + sss->y_offset,
 
			sss->x_size, sss->y_size, sss->z_size, GetBridgeHeight(ti->tile) + sss->z_offset + 8);
 
}
 

	
 
void DrawCatenary(const TileInfo *ti)
 
{
 
	switch (GetTileType(ti->tile)) {
 
		case MP_RAILWAY:
 
			if (GetRailTileType(ti->tile) == RAIL_TYPE_DEPOT_WAYPOINT && GetRailTileSubtype(ti->tile) == RAIL_SUBTYPE_DEPOT) {
 
				const SortableSpriteStruct *sss = &CatenarySpriteData[WIRE_DEPOT_SW + ReverseDiagDir(GetRailDepotDirection(ti->tile))];
 
				AddSortableSpriteToDraw( sss->image, ti->x + sss->x_offset, ti->y + sss->y_offset,
 
					sss->x_size, sss->y_size, sss->z_size, GetSlopeZ(ti->x, ti->y) + sss->z_offset);
 
				return;
 
			}
 
			/* Fall through */
 
		case MP_TUNNELBRIDGE:
 
			if (IsBridgeTile(ti->tile) && IsBridgeMiddle(ti->tile) && GetRailTypeOnBridge(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenaryOnBridge(ti);
 
			/* Fall further */
 
		case MP_STREET: case MP_STATION:
 
			DrawCatenaryRailway(ti);
 
			break;
 
		default:
 
			break;
 
	}
 
}
 

	
engine_gui.c
Show inline comments
 
@@ -21,6 +21,7 @@ static StringID GetEngineCategoryName(En
 
	if (engine < NUM_TRAIN_ENGINES) {
 
		switch (GetEngine(engine)->railtype) {
 
			case RAILTYPE_RAIL:   return STR_8102_RAILROAD_LOCOMOTIVE;
 
			case RAILTYPE_ELECTRIC: return STR_8102_RAILROAD_LOCOMOTIVE;
 
			case RAILTYPE_MONO:   return STR_8106_MONORAIL_LOCOMOTIVE;
 
			case RAILTYPE_MAGLEV: return STR_8107_MAGLEV_LOCOMOTIVE;
 
		}
gfxinit.c
Show inline comments
 
@@ -358,6 +358,9 @@ static void LoadSpriteTables(void)
 
	load_index = SPR_AUTORAIL_BASE;
 
	load_index += LoadGrfFile("autorail.grf", load_index, i++);
 

	
 
	assert(load_index == SPR_ELRAIL_BASE);
 
	load_index += LoadGrfFile("elrailsw.grf", load_index, i++);
 

	
 
	assert(load_index == SPR_2CCMAP_BASE);
 
	load_index += LoadGrfFile("2ccmap.grf", load_index, i++);
 

	
lang/english.txt
Show inline comments
 
@@ -1443,6 +1443,7 @@ STR_1005_NO_SUITABLE_RAILROAD_TRACK     
 
STR_1007_ALREADY_BUILT                                          :{WHITE}...already built
 
STR_1008_MUST_REMOVE_RAILROAD_TRACK                             :{WHITE}Must remove railway track first
 
STR_100A_RAILROAD_CONSTRUCTION                                  :{WHITE}Railway Construction
 
STR_TITLE_ELRAIL_CONSTRUCTION                                   :{WHITE}Electrified Railway Construction
 
STR_100B_MONORAIL_CONSTRUCTION                                  :{WHITE}Monorail Construction
 
STR_100C_MAGLEV_CONSTRUCTION                                    :{WHITE}MagLev Construction
 
STR_100D_SELECT_RAIL_BRIDGE                                     :{WHITE}Select Rail Bridge
 
@@ -1454,6 +1455,7 @@ STR_1012_CAN_T_REMOVE_RAILROAD_TRACK    
 
STR_1013_CAN_T_REMOVE_SIGNALS_FROM                              :{WHITE}Can't remove signals from here...
 
STR_1014_TRAIN_DEPOT_ORIENTATION                                :{WHITE}Train Depot Orientation
 
STR_1015_RAILROAD_CONSTRUCTION                                  :Railway construction
 
STR_TOOLB_ELRAIL_CONSTRUCTION                                   :Electrified Railway construction
 
STR_1016_MONORAIL_CONSTRUCTION                                  :Monorail construction
 
STR_1017_MAGLEV_CONSTRUCTION                                    :MagLev construction
 
STR_1018_BUILD_RAILROAD_TRACK                                   :{BLACK}Build railway track
 
@@ -2410,6 +2412,7 @@ STR_8819_TRAIN_TOO_LONG                 
 
STR_881A_TRAINS_CAN_ONLY_BE_ALTERED                             :{WHITE}Trains can only be altered when stopped inside a depot
 
STR_881B_TRAINS                                                 :{WHITE}{COMPANY} - {COMMA} Train{P "" s}
 
STR_881C_NEW_RAIL_VEHICLES                                      :{WHITE}New Rail Vehicles
 
STR_NEW_ELRAIL_VEHICLES                                         :{WHITE}New Electric Rail Vehicles
 
STR_881D_NEW_MONORAIL_VEHICLES                                  :{WHITE}New Monorail Vehicles
 
STR_881E_NEW_MAGLEV_VEHICLES                                    :{WHITE}New Maglev Vehicles
 
STR_881F_BUILD_VEHICLE                                          :{BLACK}Build Vehicle
 
@@ -2810,6 +2813,7 @@ STR_SIGN_LIST_CAPTION                   
 
############ Lists rail types
 

	
 
STR_RAIL_VEHICLES                                               :Rail Vehicles
 
STR_ELRAIL_VEHICLES                                             :Electrified Rail Vehicles
 
STR_MONORAIL_VEHICLES                                           :Monorail Vehicles
 
STR_MAGLEV_VEHICLES                                             :Maglev Vehicles
 

	
misc.c
Show inline comments
 
@@ -401,8 +401,6 @@ typedef struct LandscapePredefVar {
 
	byte transit_days_table_1[NUM_CARGO];
 
	byte transit_days_table_2[NUM_CARGO];
 

	
 
	byte railwagon_by_cargo[3][NUM_CARGO];
 

	
 
	byte road_veh_by_cargo_start[NUM_CARGO];
 
	byte road_veh_by_cargo_count[NUM_CARGO];
 
} LandscapePredefVar;
 
@@ -419,7 +417,6 @@ void InitializeLandscapeVariables(bool o
 

	
 
	lpd = &_landscape_predef_var[_opt.landscape];
 

	
 
	memcpy(_cargoc.ai_railwagon, lpd->railwagon_by_cargo, sizeof(lpd->railwagon_by_cargo));
 
	memcpy(_cargoc.ai_roadveh_start, lpd->road_veh_by_cargo_start,sizeof(lpd->road_veh_by_cargo_start));
 
	memcpy(_cargoc.ai_roadveh_count, lpd->road_veh_by_cargo_count,sizeof(lpd->road_veh_by_cargo_count));
 

	
newgrf.c
Show inline comments
 
@@ -355,6 +355,9 @@ static bool RailVehicleChangeInfo(uint e
 
					engclass = 0;
 
				} else if (traction <= 0x27) {
 
					engclass = 1;
 
				} else if (traction <= 0x31) {
 
					engclass = 2;
 
					ei[i].railtype = RAILTYPE_ELECTRIC;
 
				} else if (traction <= 0x41) {
 
					engclass = 2;
 
				} else {
 
@@ -2309,12 +2312,8 @@ static void InitializeGRFSpecial(void)
 
	                   | (1 << 0x18)  /* newrvs */
 
	                   | (1 << 0x19)  /* newships */
 
	                   | (1 << 0x1A)  /* newplanes */
 
	                   | (_patches.signal_side ? (1 << 0x1B) : 0);          /* signalsontrafficside */
 
	                   /* Uncomment following if you want to fool the GRF file.
 
	                    * Some GRF files will refuse to load without this
 
	                    * but you can still squeeze something from them even
 
	                    * without the support - i.e. USSet. --pasky */
 
			               //| (1 << 0x1C); /* electrifiedrailway */
 
	                   | (_patches.signal_side ? (1 << 0x1B) : 0)           /* signalsontrafficside */
 
	                   | (1 << 0x1C); /* electrifiedrailway */
 

	
 
	_ttdpatch_flags[2] = (_patches.build_on_slopes ? (1 << 0x0D) : 0)       /* buildonslopes */
 
	                   | (_patches.build_on_slopes ? (1 << 0x15) : 0)       /* buildoncoasts */
npf.c
Show inline comments
 
@@ -587,7 +587,7 @@ static void NPFFollowTrack(AyStar* aysta
 
	/* check correct rail type (mono, maglev, etc) */
 
	if (type == TRANSPORT_RAIL) {
 
		RailType dst_type = GetTileRailType(dst_tile, src_trackdir);
 
		if (!IsCompatibleRail(aystar->user_data[NPF_RAILTYPE], dst_type))
 
		if (!HASBIT(aystar->user_data[NPF_RAILTYPES], dst_type))
 
			return;
 
	}
 

	
 
@@ -661,7 +661,7 @@ static void NPFFollowTrack(AyStar* aysta
 
 * multiple targets that are spread around, we should perform a breadth first
 
 * search by specifiying CalcZero as our heuristic.
 
 */
 
static NPFFoundTargetData NPFRouteInternal(AyStarNode* start1, AyStarNode* start2, NPFFindStationOrTileData* target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, TransportType type, Owner owner, RailType railtype, uint reverse_penalty)
 
static NPFFoundTargetData NPFRouteInternal(AyStarNode* start1, AyStarNode* start2, NPFFindStationOrTileData* target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, TransportType type, Owner owner, RailTypeMask railtypes, uint reverse_penalty)
 
{
 
	int r;
 
	NPFFoundTargetData result;
 
@@ -703,7 +703,7 @@ static NPFFoundTargetData NPFRouteIntern
 
	/* Initialize user_data */
 
	_npf_aystar.user_data[NPF_TYPE] = type;
 
	_npf_aystar.user_data[NPF_OWNER] = owner;
 
	_npf_aystar.user_data[NPF_RAILTYPE] = railtype;
 
	_npf_aystar.user_data[NPF_RAILTYPES] = railtypes;
 

	
 
	/* GO! */
 
	r = AyStarMain_Main(&_npf_aystar);
 
@@ -721,7 +721,7 @@ static NPFFoundTargetData NPFRouteIntern
 
	return result;
 
}
 

	
 
NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype)
 
NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailTypeMask railtypes)
 
{
 
	AyStarNode start1;
 
	AyStarNode start2;
 
@@ -735,15 +735,15 @@ NPFFoundTargetData NPFRouteToStationOrTi
 
	start2.direction = trackdir2;
 
	start2.user_data[NPF_TRACKDIR_CHOICE] = INVALID_TRACKDIR;
 

	
 
	return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), target, NPFFindStationOrTile, NPFCalcStationOrTileHeuristic, type, owner, railtype, 0);
 
	return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), target, NPFFindStationOrTile, NPFCalcStationOrTileHeuristic, type, owner, railtypes, 0);
 
}
 

	
 
NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype)
 
NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailTypeMask railtypes)
 
{
 
	return NPFRouteToStationOrTileTwoWay(tile, trackdir, INVALID_TILE, 0, target, type, owner, railtype);
 
	return NPFRouteToStationOrTileTwoWay(tile, trackdir, INVALID_TILE, 0, target, type, owner, railtypes);
 
}
 

	
 
NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, TransportType type, Owner owner, RailType railtype, uint reverse_penalty)
 
NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, TransportType type, Owner owner, RailTypeMask railtypes, uint reverse_penalty)
 
{
 
	AyStarNode start1;
 
	AyStarNode start2;
 
@@ -759,15 +759,15 @@ NPFFoundTargetData NPFRouteToDepotBreadt
 

	
 
	/* perform a breadth first search. Target is NULL,
 
	 * since we are just looking for any depot...*/
 
	return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), NULL, NPFFindDepot, NPFCalcZero, type, owner, railtype, reverse_penalty);
 
	return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), NULL, NPFFindDepot, NPFCalcZero, type, owner, railtypes, reverse_penalty);
 
}
 

	
 
NPFFoundTargetData NPFRouteToDepotBreadthFirst(TileIndex tile, Trackdir trackdir, TransportType type, Owner owner, RailType railtype)
 
NPFFoundTargetData NPFRouteToDepotBreadthFirst(TileIndex tile, Trackdir trackdir, TransportType type, Owner owner, RailTypeMask railtypes)
 
{
 
	return NPFRouteToDepotBreadthFirstTwoWay(tile, trackdir, INVALID_TILE, 0, type, owner, railtype, 0);
 
	return NPFRouteToDepotBreadthFirstTwoWay(tile, trackdir, INVALID_TILE, 0, type, owner, railtypes, 0);
 
}
 

	
 
NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, TransportType type, Owner owner, RailType railtype)
 
NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir, TransportType type, Owner owner, RailTypeMask railtypes)
 
{
 
	/* Okay, what we're gonna do. First, we look at all depots, calculate
 
	 * the manhatten distance to get to each depot. We then sort them by

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)