summaryrefslogtreecommitdiff
path: root/src/newgrf_text.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2017-02-26 19:40:32 +0000
committerfrosch <frosch@openttd.org>2017-02-26 19:40:32 +0000
commitf4da8ece0ce02d6fe3dac6f8adc147e8a3d095a3 (patch)
tree8a2c1ca7a961cc1df6588bd0c360ef8eb182d72a /src/newgrf_text.cpp
parent9ad09627ad03030d39bd07e28c74bf91b83a0f24 (diff)
downloadopenttd-f4da8ece0ce02d6fe3dac6f8adc147e8a3d095a3.tar.xz
(svn r27755) -Codechange: Move TAB_SIZE to strings_type.h and use it consistently.
Diffstat (limited to 'src/newgrf_text.cpp')
-rw-r--r--src/newgrf_text.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp
index df00ef341..914d0ee1a 100644
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -36,7 +36,6 @@
#include "safeguards.h"
#define GRFTAB 28
-#define TABSIZE 11
/**
* Explains the newgrf shift bit positioning.
@@ -159,7 +158,7 @@ struct GRFTextEntry {
static uint _num_grf_texts = 0;
-static GRFTextEntry _grf_text[(1 << TABSIZE) * 3];
+static GRFTextEntry _grf_text[TAB_SIZE * 3];
static byte _currentLangID = GRFLX_ENGLISH; ///< by default, english is used.
/**
@@ -696,7 +695,7 @@ StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid_to_add, bool ne
grfmsg(3, "Added 0x%X: grfid %08X string 0x%X lang 0x%X string '%s'", id, grfid, stringid, newtext->langid, newtext->text);
- return (GRFTAB << TABSIZE) + id;
+ return MakeStringID(GRFTAB, 0) + id; // Id reaches across multiple tabs
}
/**
@@ -706,7 +705,7 @@ StringID GetGRFStringID(uint32 grfid, uint16 stringid)
{
for (uint id = 0; id < _num_grf_texts; id++) {
if (_grf_text[id].grfid == grfid && _grf_text[id].stringid == stringid) {
- return (GRFTAB << TABSIZE) + id;
+ return MakeStringID(GRFTAB, 0) + id; // Id reaches across multiple tabs
}
}