Skip to content

Commit

Permalink
Fix type issues with string parameter structs
Browse files Browse the repository at this point in the history
  • Loading branch information
JGRennison committed Nov 9, 2023
1 parent fe57f3a commit 48e700b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
#ifndef ERROR_H
#define ERROR_H

#include <list>
#include "strings_type.h"
#include "company_type.h"
#include "core/geometry_type.hpp"
#include "guitimer_func.h"
#include <list>
#include <vector>

struct GRFFile;

Expand Down
2 changes: 1 addition & 1 deletion src/newgrf_text.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 &parameters, bool modify_parameters);

/** Mapping of language data between a NewGRF and OpenTTD. */
Expand Down
1 change: 1 addition & 0 deletions src/news_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "date_type.h"
#include "strings_type.h"
#include "sound_type.h"
#include <vector>

/**
* Type of news.
Expand Down
1 change: 1 addition & 0 deletions src/strings_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "vehicle_type.h"
#include <array>
#include <optional>
#include <vector>

extern ArrayStringParameters<20> _global_string_params;

Expand Down
14 changes: 0 additions & 14 deletions src/strings_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,6 @@ class StringParameters {
}
};

/**
* 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
* the parameters.
Expand Down

0 comments on commit 48e700b

Please sign in to comment.