summaryrefslogtreecommitdiff
path: root/src/newgrf_text.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-07-03 13:49:29 +0000
committerfrosch <frosch@openttd.org>2011-07-03 13:49:29 +0000
commitf93c8ce5aaf8e02bd7e3325f3b84530e9bcda7f4 (patch)
treeff6d3110876298d3d5ba201c299066dfc847939a /src/newgrf_text.cpp
parentd29def43b072864fd80495b1ff786476e094c771 (diff)
downloadopenttd-f93c8ce5aaf8e02bd7e3325f3b84530e9bcda7f4.tar.xz
(svn r22627) -Codechange: Rename PrepareTextRefStackUsage() to StartTextRefStackUsage() to make it more obvious that you must call StopTextRefStackUsage() at some point. Also extent the documentation.
Diffstat (limited to 'src/newgrf_text.cpp')
-rw-r--r--src/newgrf_text.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp
index 6213b419e..6cc361f61 100644
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -955,10 +955,22 @@ void RestoreTextRefStackBackup(struct TextRefStack *backup)
}
/**
- * Prepare the TTDP compatible string code parsing
+ * Start using the TTDP compatible string code parsing.
+ *
+ * On start a number of values is copied on the #TextRefStack.
+ * You can then use #GetString() and the normal string drawing functions,
+ * and they will use the #TextRefStack for NewGRF string codes.
+ *
+ * However, when you want to draw a string multiple times using the same stack,
+ * you have to call #RewindTextRefStack() between draws.
+ *
+ * After you are done with drawing, you must disable usage of the #TextRefStack
+ * by calling #StopTextRefStackUsage(), so NewGRF string codes operate on the
+ * normal string parameters again.
+ *
* @param numEntries number of entries to copy from the registers
*/
-void PrepareTextRefStackUsage(byte numEntries)
+void StartTextRefStackUsage(byte numEntries)
{
extern TemporaryStorageArray<int32, 0x110> _temp_store;