changed src so the libpg headers are now used
[physics.git] / src / config / reader.cpp
index 4e27d93..3f370e3 100644 (file)
  */
 
 #include "reader.h"
-#include "../debug.h"
+
+#include <pg/debug.h>
 
 #include <iostream>
+using std::cerr;
+using std::cout;
+using std::endl;
+
 #include <fstream>
 #include <string>
 
@@ -39,7 +44,7 @@ void createKeyMap();
 /// ***** Private Variables *****
 
 const char* configDir = "configs/";
-const char* testFile = "test2.cfg";
+const char* testFile = "keys.cfg";
 
 /// ***** Public Methods *****
 
@@ -93,9 +98,6 @@ void processLine(const string& str)
         {
             *(key::sdlMap[name]) = key;
         }
-        cout << name << endl;
-        cout << value << endl;
-        cout << key << endl;
     }
 }
 
@@ -117,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();
 
@@ -207,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
     {