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}
# 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}
#define AUTOLOCK_H
-namespace pg
+namespace bear
{
class Lock;
Lock* m_plock;
};
-} // namespace pg
+} // namespace bear
#endif // AUTOLOCK_H
class SDL_mutex;
-namespace pg
+namespace bear
{
/// ***** Header Class *****
unsigned int m_uiThreadID;
};
-} // namespace pg
+} // namespace bear
#endif // LOCK_H
#define TICKS_H
-namespace pg
+namespace bear
{
/// ***** Header Class *****
long int m_ticks;
};
-}
+} // namespace bear
#endif // TICKS_H
#include "Ticks.h"
-namespace pg
+namespace bear
{
/// ***** Header Class *****
Ticks m_microstart;
};
-}
+} // namespace bear
#endif // TIMER_H
using std::string;
-namespace pg
+namespace bear
{
/// ***** Header Class *****
void operator*=(Vector2&, float);
void operator/=(Vector2&, float);
-} // namespace pg
+} // namespace bear
#endif // VECTOR2_H
#define DEBUG_H
-namespace pg
+namespace bear
{
namespace debug
void DASSERT(bool fAssert);
void DPF(int iLevel, const char* pstr);
-} // namespace pg
+} // namespace bear
#endif // DEBUG_H
#define MATHW_H
-namespace pg
+namespace bear
{
class Vector2;
//TODO float projectionCoeff(const Vector2&, const Vector2&) const;
//TODO void projection(const Vector2&, const Vector2&);
-} // namespace pg
+} // namespace bear
#endif // MATHW_H
*/
#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)
{
/// ***** 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;
}
*/
#include "Timer.h"
-using namespace pg;
+using namespace bear;
#include <sys/time.h>
/* 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);
#include "mathw.h"
-using namespace pg;
+using namespace bear;
/// ***** Constructors/Destructors *****
/// ***** 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;
#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);
}
#include "Lock.h"
-using namespace pg;
+using namespace bear;
/// ***** Constructors/Destructors *****
#include <SDL/SDL.h>
-using namespace pg;
+using namespace bear;
Lock::Lock()
#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,
}
}
-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;
}