summaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2012-11-10 20:41:45 +0000
committeralberth <alberth@openttd.org>2012-11-10 20:41:45 +0000
commit82e6001451f0dcfd5f85427a1f3a843656292f1e (patch)
tree1dc33da7c37b360fb225cd9086463c24bd538b55 /src/table
parentc417efc962a2d452bf52842b615bf3e09ecef7d6 (diff)
downloadopenttd-82e6001451f0dcfd5f85427a1f3a843656292f1e.tar.xz
(svn r24685) -Codechange: Add resolver classes for rail types.
Diffstat (limited to 'src/table')
-rw-r--r--src/table/newgrf_debug_data.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h
index 064b6a9a5..b937eeea7 100644
--- a/src/table/newgrf_debug_data.h
+++ b/src/table/newgrf_debug_data.h
@@ -398,7 +398,14 @@ class NIHRailType : public NIHelper {
const void *GetSpec(uint index) const { return NULL; }
void SetStringParameters(uint index) const { this->SetObjectAtStringParameters(STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE, INVALID_STRING_ID, index); }
uint32 GetGRFID(uint index) const { return 0; }
- void Resolve(ResolverObject *ro, uint32 index) const { extern void GetRailTypeResolver(ResolverObject *ro, uint index); GetRailTypeResolver(ro, index); }
+
+ /* virtual */ uint Resolve(uint index, uint var, uint param, bool *avail) const
+ {
+ /* There is no unique GRFFile for the tile. Multiple GRFs can define different parts of the railtype.
+ * However, currently the NewGRF Debug GUI does not display variables depending on the GRF (like 0x7F) anyway. */
+ RailTypeResolverObject ro(index, TCX_NORMAL, NULL);
+ return ro.GetScope(ro.scope)->GetVariable(var, param, avail);
+ }
};
static const NIFeature _nif_railtype = {