summaryrefslogtreecommitdiff
path: root/src/table/newgrf_debug_data.h
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-06-12 20:53:16 +0000
committerterkhen <terkhen@openttd.org>2011-06-12 20:53:16 +0000
commit8ddb3941f71470611285f0bdda976d0d15e8b00c (patch)
tree4ba11653d79c91bfc772106e0292ef252bbc527f /src/table/newgrf_debug_data.h
parent46d1a0621581a711aedeaa5d15628b4048fde43a (diff)
downloadopenttd-8ddb3941f71470611285f0bdda976d0d15e8b00c.tar.xz
(svn r22571) -Add: [NewGRF] Show town persistent storage in the NewGRF debug GUI.
Diffstat (limited to 'src/table/newgrf_debug_data.h')
-rw-r--r--src/table/newgrf_debug_data.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h
index 94e030620..0faf2979b 100644
--- a/src/table/newgrf_debug_data.h
+++ b/src/table/newgrf_debug_data.h
@@ -443,6 +443,20 @@ class NIHTown : public NIHelper {
void SetStringParameters(uint index) const { this->SetSimpleStringParameters(STR_TOWN_NAME, index); }
uint32 GetGRFID(uint index) const { return 0; }
uint Resolve(uint index, uint var, uint param, bool *avail) const { return TownGetVariable(var, param, avail, Town::Get(index), NULL); }
+ bool PSAWithParameter() const { return true; }
+ uint GetPSASize(uint index, uint32 grfid) const { return cpp_lengthof(PersistentStorage, storage); }
+
+ int32 *GetPSAFirstPosition(uint index, uint32 grfid) const
+ {
+ Town *t = Town::Get(index);
+
+ std::list<PersistentStorage *>::iterator iter;
+ for (iter = t->psa_list.begin(); iter != t->psa_list.end(); iter++) {
+ if ((*iter)->grfid == grfid) return (int32 *)(&(*iter)->storage[0]);
+ }
+
+ return NULL;
+ }
};
static const NIFeature _nif_town = {