1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 15:02:34 +02:00

Allow language selection in config

This commit is contained in:
Jannik Vogel 2016-08-10 19:15:10 +02:00
parent e7c772967f
commit f7fca167dc
3 changed files with 10 additions and 2 deletions

View File

@ -79,6 +79,11 @@ int GameConfig::handler(void* user,
{
self->m_gamePath = value;
}
else if (MATCH("game", "language"))
{
// @todo Don't allow path seperators and relative directories
self->m_gameLanguage = value;
}
else if (MATCH("input", "invert_y"))
{
self->m_inputInvertY = atoi(value) > 0;

View File

@ -24,6 +24,7 @@ public:
bool isValid();
const std::string& getGameDataPath() const { return m_gamePath; }
const std::string& getGameLanguage() const { return m_gameLanguage; }
bool getInputInvertY() const { return m_inputInvertY; }
private:
@ -40,6 +41,9 @@ private:
/// Path to the game data
std::string m_gamePath;
/// Language for game
std::string m_gameLanguage = "american";
/// Invert the y axis for camera control.
bool m_inputInvertY;
};

View File

@ -126,8 +126,7 @@ RWGame::RWGame(int argc, char* argv[])
data->loadDynamicObjects(config.getGameDataPath() + "/data/object.dat");
/// @TODO language choices.
data->loadGXT("american.gxt");
data->loadGXT(config.getGameLanguage() + ".gxt");
getRenderer()->water.setWaterTable(data->waterHeights, 48, data->realWater, 128*128);