Fix compatibility with newer libconfig. Patch copied from upstream source repository: https://gitlab.com/lierolibre/lierolibre/commit/b27e3604aa6bfbfcc50db1000b394d06c87ae2f2 diff --git a/src/common.cpp b/src/common.cpp index 2d6ada5..4942b05 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -162,7 +162,7 @@ void Texts::loadFromCFG(std::string cfgFilePath) const libconfig::Setting &sgmodes = texts["gameModes"]; for(int i = 0; i < 4; ++i) { - gameModes[i] = (char const*)sgmodes["gameModes" + to_string(i)]; + gameModes[i] = (char const*)sgmodes[("gameModes" + to_string(i)).c_str()]; } const libconfig::Setting &sgmspec = texts["gameModeSpec"]; @@ -181,13 +181,13 @@ void Texts::loadFromCFG(std::string cfgFilePath) const libconfig::Setting &swstates = texts["weapStates"]; for(int i = 0; i < 3; ++i) { - weapStates[i] = (char const*)swstates["weapStates" + to_string(i)]; + weapStates[i] = (char const*)swstates[("weapStates" + to_string(i)).c_str()]; } const libconfig::Setting &sknames = texts["keyNames"]; for(int i = 1; i < 177; ++i) // First
aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer/newt
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/installer/newt')
0 files changed, 0 insertions, 0 deletions
add(groupName, Setting::TypeGroup); } - return node[groupName]; + return node[groupName.c_str()]; } diff --git a/src/constants.cpp b/src/constants.cpp index 7fced6a..cf7bbfc 100644 --- a/src/constants.cpp +++ b/src/constants.cpp @@ -523,19 +523,19 @@ void Common::loadConstantsFromCFG(std::string cfgFilePath) const libconfig::Setting &vconstants = constants["Values"]; for(int i = 0; i < MaxC; ++i) { - C[i] = (int)vconstants[valueConstantsNames[i]]; + C[i] = (int)vconstants[valueConstantsNames[i].c_str()]; } const libconfig::Setting &sconstants = constants["Strings"]; for(int i = 0; i < MaxS; ++i) { - S[i]= (char const*)sconstants[stringConstantsNames[i]]; + S[i]= (char const*)sconstants[stringConstantsNames[i].c_str()]; } const libconfig::Setting &hconstants = constants["Hacks"]; for(int i = 0; i < MaxH; ++i) { - H[i] = (bool)hconstants[hackConstantsNames[i]]; + H[i] = (bool)hconstants[hackConstantsNames[i].c_str()]; } } diff --git a/src/gfx/palette.cpp b/src/gfx/palette.cpp index 3fd08c4..3d3bf22 100644 --- a/src/gfx/palette.cpp +++ b/src/gfx/palette.cpp @@ -124,9 +124,9 @@ void Palette::readFromCFG(std::string cfgFilePath) for(int i = 0; i < 256; ++i) { - entries[i].r = cfgHelp.getValue(spentries, "entries" + to_string(i) + "r"); - entries[i].g = cfgHelp.getValue(spentries, "entries" + to_string(i) + "g"); - entries[i].b = cfgHelp.getValue(spentries, "entries" + to_string(i) + "b"); + entries[i].r = cfgHelp.getValue(spentries, ("entries" + to_string(i) + "r").c_str()); + entries[i].g = cfgHelp.getValue(spentries, ("entries" + to_string(i) + "g").c_str()); + entries[i].b = cfgHelp.getValue(spentries, ("entries" + to_string(i) + "b").c_str()); } }