summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-11-24 14:41:19 +0000
committerfrosch <frosch@openttd.org>2013-11-24 14:41:19 +0000
commitdb894b0b3fa13413cdb76989cfcd2bb789243b77 (patch)
treefd61e4df264893e0c41b0d989f3294c3b4909b63 /src/newgrf_industrytiles.cpp
parent45a5aba8d55c68f54885c1de27684e8544e111d9 (diff)
downloadopenttd-db894b0b3fa13413cdb76989cfcd2bb789243b77.tar.xz
(svn r26085) -Codechange: Pass ResolverObjects as reference instead of pointer since they are never NULL.
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 65e3c530d..965c55d49 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -78,7 +78,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 == NULL ? (IndustryID)INVALID_INDUSTRY : this->industry->index, true, this->ro.grffile->grf_version >= 8);
/* Animation stage of nearby tiles */
case 0x61: {
@@ -90,7 +90,7 @@ uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
}
/* Get industry tile ID at offset */
- case 0x62: return GetIndustryIDAtOffset(GetNearbyTile(parameter, this->tile), this->industry, this->ro->grffile->grfid);
+ case 0x62: return GetIndustryIDAtOffset(GetNearbyTile(parameter, this->tile), this->industry, this->ro.grffile->grfid);
}
DEBUG(grf, 1, "Unhandled industry tile variable 0x%X", variable);
@@ -144,8 +144,8 @@ static const GRFFile *GetIndTileGrffile(IndustryGfx gfx)
IndustryTileResolverObject::IndustryTileResolverObject(IndustryGfx gfx, TileIndex tile, Industry *indus,
CallbackID callback, uint32 callback_param1, uint32 callback_param2)
: ResolverObject(GetIndTileGrffile(gfx), callback, callback_param1, callback_param2),
- indtile_scope(this, indus, tile),
- ind_scope(this, tile, indus, indus->type)
+ indtile_scope(*this, indus, tile),
+ ind_scope(*this, tile, indus, indus->type)
{
}
@@ -155,7 +155,7 @@ IndustryTileResolverObject::IndustryTileResolverObject(IndustryGfx gfx, TileInde
* @param industry %Industry owning the tile.
* @param tile %Tile of the industry.
*/
-IndustryTileScopeResolver::IndustryTileScopeResolver(ResolverObject *ro, Industry *industry, TileIndex tile) : ScopeResolver(ro)
+IndustryTileScopeResolver::IndustryTileScopeResolver(ResolverObject &ro, Industry *industry, TileIndex tile) : ScopeResolver(ro)
{
this->industry = industry;
this->tile = tile;
@@ -190,7 +190,7 @@ uint16 GetIndustryTileCallback(CallbackID callback, uint32 param1, uint32 param2
assert(industry->index == INVALID_INDUSTRY || IsTileType(tile, MP_INDUSTRY));
IndustryTileResolverObject object(gfx_id, tile, industry, callback, param1, param2);
- const SpriteGroup *group = SpriteGroup::Resolve(GetIndustryTileSpec(gfx_id)->grf_prop.spritegroup[0], &object);
+ const SpriteGroup *group = SpriteGroup::Resolve(GetIndustryTileSpec(gfx_id)->grf_prop.spritegroup[0], object);
if (group == NULL || group->type != SGT_CALLBACK) return CALLBACK_FAILED;
return group->GetCallbackResult();
@@ -211,7 +211,7 @@ bool DrawNewIndustryTile(TileInfo *ti, Industry *i, IndustryGfx gfx, const Indus
IndustryTileResolverObject object(gfx, ti->tile, i);
- const SpriteGroup *group = SpriteGroup::Resolve(inds->grf_prop.spritegroup[0], &object);
+ const SpriteGroup *group = SpriteGroup::Resolve(inds->grf_prop.spritegroup[0], object);
if (group == NULL || group->type != SGT_TILELAYOUT) return false;
/* Limit the building stage to the number of stages supplied. */
@@ -328,7 +328,7 @@ static void DoTriggerIndustryTile(TileIndex tile, IndustryTileTrigger trigger, I
IndustryTileResolverObject object(gfx, tile, ind, CBID_RANDOM_TRIGGER);
object.trigger = trigger;
- const SpriteGroup *group = SpriteGroup::Resolve(itspec->grf_prop.spritegroup[0], &object);
+ const SpriteGroup *group = SpriteGroup::Resolve(itspec->grf_prop.spritegroup[0], object);
if (group == NULL) return;
byte new_random_bits = Random();