diff options
author | frosch <frosch@openttd.org> | 2018-03-11 13:19:41 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2018-03-11 13:19:41 +0000 |
commit | d9d669dcf855e444a77141b4b96e5df1f13c7203 (patch) | |
tree | a90dc37970fd26211382b50c25b5680be5963955 /src/newgrf_generic.cpp | |
parent | 7c406f0d9dc365960f07e20e690cc0bdf8682fd6 (diff) | |
download | openttd-d9d669dcf855e444a77141b4b96e5df1f13c7203.tar.xz |
(svn r27984) -Codechange: Make ScopeResolver constructors/destructors inlineable. Speedup sprite resolving by about 8 percent.
Diffstat (limited to 'src/newgrf_generic.cpp')
-rw-r--r-- | src/newgrf_generic.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/newgrf_generic.cpp b/src/newgrf_generic.cpp index 9bd77239a..660642215 100644 --- a/src/newgrf_generic.cpp +++ b/src/newgrf_generic.cpp @@ -31,7 +31,16 @@ struct GenericScopeResolver : public ScopeResolver { uint8 count; uint8 station_size; - GenericScopeResolver(ResolverObject &ro, bool ai_callback); + /** + * Generic scope resolver. + * @param ro Surrounding resolver. + * @param ai_callback Callback comes from the AI. + */ + GenericScopeResolver(ResolverObject &ro, bool ai_callback) + : ScopeResolver(ro), cargo_type(0), default_selection(0), src_industry(0), dst_industry(0), distance(0), + event(), count(0), station_size(0), ai_callback(ai_callback) + { + } /* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const; @@ -145,24 +154,6 @@ GenericResolverObject::GenericResolverObject(bool ai_callback, CallbackID callba { } -/** - * Generic scope resolver. - * @param ro Surrounding resolver. - * @param ai_callback Callback comes from the AI. - */ -GenericScopeResolver::GenericScopeResolver(ResolverObject &ro, bool ai_callback) : ScopeResolver(ro) -{ - this->cargo_type = 0; - this->default_selection = 0; - this->src_industry = 0; - this->dst_industry = 0; - this->distance = 0; - this->event = (AIConstructionEvent)0; - this->count = 0; - this->station_size = 0; - this->ai_callback = ai_callback; -} - /** * Follow a generic feature callback list and return the first successful |