From 48e700bc329f7be78fcbfbb3606667f061dbbdd0 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 9 Nov 2023 15:49:54 +0000 Subject: [PATCH] Fix type issues with string parameter structs --- src/error.h | 3 ++- src/newgrf_text.h | 2 +- src/news_type.h | 1 + src/strings_func.h | 1 + src/strings_internal.h | 14 -------------- 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/error.h b/src/error.h index dc1eb46d6d8..b5df4705bb1 100644 --- a/src/error.h +++ b/src/error.h @@ -10,11 +10,12 @@ #ifndef ERROR_H #define ERROR_H -#include #include "strings_type.h" #include "company_type.h" #include "core/geometry_type.hpp" #include "guitimer_func.h" +#include +#include struct GRFFile; diff --git a/src/newgrf_text.h b/src/newgrf_text.h index b3312e2e8d3..60cee68124a 100644 --- a/src/newgrf_text.h +++ b/src/newgrf_text.h @@ -54,7 +54,7 @@ bool UsingNewGRFTextStack(); struct TextRefStack *CreateTextRefStackBackup(); 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); /** Mapping of language data between a NewGRF and OpenTTD. */ diff --git a/src/news_type.h b/src/news_type.h index acc9d9b918a..44d40f1a9af 100644 --- a/src/news_type.h +++ b/src/news_type.h @@ -14,6 +14,7 @@ #include "date_type.h" #include "strings_type.h" #include "sound_type.h" +#include /** * Type of news. diff --git a/src/strings_func.h b/src/strings_func.h index 5514f29263e..035f51368a0 100644 --- a/src/strings_func.h +++ b/src/strings_func.h @@ -19,6 +19,7 @@ #include "vehicle_type.h" #include #include +#include extern ArrayStringParameters<20> _global_string_params; diff --git a/src/strings_internal.h b/src/strings_internal.h index fb54f48efa0..ff520dc819e 100644 --- a/src/strings_internal.h +++ b/src/strings_internal.h @@ -197,20 +197,6 @@ class StringParameters { } }; -/** - * Extension of StringParameters with its own statically allocated buffer for - * the parameters. - */ -class AllocatedStringParameters : public StringParameters { - std::vector 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 * the parameters.