(svn r7464) -Codechange: move BuildParamList from newgrf_gui to newgrf_config and
prefix with GRF.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "macros.h"
|
||||
#include "debug.h"
|
||||
#include "variables.h"
|
||||
#include "string.h"
|
||||
#include "saveload.h"
|
||||
#include "md5.h"
|
||||
#include "newgrf.h"
|
||||
@@ -261,6 +262,22 @@ const GRFConfig *GetGRFConfig(uint32 grfid)
|
||||
}
|
||||
|
||||
|
||||
/* Build a space separated list of parameters, and terminate */
|
||||
char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last)
|
||||
{
|
||||
uint i;
|
||||
|
||||
/* Return an empty string if there are no parameters */
|
||||
if (c->num_params == 0) return strecpy(dst, "", last);
|
||||
|
||||
for (i = 0; i < c->num_params; i++) {
|
||||
if (i > 0) dst = strecpy(dst, " ", last);
|
||||
dst += snprintf(dst, last - dst, "%d", c->param[i]);
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
||||
static const SaveLoad _grfconfig_desc[] = {
|
||||
SLE_STR(GRFConfig, filename, SLE_STR, 0x40),
|
||||
SLE_VAR(GRFConfig, grfid, SLE_UINT32),
|
||||
|
||||
Reference in New Issue
Block a user