X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=src%2Fconfig%2Freader.cpp;h=3f370e3329ffa3ef9e71f7df4dfe064a0fa4c84a;hb=f32a9b7c8eab3536ad354f85ee65c41d5b5da006;hp=f3dbdd167349e086ac3ed540ff2d756bf06006d4;hpb=ca2d526eb092a673f37a906020f1f32d91a608d3;p=physics.git diff --git a/src/config/reader.cpp b/src/config/reader.cpp index f3dbdd1..3f370e3 100644 --- a/src/config/reader.cpp +++ b/src/config/reader.cpp @@ -16,7 +16,8 @@ */ #include "reader.h" -#include "../debug.h" + +#include #include using std::cerr; @@ -43,7 +44,7 @@ void createKeyMap(); /// ***** Private Variables ***** const char* configDir = "configs/"; -const char* testFile = "test2.cfg"; +const char* testFile = "keys.cfg"; /// ***** Public Methods ***** @@ -97,9 +98,6 @@ void processLine(const string& str) { *(key::sdlMap[name]) = key; } - cout << name << endl; - cout << value << endl; - cout << key << endl; } } @@ -121,11 +119,11 @@ bool extractLine(const string& str, string* name, string* value) int char_pos = 0; - int name_start; - int name_end; + int name_start = 0; + int name_end = 0; - int value_start; - int value_end; + int value_start = 0; + int value_end = 0; const char* c_str = str.c_str(); @@ -211,7 +209,7 @@ void createKeyMap() for (int i = 'A'; i <= 'Z'; i++) // uppercase { buf[0] = (char)i; - keyMap[buf] = (SDLKey)i; + keyMap[buf] = (SDLKey)(i + 'a' - 'A'); } for (int i = 'a'; i <= 'z'; i++) // lowercase {