Fix type issues with string parameter structs
This commit is contained in:
@@ -10,11 +10,12 @@
|
|||||||
#ifndef ERROR_H
|
#ifndef ERROR_H
|
||||||
#define ERROR_H
|
#define ERROR_H
|
||||||
|
|
||||||
#include <list>
|
|
||||||
#include "strings_type.h"
|
#include "strings_type.h"
|
||||||
#include "company_type.h"
|
#include "company_type.h"
|
||||||
#include "core/geometry_type.hpp"
|
#include "core/geometry_type.hpp"
|
||||||
#include "guitimer_func.h"
|
#include "guitimer_func.h"
|
||||||
|
#include <list>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
struct GRFFile;
|
struct GRFFile;
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ bool UsingNewGRFTextStack();
|
|||||||
struct TextRefStack *CreateTextRefStackBackup();
|
struct TextRefStack *CreateTextRefStackBackup();
|
||||||
void RestoreTextRefStackBackup(struct TextRefStack *backup);
|
void RestoreTextRefStackBackup(struct TextRefStack *backup);
|
||||||
|
|
||||||
struct StringParameters;
|
class StringParameters;
|
||||||
uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const char **str, StringParameters ¶meters, bool modify_parameters);
|
uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const char **str, StringParameters ¶meters, bool modify_parameters);
|
||||||
|
|
||||||
/** Mapping of language data between a NewGRF and OpenTTD. */
|
/** Mapping of language data between a NewGRF and OpenTTD. */
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#include "date_type.h"
|
#include "date_type.h"
|
||||||
#include "strings_type.h"
|
#include "strings_type.h"
|
||||||
#include "sound_type.h"
|
#include "sound_type.h"
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of news.
|
* Type of news.
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
#include "vehicle_type.h"
|
#include "vehicle_type.h"
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
extern ArrayStringParameters<20> _global_string_params;
|
extern ArrayStringParameters<20> _global_string_params;
|
||||||
|
|
||||||
|
@@ -197,20 +197,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Extension of StringParameters with its own statically allocated buffer for
|
|
||||||
* the parameters.
|
|
||||||
*/
|
|
||||||
class AllocatedStringParameters : public StringParameters {
|
|
||||||
std::vector<StringParameter> params; ///< The actual parameters
|
|
||||||
|
|
||||||
public:
|
|
||||||
AllocatedStringParameters(size_t parameters = 0) : params(parameters)
|
|
||||||
{
|
|
||||||
this->parameters = span(params.data(), params.size());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of StringParameters with its own statically sized buffer for
|
* Extension of StringParameters with its own statically sized buffer for
|
||||||
* the parameters.
|
* the parameters.
|
||||||
|
Reference in New Issue
Block a user