From f490394aa8d78f4118e73beccc724cbad3b44854 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 23 May 2009 12:13:42 +0000 Subject: (svn r16396) -Codechange: split NewGRF spritegroup into multiple subclasses instead of using a big union --- src/newgrf_generic.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/newgrf_generic.cpp') 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. */ -- cgit v1.2.3-54-g00ecf