mirror of https://github.com/OpenTTD/OpenTTD
(svn r2696) Remove stray semicolons
parent
e36506b1d1
commit
23c20173b1
4
npf.c
4
npf.c
|
@ -70,7 +70,7 @@ bool IsEndOfLine(TileIndex tile, Trackdir trackdir, RailType enginetype)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static uint NTPHash(uint key1, uint key2)
|
static uint NTPHash(uint key1, uint key2)
|
||||||
|
@ -127,7 +127,7 @@ static TileIndex CalcClosestStationTile(StationID station, TileIndex tile)
|
||||||
|
|
||||||
// return the tile of our target coordinates
|
// return the tile of our target coordinates
|
||||||
return TileXY(x, y);
|
return TileXY(x, y);
|
||||||
};
|
}
|
||||||
|
|
||||||
/* On PBS pathfinding runs, this is called before pathfinding ends (BeforeExit aystar callback), and will
|
/* On PBS pathfinding runs, this is called before pathfinding ends (BeforeExit aystar callback), and will
|
||||||
* reserve the appropriate tracks, if needed. */
|
* reserve the appropriate tracks, if needed. */
|
||||||
|
|
28
pbs.c
28
pbs.c
|
@ -40,7 +40,7 @@ static const byte encrt_to_reserved[16] = {
|
||||||
* to the track(dir)s that are unavailable due to reservations.
|
* to the track(dir)s that are unavailable due to reservations.
|
||||||
* 0xFFFF are invalid entries and should never be accessed.
|
* 0xFFFF are invalid entries and should never be accessed.
|
||||||
*/
|
*/
|
||||||
static const int16 encrt_to_unavail[16] = {
|
static const uint16 encrt_to_unavail[16] = {
|
||||||
0x0000, 0x3F3F, 0x3F3F, 0x3737, 0x3B3B, 0x1F1F, 0x2F2F, 0xFFFF,
|
0x0000, 0x3F3F, 0x3F3F, 0x3737, 0x3B3B, 0x1F1F, 0x2F2F, 0xFFFF,
|
||||||
0xFFFF, 0xFFFF, 0xFFFF, 0x3F3F, 0x3F3F, 0x3F3F, 0x3F3F, 0xFFFF
|
0xFFFF, 0xFFFF, 0xFFFF, 0x3F3F, 0x3F3F, 0x3F3F, 0x3F3F, 0xFFFF
|
||||||
};
|
};
|
||||||
|
@ -79,7 +79,7 @@ void PBSReserveTrack(TileIndex tile, Track track) {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
// if debugging, mark tile dirty to show reserved status
|
// if debugging, mark tile dirty to show reserved status
|
||||||
if (_debug_pbs_level >= 1)
|
if (_debug_pbs_level >= 1)
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
|
@ -100,7 +100,7 @@ byte PBSTileReserved(TileIndex tile) {
|
||||||
byte res = encrt_to_reserved[(_m[tile].m4 & 0xF0) >> 4];
|
byte res = encrt_to_reserved[(_m[tile].m4 & 0xF0) >> 4];
|
||||||
assert(res != 0xFF);
|
assert(res != 0xFF);
|
||||||
return res;
|
return res;
|
||||||
};
|
}
|
||||||
case MP_TUNNELBRIDGE:
|
case MP_TUNNELBRIDGE:
|
||||||
return (_m[tile].m4 & 3);
|
return (_m[tile].m4 & 3);
|
||||||
case MP_STATION:
|
case MP_STATION:
|
||||||
|
@ -117,8 +117,8 @@ byte PBSTileReserved(TileIndex tile) {
|
||||||
return HASBIT(_m[tile].m5, 3) ? 1 : 2;
|
return HASBIT(_m[tile].m5, 3) ? 1 : 2;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
uint16 PBSTileUnavail(TileIndex tile) {
|
uint16 PBSTileUnavail(TileIndex tile) {
|
||||||
assert(IsValidTile(tile));
|
assert(IsValidTile(tile));
|
||||||
|
@ -132,7 +132,7 @@ uint16 PBSTileUnavail(TileIndex tile) {
|
||||||
uint16 res = encrt_to_unavail[(_m[tile].m4 & 0xF0) >> 4];
|
uint16 res = encrt_to_unavail[(_m[tile].m4 & 0xF0) >> 4];
|
||||||
assert(res != 0xFFFF);
|
assert(res != 0xFFFF);
|
||||||
return res;
|
return res;
|
||||||
};
|
}
|
||||||
case MP_TUNNELBRIDGE:
|
case MP_TUNNELBRIDGE:
|
||||||
return (_m[tile].m4 & 3) | ((_m[tile].m4 & 3) << 8);
|
return (_m[tile].m4 & 3) | ((_m[tile].m4 & 3) << 8);
|
||||||
case MP_STATION:
|
case MP_STATION:
|
||||||
|
@ -144,8 +144,8 @@ uint16 PBSTileUnavail(TileIndex tile) {
|
||||||
return (HASBIT(_m[tile].m5, 0)) ? TRACKDIR_BIT_MASK : 0;
|
return (HASBIT(_m[tile].m5, 0)) ? TRACKDIR_BIT_MASK : 0;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
void PBSClearTrack(TileIndex tile, Track track) {
|
void PBSClearTrack(TileIndex tile, Track track) {
|
||||||
assert(IsValidTile(tile));
|
assert(IsValidTile(tile));
|
||||||
|
@ -183,11 +183,11 @@ void PBSClearTrack(TileIndex tile, Track track) {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
// if debugging, mark tile dirty to show reserved status
|
// if debugging, mark tile dirty to show reserved status
|
||||||
if (_debug_pbs_level >= 1)
|
if (_debug_pbs_level >= 1)
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
};
|
}
|
||||||
|
|
||||||
void PBSClearPath(TileIndex tile, Trackdir trackdir, TileIndex end_tile, Trackdir end_trackdir) {
|
void PBSClearPath(TileIndex tile, Trackdir trackdir, TileIndex end_tile, Trackdir end_trackdir) {
|
||||||
uint16 res;
|
uint16 res;
|
||||||
|
@ -209,7 +209,7 @@ void PBSClearPath(TileIndex tile, Trackdir trackdir, TileIndex end_tile, Trackdi
|
||||||
} else {
|
} else {
|
||||||
byte exitdir = TrackdirToExitdir(trackdir);
|
byte exitdir = TrackdirToExitdir(trackdir);
|
||||||
tile = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(exitdir));
|
tile = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDir(exitdir));
|
||||||
};
|
}
|
||||||
|
|
||||||
res = PBSTileReserved(tile);
|
res = PBSTileReserved(tile);
|
||||||
res |= res << 8;
|
res |= res << 8;
|
||||||
|
@ -217,7 +217,7 @@ void PBSClearPath(TileIndex tile, Trackdir trackdir, TileIndex end_tile, Trackdi
|
||||||
trackdir = FindFirstBit2x64(res);
|
trackdir = FindFirstBit2x64(res);
|
||||||
|
|
||||||
} while (res != 0);
|
} while (res != 0);
|
||||||
};
|
}
|
||||||
|
|
||||||
bool PBSIsPbsSignal(TileIndex tile, Trackdir trackdir)
|
bool PBSIsPbsSignal(TileIndex tile, Trackdir trackdir)
|
||||||
{
|
{
|
||||||
|
@ -240,7 +240,7 @@ bool PBSIsPbsSignal(TileIndex tile, Trackdir trackdir)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
};
|
}
|
||||||
|
|
||||||
typedef struct SetSignalsDataPbs {
|
typedef struct SetSignalsDataPbs {
|
||||||
int cur;
|
int cur;
|
||||||
|
@ -285,7 +285,7 @@ bool PBSIsPbsSegment(uint tile, Trackdir trackdir)
|
||||||
if (!PBSIsPbsSignal(tile, bit) && !PBSIsPbsSignal(tile, bit | 8))
|
if (!PBSIsPbsSignal(tile, bit) && !PBSIsPbsSignal(tile, bit | 8))
|
||||||
return false;
|
return false;
|
||||||
result = true;
|
result = true;
|
||||||
};
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1310,7 +1310,7 @@ TileIndex GetVehicleTileOutOfTunnel(const Vehicle *v, bool reverse)
|
||||||
}
|
}
|
||||||
return tile;
|
return tile;
|
||||||
|
|
||||||
};
|
}
|
||||||
|
|
||||||
static void ReverseTrainDirection(Vehicle *v)
|
static void ReverseTrainDirection(Vehicle *v)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue