(svn r27984) -Codechange: Make ScopeResolver constructors/destructors inlineable. Speedup sprite resolving by about 8 percent.

This commit is contained in:
frosch
2018-03-11 13:19:41 +00:00
parent 7c406f0d9d
commit d9d669dcf8
23 changed files with 145 additions and 220 deletions

View File

@@ -83,13 +83,6 @@ static inline uint32 GetVariable(const ResolverObject &object, ScopeResolver *sc
}
}
ScopeResolver::ScopeResolver(ResolverObject &ro)
: ro(ro)
{
}
ScopeResolver::~ScopeResolver() {}
/**
* Get a few random bits. Default implementation has no random bits.
* @return Random bits.
@@ -129,27 +122,6 @@ ScopeResolver::~ScopeResolver() {}
*/
/* virtual */ void ScopeResolver::StorePSA(uint reg, int32 value) {}
/**
* Resolver constructor.
* @param grffile NewGRF file associated with the object (or \c NULL if none).
* @param callback Callback code being resolved (default value is #CBID_NO_CALLBACK).
* @param callback_param1 First parameter (var 10) of the callback (only used when \a callback is also set).
* @param callback_param2 Second parameter (var 18) of the callback (only used when \a callback is also set).
*/
ResolverObject::ResolverObject(const GRFFile *grffile, CallbackID callback, uint32 callback_param1, uint32 callback_param2)
: default_scope(*this)
{
this->callback = callback;
this->callback_param1 = callback_param1;
this->callback_param2 = callback_param2;
this->ResetState();
this->grffile = grffile;
this->root_spritegroup = NULL;
}
ResolverObject::~ResolverObject() {}
/**
* Get the real sprites of the grf.
* @param group Group to get.