From 5e0713e5967be038b1b0cc5f0ffbd0180e3f7099 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Wed, 27 May 2009 21:44:29 -0400 Subject: [PATCH] renamed libpg to libbear --- Makefile | 6 +++--- libs/bear.dll | 1 + libs/libbear.so.0 | 1 + libs/libpg.so.0 | 1 - libs/pg.dll | 1 - src/CollisionInfo.h | 4 ++-- src/Effects/Effect.h | 4 ++-- src/Effects/Gravity.h | 4 ++-- src/Effects/GravityWell.h | 4 ++-- src/Effects/Screen.h | 4 ++-- src/Entities/Ball.cpp | 6 +++--- src/Entities/Ball.h | 4 ++-- src/Entities/Entity.cpp | 4 ++-- src/Entities/Entity.h | 4 ++-- src/Entities/Line.cpp | 4 ++-- src/Entities/Line.h | 4 ++-- src/Entities/Particle.cpp | 4 ++-- src/Entities/Particle.h | 4 ++-- src/Entities/PhysicsEntity.cpp | 6 +++--- src/Entities/PhysicsEntity.h | 4 ++-- src/Entities/Point.cpp | 4 ++-- src/Entities/Point.h | 4 ++-- src/Entities/Polygon.cpp | 6 +++--- src/Entities/Polygon.h | 4 ++-- src/Entities/WindParticle.cpp | 4 ++-- src/Entities/WindParticle.h | 4 ++-- src/collisionManager.cpp | 8 ++++---- src/config/config.cpp | 4 ++-- src/config/keys.cpp | 4 ++-- src/config/keys.h | 4 ++-- src/config/reader.cpp | 4 ++-- src/effectManager.cpp | 4 ++-- src/effectManager.h | 4 ++-- src/entityCreator.h | 4 ++-- src/entityManager.cpp | 8 ++++---- src/game.cpp | 4 ++-- src/graphics/graphics.cpp | 6 +++--- src/graphics/graphics.h | 4 ++-- src/input/inputManager.cpp | 4 ++-- src/input/inputManager.h | 4 ++-- src/main.cpp | 36 +++++++++++++++++++++++------------- 41 files changed, 106 insertions(+), 96 deletions(-) create mode 120000 libs/bear.dll create mode 120000 libs/libbear.so.0 delete mode 120000 libs/libpg.so.0 delete mode 120000 libs/pg.dll diff --git a/Makefile b/Makefile index 8fb3377..fd0cfb4 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ else LIBGL := -lGL -lGLU LIBSDL := `sdl-config --libs` endif -LIBMY := -lpg +LIBMY := -lbear LIBS := ${LIBSDL} ${LIBGL} ${LIBMY} OPTFLAGS := -O2 @@ -97,10 +97,10 @@ LIBSTXT := $(addprefix ${DSTLIBSDIR},${LIBSTXT}) LIBSCPY := # := start ifeq (${BUILD},WIN32) LIBSCPY += SDL.dll - LIBSCPY += pg.dll + LIBSCPY += bear.dll else LIBSCPY += libSDL-1.2.so.0 - LIBSCPY += libpg.so.0 + LIBSCPY += libbear.so.0 endif LIBSCPY := $(addprefix ${DSTLIBSDIR},${LIBSCPY}) diff --git a/libs/bear.dll b/libs/bear.dll new file mode 120000 index 0000000..03329c6 --- /dev/null +++ b/libs/bear.dll @@ -0,0 +1 @@ +/usr/mingw32/lib/bear.dll \ No newline at end of file diff --git a/libs/libbear.so.0 b/libs/libbear.so.0 new file mode 120000 index 0000000..5c6fb83 --- /dev/null +++ b/libs/libbear.so.0 @@ -0,0 +1 @@ +/usr/lib/libbear.so.0 \ No newline at end of file diff --git a/libs/libpg.so.0 b/libs/libpg.so.0 deleted file mode 120000 index 6b17e3b..0000000 --- a/libs/libpg.so.0 +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/libpg.so.0 \ No newline at end of file diff --git a/libs/pg.dll b/libs/pg.dll deleted file mode 120000 index dd86165..0000000 --- a/libs/pg.dll +++ /dev/null @@ -1 +0,0 @@ -/usr/mingw32/lib/pg.dll \ No newline at end of file diff --git a/src/CollisionInfo.h b/src/CollisionInfo.h index 6a1428e..32b0074 100644 --- a/src/CollisionInfo.h +++ b/src/CollisionInfo.h @@ -19,8 +19,8 @@ #ifndef COLLISIONINFO_H #define COLLISIONINFO_H -#include -using namespace pg; +#include +using namespace bear; /// ***** Header Class ***** diff --git a/src/Effects/Effect.h b/src/Effects/Effect.h index 15c7766..654c2a2 100644 --- a/src/Effects/Effect.h +++ b/src/Effects/Effect.h @@ -18,8 +18,8 @@ #ifndef EFFECT_H #define EFFECT_H -#include -using namespace pg; +#include +using namespace bear; // Mutual headers ... diff --git a/src/Effects/Gravity.h b/src/Effects/Gravity.h index f7458d3..146d787 100644 --- a/src/Effects/Gravity.h +++ b/src/Effects/Gravity.h @@ -18,8 +18,8 @@ #ifndef GRAVITY_H #define GRAVITY_H -#include -using namespace pg; +#include +using namespace bear; #include "Effect.h" diff --git a/src/Effects/GravityWell.h b/src/Effects/GravityWell.h index ea13a22..1d9f7e5 100644 --- a/src/Effects/GravityWell.h +++ b/src/Effects/GravityWell.h @@ -18,8 +18,8 @@ #ifndef GRAVITYWELL_H #define GRAVITYWELL_H -#include -using namespace pg; +#include +using namespace bear; #include "Effect.h" diff --git a/src/Effects/Screen.h b/src/Effects/Screen.h index 2ff5f1a..82bcb7e 100644 --- a/src/Effects/Screen.h +++ b/src/Effects/Screen.h @@ -18,8 +18,8 @@ #ifndef SCREEN_H #define SCREEN_H -#include -using namespace pg; +#include +using namespace bear; #include "Effect.h" diff --git a/src/Entities/Ball.cpp b/src/Entities/Ball.cpp index ecbb412..11e3e09 100644 --- a/src/Entities/Ball.cpp +++ b/src/Entities/Ball.cpp @@ -17,9 +17,9 @@ #include "Ball.h" -#include -#include -using namespace pg; +#include +#include +using namespace bear; #include "graphics/graphics.h" diff --git a/src/Entities/Ball.h b/src/Entities/Ball.h index 6b7c4c9..c3a1178 100644 --- a/src/Entities/Ball.h +++ b/src/Entities/Ball.h @@ -18,8 +18,8 @@ #ifndef BALL_H #define BALL_H -#include -using namespace pg; +#include +using namespace bear; #include "PhysicsEntity.h" diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 9510b78..ae04514 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -17,8 +17,8 @@ #include "Entity.h" -#include -using namespace pg; +#include +using namespace bear; /// ***** Constructors/Destructors ***** diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index 6cd3e41..ff1db58 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -18,8 +18,8 @@ #ifndef ENTITY_H #define ENTITY_H -#include -using namespace pg; +#include +using namespace bear; /// ***** Header Class ***** diff --git a/src/Entities/Line.cpp b/src/Entities/Line.cpp index fb82931..826d6fe 100644 --- a/src/Entities/Line.cpp +++ b/src/Entities/Line.cpp @@ -17,8 +17,8 @@ #include "Line.h" -#include -using namespace pg; +#include +using namespace bear; /// ***** Constructors/Destructors ***** diff --git a/src/Entities/Line.h b/src/Entities/Line.h index f36bf1c..31a69d3 100644 --- a/src/Entities/Line.h +++ b/src/Entities/Line.h @@ -18,8 +18,8 @@ #ifndef LINE_H #define LINE_H -#include -using namespace pg; +#include +using namespace bear; #include "Particle.h" diff --git a/src/Entities/Particle.cpp b/src/Entities/Particle.cpp index 23226e0..c7626d4 100644 --- a/src/Entities/Particle.cpp +++ b/src/Entities/Particle.cpp @@ -17,8 +17,8 @@ #include "Particle.h" -#include -using namespace pg; +#include +using namespace bear; /// ***** Constructors/Destructors ***** diff --git a/src/Entities/Particle.h b/src/Entities/Particle.h index 51c85a4..34c8f64 100644 --- a/src/Entities/Particle.h +++ b/src/Entities/Particle.h @@ -18,8 +18,8 @@ #ifndef PARTICLE_H #define PARTICLE_H -#include -using namespace pg; +#include +using namespace bear; #include "Entity.h" diff --git a/src/Entities/PhysicsEntity.cpp b/src/Entities/PhysicsEntity.cpp index 4ba50dc..060ef62 100644 --- a/src/Entities/PhysicsEntity.cpp +++ b/src/Entities/PhysicsEntity.cpp @@ -17,9 +17,9 @@ #include "PhysicsEntity.h" -#include -#include -using namespace pg; +#include +#include +using namespace bear; #include "effectManager.h" diff --git a/src/Entities/PhysicsEntity.h b/src/Entities/PhysicsEntity.h index e3ce13c..6c1d455 100644 --- a/src/Entities/PhysicsEntity.h +++ b/src/Entities/PhysicsEntity.h @@ -18,8 +18,8 @@ #ifndef PHYSICS_H #define PHYSICS_H -#include -using namespace pg; +#include +using namespace bear; #include "Entity.h" diff --git a/src/Entities/Point.cpp b/src/Entities/Point.cpp index c6072a6..58dd0da 100644 --- a/src/Entities/Point.cpp +++ b/src/Entities/Point.cpp @@ -17,8 +17,8 @@ #include "Point.h" -#include -using namespace pg; +#include +using namespace bear; /// ***** Constructors/Destructors ***** diff --git a/src/Entities/Point.h b/src/Entities/Point.h index 2f993cc..901040f 100644 --- a/src/Entities/Point.h +++ b/src/Entities/Point.h @@ -18,8 +18,8 @@ #ifndef POINT_H #define POINT_H -#include -using namespace pg; +#include +using namespace bear; #include "Particle.h" diff --git a/src/Entities/Polygon.cpp b/src/Entities/Polygon.cpp index 373f805..4b3826e 100644 --- a/src/Entities/Polygon.cpp +++ b/src/Entities/Polygon.cpp @@ -17,9 +17,9 @@ #include "Polygon.h" -#include -#include -using namespace pg; +#include +#include +using namespace bear; #include "graphics/graphics.h" diff --git a/src/Entities/Polygon.h b/src/Entities/Polygon.h index 314a5ec..6624c95 100644 --- a/src/Entities/Polygon.h +++ b/src/Entities/Polygon.h @@ -18,8 +18,8 @@ #ifndef POLYGON_H #define POLYGON_H -#include -using namespace pg; +#include +using namespace bear; #include "PhysicsEntity.h" diff --git a/src/Entities/WindParticle.cpp b/src/Entities/WindParticle.cpp index 9df28c2..786bb78 100644 --- a/src/Entities/WindParticle.cpp +++ b/src/Entities/WindParticle.cpp @@ -17,8 +17,8 @@ #include "WindParticle.h" -#include -using namespace pg; +#include +using namespace bear; /// ***** Constructors/Destructors ***** diff --git a/src/Entities/WindParticle.h b/src/Entities/WindParticle.h index b03aebb..560e660 100644 --- a/src/Entities/WindParticle.h +++ b/src/Entities/WindParticle.h @@ -18,8 +18,8 @@ #ifndef WINDPARTICLE_H #define WINDPARTICLE_H -#include -using namespace pg; +#include +using namespace bear; #include "Point.h" diff --git a/src/collisionManager.cpp b/src/collisionManager.cpp index 0e828a4..74158fd 100644 --- a/src/collisionManager.cpp +++ b/src/collisionManager.cpp @@ -17,10 +17,10 @@ #include "collisionManager.h" -#include -#include -#include -using namespace pg; +#include +#include +#include +using namespace bear; #include "Entities/Ball.h" #include "Entities/Polygon.h" diff --git a/src/config/config.cpp b/src/config/config.cpp index 5194077..6c46bf0 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -17,8 +17,8 @@ #include "config.h" -#include -using namespace pg; +#include +using namespace bear; #include #include "keys.h" diff --git a/src/config/keys.cpp b/src/config/keys.cpp index 6cd2960..fd7be9e 100644 --- a/src/config/keys.cpp +++ b/src/config/keys.cpp @@ -17,8 +17,8 @@ #include "keys.h" -#include -using namespace pg; +#include +using namespace bear; #include diff --git a/src/config/keys.h b/src/config/keys.h index 81eeb14..0b233a1 100644 --- a/src/config/keys.h +++ b/src/config/keys.h @@ -19,8 +19,8 @@ #ifndef KEYS_H #define KEYS_H -#include -using namespace pg; +#include +using namespace bear; #include diff --git a/src/config/reader.cpp b/src/config/reader.cpp index edba875..86afa68 100644 --- a/src/config/reader.cpp +++ b/src/config/reader.cpp @@ -17,8 +17,8 @@ #include "reader.h" -#include -using namespace pg; +#include +using namespace bear; #include using std::cerr; diff --git a/src/effectManager.cpp b/src/effectManager.cpp index 526debe..0060652 100644 --- a/src/effectManager.cpp +++ b/src/effectManager.cpp @@ -17,8 +17,8 @@ #include "effectManager.h" -#include -using namespace pg; +#include +using namespace bear; #include diff --git a/src/effectManager.h b/src/effectManager.h index 645c4ce..c343af3 100644 --- a/src/effectManager.h +++ b/src/effectManager.h @@ -18,8 +18,8 @@ #ifndef EFFECTMANAGER_H #define EFFECTMANAGER_H -#include -using namespace pg; +#include +using namespace bear; #include "Entities/PhysicsEntity.h" diff --git a/src/entityCreator.h b/src/entityCreator.h index 08ff369..1122b09 100644 --- a/src/entityCreator.h +++ b/src/entityCreator.h @@ -18,8 +18,8 @@ #ifndef ENTITYCREATOR_H #define ENTITYCREATOR_H -#include -using namespace pg; +#include +using namespace bear; /// ***** Header Methods ***** namespace creator diff --git a/src/entityManager.cpp b/src/entityManager.cpp index 10b2d1e..68c4508 100644 --- a/src/entityManager.cpp +++ b/src/entityManager.cpp @@ -17,10 +17,10 @@ #include "entityManager.h" -#include -#include -#include -using namespace pg; +#include +#include +#include +using namespace bear; #include #include diff --git a/src/game.cpp b/src/game.cpp index de3a602..000bdf4 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -17,8 +17,8 @@ #include "game.h" -#include -using namespace pg; +#include +using namespace bear; #include using std::vector; diff --git a/src/graphics/graphics.cpp b/src/graphics/graphics.cpp index d795961..afc4441 100644 --- a/src/graphics/graphics.cpp +++ b/src/graphics/graphics.cpp @@ -17,9 +17,9 @@ #include "graphics.h" -#include -#include -using namespace pg; +#include +#include +using namespace bear; #include #include diff --git a/src/graphics/graphics.h b/src/graphics/graphics.h index ec07616..6c58ef7 100644 --- a/src/graphics/graphics.h +++ b/src/graphics/graphics.h @@ -18,8 +18,8 @@ #ifndef GRAPHICS_H #define GRAPHICS_H -#include -using namespace pg; +#include +using namespace bear; #include diff --git a/src/input/inputManager.cpp b/src/input/inputManager.cpp index 7152138..23b945c 100644 --- a/src/input/inputManager.cpp +++ b/src/input/inputManager.cpp @@ -17,8 +17,8 @@ #include "inputManager.h" -#include -using namespace pg; +#include +using namespace bear; #include diff --git a/src/input/inputManager.h b/src/input/inputManager.h index a50f13d..f9a5ace 100644 --- a/src/input/inputManager.h +++ b/src/input/inputManager.h @@ -18,8 +18,8 @@ #ifndef INPUT_H #define INPUT_H -#include -using namespace pg; +#include +using namespace bear; #include diff --git a/src/main.cpp b/src/main.cpp index 05f9a25..988f5d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -#include -#include -using namespace pg; +#include +#include +using namespace bear; #include using std::cout; @@ -85,7 +85,9 @@ static float s_fAccDrawWait = 0; static int s_iUPS, s_iFPS; static int s_iUpdateCount, s_iDrawCount; -static MICRO s_micLastSecond; + +static Ticks s_micLastSecond; +static Timer s_timer; static const float s_fGameStep = 10; @@ -109,9 +111,13 @@ void mainInit() installSignal(); debug::init(); + + s_timer.init(); } void mainClean() { + s_timer.fini(); + debug::fini(); } @@ -177,7 +183,7 @@ void run() void updateFPSCounters() { // Check if a second has passed to recalculate UPS and FPS - if (tickCountMicro() - s_micLastSecond >= 1000000) + if (s_timer.query() - s_micLastSecond >= 1000000) { s_iUPS = s_iUpdateCount; s_iFPS = s_iDrawCount; @@ -186,7 +192,7 @@ void updateFPSCounters() s_iUpdateCount -= s_iUPS; s_iDrawCount -= s_iFPS; - s_micLastSecond = tickCountMicro(); + s_micLastSecond = s_timer.query(); if(cfg::showFPS()) { @@ -233,18 +239,20 @@ int startUpdateThread(void*) { updatesInit(); - s_micLastSecond = tickCountMicro(); + s_micLastSecond = s_timer.query(); while(s_bIsRunning) { - MICRO time = tickCountMicro(); + Timer timer; + timer.init(); handleInput(); update(s_fGameStep); updateFPSCounters(); - time = tickCountMicro() - time; + const Ticks ticks = timer.query(); + timer.fini(); - float wait = (1000000.0 / s_iTargetUPS - time); + float wait = (1000000.0 / s_iTargetUPS - ticks.microseconds()); s_fAccUpdateWait += 0 < wait ? wait : 0; if(s_iMinWaitMicro < s_fAccUpdateWait) @@ -266,11 +274,13 @@ int startDrawThread(void*) while(s_bIsRunning) { - MICRO time = tickCountMicro(); + Timer timer; + timer.init(); draw(); - time = tickCountMicro() - time; + const Ticks ticks = timer.query(); + timer.fini(); - float wait = (1000000.0 / s_iTargetFPS - time); + float wait = (1000000.0 / s_iTargetFPS - ticks.microseconds()); s_fAccDrawWait += 0 < wait ? wait : 0; if(s_iMinWaitMicro < s_fAccDrawWait) -- 2.10.2