summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-11-13 11:11:02 +0000
committerrubidium <rubidium@openttd.org>2010-11-13 11:11:02 +0000
commitf1959206951a77891664c461cd51c4f4b90db753 (patch)
tree9d121c0088e4f60d5d6a23c31d111a8d6c8cb7c3 /src/strgen
parent239fcc8ccdd201665bd4aaa76268503fefe94712 (diff)
downloadopenttd-f1959206951a77891664c461cd51c4f4b90db753.tar.xz
(svn r21160) -Codechange: reuse the strgen LanguageHeader to store some metadata about a language, and keep the language metadata in memory instead of loading it several times from disk
Diffstat (limited to 'src/strgen')
-rw-r--r--src/strgen/strgen.cpp2
-rw-r--r--src/strgen/strgen.h55
2 files changed, 1 insertions, 56 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index d13291b03..3497e7616 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -16,7 +16,7 @@
#include "../core/mem_func.hpp"
#include "../string_func.h"
#include "../strings_type.h"
-#include "strgen.h"
+#include "../language.h"
#include "../table/control_codes.h"
#include <stdarg.h>
diff --git a/src/strgen/strgen.h b/src/strgen/strgen.h
deleted file mode 100644
index 778c64361..000000000
--- a/src/strgen/strgen.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* $Id$ */
-
-/*
- * This file is part of OpenTTD.
- * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
- * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/** @file strgen.h Language pack header for strgen (needs to match). */
-
-#ifndef STRGEN_H
-#define STRGEN_H
-
-/** Header of a language file. */
-struct LanguagePackHeader {
- static const uint32 IDENT = 0x474E414C; ///< Identifier for OpenTTD language files, big endian for "LANG"
-
- uint32 ident; ///< 32-bits identifier
- uint32 version; ///< 32-bits of auto generated version info which is basically a hash of strings.h
- 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
-
- /** Thousand separator used for anything not currencies */
- char digit_group_separator[8];
- /** Thousand separator used for currencies */
- char digit_group_separator_currency[8];
- /** Decimal separator */
- char digit_decimal_separator[8];
- byte plural_form; ///< plural form index
- byte text_dir; ///< default direction of the text
- /**
- * Windows language ID:
- * Windows cannot and will not convert isocodes to something it can use to
- * determine whether a font can be used for the language or not. As a result
- * of that we need to pass the language id via strgen to OpenTTD to tell
- * what language it is in "Windows". The ID is the 'locale identifier' on:
- * http://msdn.microsoft.com/en-us/library/ms776294.aspx
- */
- uint16 winlangid; ///< windows language id
- uint8 newgrflangid; ///< newgrf language id
- byte pad[3]; ///< pad header to be a multiple of 4
-
- /**
- * Check whether the header is a valid header for OpenTTD.
- * @return true iff the header is deemed valid.
- */
- bool IsValid() const;
-};
-
-assert_compile(sizeof(LanguagePackHeader) % 4 == 0);
-
-#endif /* STRGEN_H */