summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2017-02-26 19:41:14 +0000
committerfrosch <frosch@openttd.org>2017-02-26 19:41:14 +0000
commitfc4c4d080c5d95d92354cefac4a05082fc417c83 (patch)
treef0e858b503badd205f1f44657c65c5b65df77466
parenta56e2bccd0bbeac71e3fa4c406ae5ec5f8e578a8 (diff)
downloadopenttd-fc4c4d080c5d95d92354cefac4a05082fc417c83.tar.xz
(svn r27757) -Change: Make StringID 32bit.
-rw-r--r--src/company_base.h4
-rw-r--r--src/saveload/company_sl.cpp2
-rw-r--r--src/saveload/saveload.h4
-rw-r--r--src/script/api/script_types.hpp2
-rw-r--r--src/strings_type.h4
5 files changed, 8 insertions, 8 deletions
diff --git a/src/company_base.h b/src/company_base.h
index 001776121..4d76e6251 100644
--- a/src/company_base.h
+++ b/src/company_base.h
@@ -52,10 +52,10 @@ extern CompanyPool _company_pool;
/** Statically loadable part of Company pool item */
struct CompanyProperties {
uint32 name_2; ///< Parameter of #name_1.
- uint16 name_1; ///< Name of the company if the user did not change it.
+ StringID name_1; ///< Name of the company if the user did not change it.
char *name; ///< Name of the company if the user changed it.
- uint16 president_name_1; ///< Name of the president if the user did not change it.
+ StringID president_name_1; ///< Name of the president if the user did not change it.
uint32 president_name_2; ///< Parameter of #president_name_1
char *president_name; ///< Name of the president if the user changed it.
diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp
index 2ad975990..733bc0eaf 100644
--- a/src/saveload/company_sl.cpp
+++ b/src/saveload/company_sl.cpp
@@ -244,7 +244,7 @@ static const SaveLoad _company_desc[] = {
SLE_VAR(CompanyProperties, name_1, SLE_STRINGID),
SLE_CONDSTR(CompanyProperties, name, SLE_STR | SLF_ALLOW_CONTROL, 0, 84, SL_MAX_VERSION),
- SLE_VAR(CompanyProperties, president_name_1, SLE_UINT16),
+ SLE_VAR(CompanyProperties, president_name_1, SLE_STRINGID),
SLE_VAR(CompanyProperties, president_name_2, SLE_UINT32),
SLE_CONDSTR(CompanyProperties, president_name, SLE_STR | SLF_ALLOW_CONTROL, 0, 84, SL_MAX_VERSION),
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index 1513355c8..d492558c5 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -49,7 +49,7 @@ enum SavegameType {
extern FileToSaveLoad _file_to_saveload;
void GenerateDefaultSaveName(char *buf, const char *last);
-void SetSaveLoadError(uint16 str);
+void SetSaveLoadError(StringID str);
const char *GetSaveLoadErrorString();
SaveOrLoadResult SaveOrLoad(const char *filename, SaveLoadOperation fop, DetailedFileType dft, Subdirectory sb, bool threaded = true);
void WaitTillSaved();
@@ -161,7 +161,7 @@ enum VarTypes {
SLE_INT64 = SLE_FILE_I64 | SLE_VAR_I64,
SLE_UINT64 = SLE_FILE_U64 | SLE_VAR_U64,
SLE_CHAR = SLE_FILE_I8 | SLE_VAR_CHAR,
- SLE_STRINGID = SLE_FILE_STRINGID | SLE_VAR_U16,
+ SLE_STRINGID = SLE_FILE_STRINGID | SLE_VAR_U32,
SLE_STRINGBUF = SLE_FILE_STRING | SLE_VAR_STRB,
SLE_STRINGBQUOTE = SLE_FILE_STRING | SLE_VAR_STRBQ,
SLE_STRING = SLE_FILE_STRING | SLE_VAR_STR,
diff --git a/src/script/api/script_types.hpp b/src/script/api/script_types.hpp
index d3ac70b4d..bd9b7c560 100644
--- a/src/script/api/script_types.hpp
+++ b/src/script/api/script_types.hpp
@@ -98,7 +98,7 @@ typedef uint8 IndustryType; ///< The ID of an industry-type.
typedef OverflowSafeInt64 Money; ///< Money, stored in a 32bit/64bit safe way. For scripts money is always in pounds.
typedef uint16 SignID; ///< The ID of a sign.
typedef uint16 StationID; ///< The ID of a station.
-typedef uint16 StringID; ///< The ID of a string.
+typedef uint32 StringID; ///< The ID of a string.
typedef uint16 SubsidyID; ///< The ID of a subsidy.
typedef uint16 StoryPageID; ///< The ID of a story page.
typedef uint16 StoryPageElementID; ///< The ID of a story page element.
diff --git a/src/strings_type.h b/src/strings_type.h
index 098d3f94d..f8144f79f 100644
--- a/src/strings_type.h
+++ b/src/strings_type.h
@@ -15,8 +15,8 @@
/**
* Numeric value that represents a string, independent of the selected language.
*/
-typedef uint16 StringID;
-static const StringID INVALID_STRING_ID = 0xFFFF; ///< Constant representing an invalid string
+typedef uint32 StringID;
+static const StringID INVALID_STRING_ID = 0xFFFF; ///< Constant representing an invalid string (16bit in case it is used in savegames)
static const int MAX_CHAR_LENGTH = 4; ///< Max. length of UTF-8 encoded unicode character
static const uint MAX_LANG = 0x7F; ///< Maximum number of languages supported by the game, and the NewGRF specs