From b935cb84156f18b51196288ff6d12f8ca5b26630 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 3 Mar 2014 19:32:53 +0000 Subject: [PATCH] (svn r26387) -Cleanup (r26173): No need to manually clear registers before resolving. --- src/newgrf_spritegroup.h | 11 ----------- src/newgrf_station.cpp | 3 ++- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h index e6eb4fbcbd..c3753dcfdb 100644 --- a/src/newgrf_spritegroup.h +++ b/src/newgrf_spritegroup.h @@ -33,17 +33,6 @@ static inline uint32 GetRegister(uint i) return _temp_store.GetValue(i); } -/** - * Clears the value of a so-called newgrf "register". - * @param i index of the register - * @pre i < 0x110 - */ -static inline void ClearRegister(uint i) -{ - extern TemporaryStorageArray _temp_store; - _temp_store.StoreValue(i, 0); -} - /* List of different sprite group types */ enum SpriteGroupType { SGT_REAL, diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index 9cdded6204..85277337de 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -637,9 +637,10 @@ SpriteID GetCustomStationFoundationRelocation(const StationSpec *statspec, BaseS /* callback_param1 == 2 means we are resolving the foundation sprites. */ StationResolverObject object(statspec, st, tile, CBID_NO_CALLBACK, 2, layout | (edge_info << 16)); - ClearRegister(0x100); const SpriteGroup *group = ResolveStation(object); if (group == NULL || group->type != SGT_RESULT) return 0; + + /* Note: SpriteGroup::Resolve zeroes all registers, so register 0x100 is initialised to 0. (compatibility) */ return group->GetResult() + GetRegister(0x100); }