diff options
author | Henry Wilson <m3henry@googlemail.com> | 2019-04-10 22:07:06 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-04-10 23:22:20 +0200 |
commit | 7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch) | |
tree | 99f134b7e66367cf11e10bc5061896eab4a3264f /src/newgrf_airporttiles.cpp | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/newgrf_airporttiles.cpp')
-rw-r--r-- | src/newgrf_airporttiles.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/newgrf_airporttiles.cpp b/src/newgrf_airporttiles.cpp index 2d3a5129c..42f4f1d36 100644 --- a/src/newgrf_airporttiles.cpp +++ b/src/newgrf_airporttiles.cpp @@ -149,7 +149,7 @@ static uint32 GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32 } } /* Not an 'old type' tile */ - if (ats->grf_prop.spritegroup[0] != NULL) { // tile has a spritegroup ? + if (ats->grf_prop.spritegroup[0] != nullptr) { // tile has a spritegroup ? if (ats->grf_prop.grffile->grfid == cur_grfid) { // same airport, same grf ? return ats->grf_prop.local_id; } else { @@ -162,7 +162,7 @@ static uint32 GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32 /* virtual */ uint32 AirportTileScopeResolver::GetVariable(byte variable, uint32 parameter, bool *available) const { - assert(this->st != NULL); + assert(this->st != nullptr); extern uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile); @@ -203,14 +203,14 @@ static uint32 GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32 /* virtual */ uint32 AirportTileScopeResolver::GetRandomBits() const { - return (this->st == NULL ? 0 : this->st->random_bits) | (this->tile == INVALID_TILE ? 0 : GetStationTileRandomBits(this->tile) << 16); + return (this->st == nullptr ? 0 : this->st->random_bits) | (this->tile == INVALID_TILE ? 0 : GetStationTileRandomBits(this->tile) << 16); } /** * Constructor of the resolver for airport tiles. * @param ats Specification of the airport tiles. * @param tile %Tile for the callback, only valid for airporttile callbacks. - * @param st Station of the airport for which the callback is run, or \c NULL for build gui. + * @param st Station of the airport for which the callback is run, or \c nullptr for build gui. * @param callback Callback ID. * @param callback_param1 First parameter (var 10) of the callback. * @param callback_param2 Second parameter (var 18) of the callback. @@ -230,7 +230,7 @@ uint16 GetAirportTileCallback(CallbackID callback, uint32 param1, uint32 param2, static void AirportDrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGroup *group, byte colour, StationGfx gfx) { - const DrawTileSprites *dts = group->ProcessRegisters(NULL); + const DrawTileSprites *dts = group->ProcessRegisters(nullptr); SpriteID image = dts->ground.sprite; SpriteID pal = dts->ground.pal; @@ -261,7 +261,7 @@ bool DrawNewAirportTile(TileInfo *ti, Station *st, StationGfx gfx, const Airport AirportTileResolverObject object(airts, ti->tile, st); const SpriteGroup *group = object.Resolve(); - if (group == NULL || group->type != SGT_TILELAYOUT) { + if (group == nullptr || group->type != SGT_TILELAYOUT) { return false; } @@ -282,7 +282,7 @@ struct AirportTileAnimationBase : public AnimationBase<AirportTileAnimationBase, void AnimateAirportTile(TileIndex tile) { const AirportTileSpec *ats = AirportTileSpec::GetByTile(tile); - if (ats == NULL) return; + if (ats == nullptr) return; AirportTileAnimationBase::AnimateTile(ats, Station::GetByTile(tile), tile, HasBit(ats->animation_special_flags, 0)); } |