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.
16 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
 
@@ -627,12 +627,13 @@ SRCS += dedicated.c
 
SRCS += depot.c
 
SRCS += disaster_cmd.c
 
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
 
SRCS += gfx.c
 
SRCS += gfxinit.c
 
SRCS += graph_gui.c
ai/default/default.c
Show inline comments
 
@@ -123,24 +123,24 @@ static void AiStateVehLoop(Player *p)
 
	}
 

	
 
	p->ai.state = AIS_WANT_NEW_ROUTE;
 
	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;
 
	int32 ret;
 
	EngineID i;
 

	
 
	for (i = 0; i < NUM_TRAIN_ENGINES; i++) {
 
		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) ||
 
				e->reliability < 0x8A3D) {
 
			continue;
 
		}
 
@@ -2318,12 +2318,47 @@ static StationID AiGetStationIdByDef(Til
 
{
 
	const AiDefaultBlockData *p = _default_rail_track_data[id]->data;
 
	while (p->mode != 1) p++;
 
	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;
 
	TileIndex tile;
 
	EngineID veh;
 
	int i;
 
@@ -2334,16 +2369,20 @@ static void AiStateBuildRailVeh(Player *
 

	
 
	ptr = _default_rail_track_data[p->ai.src.cur_building_rule]->data;
 
	while (ptr->mode != 0) ptr++;
 

	
 
	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;
 
			p->ai.wagon_list[i + 1] = INVALID_VEHICLE;
 
			return;
 
		}
bridge.h
Show inline comments
 
@@ -19,7 +19,9 @@ typedef struct Bridge {
 
	byte flags;          ///< bit 0 set: disable drawing of far pillars.
 
} 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
 
@@ -124,12 +124,13 @@ TileIndex GetSouthernBridgeEnd(TileIndex
 

	
 
/**
 
 * Starting at one bridge end finds the other bridge end
 
 */
 
TileIndex GetOtherBridgeEnd(TileIndex);
 

	
 
uint GetBridgeHeight(TileIndex t);
 

	
 
static inline void SetClearUnderBridge(TileIndex t)
 
{
 
	SetTileOwner(t, OWNER_NONE);
 
	SB(_m[t].m5, 3, 3, 0 << 2 | 0);
 
}
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
 
@@ -126,13 +126,13 @@ m5 bit 7 clear: railway track
 
<tr><td nowrap valign=top><tt>8</tt>&nbsp; </td><td align=left>fence on the E side (track in the W corner)</td></tr>
 
<tr><td nowrap valign=top><tt>9</tt>&nbsp; </td><td align=left>fence on the W side (track in the E corner)</td></tr>
 
<tr><td nowrap valign=top><tt>A</tt>&nbsp; </td><td align=left>fence on the S side (track in the N corner)</td></tr>
 
<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>
 
<li>m5 value C0..C3: railway depot
 
<br>m5 bits 1..0 - direction: exit towards: <tt>00</tt> = NE, <tt>01</tt> = SE, <tt>02</tt> = SW, <tt>03</tt> = NW</li>
 
<li>m5 value C4..C5: checkpoint
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
 
@@ -17,15 +17,16 @@
 

	
 

	
 
static StringID GetEngineCategoryName(EngineID engine)
 
{
 
	if (engine < NUM_TRAIN_ENGINES) {
 
		switch (GetEngine(engine)->railtype) {
 
			case RAILTYPE_RAIL:   return STR_8102_RAILROAD_LOCOMOTIVE;
 
			case RAILTYPE_MONO:   return STR_8106_MONORAIL_LOCOMOTIVE;
 
			case RAILTYPE_MAGLEV: return STR_8107_MAGLEV_LOCOMOTIVE;
 
			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;
 
		}
 
	}
 

	
 
	if (engine < NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES)
 
		return STR_8103_ROAD_VEHICLE;
 

	
gfxinit.c
Show inline comments
 
@@ -355,12 +355,15 @@ static void LoadSpriteTables(void)
 
	assert(load_index == SPR_SLOPES_BASE);
 
	LoadGrfIndexed("trkfoundw.grf", _slopes_spriteindexes[_opt.landscape], i++);
 

	
 
	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++);
 

	
 
	assert(load_index == SPR_OPENTTD_BASE);
 
	LoadGrfIndexed("openttd.grf", _openttd_grf_indexes, i++);
 
	load_index = SPR_OPENTTD_BASE + OPENTTD_SPRITES_COUNT;
lang/english.txt
Show inline comments
 
@@ -1440,23 +1440,25 @@ STR_1002_EXCAVATION_WOULD_DAMAGE        
 
STR_1003_ALREADY_AT_SEA_LEVEL                                   :{WHITE}Already at sea-level
 
STR_1004_TOO_HIGH                                               :{WHITE}Too high
 
STR_1005_NO_SUITABLE_RAILROAD_TRACK                             :{WHITE}No suitable railway 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
 
STR_100E_CAN_T_BUILD_TRAIN_DEPOT                                :{WHITE}Can't build train depot here...
 
STR_100F_CAN_T_BUILD_RAILROAD_STATION                           :{WHITE}Can't build railway station here...
 
STR_1010_CAN_T_BUILD_SIGNALS_HERE                               :{WHITE}Can't build signals here...
 
STR_1011_CAN_T_BUILD_RAILROAD_TRACK                             :{WHITE}Can't build railway track here...
 
STR_1012_CAN_T_REMOVE_RAILROAD_TRACK                            :{WHITE}Can't remove railway track from here...
 
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
 
STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING                         :{BLACK}Build train depot (for building and servicing trains)
 
STR_101A_BUILD_RAILROAD_STATION                                 :{BLACK}Build railway station
 
STR_101B_BUILD_RAILROAD_SIGNALS                                 :{BLACK}Build railway signals
 
@@ -2407,12 +2409,13 @@ STR_8814_TRAIN_IS_WAITING_IN_DEPOT      
 
STR_8815_NEW_VEHICLES                                           :{BLACK}New Vehicles
 
STR_8816                                                        :{BLACK}-
 
STR_8819_TRAIN_TOO_LONG                                         :{WHITE}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
 
STR_CLONE_ROAD_VEHICLE                                          :{BLACK}Clone Vehicle
 
STR_CLONE_ROAD_VEHICLE_INFO                                     :{BLACK}This will build a copy of the road vehicle. Control-click will share the orders
 
STR_CLONE_ROAD_VEHICLE_DEPOT_INFO                               :{BLACK}This will build a copy of a road vehicle. Click this button and then on a road vehicle inside or outside the depot. Control-click will share the orders
 
@@ -2807,12 +2810,13 @@ STR_WAGONS                              
 
STR_SHORT_DATE                                                  :{WHITE}{DATE_TINY}
 
STR_SIGN_LIST_CAPTION                                           :{WHITE}Sign List - {COMMA} Sign{P "" s}
 

	
 
############ Lists rail types
 

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

	
 
############ End of list of rail types
 

	
 
STR_TINY_BLACK                                                  :{BLACK}{TINYFONT}{COMMA}
misc.c
Show inline comments
 
@@ -398,14 +398,12 @@ typedef struct LandscapePredefVar {
 
	StringID sprites[NUM_CARGO];
 

	
 
	uint16 initial_cargo_payment[NUM_CARGO];
 
	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;
 

	
 
#include "table/landscape_const.h"
 

	
 
@@ -416,13 +414,12 @@ void InitializeLandscapeVariables(bool o
 
	const LandscapePredefVar *lpd;
 
	uint i;
 
	StringID str;
 

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

	
 
	for (i = 0; i != NUM_CARGO; i++) {
 
		_cargoc.sprites[i] = lpd->sprites[i];
 

	
newgrf.c
Show inline comments
 
@@ -352,12 +352,15 @@ static bool RailVehicleChangeInfo(uint e
 
				int engclass;
 

	
 
				if (traction <= 0x07) {
 
					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 {
 
					break;
 
				}
 

	
 
@@ -2306,18 +2309,14 @@ static void InitializeGRFSpecial(void)
 
	                   | (1 << 0x14)  /* bridgespeedlimits */
 
	                   | (1 << 0x16)  /* eternalgame */
 
	                   | (1 << 0x17)  /* newtrains */
 
	                   | (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 */
 
	                   | (1 << 0x16)  /* canals */
 
	                   | (1 << 0x17)  /* newstartyear */
 
	                   | (1 << 0x1A)  /* newbridges */

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

0 comments (0 inline, 0 general)