diff options
author | rubidium <rubidium@openttd.org> | 2009-05-23 12:13:42 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-23 12:13:42 +0000 |
commit | f490394aa8d78f4118e73beccc724cbad3b44854 (patch) | |
tree | 066d0254c6624bdb2646e30d9b43076fc7de6726 /src/newgrf_generic.cpp | |
parent | b270ca84ba0002ae23aed3bb614e06b19c7197f5 (diff) | |
download | openttd-f490394aa8d78f4118e73beccc724cbad3b44854.tar.xz |
(svn r16396) -Codechange: split NewGRF spritegroup into multiple subclasses instead of using a big union
Diffstat (limited to 'src/newgrf_generic.cpp')
-rw-r--r-- | src/newgrf_generic.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/newgrf_generic.cpp b/src/newgrf_generic.cpp index 6ce92b7af..0ca9fba77 100644 --- a/src/newgrf_generic.cpp +++ b/src/newgrf_generic.cpp @@ -98,11 +98,11 @@ static uint32 GenericCallbackGetVariable(const ResolverObject *object, byte vari } -static const SpriteGroup *GenericCallbackResolveReal(const ResolverObject *object, const SpriteGroup *group) +static const SpriteGroup *GenericCallbackResolveReal(const ResolverObject *object, const RealSpriteGroup *group) { - if (group->g.real.num_loaded == 0) return NULL; + if (group->num_loaded == 0) return NULL; - return group->g.real.loaded[0]; + return group->loaded[0]; } @@ -140,12 +140,12 @@ static uint16 GetGenericCallbackResult(uint8 feature, ResolverObject *object, co for (GenericCallbackList::const_iterator it = _gcl[feature].begin(); it != _gcl[feature].end(); ++it) { const SpriteGroup *group = it->group; group = Resolve(group, object); - if (group == NULL || group->type != SGT_CALLBACK) continue; + if (group == NULL) continue; /* Return NewGRF file if necessary */ if (file != NULL) *file = it->file; - return group->g.callback.result; + return group->GetCallbackResult(); } /* No callback returned a valid result, so we've failed. */ |