Mercurial > hg > openttd
changeset 2916:9f16688176a1 draft
(svn r3472) - [PBS] Remove from trunk. Anyone interested can still find it in branch/pbs. This reverts revisions r3158, r3140, r3075, r2977, r2674, r2625, r2621, r2529, r2528, r2525, r2524, r2519, r2517, r2516, r2507, r2499. (in conjunction with Tron)
- The only change is that the nsignalsw.grf file is kept and that existing nightlies with PBS signals get those signals converted to combo-signals.
author | Darkvater <Darkvater@openttd.org> |
---|---|
date | Sun, 29 Jan 2006 18:57:26 +0000 |
parents | 53ad8a24d448 |
children | af2c10d997ac |
files | Makefile ai/trolly/pathfinder.c aystar.c aystar.h debug.c debug.h docs/landscape.html docs/landscape_grid.html lang/american.txt lang/brazilian_portuguese.txt lang/catalan.txt lang/czech.txt lang/danish.txt lang/dutch.txt lang/english.txt lang/estonian.txt lang/finnish.txt lang/french.txt lang/galician.txt lang/german.txt lang/hungarian.txt lang/icelandic.txt lang/italian.txt lang/norwegian.txt lang/polish.txt lang/portuguese.txt lang/romanian.txt lang/slovak.txt lang/spanish.txt lang/turkish.txt lang/unfinished/latvian.txt npf.c npf.h oldloader.c openttd.c openttd.dsp openttd.vcproj rail.h rail_cmd.c road_cmd.c roadveh_cmd.c saveload.c settings.c settings_gui.c ship_cmd.c station_cmd.c train_cmd.c tunnelbridge_cmd.c variables.h vehicle.c vehicle.h waypoint.c |
diffstat | 52 files changed, 90 insertions(+), 762 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile +++ b/Makefile @@ -660,7 +660,6 @@ SRCS += order_cmd.c SRCS += order_gui.c SRCS += pathfind.c -SRCS += pbs.c SRCS += player_gui.c SRCS += players.c SRCS += pool.c
--- a/ai/trolly/pathfinder.c +++ b/ai/trolly/pathfinder.c @@ -107,8 +107,6 @@ result->FoundEndNode = AyStar_AiPathFinder_FoundEndNode; result->GetNeighbours = AyStar_AiPathFinder_GetNeighbours; - result->BeforeExit = NULL; - result->free = AyStar_AiPathFinder_Free; // Set some information
--- a/aystar.c +++ b/aystar.c @@ -232,10 +232,6 @@ else if (r == AYSTAR_LIMIT_REACHED) printf("[AyStar] Exceeded search_nodes, no path found\n"); #endif - - if (aystar->BeforeExit != NULL) - aystar->BeforeExit(aystar); - if (r != AYSTAR_STILL_BUSY) /* We're done, clean up */ aystar->clear(aystar);
--- a/aystar.h +++ b/aystar.h @@ -98,11 +98,6 @@ */ typedef void AyStar_FoundEndNode(AyStar *aystar, OpenListNode *current); -/* - * Is called when aystar ends it pathfinding, but before cleanup. - */ -typedef void AyStar_BeforeExit(AyStar *aystar); - // For internal use, see aystar.c typedef void AyStar_AddStartNode(AyStar *aystar, AyStarNode* start_node, uint g); typedef int AyStar_Main(AyStar *aystar); @@ -122,7 +117,6 @@ AyStar_GetNeighbours* GetNeighbours; AyStar_EndNodeCheck* EndNodeCheck; AyStar_FoundEndNode* FoundEndNode; - AyStar_BeforeExit* BeforeExit; /* These are completely untouched by AyStar, they can be accesed by * the application specific routines to input and output data.
--- a/debug.c +++ b/debug.c @@ -18,7 +18,6 @@ int _debug_net_level; int _debug_spritecache_level; int _debug_oldloader_level; -int _debug_pbs_level; int _debug_ntp_level; int _debug_npf_level; @@ -51,7 +50,6 @@ DEBUG_LEVEL(net), DEBUG_LEVEL(spritecache), DEBUG_LEVEL(oldloader), - DEBUG_LEVEL(pbs), DEBUG_LEVEL(ntp), DEBUG_LEVEL(npf) };
--- a/debug.h +++ b/debug.h @@ -17,7 +17,6 @@ extern int _debug_net_level; extern int _debug_spritecache_level; extern int _debug_oldloader_level; - extern int _debug_pbs_level; extern int _debug_ntp_level; extern int _debug_npf_level; #endif
--- a/docs/landscape.html +++ b/docs/landscape.html @@ -103,13 +103,12 @@ <li>m2 bits 7..4: bit clear = signal shows red; same bits as in m3</li> <li>OpenTTD bits in m4: <table> -<tr><td nowrap valign=top>bits 2..0: </td><td align=left>type of signal:</td></tr> -<tr><td nowrap valign=top><tt>000</tt>: </td><td align=left>normal signals</td></tr> -<tr><td nowrap valign=top><tt>001</tt>: </td><td align=left>pre-signals</td></tr> -<tr><td nowrap valign=top><tt>010</tt>: </td><td align=left>exit-signals</td></tr> -<tr><td nowrap valign=top><tt>011</tt>: </td><td align=left>combo-signals</td></tr> -<tr><td nowrap valign=top><tt>100</tt>: </td><td align=left>PBS signals</td></tr> -<tr><td nowrap valign=top>bit 3: </td><td align=left>set = semaphore signals, clear = light signals</td></tr> +<tr><td nowrap valign=top>bits 1..0: </td><td align=left>type of signal:</td></tr> +<tr><td nowrap valign=top><tt>00</tt>: </td><td align=left>normal signals</td></tr> +<tr><td nowrap valign=top><tt>01</tt>: </td><td align=left>pre-signals</td></tr> +<tr><td nowrap valign=top><tt>10</tt>: </td><td align=left>exit-signals</td></tr> +<tr><td nowrap valign=top><tt>11</tt>: </td><td align=left>combo-signals</td></tr> +<tr><td nowrap valign=top>bit 2: </td><td align=left>set = semaphore signals, clear = light signals</td></tr> </table></li> </ul></li> <li>m1: <a href="#OwnershipInfo">owner</a> of the track @@ -131,11 +130,6 @@ <tr><td nowrap valign=top><tt>C</tt> </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>m4 bits 4..7 = Pbs reserved status: -<table> -<tr><td nowrap valign=top><tt>bits 4..6</tt> </td><td align=left>'Track'number of reserved track + 1, if this is zero it means nothing is reserved on this tile</td></tr> -<tr><td nowrap valign=top><tt>bit 7</tt> </td><td align=left>If this is set, then the opposite track ('Track'number^1) is also reserved</td></tr> -</table></li> </ul> m5 bits 7 and 6 set: railway depot / checkpoints <ul> @@ -149,7 +143,6 @@ <li>m2: For waypoints, index into the array of waypoints.</li> <li>m3 bits 0..3 = <a href="#TrackType">track type</a></li> <li>m3 bit 4 = use custom sprite (valid only for the checkpoint)</li> -<li>m3 bit 6 = track on this tile is reserved by pbs</li> <li>m4 bits 0..3 = ground type, as per m2 bits 0..3 for railway tiles.</li> </ul> </td></tr> @@ -174,7 +167,6 @@ <ul> <li>m5 bit 3: clear - road in the X direction, set - road in the Y direction (railway track always perpendicular)</li> <li>m5 bit 2: set if crossing lights are on</li> -<li>m5 bit 0: set if rail track is reserved by pbs</li> <li>m1: <a href="#OwnershipInfo">owner</a> of the railway track</li> <li>m2: Index into the array of towns, 0 for non-town roads</li> <li>m3 bits 0..7: <a href="#OwnershipInfo">owner</a> of the road</li> @@ -390,7 +382,6 @@ <li>m2: index into the <a href="#_StationArray">array of stations</a></li> <li>m3 bits 0..3: <a href="#TrackType">track type</a> for railway stations, must be 0 for all the other stations</li> <li>m3 bit 4 = use custom sprite (valid only railway stations FOR NOW)</li> -<li>m3 bit 6 set = track is reserved by pbs (railway stations only)</li> <li>m4 = custom station id</li> </ul> </td></tr> @@ -561,8 +552,6 @@ <li>m1: <a href="#OwnershipInfo">owner</a> of the tunnel</li> <li>m3 bits 3..0 = <a href="#TrackType">track type</a> for railway tunnel, must be 0 for road tunnel</li> <li>m4 bit 7 set = on snow or desert</li> -<li>m4 bit 0 set = track with 'Track'number 0 is reserved by pbs</li> -<li>m4 bit 1 set = track with 'Track'number 1 is reserved by pbs</li> </ul> m5 bit 7 set: bridge <ul><li> @@ -605,8 +594,6 @@ <tr><td nowrap valign=top><tt>A</tt> </td><td align=center>200</td><td align=left>tubular, steel</td></tr> </table></li> <li>m4 bit 7 set = on snow or desert</li> -<li>m4 bit 0 set = track with 'Track'number 0 is reserved by pbs</li> -<li>m4 bit 1 set = track with 'Track'number 1 is reserved by pbs</li> </ul> </td></tr>
--- a/docs/landscape_grid.html +++ b/docs/landscape_grid.html @@ -70,7 +70,7 @@ <td class="bits">XXXX XXXX</td> <td class="bits"><span class="free">OOOO OOOO</span> XXXX XXXX</td> <td class="bits">XXXX XXXX</td> - <td class="bits">XXXX XXXX</td> + <td class="bits"><span class="free">OOOO O</span>XXX</td> <td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td> </tr> @@ -78,7 +78,7 @@ <td class="caption">depot</td> <td class="bits">-inherit-</td> <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td> - <td class="bits"><span class="free">O</span>X<span class="free">OO</span> XXXX</td> + <td class="bits"><span class="free">OOOO</span> XXXX</td> <td class="bits"><span class="free">OOOO</span> XXXX</td> <td class="bits">-inherit-</td> <td class="bits">XX<span class="free">OO O</span>XXX</td> @@ -87,7 +87,7 @@ <td class="caption">waypoint</td> <td class="bits">-inherit-</td> <td class="bits">XXXX XXXX XXXX XXXX</td> - <td class="bits"><span class="free">O</span>X<span class="free">O</span>X XXXX</td> + <td class="bits"><span class="free">OOO</span>X XXXX</td> <td class="bits"><span class="free">OOOO</span> XXXX</td> <td class="bits">-inherit-</td> <td class="bits">XX<span class="free">OO O</span>XXX</td> @@ -109,7 +109,7 @@ <td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td> <td class="bits">-inherit-</td> - <td class="bits">XXXX XX<span class="free">O</span>X</td> + <td class="bits">XXXX XX<span class="free">OO</span></td> </tr> <tr> <td class="caption">road depot</td> @@ -145,7 +145,7 @@ <td class="caption">station</td> <td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX XXXX XXXX</td> - <td class="bits"><span class="free">O</span>X<span class="free">O</span>X XXXX</td> + <td class="bits"><span class="free">OOO</span>X XXXX</td> <td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td> @@ -221,7 +221,7 @@ <td class="bits">XXXX XXXX</td> <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td> <td class="bits"><span class="free">OOOO</span> XXXX</td> - <td class="bits">X<span class="free">OOO OO</span>XX</td> + <td class="bits">X<span class="free">OOO OOOO</span></td> <td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td> </tr> @@ -230,7 +230,7 @@ <td class="bits">XXXX XXXX</td> <td class="bits"><span class="free">OOOO OOOO</span> <span class="abuse">XXXX XXXX</span></td> <td class="bits">XXXX XXXX</td> - <td class="bits">X<span class="free">OOO OO</span>XX</td> + <td class="bits">X<span class="free">OOO OOOO</span></td> <td class="bits">XXXX XXXX</td> <td class="bits">XXXX XXXX</td> </tr>
--- a/lang/american.txt +++ b/lang/american.txt @@ -1020,7 +1020,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Enable smooth economy (more, smaller changes) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Allow buying shares from other companies STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}When dragging place signals every: {ORANGE}{STRING} tile(s) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Allow automatic placement of pbs signals: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Position of main toolbar: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Left STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centre @@ -1429,7 +1428,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Railroad track with pre-signals STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Railroad track with exit-signals STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Railroad track with combo-signals -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Railroad track with pbs-signals
--- a/lang/brazilian_portuguese.txt +++ b/lang/brazilian_portuguese.txt @@ -1030,7 +1030,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Ativar economia regular (alterações menores) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Permite comprar ações de outras companhias STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Ao arrastar colocar sinais a cada: {ORANGE}{STRING} quadrado(s) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Permitir colocação automática de sinais PBS: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Posição da barra de ferramentas principal: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Esquerda STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centro @@ -1438,7 +1437,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Ferrovia com pre-sinais STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Ferrovia com sinais de saída STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Ferrovia com sinais combinados -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Ferrovia com sinalização PBS
--- a/lang/catalan.txt +++ b/lang/catalan.txt @@ -1029,7 +1029,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Activar economia suau (més canvis però més petits) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Permetre comprar participadions d'altres empreses STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}En arrosegant, sitúa senyals cada: {ORANGE}{STRING} quadre(s) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Permetre situacio automatica de senyals pbs: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Posició de la barra d'eines principal: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Esquerra STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centre @@ -1436,7 +1435,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Vía de tren amb pre-senyals STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Vía de tren amb senyals de sortida STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Vía de tren amb senyals combinades -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Via de tren amb senyals pbs
--- a/lang/czech.txt +++ b/lang/czech.txt @@ -1085,7 +1085,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Plynulé zmeny ekonomiky (více men¨ích zmen) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Povolit kupování podílu z ostatních spolecnosti STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Pri ta¸ení umistovat signály ka¸dých(é): {ORANGE}{STRING} dilku(y) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Povolit automatické pokládání PBS signalu: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Umisteni hlavní li¨ty: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :vlevo STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :uprostred @@ -1492,7 +1491,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Zeleznicni trat s presignály STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Zeleznicni trat s výstupními signály STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Zeleznicni trat s kombinovanými signály -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Koleje s PBS signály
--- a/lang/danish.txt +++ b/lang/danish.txt @@ -1025,7 +1025,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Aktiver rolig økonomi (flere små ændringer) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Tillad at købe aktier i andre selskaber STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Ved trækning placer signal hvert: {ORANGE}{STRING} felt -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Tillad automatisk opsætning af pbs signaler: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Placering af værktøjslinie: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Venstre STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Center @@ -1432,7 +1431,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Togskinner med indkørselssignaler STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Togskinner med udkørselssignaler STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Togskinner med kombineret ind- og udkørselssignaler -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Togskinner med pbs signaler
--- a/lang/dutch.txt +++ b/lang/dutch.txt @@ -1028,7 +1028,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Vloeiende economie inschakelen (meer, kleinere veranderingen) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Sta het kopen van aandelen toe STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Bij slepen, plaats seinen elke: {ORANGE}{STRING} tegel(s) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Sta automatische plaatsing van PBS-seinen toe: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Positie van hoofd knoppenbalk: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Links STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Midden @@ -1438,7 +1437,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Spoor met voorseinen STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Spoor met uitgangseinen STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Spoor met combinatieseinen -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Spoor met pbs-seinen
--- a/lang/english.txt +++ b/lang/english.txt @@ -1030,7 +1030,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Enable smooth economy (more, smaller changes) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Allow buying shares from other companies STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}When dragging, place signals every: {ORANGE}{STRING1} tile(s) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Allow automatic placement of pbs signals: {ORANGE}{STRING1} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Position of main toolbar: {ORANGE}{STRING1} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Left STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centre @@ -1445,7 +1444,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Railway track with pre-signals STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Railway track with exit-signals STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Railway track with combo-signals -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Railway track with pbs-signals
--- a/lang/estonian.txt +++ b/lang/estonian.txt @@ -1028,7 +1028,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Luba sujuv majandus (väiksemad muutused) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Luba teiste ettevõtete aktsiate ostmine STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Venitades paigutatud signaaltulede tihedus: {ORANGE}{STRING} ühik(ut) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Luba automaatset pbs signaalide panemist: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Tööriistariba asukoht: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Vasakul STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Keskel @@ -1434,7 +1433,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Raudtee eel-signaalidega STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Raudtee väljumis-signaalidega STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Raudtee kombo-signaalidega -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Raudtee koos pbs signaalidega
--- a/lang/finnish.txt +++ b/lang/finnish.txt @@ -1025,7 +1025,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Tasainen talous (enemmän pieniä muutoksia) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Osakkeiden ostaminen yhtiöistä STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Vedettäessä aseta opastimien väleiksi: {ORANGE}{STRING} ruutu(a) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Salli kulkutieopastimien automaattinen sijoitus: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Päätyökalupalkin sijainti: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :vasen STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :keskellä @@ -1432,7 +1431,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Rautatie esiopastimin STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Rautatie poistumisopastimin STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Rautatie yhdistetyin opastimin -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Rautatie kulkutieopastimin
--- a/lang/french.txt +++ b/lang/french.txt @@ -1031,7 +1031,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Permettre une économie stable (plus de petits changements) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Permettre d'acheter des actions d'autres compagnies STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Espacements des signaux en mode drag & drop : {ORANGE}{STRING} case(s) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Permettre pose automatique signaux PBS: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Position de la barre d'outils principale: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :À gauche STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centrée @@ -1439,7 +1438,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Rails avec des pré-signaux STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Rails avec des signaux de sortie STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Rails avec des signaux combinés -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Rails avec des signaux PBS
--- a/lang/galician.txt +++ b/lang/galician.txt @@ -1018,7 +1018,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Habilita-la economía "suave"(máis cambios, pero máis pequenos) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Permiti-la compra de accións por outras compañías STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Cando se arrastre, colocar siniais cada: {ORANGE}{STRING} cadrado(s) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Permiti-lo emprazamento automático de sinais pbs: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Posición da barra de ferramentas principal: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Esquerda STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centro @@ -1423,7 +1422,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Vía de ferrocarril con pre-sinais STR_RAILROAD_TRACK_WITH_EXITSIGNALS :vía de ferrocarril con sinais de saída STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Via de ferrocarril con sinais combinados -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Vía de ferrocarril con sinais pbs
--- a/lang/german.txt +++ b/lang/german.txt @@ -1031,7 +1031,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Feinere Wirtschaft aktivieren (mehrere, kleinere Veränderungen) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Erlaube Anteile an anderen Firmen zu kaufen STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Errichte Signale alle {ORANGE}{STRING} Felder beim Ziehen mit der Maus -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Erlaube automatische Errichtung von Fahrstraßen-Signalen: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Position der Werkzeugleiste: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Links STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Mitte @@ -1441,7 +1440,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Gleis mit Vorsignalen STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Gleis mit Ausfahrtsignalen STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Gleis mit kombinierten Vor-/Ausfahrtsignalen -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Gleise mit Fahrstraßen-Signalen
--- a/lang/hungarian.txt +++ b/lang/hungarian.txt @@ -1092,7 +1092,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Egyenletes gazdaság (több, kisebb változás) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Másik cégekbõl részvényt lehet vásárolni STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Amikor megragadom helyezzen lámpákat minden {ORANGE}{STRING}. mezõre -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Automatikus PBS (intelligens jelzõcsoport) létrehozás: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}A fõ eszközsor helye: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Balra STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Középen @@ -1501,7 +1500,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Vasúti sin elõrejelzõ szemaforral STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Vasúti sin kijáratjelzõ szemaforral STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Vasúti sin vegyes szemaforral -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Vasúti sín intelligens jelzõkkel
--- a/lang/icelandic.txt +++ b/lang/icelandic.txt @@ -1025,7 +1025,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Virkja jafnan efnahag (fleiri og minni breytingar) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Leyfa hlutabréfakaup í öðrum fyrirtækjum STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Þegar dregið er, setja skilti á: {ORANGE}{STRING} hvern reit -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Leyfa sjálfvirka staðsetningu pbs lestarljósa: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Staðsetning tækjasláar: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Vinstri STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Miðjað @@ -1432,7 +1431,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Lestarteinn með forljósum STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Lestarteinn með útljósum STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Lestarteinn með samljósum -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Lestarteinn með pbs ljósi
--- a/lang/italian.txt +++ b/lang/italian.txt @@ -1029,7 +1029,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Abilita nuova economia stabile (diverse piccole modifiche) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Permetti l'acquisto di azioni da altre compagnie STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Trascinando il cursore costruisci i semafori ogni: {ORANGE}{STRING} quadrato/i -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Permetti la disposizione automatica dei segnali pbs: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Posizione barra degli strumenti principale: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Sinistra STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centro @@ -1439,7 +1438,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Binario ferroviario con presegnali STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Binario ferroviario con segnali di uscita STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Binario ferroviario con segnali combinati -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Binario ferroviario con segnali pbs
--- a/lang/norwegian.txt +++ b/lang/norwegian.txt @@ -1027,7 +1027,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Jevn økonomi (Flere, mindre endringer) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Tillat kjøping av aksjer i andre selskaper STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Ved opptrekking plasser signal hver: {ORANGE}{STRING} rute(r) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Tillat automatisk plassering av pbs signal: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Posisjon av hovedverktøylinje: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Venstre STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Sentrert @@ -1434,7 +1433,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Jernbanespor med for-signaler STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Jernbanespor med forlat-signaler STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Jernbanespor med kombinerte signaler -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Jernbane med PBS-signaler
--- a/lang/polish.txt +++ b/lang/polish.txt @@ -1030,7 +1030,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Pozwol na lagodna ekonomie (male zmiany) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Pozwol kupowac udzialy w innych firmach STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}W trakcie przeciagania ustaw sygnaly co: {ORANGE}{STRING} kratk{P e i ek} -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Zezwol na automatyczne stawianie sygnalow PBS: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Pozycja glownego paska narzedzi: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Z lewej strony STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centralnie @@ -1438,7 +1437,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Tory kolejowe z pre-sygnalami STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Tory kolejowe z sygnalizacja wyjsciowa STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Tory kolejowe z sygnalizacja combo -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Tory kolejowe z sygnalizacja PBS
--- a/lang/portuguese.txt +++ b/lang/portuguese.txt @@ -1030,7 +1030,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Activar economia regular (alterações menores) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Permite comprar acções de outras companhias STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Ao arrastar colocar sinais a cada: {ORANGE}{STRING} quadrado(s) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Permitir posicionamento automático de sinais pbs: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Posição da barra de ferramentas principal: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Esquerda STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centro @@ -1438,7 +1437,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Caminhos-de-ferro com pre-sinais STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Caminhos-de-ferro com sinais de saída STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Caminhos-de-ferro com sinais combinados -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Caminho de ferro com sinais pbs
--- a/lang/romanian.txt +++ b/lang/romanian.txt @@ -1029,7 +1029,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Economie cu schimbãri de productie mai reduse, dar mai frecvente STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Permite cumpararea de actiuni de la alte companii STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Plasare automatã a semnalelor la fiecare: {ORANGE}{STRING} pãtrãtele -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Permite plasarea automata a semnalelor PBS: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Pozitia listei cu instrumente: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :stânga STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :centru @@ -1436,7 +1435,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Cale feratã cu pre-semnalizare STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Cale feratã cu semnale de iesire STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Cale feratã cu semnale combinate -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Cai ferate cu semnalizare PBS
--- a/lang/slovak.txt +++ b/lang/slovak.txt @@ -1030,7 +1030,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Mierne zmeny ekonomiky (viac mensich zmien) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Povolit nakup akcii od ostatnych spolocnosti STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Pri tahani umiestnit semafory kazdych(e): {ORANGE}{STRING} dlazdic(e) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Automaticke umiestnenie semaforov pbs: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Pozicia hlavneho menu: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Na lavo STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :V strede @@ -1438,7 +1437,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Zeleznicne kolaje z pre-signami STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Zeleznicne kolaje z exit-signalmi STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Zeleznicne kolaje z combo-signalmi -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Kolajnice so semaformi pbs
--- a/lang/spanish.txt +++ b/lang/spanish.txt @@ -1029,7 +1029,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Activar economía suave (cambios más pequeños) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Permitir comprar acciones de otras empresas STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Cuando arrastre colocar señales cada: {ORANGE}{STRING} casilla(s) -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Permitir colocación automática de señales pbs: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Posición de la barra de herramientas principal: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Izquierda STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centro @@ -1436,7 +1435,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Vía del tren con pre-señales STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Vía del tren con señales de salida STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :Vía del tren con señales combo -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Via del tren con señales pbs
--- a/lang/turkish.txt +++ b/lang/turkish.txt @@ -1030,7 +1030,6 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY :{LTBLUE}Yüzeysel ekonomi (daha çok ve küçük çapta degisiklikler) STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Diger sirketlerin hisseleri alinabilsin STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY :{LTBLUE}Sürüklerken her: {ORANGE}{STRING} karede bir sinyal koy -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}pbs sinyallerini otomatik yerlestir: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS :{LTBLUE}Ana araç çubugu pozisyonu: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Sol STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Orta @@ -1436,7 +1435,6 @@ STR_RAILROAD_TRACK_WITH_PRESIGNALS :Ön-sinayalli ray STR_RAILROAD_TRACK_WITH_EXITSIGNALS :Çikis-sinyalli ray STR_RAILROAD_TRACK_WITH_COMBOSIGNALS :ön+çikis-sinyalli ray -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :pbs-sinyalli ray
--- a/lang/unfinished/latvian.txt +++ b/lang/unfinished/latvian.txt @@ -1004,7 +1004,6 @@ STR_CONFIG_PATCHES_ENDING_DATE :{LTBLUE}Nobeidz spe'li: {ORANGE}{STRING} STR_CONFIG_PATCHES_ALLOW_SHARES :{LTBLUE}Atïauj akciju pirkðanu no citâm kompânijâm -STR_CONFIG_AUTO_PBS_PLACEMENT :{LTBLUE}Atl'aut automatisko novietojumu PBS signa'lus: {ORANGE}{STRING} STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT :Pa kreisi STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER :Centrâ STR_CONFIG_PATCHES_TOOLBAR_POS_RIGHT :Pa labi @@ -1121,7 +1120,6 @@ ##id 0x1000 STR_1021_RAILROAD_TRACK :Dzelzceïa ceïs -STR_RAILROAD_TRACK_WITH_PBSSIGNALS :Dzelzcel's' ar pbs signa'liem
--- a/npf.c +++ b/npf.c @@ -47,66 +47,6 @@ return diagTracks * NPF_TILE_LENGTH + straightTracks * NPF_TILE_LENGTH * STRAIGHT_TRACK_LENGTH; } -/** - * Check if a rail track is the end of the line. Will also consider 1-way signals to be the end of a line. - * @param tile The tile on which the current track is. - * @param trackdir The (track)direction in which you want to look. - * @param enginetype The type of the engine for which we are checking this. - */ -static bool IsEndOfLine(TileIndex tile, Trackdir trackdir, RailType enginetype) -{ - byte exitdir = TrackdirToExitdir(trackdir); - TileIndex dst_tile; - uint32 ts; - - /* Can always go into a tunnel */ - if (IsTileType(tile, MP_TUNNELBRIDGE) && GB(_m[tile].m5, 4, 4) == 0 && - GB(_m[tile].m5, 0, 2) == exitdir) { - return false; - } - - /* Cannot go through the back of a depot */ - if (IsTileDepotType(tile, TRANSPORT_RAIL) && (exitdir != GetDepotDirection(tile, TRANSPORT_RAIL))) - return true; - - /* Calculate next tile */ - dst_tile = tile + TileOffsByDir(exitdir); - // determine the track status on the next tile. - ts = GetTileTrackStatus(dst_tile, TRANSPORT_RAIL) & TrackdirReachesTrackdirs(trackdir); - - // when none of the trackdir bits are set, we cant enter the new tile - if ( (ts & TRACKDIR_BIT_MASK) == 0) - return true; - - { - byte dst_type = GetTileRailType(dst_tile, exitdir); - if (!IsCompatibleRail(enginetype, dst_type)) - return true; - if (GetTileOwner(tile) != GetTileOwner(dst_tile)) - return true; - - /* Prevent us from entering a depot from behind */ - if (IsTileDepotType(dst_tile, TRANSPORT_RAIL) && (exitdir != ReverseDiagdir(GetDepotDirection(dst_tile, TRANSPORT_RAIL)))) - return true; - - /* Prevent us from falling off a slope into a tunnel exit */ - if (IsTileType(dst_tile, MP_TUNNELBRIDGE) && - GB(_m[dst_tile].m5, 4, 4) == 0 && - (DiagDirection)GB(_m[dst_tile].m5, 0, 2) == ReverseDiagdir(exitdir)) { - return true; - } - - /* Check for oneway signal against us */ - if (IsTileType(dst_tile, MP_RAILWAY) && GetRailTileType(dst_tile) == RAIL_TYPE_SIGNALS) { - if (HasSignalOnTrackdir(dst_tile, ReverseTrackdir(FindFirstBit2x64(ts))) && !HasSignalOnTrackdir(dst_tile, FindFirstBit2x64(ts))) - // if one way signal not pointing towards us, stop going in this direction. - return true; - } - - return false; - } -} - #if 0 static uint NTPHash(uint key1, uint key2) { @@ -164,90 +104,6 @@ return TileXY(x, y); } -/* On PBS pathfinding runs, this is called before pathfinding ends (BeforeExit aystar callback), and will - * reserve the appropriate tracks, if needed. */ -static void NPFReservePBSPath(AyStar *as) -{ - NPFFoundTargetData* ftd = (NPFFoundTargetData*)as->user_path; - bool eol_end = false; - - if (ftd->best_trackdir == 0xFF) - return; - - if (!NPFGetFlag(&ftd->node, NPF_FLAG_PBS_EXIT) && IsEndOfLine(ftd->node.tile, ftd->node.direction, as->user_data[NPF_RAILTYPE]) && !NPFGetFlag(&ftd->node, NPF_FLAG_SEEN_SIGNAL)) { - /* The path ends in an end of line, we'll need to reserve a path. - * We treat and end of line as a red exit signal */ - eol_end = true; - NPFSetFlag(&ftd->node, NPF_FLAG_PBS_EXIT, true); - if (!NPFGetFlag(&ftd->node, NPF_FLAG_PBS_TARGET_SEEN)) - NPFSetFlag(&ftd->node, NPF_FLAG_PBS_RED, true); - } - - if (!NPFGetFlag(&ftd->node, NPF_FLAG_PBS_CHOICE)) { - /* there have been no choices to make on our path, we dont care if our end signal is red */ - NPFSetFlag(&ftd->node, NPF_FLAG_PBS_RED, false); - } - - if (NPFGetFlag(&ftd->node, NPF_FLAG_PBS_EXIT) && // we passed an exit signal - !NPFGetFlag(&ftd->node, NPF_FLAG_PBS_BLOCKED) && // we didnt encounter reserver tracks - ((as->user_data[NPF_PBS_MODE] != PBS_MODE_GREEN) || (!NPFGetFlag(&ftd->node, NPF_FLAG_PBS_RED))) ) { // our mode permits having a red exit signal, or the signal is green - PathNode parent; - PathNode *curr; - PathNode *prev; - TileIndex start = INVALID_TILE; - byte trackdir = 0; - - parent.node = ftd->node; - parent.parent = &ftd->path; - curr = &parent; - prev = NULL; - - do { - if (!NPFGetFlag(&curr->node, NPF_FLAG_PBS_EXIT) || eol_end) { - /* check for already reserved track on this path, if they clash with what we - currently trying to reserve, we have a self-crossing path :-( */ - if ((PBSTileUnavail(curr->node.tile) & (1 << curr->node.direction)) - && !(PBSTileReserved(curr->node.tile) & (1 << (curr->node.direction & 7))) - && (start != INVALID_TILE)) { - /* It's actually quite bad if this happens, it means the pathfinder - * found a path that is intersecting with itself, which is a very bad - * thing in a pbs block. Also there is not much we can do about it at - * this point.... - * BUT, you have to have a pretty fucked up junction layout for this to happen, - * so we'll just stop this train, the user will eventually notice, so he can fix it. - */ - PBSClearPath(start, trackdir, curr->node.tile, curr->node.direction); - NPFSetFlag(&ftd->node, NPF_FLAG_PBS_BLOCKED, true); - DEBUG(pbs, 1) ("PBS: Self-crossing path!!!"); - return; - }; - - PBSReserveTrack(curr->node.tile, TrackdirToTrack(curr->node.direction) ); - - /* we want to reserve the last tile (with the signal) on the path too - also remember this tile, cause its the end of the path (where we exit the block) */ - if (start == INVALID_TILE) { - if (prev != NULL) { - PBSReserveTrack(prev->node.tile, TrackdirToTrack(prev->node.direction) ); - start = prev->node.tile; - trackdir = ReverseTrackdir(prev->node.direction); - } else { - start = curr->node.tile; - trackdir = curr->node.direction; - } - } - } - - prev = curr; - curr = curr->parent; - } while (curr != NULL); - // we remember the tile/track where this path leaves the pbs junction - ftd->node.tile = start; - ftd->node.direction = trackdir; - } -} - - /* Calcs the heuristic to the target station or tile. For train stations, it * takes into account the direction of approach. */ @@ -272,21 +128,9 @@ DEBUG(npf, 4)("Calculating H for: (%d, %d). Result: %d", TileX(current->tile), TileY(current->tile), dist); - /* for pbs runs, we ignore tiles inside the pbs block for the tracking - of the 'closest' tile */ - if ((as->user_data[NPF_PBS_MODE] != PBS_MODE_NONE) - && (!NPFGetFlag(current , NPF_FLAG_SEEN_SIGNAL)) - && (!IsEndOfLine(current->tile, current->direction, as->user_data[NPF_RAILTYPE]))) - return dist; - - if ((dist < ftd->best_bird_dist) || - /* for pbs runs, prefer tiles that pass a green exit signal to the pbs blocks */ - ((as->user_data[NPF_PBS_MODE] != PBS_MODE_NONE) && !NPFGetFlag(current, NPF_FLAG_PBS_RED) && NPFGetFlag(&ftd->node, NPF_FLAG_PBS_RED)) -) { + if (dist < ftd->best_bird_dist) { ftd->best_bird_dist = dist; ftd->best_trackdir = current->user_data[NPF_TRACKDIR_CHOICE]; - ftd->path = parent->path; - ftd->node = *current; } return dist; } @@ -485,11 +329,6 @@ /* Determine extra costs */ - /* Check for reserved tracks (PBS) */ - if ((as->user_data[NPF_PBS_MODE] != PBS_MODE_NONE) && !(NPFGetFlag(current, NPF_FLAG_PBS_EXIT)) && !(NPFGetFlag(current, NPF_FLAG_PBS_BLOCKED)) && (PBSTileUnavail(tile) & (1<<trackdir))) { - NPFSetFlag(current, NPF_FLAG_PBS_BLOCKED, true); - }; - /* Check for signals */ if (IsTileType(tile, MP_RAILWAY) && HasSignalOnTrackdir(tile, trackdir)) { /* Ordinary track with signals */ @@ -506,10 +345,6 @@ cost += _patches.npf_rail_firstred_exit_penalty; else cost += _patches.npf_rail_firstred_penalty; - - /* for pbs runs, store the fact that the exit signal to the pbs block was red */ - if (!(NPFGetFlag(current, NPF_FLAG_PBS_EXIT)) && !(NPFGetFlag(current, NPF_FLAG_PBS_RED)) && NPFGetFlag(current, NPF_FLAG_PBS_CHOICE)) - NPFSetFlag(current, NPF_FLAG_PBS_RED, true); } /* Record the state of this signal */ NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, true); @@ -517,15 +352,6 @@ /* Record the state of this signal */ NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, false); } - - if (!NPFGetFlag(current, NPF_FLAG_SEEN_SIGNAL) && NPFGetFlag(current, NPF_FLAG_PBS_BLOCKED)) { - /* penalise a path through the pbs block if it crosses reserved tracks */ - cost += 1000; - } - if ((PBSIsPbsSignal(tile, trackdir)) && !NPFGetFlag(current, NPF_FLAG_SEEN_SIGNAL)) { - /* we've encountered an exit signal to the pbs block */ - NPFSetFlag(current, NPF_FLAG_PBS_EXIT, true); - } NPFSetFlag(current, NPF_FLAG_SEEN_SIGNAL, true); } @@ -547,25 +373,13 @@ // curves should be taken into account, as this affects the speed limit. - /* Check for depots */ - if (IsTileDepotType(tile, TRANSPORT_RAIL)) { + /* Check for reverse in depot */ + if (IsTileDepotType(tile, TRANSPORT_RAIL) && as->EndNodeCheck(as, &new_node) != AYSTAR_FOUND_END_NODE) { /* Penalise any depot tile that is not the last tile in the path. This * _should_ penalise every occurence of reversing in a depot (and only * that) */ - if (as->EndNodeCheck(as, &new_node) != AYSTAR_FOUND_END_NODE) - cost += _patches.npf_rail_depot_reverse_penalty; + cost += _patches.npf_rail_depot_reverse_penalty; - /* Do we treat this depot as a pbs signal? */ - if (!NPFGetFlag(current, NPF_FLAG_SEEN_SIGNAL)) { - if (NPFGetFlag(current, NPF_FLAG_PBS_BLOCKED)) { - cost += 1000; - } - if (PBSIsPbsSegment(tile, ReverseTrackdir(trackdir))) { - NPFSetFlag(current, NPF_FLAG_PBS_EXIT, true); - NPFSetFlag(current, NPF_FLAG_SEEN_SIGNAL, true); - } - } - NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, false); } /* Check for occupied track */ @@ -600,13 +414,8 @@ * is correct */ if ( (fstd->station_index == -1 && tile == fstd->dest_coords) || /* We've found the tile, or */ - (IsTileType(tile, MP_STATION) && _m[tile].m2 == fstd->station_index) || /* the station */ - (NPFGetFlag(node, NPF_FLAG_PBS_TARGET_SEEN)) /* or, we've passed it already (for pbs) */ + (IsTileType(tile, MP_STATION) && _m[tile].m2 == fstd->station_index) /* the station */ ) { - NPFSetFlag(¤t->path.node, NPF_FLAG_PBS_TARGET_SEEN, true); - /* for pbs runs, only accept we've found the target if we've also found a way out of the block */ - if ((as->user_data[NPF_PBS_MODE] != PBS_MODE_NONE) && !NPFGetFlag(node, NPF_FLAG_SEEN_SIGNAL) && !IsEndOfLine(node->tile, node->direction, as->user_data[NPF_RAILTYPE])) - return AYSTAR_DONE; return AYSTAR_FOUND_END_NODE; } else { return AYSTAR_DONE; @@ -624,7 +433,6 @@ ftd->best_path_dist = current->g; ftd->best_bird_dist = 0; ftd->node = current->path.node; - ftd->path = current->path; } /** @@ -701,8 +509,6 @@ aystar->num_neighbours = 0; DEBUG(npf, 4)("Expanding: (%d, %d, %d) [%d]", TileX(src_tile), TileY(src_tile), src_trackdir, src_tile); - aystar->EndNodeCheck(aystar, current); - /* Find dest tile */ if (IsTileType(src_tile, MP_TUNNELBRIDGE) && GB(_m[src_tile].m5, 4, 4) == 0 && (DiagDirection)GB(_m[src_tile].m5, 0, 2) == src_exitdir) { @@ -789,16 +595,7 @@ /* Select only trackdirs we can reach from our current trackdir */ trackdirbits &= TrackdirReachesTrackdirs(src_trackdir); if (_patches.forbid_90_deg && (type == TRANSPORT_RAIL || type == TRANSPORT_WATER)) /* Filter out trackdirs that would make 90 deg turns for trains */ - - trackdirbits &= ~TrackdirCrossesTrackdirs(src_trackdir); - - if (KillFirstBit2x64(trackdirbits) != 0) - NPFSetFlag(¤t->path.node, NPF_FLAG_PBS_CHOICE, true); - - /* When looking for 'any' route, ie when already inside a pbs block, discard all tracks that would cross - other reserved tracks, so we *always* will find a valid route if there is one */ - if (!(NPFGetFlag(¤t->path.node, NPF_FLAG_PBS_EXIT)) && (aystar->user_data[NPF_PBS_MODE] == PBS_MODE_ANY)) - trackdirbits &= ~PBSTileUnavail(dst_tile); + trackdirbits &= ~TrackdirCrossesTrackdirs(src_trackdir); DEBUG(npf,6)("After filtering: (%d, %d), possible trackdirs: %#x", TileX(dst_tile), TileY(dst_tile), trackdirbits); @@ -840,7 +637,7 @@ * multiple targets that are spread around, we should perform a breadth first * search by specifiying CalcZero as our heuristic. */ -static NPFFoundTargetData NPFRouteInternal(AyStarNode* start1, AyStarNode* start2, NPFFindStationOrTileData* target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, TransportType type, Owner owner, RailType railtype, uint reverse_penalty, byte pbs_mode) +static NPFFoundTargetData NPFRouteInternal(AyStarNode* start1, AyStarNode* start2, NPFFindStationOrTileData* target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, TransportType type, Owner owner, RailType railtype, uint reverse_penalty) { int r; NPFFoundTargetData result; @@ -859,11 +656,6 @@ else assert(0); - if (pbs_mode != PBS_MODE_NONE) - _npf_aystar.BeforeExit = NPFReservePBSPath; - else - _npf_aystar.BeforeExit = NULL; - /* Initialize Start Node(s) */ start1->user_data[NPF_TRACKDIR_CHOICE] = INVALID_TRACKDIR; start1->user_data[NPF_NODE_FLAGS] = 0; @@ -888,7 +680,6 @@ _npf_aystar.user_data[NPF_TYPE] = type; _npf_aystar.user_data[NPF_OWNER] = owner; _npf_aystar.user_data[NPF_RAILTYPE] = railtype; - _npf_aystar.user_data[NPF_PBS_MODE] = pbs_mode; /* GO! */ r = AyStarMain_Main(&_npf_aystar); @@ -906,7 +697,7 @@ return result; } -NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype, byte pbs_mode) +NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype) { AyStarNode start1; AyStarNode start2; @@ -920,12 +711,12 @@ start2.direction = trackdir2; start2.user_data[NPF_TRACKDIR_CHOICE] = INVALID_TRACKDIR; - return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), target, NPFFindStationOrTile, NPFCalcStationOrTileHeuristic, type, owner, railtype, 0, pbs_mode); + return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), target, NPFFindStationOrTile, NPFCalcStationOrTileHeuristic, type, owner, railtype, 0); } -NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype, byte pbs_mode) +NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype) { - return NPFRouteToStationOrTileTwoWay(tile, trackdir, INVALID_TILE, 0, target, type, owner, railtype, pbs_mode); + return NPFRouteToStationOrTileTwoWay(tile, trackdir, INVALID_TILE, 0, target, type, owner, railtype); } NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, TransportType type, Owner owner, RailType railtype, uint reverse_penalty) @@ -944,7 +735,7 @@ /* perform a breadth first search. Target is NULL, * since we are just looking for any depot...*/ - return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), NULL, NPFFindDepot, NPFCalcZero, type, owner, railtype, reverse_penalty, PBS_MODE_NONE); + return NPFRouteInternal(&start1, (IsValidTile(tile2) ? &start2 : NULL), NULL, NPFFindDepot, NPFCalcZero, type, owner, railtype, reverse_penalty); } NPFFoundTargetData NPFRouteToDepotBreadthFirst(TileIndex tile, Trackdir trackdir, TransportType type, Owner owner, RailType railtype) @@ -997,8 +788,6 @@ else assert(0); - _npf_aystar.BeforeExit = NULL; - /* Initialize target */ target.station_index = -1; /* We will initialize dest_coords inside the loop below */ _npf_aystar.user_target = ⌖ @@ -1006,7 +795,6 @@ /* Initialize user_data */ _npf_aystar.user_data[NPF_TYPE] = type; _npf_aystar.user_data[NPF_OWNER] = owner; - _npf_aystar.user_data[NPF_PBS_MODE] = PBS_MODE_NONE; /* Initialize Start Node */ start.tile = tile;
--- a/npf.h +++ b/npf.h @@ -6,7 +6,6 @@ #include "openttd.h" #include "aystar.h" #include "vehicle.h" -#include "pbs.h" #include "tile.h" #include "variables.h" @@ -39,7 +38,6 @@ NPF_TYPE = 0, /* Contains a TransportTypes value */ NPF_OWNER, /* Contains an Owner value */ NPF_RAILTYPE, /* Contains the RailType value of the engine when NPF_TYPE == TRANSPORT_RAIL. Unused otherwise. */ - NPF_PBS_MODE, /* Contains the pbs mode, see pbs.h */ }; enum { /* Indices into AyStarNode.userdata[] */ @@ -51,11 +49,6 @@ NPF_FLAG_SEEN_SIGNAL, /* Used to mark that a signal was seen on the way, for rail only */ NPF_FLAG_REVERSE, /* Used to mark that this node was reached from the second start node, if applicable */ NPF_FLAG_LAST_SIGNAL_RED, /* Used to mark that the last signal on this path was red */ - NPF_FLAG_PBS_EXIT, /* Used to mark tracks inside a pbs block, for rail only, for the end node, this is set when the path found goes through a pbs block */ - NPF_FLAG_PBS_BLOCKED, /* Used to mark that this path crosses another pbs path */ - NPF_FLAG_PBS_RED, /* Used to mark that this path goes through a red exit-pbs signal */ - NPF_FLAG_PBS_CHOICE, /* Used to mark that the train has had a choice on this path */ - NPF_FLAG_PBS_TARGET_SEEN, /* Used to mark that a target tile has been passed on this path */ } NPFNodeFlag; typedef struct NPFFoundTargetData { /* Meant to be stored in AyStar.userpath */ @@ -63,7 +56,6 @@ uint best_path_dist; /* The shortest path. Is (uint)-1 if no path is found */ Trackdir best_trackdir; /* The trackdir that leads to the shortest path/closest birds dist */ AyStarNode node; /* The node within the target the search led us to */ - PathNode path; } NPFFoundTargetData; /* These functions below are _not_ re-entrant, in favor of speed! */ @@ -71,12 +63,11 @@ /* Will search from the given tile and direction, for a route to the given * station for the given transport type. See the declaration of * NPFFoundTargetData above for the meaning of the result. */ -NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype, byte pbs_mode); - +NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir trackdir, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype); /* Will search as above, but with two start nodes, the second being the * reverse. Look at the NPF_FLAG_REVERSE flag in the result node to see which * direction was taken (NPFGetBit(result.node, NPF_FLAG_REVERSE)) */ -NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype, byte pbs_mode); +NPFFoundTargetData NPFRouteToStationOrTileTwoWay(TileIndex tile1, Trackdir trackdir1, TileIndex tile2, Trackdir trackdir2, NPFFindStationOrTileData* target, TransportType type, Owner owner, RailType railtype); /* Will search a route to the closest depot. */
--- a/oldloader.c +++ b/oldloader.c @@ -1574,7 +1574,7 @@ for (i = 0; i < OLD_MAP_SIZE; i ++) { if (IsTileType(i, MP_RAILWAY)) { /* We save presignals different from TTDPatch, convert them */ - if ((_m[i].m5 & 0xC0) == 0x40) { + if (GB(_m[i].m5, 6, 2) == 1) { /* This byte is always zero in TTD for this type of tile */ if (_m[i].m4) /* Convert the presignals to our own format */ _m[i].m4 = (_m[i].m4 >> 1) & 7;
--- a/openttd.c +++ b/openttd.c @@ -1249,20 +1249,6 @@ FOR_ALL_TOWNS(t) UpdateTownMaxPass(t); } - /* From version 15.0, we moved a semaphore bit from bit 2 to bit 3 in m4, making - * room for PBS. While doing that, clean some blocks that should be empty, for PBS. */ - if (CheckSavegameVersion(15)) { - BEGIN_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0) { - if (IsTileType(tile, MP_RAILWAY) && HasSignals(tile) && HASBIT(_m[tile].m4, 2)) { - CLRBIT(_m[tile].m4, 2); - SETBIT(_m[tile].m4, 3); - } - // Clear possible junk data in PBS bits. - if (IsTileType(tile, MP_RAILWAY) && !HASBIT(_m[tile].m5, 7)) - SB(_m[tile].m4, 4, 4, 0); - } END_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0); - } - /* From version 16.0, we included autorenew on engines, which are now saved, but * of course, we do need to initialize them for older savegames. */ if (CheckSavegameVersion(16)) { @@ -1328,6 +1314,37 @@ UpdateAllWaypointCustomGraphics(); } + /* From version 15, we moved a semaphore bit from bit 2 to bit 3 in m4, making + * room for PBS. Now in version 21 move it back :P. */ + if (CheckSavegameVersion(21) && !CheckSavegameVersion(15)) { + BEGIN_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0) { + if (IsTileType(tile, MP_RAILWAY)) { + // Clear PBS signals, move back sempahore bit to 2 + if (HasSignals(tile)) { + // convert PBS signals to combo-signals + if (HASBIT(_m[tile].m4, 2)) SB(_m[tile].m4, 0, 2, 3); + + SB(_m[tile].m4, 2, 2, HASBIT(_m[tile].m4, 3)); + CLRBIT(_m[tile].m4, 3); + } + + // Clear PBS reservation on track + if (!IsTileDepotType(tile, TRANSPORT_RAIL)) + SB(_m[tile].m4, 4, 4, 0); + else + CLRBIT(_m[tile].m3, 6); + } + + // Clear PBS reservation on crossing + if (IsTileType(tile, MP_STREET) && IsLevelCrossing(tile)) + CLRBIT(_m[tile].m5, 0); + + // Clear PBS reservation on station + if (IsTileType(tile, MP_STATION) && IsLevelCrossing(tile)) + CLRBIT(_m[tile].m3, 6); + } END_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0); + } + FOR_ALL_PLAYERS(p) p->avail_railtypes = GetPlayerRailtypes(p->index); return true;
--- a/openttd.dsp +++ b/openttd.dsp @@ -335,10 +335,6 @@ # End Source File # Begin Source File -SOURCE=.\pbs.c -# End Source File -# Begin Source File - SOURCE=.\players.c # End Source File # Begin Source File @@ -650,10 +646,6 @@ # End Source File # Begin Source File -SOURCE=.\pbs.h -# End Source File -# Begin Source File - SOURCE=.\player.h # End Source File # Begin Source File
--- a/openttd.vcproj +++ b/openttd.vcproj @@ -297,9 +297,6 @@ RelativePath=".\pathfind.c"> </File> <File - RelativePath=".\pbs.c"> - </File> - <File RelativePath="players.c"> </File> <File @@ -511,9 +508,6 @@ RelativePath=".\pathfind.h"> </File> <File - RelativePath=".\pbs.h"> - </File> - <File RelativePath=".\player.h"> </File> <File
--- a/rail.h +++ b/rail.h @@ -42,14 +42,13 @@ } RailTileSubtype; typedef enum SignalTypes { - /* Stored in m4[0..2] for MP_RAILWAY */ + /* Stored in m4[0..1] for MP_RAILWAY */ SIGTYPE_NORMAL = 0, // normal signal SIGTYPE_ENTRY = 1, // presignal block entry SIGTYPE_EXIT = 2, // presignal block exit SIGTYPE_COMBO = 3, // presignal inter-block - SIGTYPE_PBS = 4, // pbs signal SIGTYPE_END, - SIGTYPE_MASK = 7, + SIGTYPE_MASK = 3, } SignalType; typedef enum RailTypes { @@ -62,7 +61,7 @@ } RailType; enum { - SIG_SEMAPHORE_MASK = 1 << 3, + SIG_SEMAPHORE_MASK = 1 << 2, }; /** These are used to specify a single track. Can be translated to a trackbit
--- a/rail_cmd.c +++ b/rail_cmd.c @@ -18,9 +18,7 @@ #include "station.h" #include "sprite.h" #include "depot.h" -#include "pbs.h" #include "waypoint.h" -#include "npf.h" #include "rail.h" #include "railtypes.h" // include table for railtypes @@ -474,10 +472,6 @@ /* We remove the trackbit here. */ _m[tile].m5 &= ~trackbit; - /* Unreserve track for PBS */ - if (PBSTileReserved(tile) & trackbit) - PBSClearTrack(tile, track); - if (GetTrackBits(tile) == 0) { /* The tile has no tracks left, it is no longer a rail tile */ DoClearSquare(tile); @@ -766,9 +760,9 @@ _m[tile].m3 |= SignalOnTrack(track); } else { if (pre_signal) { - // cycle between normal -> pre -> exit -> combo -> pbs ->... + // cycle between normal -> pre -> exit -> combo -> ... byte type = (GetSignalType(tile, track) + 1) % SIGTYPE_END; - SB(_m[tile].m4, 0, 3, type); + SB(_m[tile].m4, 0, 2, type); } else { // cycle between two-way -> one-way -> one-way -> ... /* TODO: Rewrite switch into something more general */ @@ -799,9 +793,9 @@ _m[tile].m3 |= p2 & SignalOnTrack(track); // convert between signal<->semaphores when dragging if (semaphore) { - SETBIT(_m[tile].m4, 3); + SETBIT(_m[tile].m4, 2); } else { - CLRBIT(_m[tile].m4, 3); + CLRBIT(_m[tile].m4, 2); } } @@ -938,7 +932,7 @@ if (GB(_m[tile].m3, 4, 4) == 0) { SB(_m[tile].m2, 4, 4, 0); SB(_m[tile].m5, 6, 2, RAIL_TYPE_NORMAL >> 6); // XXX >> because the constant is meant for direct application, not use with SB - CLRBIT(_m[tile].m4, 3); // remove any possible semaphores + CLRBIT(_m[tile].m4, 2); // remove any possible semaphores } SetSignalsOnBothDir(tile, track); @@ -1130,54 +1124,29 @@ #include "table/track_land.h" // used for presignals -static const SpriteID _signal_base_sprites[32] = { +static const SpriteID _signal_base_sprites[16] = { 0x4FB, 0x1323, 0x1333, 0x1343, - // pbs signals - 0x1393, - 0x13A3, // not used (yet?) - 0x13B3, // not used (yet?) - 0x13C3, // not used (yet?) - // semaphores 0x1353, 0x1363, 0x1373, 0x1383, - // pbs semaphores - 0x13D3, - 0x13E3, // not used (yet?) - 0x13F3, // not used (yet?) - 0x1403, // not used (yet?) - - // mirrored versions 0x4FB, 0x1323, 0x1333, 0x1343, - // pbs signals - 0x1393, - 0x13A3, // not used (yet?) - 0x13B3, // not used (yet?) - 0x13C3, // not used (yet?) - // semaphores 0x1446, 0x1456, 0x1466, 0x1476, - - // pbs semaphores - 0x14C6, - 0x14D6, // not used (yet?) - 0x14E6, // not used (yet?) - 0x14F6, // not used (yet?) }; // used to determine the side of the road for the signal @@ -1195,7 +1164,7 @@ uint v = _signal_position[(image_and_pos & 0xF) + (otherside ? 12 : 0)]; uint x = ti->x | (v&0xF); uint y = ti->y | (v>>4); - uint sprite = _signal_base_sprites[(_m[ti->tile].m4 & 0xF) + (otherside ? 0x10 : 0)] + (image_and_pos>>4) + ((condition != 0) ? 1 : 0); + uint sprite = _signal_base_sprites[(_m[ti->tile].m4 & 0x7) + (otherside ? 8 : 0)] + (image_and_pos>>4) + ((condition != 0) ? 1 : 0); AddSortableSpriteToDraw(sprite, x, y, 1, 1, 10, GetSlopeZ(x,y)); } @@ -1387,16 +1356,6 @@ if (track & TRACK_BIT_LEFT) DrawGroundSprite(rti->base_sprites.single_w); if (track & TRACK_BIT_RIGHT) DrawGroundSprite(rti->base_sprites.single_e); } - - if (_debug_pbs_level >= 1) { - byte pbs = PBSTileReserved(ti->tile) & track; - if (pbs & TRACK_BIT_DIAG1) DrawGroundSprite(rti->base_sprites.single_y | PALETTE_CRASH); - if (pbs & TRACK_BIT_DIAG2) DrawGroundSprite(rti->base_sprites.single_x | PALETTE_CRASH); - if (pbs & TRACK_BIT_UPPER) DrawGroundSprite(rti->base_sprites.single_n | PALETTE_CRASH); - if (pbs & TRACK_BIT_LOWER) DrawGroundSprite(rti->base_sprites.single_s | PALETTE_CRASH); - if (pbs & TRACK_BIT_LEFT) DrawGroundSprite(rti->base_sprites.single_w | PALETTE_CRASH); - if (pbs & TRACK_BIT_RIGHT) DrawGroundSprite(rti->base_sprites.single_e | PALETTE_CRASH); - } } static void DrawTile_Track(TileInfo *ti) @@ -1526,16 +1485,6 @@ DrawGroundSprite(image); - if (_debug_pbs_level >= 1) { - byte pbs = PBSTileReserved(ti->tile); - if (pbs & TRACK_BIT_DIAG1) DrawGroundSprite(rti->base_sprites.single_y | PALETTE_CRASH); - if (pbs & TRACK_BIT_DIAG2) DrawGroundSprite(rti->base_sprites.single_x | PALETTE_CRASH); - if (pbs & TRACK_BIT_UPPER) DrawGroundSprite(rti->base_sprites.single_n | PALETTE_CRASH); - if (pbs & TRACK_BIT_LOWER) DrawGroundSprite(rti->base_sprites.single_s | PALETTE_CRASH); - if (pbs & TRACK_BIT_LEFT) DrawGroundSprite(rti->base_sprites.single_w | PALETTE_CRASH); - if (pbs & TRACK_BIT_RIGHT) DrawGroundSprite(rti->base_sprites.single_e | PALETTE_CRASH); - } - for (; drss->image != 0; drss++) { DrawSpecialBuilding(drss->image, type < 4 ? rti->total_offset : 0, ti, drss->subcoord_x, drss->subcoord_y, 0, @@ -1595,11 +1544,6 @@ bool stop; bool has_presignal; - bool has_pbssignal; - // lowest 2 bits = amount of pbs signals in the block, clamped at 2 - // bit 2 = there is a pbs entry signal in this block - // bit 3 = there is a pbs exit signal in this block - // presignal info int presignal_exits; int presignal_exits_free; @@ -1608,10 +1552,6 @@ byte bit[NUM_SSD_ENTRY]; TileIndex tile[NUM_SSD_ENTRY]; - int pbs_cur; - // these are used to keep track of all signals in the block - TileIndex pbs_tile[NUM_SSD_ENTRY]; - // these are used to keep track of the stack that modifies presignals recursively TileIndex next_tile[NUM_SSD_STACK]; byte next_dir[NUM_SSD_STACK]; @@ -1631,32 +1571,15 @@ ssd->cur++; } - if (PBSIsPbsSignal(tile, ReverseTrackdir(track))) - SETBIT(ssd->has_pbssignal, 2); - // remember if this block has a presignal. ssd->has_presignal |= (_m[tile].m4&1); } - if (PBSIsPbsSignal(tile, ReverseTrackdir(track)) || PBSIsPbsSignal(tile, track)) { - byte num = ssd->has_pbssignal & 3; - num = clamp(num + 1, 0, 2); - ssd->has_pbssignal &= ~3; - ssd->has_pbssignal |= num; - } - - ssd->pbs_tile[ssd->pbs_cur] = tile; // remember the tile index - ssd->pbs_cur++; - - if (HasSignalOnTrackdir(tile, track)) { - if (_m[tile].m4&2) { - // this is an exit signal that points out from the segment - ssd->presignal_exits++; - if (GetSignalState(tile, track) != SIGNAL_STATE_RED) - ssd->presignal_exits_free++; - } - if (PBSIsPbsSignal(tile, track)) - SETBIT(ssd->has_pbssignal, 3); + if (HasSignalOnTrackdir(tile, track) && (_m[tile].m4 & 2)) { + // this is an exit signal that points out from the segment + ssd->presignal_exits++; + if (GetSignalState(tile, track) != SIGNAL_STATE_RED) + ssd->presignal_exits_free++; } return true; @@ -1791,14 +1714,6 @@ // there is at least one green exit signal OR // there are no exit signals in the segment - // convert the block to pbs, if needed - if (_patches.auto_pbs_placement && !(ssd->stop) && (ssd->has_pbssignal == 0xE) && !ssd->has_presignal && (ssd->presignal_exits == 0)) // 0xE means at least 2 pbs signals, and at least 1 entry and 1 exit, see comments ssd->has_pbssignal - for (i = 0; i != ssd->pbs_cur; i++) { - TileIndex tile = ssd->pbs_tile[i]; - SB(_m[tile].m4, 0, 3, SIGTYPE_PBS); - MarkTileDirtyByTile(tile); - }; - // then mark the signals in the segment accordingly for (i = 0; i != ssd->cur; i++) { TileIndex tile = ssd->tile[i]; @@ -1859,9 +1774,8 @@ for(;;) { // go through one segment and update all signals pointing into that segment. - ssd.cur = ssd.pbs_cur = ssd.presignal_exits = ssd.presignal_exits_free = 0; + ssd.cur = ssd.presignal_exits = ssd.presignal_exits_free = 0; ssd.has_presignal = false; - ssd.has_pbssignal = false; FollowTrack(tile, 0xC000 | TRANSPORT_RAIL, direction, (TPFEnumProc*)SetSignalsEnumProc, SetSignalsAfterProc, &ssd); ChangeSignalStates(&ssd); @@ -2126,16 +2040,14 @@ break; case RAIL_TYPE_SIGNALS: { - const StringID signal_type[7] = { + const StringID signal_type[] = { STR_RAILROAD_TRACK_WITH_NORMAL_SIGNALS, STR_RAILROAD_TRACK_WITH_PRESIGNALS, STR_RAILROAD_TRACK_WITH_EXITSIGNALS, - STR_RAILROAD_TRACK_WITH_COMBOSIGNALS, - STR_RAILROAD_TRACK_WITH_PBSSIGNALS, - STR_NULL, STR_NULL + STR_RAILROAD_TRACK_WITH_COMBOSIGNALS }; - td->str = signal_type[GB(_m[tile].m4, 0, 3)]; + td->str = signal_type[GB(_m[tile].m4, 0, 2)]; break; } @@ -2199,8 +2111,6 @@ } else if (_fractcoords_enter[dir] == fract_coord) { if (_enter_directions[dir] == v->direction) { /* enter the depot */ - if (v->next == NULL) - PBSClearTrack(v->tile, FIND_FIRST_BIT(v->u.rail.track)); v->u.rail.track = 0x80, v->vehstatus |= VS_HIDDEN; /* hide it */ v->direction ^= 4;
--- a/road_cmd.c +++ b/road_cmd.c @@ -15,8 +15,6 @@ #include "gfx.h" #include "sound.h" #include "depot.h" -#include "pbs.h" -#include "debug.h" /* When true, GetTrackStatus for roads will treat roads under reconstruction * as normal roads instead of impassable. This is used when detecting whether @@ -251,7 +249,6 @@ cost = _price.remove_road * 2; if (flags & DC_EXEC) { - byte pbs_track = PBSTileReserved(tile); ChangeTownRating(t, -road_remove_cost[(byte)edge_road], RATING_ROAD_MINIMUM); ModifyTile(tile, @@ -260,8 +257,6 @@ _m[tile].m4 & 0xF, /* map3_lo */ c /* map5 */ ); - if (pbs_track != 0) - PBSReserveTrack(tile, FIND_FIRST_BIT(pbs_track)); } return cost; } else @@ -404,7 +399,6 @@ goto do_clear; if (flags & DC_EXEC) { - byte pbs_track = PBSTileReserved(tile); ModifyTile(tile, MP_SETTYPE(MP_STREET) | MP_MAP2 | MP_MAP3LO | MP_MAP3HI | MP_MAP5, @@ -413,8 +407,6 @@ _m[tile].m3 & 0xF, /* map3_hi */ m5 /* map5 */ ); - if (pbs_track != 0) - PBSReserveTrack(tile, FIND_FIRST_BIT(pbs_track)); } return _price.build_road * 2; } else if (ti.type == MP_TUNNELBRIDGE) { @@ -854,17 +846,6 @@ } DrawGroundSprite(image); - - if (_debug_pbs_level >= 1) { - byte pbs = PBSTileReserved(ti->tile); - if (pbs & TRACK_BIT_DIAG1) DrawGroundSprite(0x3ED | PALETTE_CRASH); - if (pbs & TRACK_BIT_DIAG2) DrawGroundSprite(0x3EE | PALETTE_CRASH); - if (pbs & TRACK_BIT_UPPER) DrawGroundSprite(0x3EF | PALETTE_CRASH); - if (pbs & TRACK_BIT_LOWER) DrawGroundSprite(0x3F0 | PALETTE_CRASH); - if (pbs & TRACK_BIT_LEFT) DrawGroundSprite(0x3F2 | PALETTE_CRASH); - if (pbs & TRACK_BIT_RIGHT) DrawGroundSprite(0x3F1 | PALETTE_CRASH); - } - } else { uint32 ormod; PlayerID player;
--- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -1062,7 +1062,7 @@ trackdir = DiagdirToDiagTrackdir(enterdir); //debug("Finding path. Enterdir: %d, Trackdir: %d", enterdir, trackdir); - ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE, PBS_MODE_NONE); + ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE); if (ftd.best_trackdir == 0xff) { /* We are already at our target. Just do something */ //TODO: maybe display error? @@ -1140,7 +1140,7 @@ fstd.dest_coords = tile; fstd.station_index = -1; // indicates that the destination is a tile, not a station - return NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE, PBS_MODE_NONE).best_path_dist; + return NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE).best_path_dist; } #endif
--- a/saveload.c +++ b/saveload.c @@ -29,7 +29,7 @@ #include <setjmp.h> enum { - SAVEGAME_VERSION = 20, + SAVEGAME_VERSION = 21, };
--- a/settings.c +++ b/settings.c @@ -868,7 +868,6 @@ // Non-static, needed in network_server.c const SettingDesc patch_settings[] = { {"build_on_slopes", SDT_BOOL, (void*)true, &_patches.build_on_slopes, NULL}, - {"auto_pbs_placement", SDT_BOOL, (void*)true, &_patches.auto_pbs_placement, NULL}, {"mammoth_trains", SDT_BOOL, (void*)true, &_patches.mammoth_trains, NULL}, {"join_stations", SDT_BOOL, (void*)true, &_patches.join_stations, NULL}, {"station_spread", SDT_UINT8, (void*)12, &_patches.station_spread, NULL},
--- a/settings_gui.c +++ b/settings_gui.c @@ -701,7 +701,6 @@ {PE_BOOL, 0, STR_CONFIG_PATCHES_SMALL_AIRPORTS, "always_small_airport", &_patches.always_small_airport, 0, 0, 0, NULL}, {PE_UINT8, PF_PLAYERBASED, STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY, "drag_signals_density", &_patches.drag_signals_density, 1, 20, 1, NULL}, - {PE_BOOL, 0, STR_CONFIG_AUTO_PBS_PLACEMENT, "auto_pbs_placement", &_patches.auto_pbs_placement, 1, 20, 1, NULL}, }; static const PatchEntry _patches_vehicles[] = {
--- a/ship_cmd.c +++ b/ship_cmd.c @@ -543,7 +543,7 @@ NPFFillWithOrderData(&fstd, v); - ftd = NPFRouteToStationOrTile(src_tile, trackdir, &fstd, TRANSPORT_WATER, v->owner, INVALID_RAILTYPE, PBS_MODE_NONE); + ftd = NPFRouteToStationOrTile(src_tile, trackdir, &fstd, TRANSPORT_WATER, v->owner, INVALID_RAILTYPE); if (ftd.best_trackdir != 0xff) { /* If ftd.best_bird_dist is 0, we found our target and ftd.best_trackdir contains
--- a/station_cmd.c +++ b/station_cmd.c @@ -25,7 +25,6 @@ #include "airport.h" #include "sprite.h" #include "depot.h" -#include "pbs.h" #include "train.h" enum { @@ -2072,16 +2071,6 @@ // but this is something else. If AI builds station with 114 it looks all weird DrawGroundSprite(image); - if (_debug_pbs_level >= 1) { - byte pbs = PBSTileReserved(ti->tile); - if (pbs & TRACK_BIT_DIAG1) DrawGroundSprite(rti->base_sprites.single_y | PALETTE_CRASH); - if (pbs & TRACK_BIT_DIAG2) DrawGroundSprite(rti->base_sprites.single_x | PALETTE_CRASH); - if (pbs & TRACK_BIT_UPPER) DrawGroundSprite(rti->base_sprites.single_n | PALETTE_CRASH); - if (pbs & TRACK_BIT_LOWER) DrawGroundSprite(rti->base_sprites.single_s | PALETTE_CRASH); - if (pbs & TRACK_BIT_LEFT) DrawGroundSprite(rti->base_sprites.single_w | PALETTE_CRASH); - if (pbs & TRACK_BIT_RIGHT) DrawGroundSprite(rti->base_sprites.single_e | PALETTE_CRASH); - } - foreach_draw_tile_seq(dtss, t->seq) { image = dtss->image + relocation; image += offset;
--- a/train_cmd.c +++ b/train_cmd.c @@ -19,7 +19,6 @@ #include "player.h" #include "sound.h" #include "depot.h" -#include "debug.h" #include "waypoint.h" #include "vehicle_gui.h" #include "train.h" @@ -1552,81 +1551,10 @@ } } -static TileIndex GetVehicleTileOutOfTunnel(const Vehicle* v, bool reverse) -{ - TileIndex tile; - byte direction = (!reverse) ? DirToDiagdir(v->direction) : ReverseDiagdir(v->direction >> 1); - TileIndexDiff delta = TileOffsByDir(direction); - - if (v->u.rail.track != 0x40) return v->tile; - - for (tile = v->tile;; tile += delta) { - if (IsTunnelTile(tile) && GB(_m[tile].m5, 0, 2) != direction && GetTileZ(tile) == v->z_pos) - break; - } - return tile; -} - static void ReverseTrainDirection(Vehicle *v) { int l = 0, r = -1; Vehicle *u; - TileIndex tile; - Trackdir trackdir; - TileIndex pbs_end_tile = v->u.rail.pbs_end_tile; // these may be changed, and we may need - Trackdir pbs_end_trackdir = v->u.rail.pbs_end_trackdir; // the old values, so cache them - - u = GetLastVehicleInChain(v); - tile = GetVehicleTileOutOfTunnel(u, false); - trackdir = ReverseTrackdir(GetVehicleTrackdir(u)); - - if (PBSTileReserved(tile) & (1 << TrackdirToTrack(trackdir))) { - NPFFindStationOrTileData fstd; - NPFFoundTargetData ftd; - - NPFFillWithOrderData(&fstd, v); - - tile = GetVehicleTileOutOfTunnel(u, true); - - DEBUG(pbs, 2) ("pbs: (%i) choose reverse (RV), tile:%x, trackdir:%i",v->unitnumber, u->tile, trackdir); - ftd = NPFRouteToStationOrTile(tile, trackdir, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.railtype, PBS_MODE_ANY); - - if (ftd.best_trackdir == 0xFF) { - DEBUG(pbs, 0) ("pbs: (%i) no nodes encountered (RV)", v->unitnumber); - CLRBIT(v->u.rail.flags, VRF_REVERSING); - return; - } - - // we found a way out of the pbs block - if (NPFGetFlag(&ftd.node, NPF_FLAG_PBS_EXIT)) { - if (NPFGetFlag(&ftd.node, NPF_FLAG_PBS_BLOCKED)) { - CLRBIT(v->u.rail.flags, VRF_REVERSING); - return; - } - } - - v->u.rail.pbs_end_tile = ftd.node.tile; - v->u.rail.pbs_end_trackdir = ftd.node.direction; - } - - tile = GetVehicleTileOutOfTunnel(v, false); - trackdir = GetVehicleTrackdir(v); - - if (v->u.rail.pbs_status == PBS_STAT_HAS_PATH) { - TileIndex tile = AddTileIndexDiffCWrap(v->tile, TileIndexDiffCByDir(TrackdirToExitdir(trackdir))); - uint32 ts; - assert(tile != INVALID_TILE); - ts = GetTileTrackStatus(tile, TRANSPORT_RAIL); - ts &= TrackdirReachesTrackdirs(trackdir); - assert(ts != 0 && KillFirstBit2x64(ts) == 0); - trackdir = FindFirstBit2x64(ts); - PBSClearPath(tile, trackdir, pbs_end_tile, pbs_end_trackdir); - v->u.rail.pbs_status = PBS_STAT_NONE; - } else if (PBSTileReserved(tile) & (1 << TrackdirToTrack(trackdir))) { - PBSClearPath(tile, trackdir, pbs_end_tile, pbs_end_trackdir); - if (v->u.rail.track != 0x40) - PBSReserveTrack(tile, trackdir & 7); - }; if (IsTileDepotType(v->tile, TRANSPORT_RAIL)) InvalidateWindow(WC_VEHICLE_DEPOT, v->tile); @@ -2040,8 +1968,6 @@ } if (v->u.rail.force_proceed == 0) { - Trackdir trackdir = GetVehicleTrackdir(v); - if (++v->load_unload_time_rem < 37) { InvalidateWindowClasses(WC_TRAINS_LIST); return true; @@ -2049,35 +1975,12 @@ v->load_unload_time_rem = 0; - if (PBSIsPbsSegment(v->tile, trackdir)) { - NPFFindStationOrTileData fstd; - NPFFoundTargetData ftd; - - if (PBSTileUnavail(v->tile) & (1 << trackdir)) return true; - - NPFFillWithOrderData(&fstd, v); - - DEBUG(pbs, 2) ("pbs: (%i) choose depot (DP), tile:%x, trackdir:%i",v->unitnumber, v->tile, trackdir); - ftd = NPFRouteToStationOrTile(v->tile, trackdir, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.railtype, PBS_MODE_GREEN); - - // we found a way out of the pbs block - if (NPFGetFlag(&ftd.node, NPF_FLAG_PBS_EXIT)) { - if (NPFGetFlag(&ftd.node, NPF_FLAG_PBS_BLOCKED) || NPFGetFlag(&ftd.node, NPF_FLAG_PBS_RED)) { - return true; - } else { - v->u.rail.pbs_end_tile = ftd.node.tile; - v->u.rail.pbs_end_trackdir = ftd.node.direction; - goto green; - } - } - } - if (UpdateSignalsOnSegment(v->tile, v->direction)) { InvalidateWindowClasses(WC_TRAINS_LIST); return true; } } -green: + VehicleServiceInDepot(v); InvalidateWindowClasses(WC_TRAINS_LIST); TrainPlayLeaveStationSound(v); @@ -2215,29 +2118,13 @@ NPFFindStationOrTileData fstd; NPFFoundTargetData ftd; Trackdir trackdir; - uint16 pbs_tracks; NPFFillWithOrderData(&fstd, v); /* The enterdir for the new tile, is the exitdir for the old tile */ trackdir = GetVehicleTrackdir(v); assert(trackdir != 0xff); - pbs_tracks = PBSTileReserved(tile); - pbs_tracks |= pbs_tracks << 8; - pbs_tracks &= TrackdirReachesTrackdirs(trackdir); - if (pbs_tracks || (v->u.rail.pbs_status == PBS_STAT_NEED_PATH)) { - DEBUG(pbs, 2) ("pbs: (%i) choosefromblock, tile_org:%x tile_dst:%x trackdir:%i pbs_tracks:%i",v->unitnumber, tile,tile - TileOffsByDir(enterdir), trackdir, pbs_tracks); - // clear the currently planned path - if (v->u.rail.pbs_status != PBS_STAT_NEED_PATH) PBSClearPath(tile, FindFirstBit2x64(pbs_tracks), v->u.rail.pbs_end_tile, v->u.rail.pbs_end_trackdir); - - // try to find a route to a green exit signal - ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.railtype, PBS_MODE_ANY); - - v->u.rail.pbs_end_tile = ftd.node.tile; - v->u.rail.pbs_end_trackdir = ftd.node.direction; - - } else - ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.railtype, PBS_MODE_NONE); + ftd = NPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.railtype); if (ftd.best_trackdir == 0xff) { /* We are already at our target. Just do something */ @@ -2317,8 +2204,7 @@ assert(trackdir != 0xff); assert(trackdir_rev != 0xff); - ftd = NPFRouteToStationOrTileTwoWay(v->tile, trackdir, last->tile, trackdir_rev, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.railtype, PBS_MODE_NONE); - + ftd = NPFRouteToStationOrTileTwoWay(v->tile, trackdir, last->tile, trackdir_rev, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.railtype); if (ftd.best_bird_dist != 0) { /* We didn't find anything, just keep on going straight ahead */ reverse_best = false; @@ -2906,7 +2792,7 @@ } else { /* is not inside depot */ - if ((prev == NULL) && (!TrainCheckIfLineEnds(v))) + if (!TrainCheckIfLineEnds(v)) return; r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y); @@ -2961,56 +2847,11 @@ } if (prev == NULL) { - byte trackdir; /* Currently the locomotive is active. Determine which one of the * available tracks to choose */ chosen_track = 1 << ChooseTrainTrack(v, gp.new_tile, enterdir, bits); assert(chosen_track & tracks); - trackdir = TrackEnterdirToTrackdir(FIND_FIRST_BIT(chosen_track), enterdir); - assert(trackdir != 0xff); - - if (PBSIsPbsSignal(gp.new_tile,trackdir) && PBSIsPbsSegment(gp.new_tile,trackdir)) { - // encountered a pbs signal, and possible a pbs block - DEBUG(pbs, 3) ("pbs: (%i) arrive AT signal, tile:%x pbs_stat:%i",v->unitnumber, gp.new_tile, v->u.rail.pbs_status); - - if (v->u.rail.pbs_status == PBS_STAT_NONE) { - // we havent planned a path already, so try to find one now - NPFFindStationOrTileData fstd; - NPFFoundTargetData ftd; - - NPFFillWithOrderData(&fstd, v); - - DEBUG(pbs, 2) ("pbs: (%i) choose signal (TC), tile:%x, trackdir:%i",v->unitnumber, gp.new_tile, trackdir); - ftd = NPFRouteToStationOrTile(gp.new_tile, trackdir, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.railtype, PBS_MODE_GREEN); - - if (v->u.rail.force_proceed != 0) - goto green_light; - - if (ftd.best_trackdir == 0xFF) - goto red_light; - - // we found a way out of the pbs block - if (NPFGetFlag(&ftd.node, NPF_FLAG_PBS_EXIT)) { - if (NPFGetFlag(&ftd.node, NPF_FLAG_PBS_BLOCKED) || NPFGetFlag(&ftd.node, NPF_FLAG_PBS_RED)) - goto red_light; - else { - v->u.rail.pbs_end_tile = ftd.node.tile; - v->u.rail.pbs_end_trackdir = ftd.node.direction; - goto green_light; - } - - }; - - } else { - // we have already planned a path through this pbs block - // on entering the block, we reset our status - v->u.rail.pbs_status = PBS_STAT_NONE; - goto green_light; - }; - DEBUG(pbs, 3) ("pbs: (%i) no green light found, or was no pbs-block",v->unitnumber); - }; - /* Check if it's a red signal and that force proceed is not clicked. */ if ( (tracks>>16)&chosen_track && v->u.rail.force_proceed == 0) goto red_light; } else { @@ -3019,9 +2860,6 @@ /* The wagon is active, simply follow the prev vehicle. */ chosen_track = (byte)(_matching_tracks[GetDirectionToVehicle(prev, gp.x, gp.y)] & bits); } -green_light: - if (v->next == NULL) - PBSClearTrack(gp.old_tile, FIND_FIRST_BIT(v->u.rail.track)); /* make sure chosen track is a valid track */ assert(chosen_track==1 || chosen_track==2 || chosen_track==4 || chosen_track==8 || chosen_track==16 || chosen_track==32); @@ -3050,12 +2888,12 @@ } if (IsFrontEngine(v)) - TrainMovedChangeSignals(gp.new_tile, enterdir); + TrainMovedChangeSignals(gp.new_tile, enterdir); /* Signals can only change when the first * (above) or the last vehicle moves. */ if (v->next == NULL) - TrainMovedChangeSignals(gp.old_tile, (enterdir) ^ 2); + TrainMovedChangeSignals(gp.old_tile, (enterdir) ^ 2); if (prev == NULL) { AffectSpeedByDirChange(v, chosen_dir); @@ -3164,17 +3002,6 @@ EndVehicleMove(v); DeleteVehicle(v); - // clear up reserved pbs tracks - if (PBSTileReserved(v->tile) & v->u.rail.track) { - if (v == u) { - PBSClearPath(v->tile, FIND_FIRST_BIT(v->u.rail.track), v->u.rail.pbs_end_tile, v->u.rail.pbs_end_trackdir); - PBSClearPath(v->tile, FIND_FIRST_BIT(v->u.rail.track) + 8, v->u.rail.pbs_end_tile, v->u.rail.pbs_end_trackdir); - }; - if (v->tile != u->tile) { - PBSClearTrack(v->tile, FIND_FIRST_BIT(v->u.rail.track)); - }; - } - if (!(v->u.rail.track & 0xC0)) SetSignalsOnBothDir(v->tile, FIND_FIRST_BIT(v->u.rail.track)); @@ -3302,7 +3129,6 @@ uint16 break_speed; DiagDirection t; uint32 ts; - byte trackdir; t = v->breakdown_ctr; if (t > 1) { @@ -3339,12 +3165,6 @@ // determine the track status on the next tile. ts = GetTileTrackStatus(tile, TRANSPORT_RAIL) & _reachable_tracks[t]; - // if there are tracks on the new tile, pick one (trackdir will only be used when its a signal tile, in which case only 1 trackdir is accessible for us) - if (ts & TRACKDIR_BIT_MASK) - trackdir = FindFirstBit2x64(ts & TRACKDIR_BIT_MASK); - else - trackdir = INVALID_TRACKDIR; - /* Calc position within the current tile ?? */ x = v->x_pos & 0xF; y = v->y_pos & 0xF; @@ -3400,28 +3220,6 @@ return false; } - if (v->u.rail.pbs_status == PBS_STAT_HAS_PATH) - return true; - - if ((trackdir != INVALID_TRACKDIR) && (PBSIsPbsSignal(tile,trackdir) && PBSIsPbsSegment(tile,trackdir)) && !(IsTileType(v->tile, MP_STATION) && (v->current_order.station == _m[v->tile].m2))) { - NPFFindStationOrTileData fstd; - NPFFoundTargetData ftd; - - NPFFillWithOrderData(&fstd, v); - - DEBUG(pbs, 2) ("pbs: (%i) choose signal (CEOL), tile:%x trackdir:%i", v->unitnumber, tile, trackdir); - ftd = NPFRouteToStationOrTile(tile, trackdir, &fstd, TRANSPORT_RAIL, v->owner, v->u.rail.railtype, PBS_MODE_GREEN); - - if (ftd.best_trackdir != 0xFF && NPFGetFlag(&ftd.node, NPF_FLAG_PBS_EXIT)) { - if (!(NPFGetFlag(&ftd.node, NPF_FLAG_PBS_BLOCKED) || NPFGetFlag(&ftd.node, NPF_FLAG_PBS_RED))) { - v->u.rail.pbs_status = PBS_STAT_HAS_PATH; - v->u.rail.pbs_end_tile = ftd.node.tile; - v->u.rail.pbs_end_trackdir = ftd.node.direction; - return true; - } - }; - }; - // slow down v->vehstatus |= VS_TRAIN_SLOWING; break_speed = _breakdown_speeds[x & 0xF]; @@ -3578,8 +3376,6 @@ const Depot* depot; TrainFindDepotData tfdd; - if (PBSTileReserved(v->tile) & v->u.rail.track) return; - if (v->u.rail.pbs_status == PBS_STAT_HAS_PATH) return; if (_patches.servint_trains == 0) return; if (!VehicleNeedsService(v)) return; if (v->vehstatus & VS_STOPPED) return;
--- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -18,8 +18,6 @@ #include "player.h" #include "town.h" #include "sound.h" -#include "pbs.h" -#include "debug.h" #include "variables.h" #include "bridge.h" #include "train.h" @@ -204,7 +202,6 @@ uint i; int32 cost, terraformcost, ret; bool allow_on_slopes; - bool reserved = false; SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); @@ -352,7 +349,6 @@ if (ti.map5 != 1) goto not_valid_below; } m5 = 0xE0; - reserved = PBSTileReserved(ti.tile) != 0; } else if (ti.type == MP_STREET) { if (direction == 0) { if (ti.map5 != 5) goto not_valid_below; @@ -402,16 +398,6 @@ _m[ti.tile].m2 = (bridge_type << 4) | m5; SB(_m[ti.tile].m3, 4, 4, railtype); - if (ti.type == MP_RAILWAY) { - // Set or clear PBS reservation status. direction here is of - // the bridge, not the track below. - if (reserved) { - PBSReserveTrack(ti.tile, direction ? TRACK_DIAG1 : TRACK_DIAG2); - } else { - PBSClearTrack(ti.tile, direction ? TRACK_DIAG1 : TRACK_DIAG2); - } - } - MarkTileDirtyByTile(ti.tile); } } @@ -807,7 +793,6 @@ byte m5; uint c = tile; uint16 new_data; - byte pbs; //checks if the owner is town then decrease town rating by RATING_TUNNEL_BRIDGE_DOWN_STEP until // you have a "Poor" (0) town rating @@ -816,7 +801,6 @@ do { m5 = _m[c].m5; - pbs = PBSTileReserved(c); if (m5 & 0x40) { if (m5 & 0x20) { @@ -831,8 +815,6 @@ _m[c].m5 = (byte)new_data; _m[c].m2 = 0; _m[c].m4 &= 0x0F; - if (direction ? HASBIT(pbs,0) : HASBIT(pbs,1)) - PBSReserveTrack(c, direction ? 0 : 1); MarkTileDirtyByTile(c); @@ -1212,16 +1194,6 @@ } } } - - if (_debug_pbs_level >= 1) { - byte pbs = PBSTileReserved(ti->tile); - if (pbs & TRACK_BIT_DIAG1) DrawGroundSprite(0x3ED | PALETTE_CRASH); - if (pbs & TRACK_BIT_DIAG2) DrawGroundSprite(0x3EE | PALETTE_CRASH); - if (pbs & TRACK_BIT_UPPER) DrawGroundSprite(0x3EF | PALETTE_CRASH); - if (pbs & TRACK_BIT_LOWER) DrawGroundSprite(0x3F0 | PALETTE_CRASH); - if (pbs & TRACK_BIT_LEFT) DrawGroundSprite(0x3F2 | PALETTE_CRASH); - if (pbs & TRACK_BIT_RIGHT) DrawGroundSprite(0x3F1 | PALETTE_CRASH); - } } static uint GetSlopeZ_TunnelBridge(const TileInfo* ti) @@ -1504,8 +1476,6 @@ return 0; } if (fc == _tunnel_fractcoord_2[dir]) { - if (v->next == NULL) - PBSClearTrack(v->tile, FIND_FIRST_BIT(v->u.rail.track)); v->tile = tile; v->u.rail.track = 0x40; v->vehstatus |= VS_HIDDEN;
--- a/variables.h +++ b/variables.h @@ -87,7 +87,6 @@ bool modified_catchment; //different-size catchment areas bool vehicle_speed; // show vehicle speed bool build_on_slopes; // allow building on slopes - bool auto_pbs_placement;// automatic pbs signal placement bool mammoth_trains; // allow very long trains bool join_stations; // allow joining of train stations bool full_load_any; // new full load calculation, any cargo must be full
--- a/vehicle.c +++ b/vehicle.c @@ -2122,11 +2122,8 @@ SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,flags), SLE_UINT8, 2, 255), SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,days_since_order_progr), SLE_UINT16, 2, 255), - SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,pbs_status), SLE_UINT8, 2, 255), - SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,pbs_end_tile), SLE_UINT32, 2, 255), - SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,pbs_end_trackdir), SLE_UINT8, 2, 255), - - SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, 2, 2, 255), + // reserve extra space in savegame here. (currently 8 bytes) + SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, 8, 2, 255), SLE_CONDREFX(offsetof(Vehicle,u)+offsetof(VehicleRail,other_multiheaded_part), REF_VEHICLE, 2, 19), // added with 17.1, but was blank since 2. Removed in 20 // reserve extra space in savegame here. (currently 3 bytes)
--- a/vehicle.h +++ b/vehicle.h @@ -74,10 +74,6 @@ byte flags; - byte pbs_status; - TileIndex pbs_end_tile; - Trackdir pbs_end_trackdir; - // Link between the two ends of a multiheaded engine Vehicle *other_multiheaded_part; } VehicleRail;
--- a/waypoint.c +++ b/waypoint.c @@ -14,7 +14,6 @@ #include "town.h" #include "waypoint.h" #include "variables.h" -#include "pbs.h" #include "table/sprites.h" #include "table/strings.h" @@ -209,7 +208,6 @@ if (flags & DC_EXEC) { const StationSpec *spec = NULL; - bool reserved = PBSTileReserved(tile) != 0; ModifyTile(tile, MP_MAP2 | MP_MAP5, wp->index, RAIL_TYPE_WAYPOINT | dir); if (GB(p1, 0, 8) < GetNumCustomStations(STAT_CLASS_WAYP)) @@ -228,12 +226,6 @@ wp->localidx = 0; } - if (reserved) { - PBSReserveTrack(tile, dir); - } else { - PBSClearTrack(tile, dir); - } - wp->deleted = 0; wp->xy = tile; wp->build_date = _date; @@ -302,15 +294,9 @@ RedrawWaypointSign(wp); if (justremove) { - bool reserved = PBSTileReserved(tile) != 0; ModifyTile(tile, MP_MAP2_CLEAR | MP_MAP5, 1<<direction); CLRBIT(_m[tile].m3, 4); _m[tile].m4 = 0; - if (reserved) { - PBSReserveTrack(tile, direction); - } else { - PBSClearTrack(tile, direction); - } } else { DoClearSquare(tile); SetSignalsOnBothDir(tile, direction);