From 3e62457107457c8295076370425e9a1df44fa58c Mon Sep 17 00:00:00 2001 From: ludde Date: Thu, 14 Jul 2005 09:43:59 +0000 Subject: (svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state". Added a way to bind a C-string to an openttd string which doesn't modify the game state. --- variables.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'variables.h') diff --git a/variables.h b/variables.h index 3514ad54f..985390095 100644 --- a/variables.h +++ b/variables.h @@ -424,6 +424,16 @@ static inline uint32 GetDParam(uint n) return _decode_parameters[n]; } +// Used to bind a C string name to a dparam number. +// NOTE: This has a short lifetime. You can't +// use this string much later or it will be gone. +void SetDParamStr(uint n, const char *str); + +// This function takes a C-string and allocates a temporary string ID. +// The duration of the bound string is valid only until the next acll to GetString, +// so be careful. +StringID BindCString(const char *str); + #define COPY_IN_DPARAM(offs,src,num) memcpy(_decode_parameters + offs, src, sizeof(uint32) * (num)) #define COPY_OUT_DPARAM(dst,offs,num) memcpy(dst,_decode_parameters + offs, sizeof(uint32) * (num)) -- cgit v1.2.3-54-g00ecf