setup config to be one file
authorPatrik Gornicz <Gornicz.P@gmail.com>
Thu, 21 Aug 2008 19:35:53 +0000 (15:35 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Thu, 21 Aug 2008 19:35:53 +0000 (15:35 -0400)
deps/config/.tmp [moved from deps/configs/.tmp with 100% similarity]
objs/config/.tmp [moved from objs/configs/.tmp with 100% similarity]
src/GameStates/Paused.cpp
src/Makefile
src/config/config.cpp [moved from src/configs/paused_cfg.cpp with 81% similarity]
src/config/config.h [moved from src/configs/paused_cfg.h with 86% similarity]
src/main.cpp

similarity index 100%
rename from deps/configs/.tmp
rename to deps/config/.tmp
similarity index 100%
rename from objs/configs/.tmp
rename to objs/config/.tmp
index 8f35c70..20ef061 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #include "Paused.h"
-#include "../configs/paused_cfg.h"
+#include "../config/config.h"
 
 /// ***** Constructors/Destructors *****
 
@@ -46,9 +46,9 @@ void Paused::draw(bool on_top) const
 
 bool Paused::pushMe() const
 {
-    return CFG::pause();
+    return cfg::pause();
 }
 bool Paused::popMe() const
 {
-    return CFG::unPause();
+    return cfg::unPause();
 }
index 1e11991..638655a 100644 (file)
@@ -45,7 +45,7 @@ SRCS += Effects/Effect.cpp
 SRCS += Effects/Gravity.cpp
 SRCS += Effects/Screen.cpp
 
-SRCS += configs/paused_cfg.cpp
+SRCS += config/config.cpp
 
 SRCS += input/inputManager.cpp
 
similarity index 81%
rename from src/configs/paused_cfg.cpp
rename to src/config/config.cpp
index 4b2b001..ae569fa 100644 (file)
@@ -15,7 +15,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "paused_cfg.h"
+#include "config.h"
 #include "../input/inputManager.h"
 
 /// ***** Private Method Headers *****
 
 /// ***** Initializers/Cleaners *****
 
+void cfg::init()
+{
+    // TODO read in config files
+}
+void cfg::clean()
+{
+    // TODO save to config files?
+}
+
 /// ***** Public Methods *****
 
-bool CFG::pause()
+bool cfg::pause()
 {
     return input::wasPressed(SDLK_p);
 }
-bool CFG::unPause()
+bool cfg::unPause()
 {
     return input::wasPressed(SDLK_p);
 }
 
+bool cfg::endGame()
+{
+    return input::wasReleased(SDLK_ESCAPE);
+}
+
 /// ***** Private Methods *****
similarity index 86%
rename from src/configs/paused_cfg.h
rename to src/config/config.h
index 753a250..c02a5fc 100644 (file)
  */
 
 
-#ifndef PAUSED_CFG_H
-#define PAUSED_CFG_H
+#ifndef CONFIG_H
+#define CONFIG_H
 
 /// ***** Header Methods *****
 
-namespace CFG
+namespace cfg
 {
+    void init();
+    void clean();
+
     bool pause();
     bool unPause();
+
+    bool endGame();
 }
 
-#endif // PAUSED_CFG_H
+#endif // CONFIG_H
index 60fb834..5381a86 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "graphics/graphics.h"
 #include "input/inputManager.h"
+#include "config/config.h"
 
 /// ***** Private Method Headers *****
 
@@ -90,6 +91,8 @@ void init()
 
     input::init();
 
+    cfg::init();
+
 #ifdef DEBUGGING
     cout << "Initialization Complete" << endl;
 #endif
@@ -101,6 +104,8 @@ void clean()
     cout << "Cleaning up" << endl;
 #endif
 
+    cfg::clean();
+
     input::clean();
 
     game::clean();
@@ -178,7 +183,7 @@ void handleInput()
 
     game::input();
 
-    if(input::wasReleased(SDLK_ESCAPE))
+    if(cfg::endGame())
         is_Running = false;
 }