(svn r21164) -Codechange: replace the hardcoded array of language metadata with a list

This commit is contained in:
rubidium
2010-11-13 12:09:30 +00:00
parent 68b94e61e0
commit 8aba642ed5
5 changed files with 36 additions and 52 deletions

View File

@@ -12,6 +12,8 @@
#ifndef LANGUAGE_H
#define LANGUAGE_H
#include "core/smallvec_type.hpp"
/** Header of a language file. */
struct LanguagePackHeader {
static const uint32 IDENT = 0x474E414C; ///< Identifier for OpenTTD language files, big endian for "LANG"
@@ -56,6 +58,12 @@ struct LanguageMetadata : public LanguagePackHeader {
char file[MAX_PATH]; ///< Name of the file we read this data from.
};
/** Type for the list of language meta data. */
typedef SmallVector<LanguageMetadata, 4> LanguageList;
/** The actual list of language meta data. */
extern LanguageList _languages;
/** The currently loaded language. */
extern const LanguageMetadata *_current_language;