From 48ce2fad280c49eacfa5cc328957129af23b6af7 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sat, 16 May 2009 13:54:34 -0400 Subject: [PATCH] cleaned up the library --- inc/Autolock.h | 2 +- inc/Mutex.h | 4 +++- inc/Vector2.h | 3 ++- inc/debug.h | 14 +++----------- inc/mathw.h | 5 ++--- src/Vector2.cpp | 2 ++ src/debug.cpp | 11 ++++++----- src/locks/Mutex.cpp | 2 +- src/mathw.cpp | 5 +++++ 9 files changed, 25 insertions(+), 23 deletions(-) diff --git a/inc/Autolock.h b/inc/Autolock.h index f845f1e..c18b590 100644 --- a/inc/Autolock.h +++ b/inc/Autolock.h @@ -19,6 +19,7 @@ #ifndef AUTOLOCK_H #define AUTOLOCK_H + namespace pg { @@ -45,6 +46,5 @@ namespace pg } // namespace pg -/// ***** Header Methods ***** #endif // AUTOLOCK_H diff --git a/inc/Mutex.h b/inc/Mutex.h index 4ba02e5..aa17d98 100644 --- a/inc/Mutex.h +++ b/inc/Mutex.h @@ -21,6 +21,7 @@ class SDL_mutex; + namespace pg { @@ -33,7 +34,7 @@ namespace pg ~Mutex(); void init(); - void clean(); + void deinit(); bool IsValid(); @@ -52,4 +53,5 @@ namespace pg } // namespace pg + #endif // MUTEX_H diff --git a/inc/Vector2.h b/inc/Vector2.h index 96cfc28..fefd0fe 100644 --- a/inc/Vector2.h +++ b/inc/Vector2.h @@ -19,9 +19,9 @@ #define VECTOR2_H #include - using std::string; + namespace pg { @@ -71,4 +71,5 @@ namespace pg } // namespace pg + #endif // VECTOR2_H diff --git a/inc/debug.h b/inc/debug.h index f6ea414..676cb6b 100644 --- a/inc/debug.h +++ b/inc/debug.h @@ -18,28 +18,20 @@ #ifndef DEBUG_H #define DEBUG_H -#include -using std::cout; -using std::cerr; -using std::endl; namespace pg { - void DPF(int level, const char* pstr); - namespace debug { void init(); - void clean(); + void deinit(); } - void DASSERT(bool fBreak); + void DASSERT(bool fAssert); + void DPF(int iLevel, const char* pstr); } // namespace pg -// comment out when not debugging -#define DEBUGGING - #endif // DEBUG_H diff --git a/inc/mathw.h b/inc/mathw.h index 3034f35..9adddfb 100644 --- a/inc/mathw.h +++ b/inc/mathw.h @@ -18,13 +18,12 @@ #ifndef MATHW_H #define MATHW_H -#include -#include "Vector2.h" - namespace pg { + class Vector2; + /// ***** Public Variables ***** static const float PI = 3.1415926535897; diff --git a/src/Vector2.cpp b/src/Vector2.cpp index 5f2fcd8..67ad8fc 100644 --- a/src/Vector2.cpp +++ b/src/Vector2.cpp @@ -18,6 +18,8 @@ #include "Vector2.h" #include "debug.h" +#include + #include "mathw.h" using namespace pg; diff --git a/src/debug.cpp b/src/debug.cpp index 603bbe2..f96795c 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -29,11 +29,12 @@ using std::endl; using namespace pg; + /// ***** Public Methods ***** Mutex muDPF; -void pg::DPF(int level, const char* pstr) +void pg::DPF(int iLevel, const char* pstr) { Autolock lock(muDPF); @@ -45,14 +46,14 @@ void pg::debug::init() muDPF.init(); } -void pg::debug::clean() +void pg::debug::deinit() { - muDPF.clean(); + muDPF.deinit(); } -void pg::DASSERT(bool fBreak) +void pg::DASSERT(bool fAssert) { - assert(fBreak); + assert(fAssert); } /// ***** Private Methods ***** diff --git a/src/locks/Mutex.cpp b/src/locks/Mutex.cpp index 2668669..c419b86 100644 --- a/src/locks/Mutex.cpp +++ b/src/locks/Mutex.cpp @@ -37,7 +37,7 @@ void Mutex::init() { m_pSDL_mutex = SDL_CreateMutex(); } -void Mutex::clean() +void Mutex::deinit() { SDL_DestroyMutex(m_pSDL_mutex); m_pSDL_mutex = NULL; diff --git a/src/mathw.cpp b/src/mathw.cpp index e83af5a..60e70d3 100644 --- a/src/mathw.cpp +++ b/src/mathw.cpp @@ -16,6 +16,11 @@ */ #include "mathw.h" +#include "debug.h" + +#include + +#include "Vector2.h" using namespace pg; -- 2.10.2