summaryrefslogtreecommitdiff
path: root/src/newgrf_debug_gui.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-06-12 20:47:45 +0000
committerterkhen <terkhen@openttd.org>2011-06-12 20:47:45 +0000
commit00e5c1df18449992cc974b99c61a44d1385bf4a7 (patch)
tree7433db92049848236fe05f18b99d6f80c99442c6 /src/newgrf_debug_gui.cpp
parent9f55abf51aac0f408e60d905fb2ac1b8a1405bb9 (diff)
downloadopenttd-00e5c1df18449992cc974b99c61a44d1385bf4a7.tar.xz
(svn r22567) -Codechange: Store persistent storages inside a pool.
Diffstat (limited to 'src/newgrf_debug_gui.cpp')
-rw-r--r--src/newgrf_debug_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp
index edb44fdc9..5cd3cd63a 100644
--- a/src/newgrf_debug_gui.cpp
+++ b/src/newgrf_debug_gui.cpp
@@ -158,7 +158,7 @@ public:
/**
* Allows to know the size of the persistent storage.
- * @param index Unused.
+ * @param index Index of the item.
* @param grfid Unused.
* @return Size of the persistent storage in indices.
*/
@@ -169,7 +169,7 @@ public:
/**
* Gets the first position of the array containing the persistent storage.
- * @param index Unused.
+ * @param index Index of the item.
* @param grfid Unused.
* @return Pointer to the first position of the storage array or NULL if not present.
*/
@@ -368,11 +368,11 @@ struct NewGRFInspectWindow : Window {
}
}
- uint psa_size = nih->GetPSASize(0, 0);
- if (psa_size != 0) {
+ uint psa_size = nih->GetPSASize(index, 0);
+ int32 *psa = nih->GetPSAFirstPosition(index, 0);
+ if (psa_size != 0 && psa != NULL) {
this->DrawString(r, i++, "Persistent storage:");
assert(psa_size % 4 == 0);
- int32 *psa = nih->GetPSAFirstPosition(0, 0);
for (uint j = 0; j < psa_size; j += 4, psa += 4) {
this->DrawString(r, i++, " %i: %i %i %i %i", j, psa[0], psa[1], psa[2], psa[3]);
}