diff options
| author | Travis Howell | 2005-04-13 06:53:38 +0000 |
|---|---|---|
| committer | Travis Howell | 2005-04-13 06:53:38 +0000 |
| commit | b8d3bec5681afb05430a070c86fb17d05919dfff (patch) | |
| tree | 347c8ee7b45b0465404e0bf342ae17869ac2fbdb /scumm/script_v72he.cpp | |
| parent | 75f6aa850b5218692b21ef45f35ecf7540d68806 (diff) | |
| download | scummvm-rg350-b8d3bec5681afb05430a070c86fb17d05919dfff.tar.gz scummvm-rg350-b8d3bec5681afb05430a070c86fb17d05919dfff.tar.bz2 scummvm-rg350-b8d3bec5681afb05430a070c86fb17d05919dfff.zip | |
Read/write INI entries from config file in HE games.
svn-id: r17580
Diffstat (limited to 'scumm/script_v72he.cpp')
| -rw-r--r-- | scumm/script_v72he.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index f308b2d140..4653a11e39 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -2069,7 +2069,9 @@ void ScummEngine_v72he::o72_checkGlobQueue() { void ScummEngine_v72he::o72_readINI() { byte option[100]; - int type; + ArrayHeader *ah; + const char *entry; + int len, type; // we pretend that we don't have .ini file copyScriptString(option); @@ -2081,19 +2083,22 @@ void ScummEngine_v72he::o72_readINI() { if (!strcmp((char *)option, "NoPrinting")) push(1); else - push(0); + push(ConfMan.getInt((char *)option)); break; case 77: // HE 100 case 7: // string + entry = (ConfMan.get((char *)option).c_str()); + writeVar(0, 0); - defineArray(0, kStringArray, 0, 0, 0, 0); - writeArray(0, 0, 0, 0); - push(readVar(0)); // var ID string + len = resStrLen((const byte *)entry) + 1; + ah = defineArray(0, kStringArray, 0, 0, 0, len); + memcpy(ah->data, entry, len); + + push(readVar(0)); break; default: error("o72_readINI: default type %d", type); } - debug(0, "o72_readINI (%d) %s", type, option); } void ScummEngine_v72he::o72_writeINI() { @@ -2107,17 +2112,19 @@ void ScummEngine_v72he::o72_writeINI() { case 6: // number value = pop(); copyScriptString(option); - debug(1,"o72_writeINI: %s set to %d", option, value); + ConfMan.set((char *)option, value); break; case 77: // HE 100 case 7: // string copyScriptString(string); copyScriptString(option); - debug(1,"o72_writeINI: %s set to %s", option, string); + ConfMan.set((char *)option, (char *)string); break; default: error("o72_writeINI: default type %d", type); } + + ConfMan.flushToDisk(); } void ScummEngine_v72he::o72_getResourceSize() { |
