summaryrefslogtreecommitdiff
path: root/src/language.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-17 23:16:16 +0000
committerrubidium <rubidium@openttd.org>2011-12-17 23:16:16 +0000
commit50b63c587087733b2d3b059e10a10eba748c0166 (patch)
tree1f004d4165d0434bf51e5f848d566e063a4b33af /src/language.h
parent89c263c2df3f7d457716ae5cc8c5cf0e8eb7d520 (diff)
downloadopenttd-50b63c587087733b2d3b059e10a10eba748c0166.tar.xz
(svn r23585) -Codechange: replace some magic numbers with less magic constants
Diffstat (limited to 'src/language.h')
-rw-r--r--src/language.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/language.h b/src/language.h
index a6797ed2f..694b0ca1b 100644
--- a/src/language.h
+++ b/src/language.h
@@ -21,6 +21,13 @@ static const uint8 CASE_GENDER_LEN = 16; ///< The (maximum) length of a case/gen
static const uint8 MAX_NUM_GENDERS = 8; ///< Maximum number of supported genders.
static const uint8 MAX_NUM_CASES = 16; ///< Maximum number of supported cases.
+static const uint TAB_SIZE_OFFSET = 0; ///< The offset for the tab size.
+static const uint TAB_SIZE_BITS = 11; ///< The number of bits used for the tab size.
+static const uint TAB_SIZE = 1 << TAB_SIZE_BITS; ///< The number of values in a tab.
+static const uint TAB_COUNT_OFFSET = TAB_SIZE_BITS; ///< The offset for the tab count.
+static const uint TAB_COUNT_BITS = 5; ///< The number of bits used for the amount of tabs.
+static const uint TAB_COUNT = 1 << TAB_COUNT_BITS; ///< The amount of tabs.
+
/** Header of a language file. */
struct LanguagePackHeader {
static const uint32 IDENT = 0x474E414C; ///< Identifier for OpenTTD language files, big endian for "LANG"
@@ -30,7 +37,7 @@ struct LanguagePackHeader {
char name[32]; ///< the international name of this language
char own_name[32]; ///< the localized name of this language
char isocode[16]; ///< the ISO code for the language (not country code)
- uint16 offsets[32]; ///< the offsets
+ uint16 offsets[TAB_COUNT]; ///< the offsets
/** Thousand separator used for anything not currencies */
char digit_group_separator[8];