summaryrefslogtreecommitdiff
path: root/strings.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-03-25 11:32:58 +0000
committertron <tron@openttd.org>2005-03-25 11:32:58 +0000
commit4d55d8a4bd550a49aa4ea89b2db7177eb3268fdc (patch)
tree0e7bd63c45044b1b65e883fd68ab18c71a309837 /strings.h
parent6246150d8d950145ee5c8e70993280d722123da0 (diff)
downloadopenttd-4d55d8a4bd550a49aa4ea89b2db7177eb3268fdc.tar.xz
(svn r2057) Add InlineString() to make _userstring construction a bit cleaner.
Diffstat (limited to 'strings.h')
-rw-r--r--strings.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/strings.h b/strings.h
index 8cf629255..f3cd34d1d 100644
--- a/strings.h
+++ b/strings.h
@@ -1,6 +1,14 @@
#ifndef STRINGS_H
#define STRINGS_H
+static inline char* InlineString(char* buf, uint16 string)
+{
+ *buf++ = '\x81';
+ *buf++ = string & 0xFF;
+ *buf++ = string >> 8;
+ return buf;
+}
+
char *GetString(char *buffr, uint16 string);
void InjectDParam(int amount);