|
|
@ -4,14 +4,10 @@
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <thread>
|
|
|
|
#include <thread>
|
|
|
|
#include "config.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "overlay_params.h"
|
|
|
|
|
|
|
|
#include "file_utils.h"
|
|
|
|
#include "file_utils.h"
|
|
|
|
#include "string_utils.h"
|
|
|
|
#include "string_utils.h"
|
|
|
|
|
|
|
|
|
|
|
|
std::string config_file_path;
|
|
|
|
void parseConfigLine(std::string line, std::unordered_map<std::string,std::string>& options) {
|
|
|
|
std::unordered_map<std::string,std::string> options;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void parseConfigLine(std::string line) {
|
|
|
|
|
|
|
|
std::string param, value;
|
|
|
|
std::string param, value;
|
|
|
|
|
|
|
|
|
|
|
|
if (line.find("#") != std::string::npos)
|
|
|
|
if (line.find("#") != std::string::npos)
|
|
|
@ -30,8 +26,8 @@ void parseConfigLine(std::string line) {
|
|
|
|
options[param] = value;
|
|
|
|
options[param] = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void parseConfigFile() {
|
|
|
|
void parseConfigFile(overlay_params& params) {
|
|
|
|
options.clear();
|
|
|
|
params.options.clear();
|
|
|
|
std::vector<std::string> paths;
|
|
|
|
std::vector<std::string> paths;
|
|
|
|
static const char *mangohud_dir = "/MangoHud/";
|
|
|
|
static const char *mangohud_dir = "/MangoHud/";
|
|
|
|
|
|
|
|
|
|
|
@ -90,10 +86,10 @@ void parseConfigFile() {
|
|
|
|
std::cerr << "parsing config: " << *p;
|
|
|
|
std::cerr << "parsing config: " << *p;
|
|
|
|
while (std::getline(stream, line))
|
|
|
|
while (std::getline(stream, line))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
parseConfigLine(line);
|
|
|
|
parseConfigLine(line, params.options);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
std::cerr << " [ ok ]" << std::endl;
|
|
|
|
std::cerr << " [ ok ]" << std::endl;
|
|
|
|
config_file_path = *p;
|
|
|
|
params.config_file_path = *p;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|