forked from teamnwah/openmw-tes3coop
technical corrections
This commit is contained in:
parent
b7635b3d4a
commit
ceedae4a1a
2 changed files with 16 additions and 7 deletions
|
@ -3,6 +3,18 @@
|
||||||
#include <boost/iostreams/stream.hpp>
|
#include <boost/iostreams/stream.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
MwIniImporter::MwIniImporter() {
|
||||||
|
const char *map[][2] =
|
||||||
|
{
|
||||||
|
{ "fps", "General:Show FPS" },
|
||||||
|
{ 0, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
for(int i=0; map[i][0]; i++) {
|
||||||
|
mMergeMap.insert(std::make_pair<std::string, std::string>(map[i][0], map[i][1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MwIniImporter::setVerbose(bool verbose) {
|
void MwIniImporter::setVerbose(bool verbose) {
|
||||||
mVerbose = verbose;
|
mVerbose = verbose;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +46,7 @@ strmap MwIniImporter::loadIniFile(std::string filename) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
map.insert(STRPAIR(section + ":" + line.substr(0,pos), line.substr(pos+1)));
|
map.insert(std::make_pair<std::string, std::string>(section + ":" + line.substr(0,pos), line.substr(pos+1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
@ -68,7 +80,7 @@ strmap MwIniImporter::loadCfgFile(std::string filename) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
map.insert(STRPAIR(line.substr(0,pos), line.substr(pos+1)));
|
map.insert(std::make_pair<std::string, std::string>(line.substr(0,pos), line.substr(pos+1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
|
@ -81,7 +93,7 @@ void MwIniImporter::merge(strmap &cfg, strmap &ini) {
|
||||||
if((iniIt = ini.find(it->second)) != ini.end()) {
|
if((iniIt = ini.find(it->second)) != ini.end()) {
|
||||||
cfg.erase(it->first);
|
cfg.erase(it->first);
|
||||||
if(!this->specialMerge(it->first, it->second, cfg, ini)) {
|
if(!this->specialMerge(it->first, it->second, cfg, ini)) {
|
||||||
cfg.insert(STRPAIR(it->first, iniIt->second));
|
cfg.insert(std::make_pair<std::string, std::string>(it->first, iniIt->second));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,11 @@
|
||||||
|
|
||||||
|
|
||||||
typedef std::map<std::string, std::string> strmap;
|
typedef std::map<std::string, std::string> strmap;
|
||||||
#define STRPAIR std::make_pair<std::string, std::string>
|
|
||||||
|
|
||||||
class MwIniImporter {
|
class MwIniImporter {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MwIniImporter() {
|
MwIniImporter();
|
||||||
mMergeMap.insert(STRPAIR("fps", "General:Show FPS"));
|
|
||||||
};
|
|
||||||
void setVerbose(bool verbose);
|
void setVerbose(bool verbose);
|
||||||
strmap loadIniFile(std::string filename);
|
strmap loadIniFile(std::string filename);
|
||||||
strmap loadCfgFile(std::string filename);
|
strmap loadCfgFile(std::string filename);
|
||||||
|
|
Loading…
Reference in a new issue