Changeset - r21298:c09c5ce22fcd
[Not reviewed]
master
0 2 0
frosch - 10 years ago 2014-03-03 19:32:53
frosch@openttd.org
(svn r26387) -Cleanup (r26173): No need to manually clear registers before resolving.
2 files changed with 2 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/newgrf_spritegroup.h
Show inline comments
 
@@ -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<int32, 0x110> _temp_store;
 
	_temp_store.StoreValue(i, 0);
 
}
 

	
 
/* List of different sprite group types */
 
enum SpriteGroupType {
 
	SGT_REAL,
src/newgrf_station.cpp
Show inline comments
 
@@ -637,9 +637,10 @@ SpriteID GetCustomStationFoundationReloc
 
	/* 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);
 
}
 

	
0 comments (0 inline, 0 general)