From: Patrik Gornicz Date: Thu, 28 May 2009 01:44:43 +0000 (-0400) Subject: renamed libpg to libbear X-Git-Tag: libbear-premerge~82 X-Git-Url: http://gitweb.pgornicz.com/?a=commitdiff_plain;h=7936c2c59fe0e6a4c23b78e9fcd4d35e7dc04091;p=libbear.git renamed libpg to libbear --- diff --git a/Makefile b/Makefile index ac3d9dc..744aa81 100644 --- a/Makefile +++ b/Makefile @@ -39,13 +39,13 @@ LIBS := ${LIBSDL} ${LIBGL} ifeq (${BUILD},WIN32) - LINKERNAME := pg.dll - SONAME := pg.dll - REALNAME := pg.dll + LINKERNAME := bear.dll + SONAME := bear.dll + REALNAME := bear.dll else - LINKERNAME := libpg.so - SONAME := libpg.so.0 - REALNAME := libpg.so.0.0 + LINKERNAME := libbear.so + SONAME := libbear.so.0 + REALNAME := libbear.so.0.0 endif TARGETTMP := ${OBJSDIR}${REALNAME} @@ -141,15 +141,15 @@ INSTALL := install # HACK install install: - ${INSTALL} -d ${includedir}/pg - ${INSTALL} -t ${includedir}/pg inc/* + ${INSTALL} -d ${includedir}/bear + ${INSTALL} -t ${includedir}/bear inc/* ln -sfn ${REALNAME} ${libdir}/${LINKERNAME} ln -sfn ${REALNAME} ${libdir}/${SONAME} ${INSTALL} -t ${libdir} ${WORKINGDIR}${REALNAME} # HACK uninstall uninstall: - rm -rf /usr/include/pg + rm -rf /usr/include/bear rm /usr/lib/${REALNAME} rm /usr/lib/${LINKERNAME} rm /usr/lib/${SONAME} diff --git a/inc/Autolock.h b/inc/Autolock.h index b5d99ca..74eceb2 100644 --- a/inc/Autolock.h +++ b/inc/Autolock.h @@ -20,7 +20,7 @@ #define AUTOLOCK_H -namespace pg +namespace bear { class Lock; @@ -44,7 +44,7 @@ namespace pg Lock* m_plock; }; -} // namespace pg +} // namespace bear #endif // AUTOLOCK_H diff --git a/inc/Lock.h b/inc/Lock.h index 89a3f65..45d2a5b 100644 --- a/inc/Lock.h +++ b/inc/Lock.h @@ -22,7 +22,7 @@ class SDL_mutex; -namespace pg +namespace bear { /// ***** Header Class ***** @@ -51,7 +51,7 @@ namespace pg unsigned int m_uiThreadID; }; -} // namespace pg +} // namespace bear #endif // LOCK_H diff --git a/inc/Ticks.h b/inc/Ticks.h index f94927a..581b1c9 100644 --- a/inc/Ticks.h +++ b/inc/Ticks.h @@ -19,7 +19,7 @@ #define TICKS_H -namespace pg +namespace bear { /// ***** Header Class ***** @@ -43,7 +43,7 @@ namespace pg long int m_ticks; }; -} +} // namespace bear #endif // TICKS_H diff --git a/inc/Timer.h b/inc/Timer.h index c7d9c32..1eba36d 100644 --- a/inc/Timer.h +++ b/inc/Timer.h @@ -20,7 +20,7 @@ #include "Ticks.h" -namespace pg +namespace bear { /// ***** Header Class ***** @@ -40,7 +40,7 @@ namespace pg Ticks m_microstart; }; -} +} // namespace bear #endif // TIMER_H diff --git a/inc/Vector2.h b/inc/Vector2.h index fefd0fe..d109750 100644 --- a/inc/Vector2.h +++ b/inc/Vector2.h @@ -22,7 +22,7 @@ using std::string; -namespace pg +namespace bear { /// ***** Header Class ***** @@ -69,7 +69,7 @@ namespace pg void operator*=(Vector2&, float); void operator/=(Vector2&, float); -} // namespace pg +} // namespace bear #endif // VECTOR2_H diff --git a/inc/debug.h b/inc/debug.h index 66857fc..90ab59e 100644 --- a/inc/debug.h +++ b/inc/debug.h @@ -19,7 +19,7 @@ #define DEBUG_H -namespace pg +namespace bear { namespace debug @@ -31,7 +31,7 @@ namespace pg void DASSERT(bool fAssert); void DPF(int iLevel, const char* pstr); -} // namespace pg +} // namespace bear #endif // DEBUG_H diff --git a/inc/mathw.h b/inc/mathw.h index 9adddfb..07f5769 100644 --- a/inc/mathw.h +++ b/inc/mathw.h @@ -19,7 +19,7 @@ #define MATHW_H -namespace pg +namespace bear { class Vector2; @@ -53,6 +53,6 @@ namespace pg //TODO float projectionCoeff(const Vector2&, const Vector2&) const; //TODO void projection(const Vector2&, const Vector2&); -} // namespace pg +} // namespace bear #endif // MATHW_H diff --git a/src/Ticks.cpp b/src/Ticks.cpp index 05e9a46..c1077fe 100644 --- a/src/Ticks.cpp +++ b/src/Ticks.cpp @@ -16,15 +16,15 @@ */ #include "Ticks.h" -using namespace pg; +using namespace bear; -pg::Ticks::Ticks() +bear::Ticks::Ticks() : m_ticks(0) { } -pg::Ticks::Ticks(long int ticks) +bear::Ticks::Ticks(long int ticks) : m_ticks(ticks) { @@ -33,22 +33,22 @@ pg::Ticks::Ticks(long int ticks) /// ***** Public Methods ***** -pg::Ticks::operator long int () const +bear::Ticks::operator long int () const { return m_ticks; } -long int pg::Ticks::seconds() const +long int bear::Ticks::seconds() const { return m_ticks / 1000000; } -long int pg::Ticks::milliseconds() const +long int bear::Ticks::milliseconds() const { return m_ticks / 1000; } -long int pg::Ticks::microseconds() const +long int bear::Ticks::microseconds() const { return m_ticks; } diff --git a/src/Timer.cpp b/src/Timer.cpp index 25f9875..ba1c50e 100644 --- a/src/Timer.cpp +++ b/src/Timer.cpp @@ -16,34 +16,34 @@ */ #include "Timer.h" -using namespace pg; +using namespace bear; #include /* this file is specific to a UNIX system */ -pg::Timer::Timer() +bear::Timer::Timer() : m_microstart(0) { } -void pg::Timer::init() +void bear::Timer::init() { timeval tv; gettimeofday(&tv, 0); m_microstart = (long int)tv.tv_sec * 1000000 + tv.tv_usec; } -void pg::Timer::fini() +void bear::Timer::fini() { } /// ***** Public Methods ***** -Ticks pg::Timer::query() const +Ticks bear::Timer::query() const { timeval tv; gettimeofday(&tv, 0); diff --git a/src/Vector2.cpp b/src/Vector2.cpp index 67ad8fc..7c8e743 100644 --- a/src/Vector2.cpp +++ b/src/Vector2.cpp @@ -22,7 +22,7 @@ #include "mathw.h" -using namespace pg; +using namespace bear; /// ***** Constructors/Destructors ***** @@ -109,44 +109,44 @@ Vector2 Vector2::divide(float f) const /// ***** Public Methods ***** -Vector2 pg::operator+(const Vector2& vec1, const Vector2& vec2) +Vector2 bear::operator+(const Vector2& vec1, const Vector2& vec2) { return vec1.add(vec2); } -Vector2 pg::operator-(const Vector2& vec1, const Vector2& vec2) +Vector2 bear::operator-(const Vector2& vec1, const Vector2& vec2) { return vec1.subtract(vec2); } -Vector2 pg::operator*(float f, const Vector2& vec) +Vector2 bear::operator*(float f, const Vector2& vec) { return vec.multiply(f); } -Vector2 pg::operator*(const Vector2& vec, float f) +Vector2 bear::operator*(const Vector2& vec, float f) { return vec.multiply(f); } -Vector2 pg::operator/(const Vector2& vec, float f) +Vector2 bear::operator/(const Vector2& vec, float f) { return vec.divide(f); } -void pg::operator+=(Vector2& vec1, const Vector2& vec2) +void bear::operator+=(Vector2& vec1, const Vector2& vec2) { vec1.m_fX += vec2.m_fX; vec1.m_fY += vec2.m_fY; } -void pg::operator-=(Vector2& vec1, const Vector2& vec2) +void bear::operator-=(Vector2& vec1, const Vector2& vec2) { vec1.m_fX -= vec2.m_fX; vec1.m_fY -= vec2.m_fY; } -void pg::operator*=(Vector2& vec, float f) +void bear::operator*=(Vector2& vec, float f) { vec.m_fX *= f; vec.m_fY *= f; } -void pg::operator/=(Vector2& vec, float f) +void bear::operator/=(Vector2& vec, float f) { vec.m_fX /= f; vec.m_fY /= f; diff --git a/src/debug.cpp b/src/debug.cpp index 490ec81..8d523dd 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -27,31 +27,31 @@ using std::endl; #include "Lock.h" #include "Autolock.h" -using namespace pg; +using namespace bear; /// ***** Public Methods ***** Lock muDPF; -void pg::DPF(int iLevel, const char* pstr) +void bear::DPF(int iLevel, const char* pstr) { Autolock lock(&muDPF); cout << pstr << endl; } -void pg::debug::init() +void bear::debug::init() { muDPF.init(); } -void pg::debug::fini() +void bear::debug::fini() { muDPF.fini(); } -void pg::DASSERT(bool fAssert) +void bear::DASSERT(bool fAssert) { assert(fAssert); } diff --git a/src/locks/Autolock.cpp b/src/locks/Autolock.cpp index 5bc4120..4af866d 100644 --- a/src/locks/Autolock.cpp +++ b/src/locks/Autolock.cpp @@ -19,7 +19,7 @@ #include "Lock.h" -using namespace pg; +using namespace bear; /// ***** Constructors/Destructors ***** diff --git a/src/locks/Lock.cpp b/src/locks/Lock.cpp index 9204896..8b3ff05 100644 --- a/src/locks/Lock.cpp +++ b/src/locks/Lock.cpp @@ -20,7 +20,7 @@ #include -using namespace pg; +using namespace bear; Lock::Lock() diff --git a/src/mathw.cpp b/src/mathw.cpp index 60e70d3..35d866b 100644 --- a/src/mathw.cpp +++ b/src/mathw.cpp @@ -22,19 +22,19 @@ #include "Vector2.h" -using namespace pg; +using namespace bear; /// ***** Public Methods ***** -int pg::mod(int x, int y) +int bear::mod(int x, int y) { return x % y + (x < 0 ? y : 0); } // Vector2 Math -Vector2 pg::vectorToLine +Vector2 bear::vectorToLine ( const Vector2& vec, float x1, @@ -63,12 +63,12 @@ Vector2 pg::vectorToLine } } -Vector2 pg::perp(const Vector2& vec) +Vector2 bear::perp(const Vector2& vec) { return Vector2(-vec.m_fY, vec.m_fX); } -float pg::dot(const Vector2& vec1, const Vector2& vec2) +float bear::dot(const Vector2& vec1, const Vector2& vec2) { return vec1.m_fX * vec2.m_fX + vec1.m_fY * vec2.m_fY; }