comparison src/openttd.cpp @ 9790:f5b8e5291165 draft

(svn r13932) -Add [YAPP]: PBS signals added to the map array. The signals are drawn using the old Patch-like PBS sprites. (michi_cc)
author rubidium <rubidium@openttd.org>
date Sat, 02 Aug 2008 22:48:43 +0000
parents 6d3372e45a23
children b849464ebe27
comparison
equal deleted inserted replaced
9789:a650fef48373 9790:f5b8e5291165
2462 } 2462 }
2463 } 2463 }
2464 } 2464 }
2465 } 2465 }
2466 2466
2467 /* Move the signal variant back up one bit for PBS. We don't convert the old PBS
2468 * format here, as an old layout wouldn't work properly anyway. To be safe, we
2469 * clear any possible PBS reservations as well. */
2470 if (CheckSavegameVersion(100)) {
2471 for (TileIndex t = 0; t < map_size; t++) {
2472 switch (GetTileType(t)) {
2473 case MP_RAILWAY:
2474 if (HasSignals(t)) {
2475 /* move the signal variant */
2476 SetSignalVariant(t, TRACK_UPPER, HasBit(_m[t].m2, 2) ? SIG_SEMAPHORE : SIG_ELECTRIC);
2477 SetSignalVariant(t, TRACK_LOWER, HasBit(_m[t].m2, 6) ? SIG_SEMAPHORE : SIG_ELECTRIC);
2478 ClrBit(_m[t].m2, 2);
2479 ClrBit(_m[t].m2, 6);
2480 }
2481
2482 /* Clear PBS reservation on track */
2483 if (IsRailDepot(t) ||IsRailWaypoint(t)) {
2484 SetDepotWaypointReservation(t, false);
2485 } else {
2486 SetTrackReservation(t, TRACK_BIT_NONE);
2487 }
2488 break;
2489
2490 case MP_ROAD: /* Clear PBS reservation on crossing */
2491 if (IsLevelCrossing(t)) SetCrossingReservation(t, false);
2492 break;
2493
2494 case MP_STATION: /* Clear PBS reservation on station */
2495 if (IsRailwayStation(t)) SetRailwayStationReservation(t, false);
2496 break;
2497
2498 case MP_TUNNELBRIDGE: /* Clear PBS reservation on tunnels/birdges */
2499 if (GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL) SetTunnelBridgeReservation(t, false);
2500 break;
2501
2502 default: break;
2503 }
2504 }
2505 }
2506
2467 GamelogPrintDebug(1); 2507 GamelogPrintDebug(1);
2468 2508
2469 return InitializeWindowsAndCaches(); 2509 return InitializeWindowsAndCaches();
2470 } 2510 }
2471 2511