summaryrefslogtreecommitdiff
path: root/src/newgrf_text.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-07-03 13:53:42 +0000
committerfrosch <frosch@openttd.org>2011-07-03 13:53:42 +0000
commit2158f4f1bf9e8bafd8602b07652f24019ecde8c9 (patch)
treef2724d7b7868161fa8b7ac084d05f39eb2ef9513 /src/newgrf_text.cpp
parentf93c8ce5aaf8e02bd7e3325f3b84530e9bcda7f4 (diff)
downloadopenttd-2158f4f1bf9e8bafd8602b07652f24019ecde8c9.tar.xz
(svn r22628) -Codechange: Allow passing the textref stack values to use to StartTextRefStackUsage() instead of always using the temporary NewGRF registers.
Diffstat (limited to 'src/newgrf_text.cpp')
-rw-r--r--src/newgrf_text.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp
index 6cc361f61..871781f2e 100644
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -969,8 +969,9 @@ void RestoreTextRefStackBackup(struct TextRefStack *backup)
* normal string parameters again.
*
* @param numEntries number of entries to copy from the registers
+ * @param values values to copy onto the stack; if NULL the temporary NewGRF registers will be used instead
*/
-void StartTextRefStackUsage(byte numEntries)
+void StartTextRefStackUsage(byte numEntries, const uint32 *values)
{
extern TemporaryStorageArray<int32, 0x110> _temp_store;
@@ -978,8 +979,9 @@ void StartTextRefStackUsage(byte numEntries)
byte *p = _newgrf_textrefstack->stack;
for (uint i = 0; i < numEntries; i++) {
+ uint32 value = values != NULL ? values[i] : _temp_store.GetValue(0x100 + i);
for (uint j = 0; j < 32; j += 8) {
- *p = GB(_temp_store.GetValue(0x100 + i), j, 8);
+ *p = GB(value, j, 8);
p++;
}
}