summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-04-10 22:07:06 +0100
committerMichael Lutz <michi@icosahedron.de>2019-04-10 23:22:20 +0200
commit7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch)
tree99f134b7e66367cf11e10bc5061896eab4a3264f /src/newgrf_industrytiles.cpp
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 0b2a55000..5a8794564 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -80,7 +80,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
/* Land info of nearby tiles */
case 0x60: return GetNearbyIndustryTileInformation(parameter, this->tile,
- this->industry == NULL ? (IndustryID)INVALID_INDUSTRY : this->industry->index, true, this->ro.grffile->grf_version >= 8);
+ this->industry == nullptr ? (IndustryID)INVALID_INDUSTRY : this->industry->index, true, this->ro.grffile->grf_version >= 8);
/* Animation stage of nearby tiles */
case 0x61: {
@@ -103,7 +103,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
/* virtual */ uint32 IndustryTileScopeResolver::GetRandomBits() const
{
- assert(this->industry != NULL && IsValidTile(this->tile));
+ assert(this->industry != nullptr && IsValidTile(this->tile));
assert(this->industry->index == INVALID_INDUSTRY || IsTileType(this->tile, MP_INDUSTRY));
return (this->industry->index != INVALID_INDUSTRY) ? GetIndustryRandomBits(this->tile) : 0;
@@ -111,7 +111,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
/* virtual */ uint32 IndustryTileScopeResolver::GetTriggers() const
{
- assert(this->industry != NULL && IsValidTile(this->tile));
+ assert(this->industry != nullptr && IsValidTile(this->tile));
assert(this->industry->index == INVALID_INDUSTRY || IsTileType(this->tile, MP_INDUSTRY));
if (this->industry->index == INVALID_INDUSTRY) return 0;
return GetIndustryTriggers(this->tile);
@@ -125,7 +125,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
static const GRFFile *GetIndTileGrffile(IndustryGfx gfx)
{
const IndustryTileSpec *its = GetIndustryTileSpec(gfx);
- return (its != NULL) ? its->grf_prop.grffile : NULL;
+ return (its != nullptr) ? its->grf_prop.grffile : nullptr;
}
/**
@@ -171,7 +171,7 @@ static void IndustryDrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGro
uint16 GetIndustryTileCallback(CallbackID callback, uint32 param1, uint32 param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile)
{
- assert(industry != NULL && IsValidTile(tile));
+ assert(industry != nullptr && IsValidTile(tile));
assert(industry->index == INVALID_INDUSTRY || IsTileType(tile, MP_INDUSTRY));
IndustryTileResolverObject object(gfx_id, tile, industry, callback, param1, param2);
@@ -194,7 +194,7 @@ bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const Indus
IndustryTileResolverObject object(gfx, ti->tile, i);
const SpriteGroup *group = object.Resolve();
- if (group == NULL || group->type != SGT_TILELAYOUT) return false;
+ if (group == nullptr || group->type != SGT_TILELAYOUT) return false;
/* Limit the building stage to the number of stages supplied. */
const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
@@ -259,7 +259,7 @@ struct IndustryAnimationBase : public AnimationBase<IndustryAnimationBase, Indus
void AnimateNewIndustryTile(TileIndex tile)
{
const IndustryTileSpec *itspec = GetIndustryTileSpec(GetIndustryGfx(tile));
- if (itspec == NULL) return;
+ if (itspec == nullptr) return;
IndustryAnimationBase::AnimateTile(itspec, Industry::GetByTile(tile), tile, (itspec->special_flags & INDTILE_SPECIAL_NEXTFRAME_RANDOMBITS) != 0);
}
@@ -305,14 +305,14 @@ static void DoTriggerIndustryTile(TileIndex tile, IndustryTileTrigger trigger, I
IndustryGfx gfx = GetIndustryGfx(tile);
const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx);
- if (itspec->grf_prop.spritegroup[0] == NULL) return;
+ if (itspec->grf_prop.spritegroup[0] == nullptr) return;
IndustryTileResolverObject object(gfx, tile, ind, CBID_RANDOM_TRIGGER);
object.waiting_triggers = GetIndustryTriggers(tile) | trigger;
SetIndustryTriggers(tile, object.waiting_triggers); // store now for var 5F
const SpriteGroup *group = object.Resolve();
- if (group == NULL) return;
+ if (group == nullptr) return;
/* Store remaining triggers. */
SetIndustryTriggers(tile, object.GetRemainingTriggers());
@@ -335,7 +335,7 @@ static void DoTriggerIndustryTile(TileIndex tile, IndustryTileTrigger trigger, I
*/
static void DoReseedIndustry(Industry *ind, uint32 reseed)
{
- if (reseed == 0 || ind == NULL) return;
+ if (reseed == 0 || ind == nullptr) return;
uint16 random_bits = Random();
ind->random &= reseed;