2016-05-20 03:09:22 +02:00
|
|
|
#ifndef RWGAME_GAMECONFIG_HPP
|
|
|
|
#define RWGAME_GAMECONFIG_HPP
|
|
|
|
#include <string>
|
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
class GameConfig {
|
2016-05-20 03:09:22 +02:00
|
|
|
public:
|
2016-09-09 22:13:20 +02:00
|
|
|
/**
|
|
|
|
* @brief GameConfig Loads a game configuration
|
|
|
|
* @param configName The configuration filename to load
|
|
|
|
* @param configPath Where to look.
|
|
|
|
*/
|
|
|
|
GameConfig(const std::string& configName,
|
|
|
|
const std::string& configPath = getDefaultConfigPath());
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief getFilePath Returns the system file path for the configuration
|
|
|
|
*/
|
|
|
|
std::string getConfigFile();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief isValid
|
|
|
|
* @return True if the loaded configuration is valid
|
|
|
|
*/
|
|
|
|
bool isValid();
|
|
|
|
|
|
|
|
const std::string& getGameDataPath() const {
|
|
|
|
return m_gamePath;
|
|
|
|
}
|
|
|
|
const std::string& getGameLanguage() const {
|
|
|
|
return m_gameLanguage;
|
|
|
|
}
|
|
|
|
bool getInputInvertY() const {
|
|
|
|
return m_inputInvertY;
|
|
|
|
}
|
2016-05-20 03:09:22 +02:00
|
|
|
|
|
|
|
private:
|
2016-09-09 22:13:20 +02:00
|
|
|
static std::string getDefaultConfigPath();
|
|
|
|
static int handler(void*, const char*, const char*, const char*);
|
2016-05-20 03:09:22 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
/* Config State */
|
|
|
|
std::string m_configName;
|
|
|
|
std::string m_configPath;
|
|
|
|
bool m_valid;
|
2016-05-20 03:09:22 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
/* Actual Configuration */
|
2016-05-20 03:09:22 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
/// Path to the game data
|
|
|
|
std::string m_gamePath;
|
2016-05-22 16:58:36 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
/// Language for game
|
|
|
|
std::string m_gameLanguage = "american";
|
2016-08-10 19:15:10 +02:00
|
|
|
|
2016-09-09 22:13:20 +02:00
|
|
|
/// Invert the y axis for camera control.
|
|
|
|
bool m_inputInvertY;
|
2016-05-20 03:09:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|