From ca2d526eb092a673f37a906020f1f32d91a608d3 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sat, 15 Nov 2008 19:25:40 -0500 Subject: [PATCH] more debug changes --- src/collisionManager.cpp | 4 +--- src/config/reader.cpp | 4 ++++ src/debug.cpp | 8 +++++--- src/debug.h | 11 ++--------- src/entityManager.cpp | 8 ++------ src/game.cpp | 4 +--- src/graphics/graphics.cpp | 5 +++++ src/main.cpp | 4 +--- 8 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/collisionManager.cpp b/src/collisionManager.cpp index 3327ebb..39f6396 100644 --- a/src/collisionManager.cpp +++ b/src/collisionManager.cpp @@ -81,9 +81,7 @@ void applyCollisionAt(PhysicsEntity* p1, PhysicsEntity* p2) return; } -#ifdef WARNINGS - cerr << "ENTITY TYPE NOT SUPPORTED BY applyCollisionAt()!!" << endl; -#endif + DPF(0, "ENTITY TYPE NOT SUPPORTED BY applyCollisionAt()!!"); } void applyCollisionAt(Ball* b1, Ball* b2) diff --git a/src/config/reader.cpp b/src/config/reader.cpp index 4e27d93..f3dbdd1 100644 --- a/src/config/reader.cpp +++ b/src/config/reader.cpp @@ -19,6 +19,10 @@ #include "../debug.h" #include +using std::cerr; +using std::cout; +using std::endl; + #include #include diff --git a/src/debug.cpp b/src/debug.cpp index 8c13cbe..148db98 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -17,14 +17,16 @@ #include "debug.h" -/// ***** Private Method Headers ***** -/// ***** Private Variables ***** +#include +using std::cerr; +using std::cout; +using std::endl; /// ***** Public Methods ***** void DPF(int level, const char* pstr) { - cout << pstr << endl; + //cout << pstr << endl; } /// ***** Private Methods ***** diff --git a/src/debug.h b/src/debug.h index d1bc04d..1fb0131 100644 --- a/src/debug.h +++ b/src/debug.h @@ -18,11 +18,7 @@ #ifndef DEBUG_H #define DEBUG_H -#include -using std::cerr; -using std::cout; -using std::endl; - +void DPF(int level, const char* pstr); // comment out when not debugging #define DEBUGGING @@ -31,10 +27,7 @@ using std::endl; #define WARNINGS // comment out to prevent FPS and UPS printing -#define FPSUPS - - -void DPF(int level, const char* pstr); +//#define FPSUPS #endif // DEBUG_H diff --git a/src/entityManager.cpp b/src/entityManager.cpp index 0707dfe..bae30ae 100644 --- a/src/entityManager.cpp +++ b/src/entityManager.cpp @@ -77,9 +77,7 @@ void manager::add(Entity* e) } } -#ifdef WARNINGS - cerr << "ENTITY TYPE NOT SUPPORTED BY addEntity()!!" << endl; -#endif + DPF(0, "ENTITY TYPE NOT SUPPORTED BY addEntity()!!"); } void manager::remove(Entity* e) { @@ -101,9 +99,7 @@ void manager::remove(Entity* e) } } -#ifdef WARNINGS - cerr << "ENTITY TYPE NOT SUPPORTED BY deleteEntity()!!" << endl; -#endif + DPF(0, "ENTITY TYPE NOT SUPPORTED BY deleteEntity()!!"); } void manager::handleInput() diff --git a/src/game.cpp b/src/game.cpp index 929f6b5..08f9530 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -65,9 +65,7 @@ void game::init() effect::init(); -#ifdef DEBUGGING - cout << "World Created" << endl; -#endif + DPF(0, "World Created"); } void game::clean() diff --git a/src/graphics/graphics.cpp b/src/graphics/graphics.cpp index d5148c1..17c2e38 100644 --- a/src/graphics/graphics.cpp +++ b/src/graphics/graphics.cpp @@ -25,6 +25,11 @@ #include "../mathw.h" +#include +using std::cerr; +using std::cout; +using std::endl; + /// ***** Private Method Headers ***** diff --git a/src/main.cpp b/src/main.cpp index 84964d2..a9984f6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -117,9 +117,7 @@ void init() void clean() { -#ifdef DEBUGGING - cout << "Cleaning up" << endl; -#endif + DPF(0, "Cleaning up"); cfg::clean(); -- 2.10.2