From 8fe800f7afa25e052c387b8a1a7ad6d46f38d916 Mon Sep 17 00:00:00 2001 From: Alexander Baldeck Date: Wed, 29 Dec 2004 12:29:58 +0000 Subject: - ported sound engine to SDL_Mixer - name change from TmwSound to Sound as required by HACKING.txt - slight modification of other files using it due to interface changes - minor speedups in Configuration - makefile.static modfified to link against SDL --- src/configuration.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/configuration.cpp') diff --git a/src/configuration.cpp b/src/configuration.cpp index a7f07aeb..4debdb16 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -100,7 +100,9 @@ bool Configuration::write(std::string filename) { out.write(tmp, strlen(tmp)); strcpy(tmp, ""); } - std::cout << "Configuration::write(" << optionTmp.key << ", \"" << optionTmp.stringValue << "\" / " << optionTmp.numericValue << ")\n"; + #ifdef __DEBUG + std::cout << "Configuration::write(" << optionTmp.key << ", \"" << optionTmp.stringValue << "\" / " << optionTmp.numericValue << ")\n"; + #endif out.write("\n", 1); } @@ -163,11 +165,9 @@ void Configuration::setValue(std::string key, float value) { \param deflt default option if not there or error */ std::string Configuration::getValue(std::string key, std::string deflt) { - for (iter = iniOptions.begin(); iter != iniOptions.end(); iter++) { - if(iter->key == key) - return iter->stringValue; + if(keyExists(key)) { + return iter->stringValue; } - return deflt; } @@ -177,11 +177,9 @@ std::string Configuration::getValue(std::string key, std::string deflt) { \param deflt default option if not there or error */ float Configuration::getValue(std::string key, float deflt) { - for (iter = iniOptions.begin(); iter != iniOptions.end(); iter++) { - if(iter->key == key) - return iter->numericValue; + if(keyExists(key)) { + return iter->numericValue; } - return deflt; } -- cgit v1.2.3-60-g2f50