From: Patrik Gornicz Date: Sat, 19 Jul 2008 16:49:22 +0000 (-0400) Subject: cleaned Make output, added base for entity Creator, and calling hooks X-Git-Tag: physics-premerge~193 X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=commitdiff_plain;h=054d658f7ba8742cc1bc0a2f16d0f7e4a1499516;p=libbear.git cleaned Make output, added base for entity Creator, and calling hooks --- diff --git a/src/Makefile b/src/Makefile index 885bc9e..10f3f93 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,6 +12,7 @@ CXXFLAGS := -Wall -pedantic -ansi ${DBGFLAGS} SRCS := entityManager.cpp +SRCS += entityCreator.cpp SRCS += game.cpp SRCS += main.cpp SRCS += mathw.cpp @@ -47,16 +48,19 @@ DEPENDS := ${SRCS:.cpp=.d} all: ${TARGET} ${TARGET}: ${OBJS} - ${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS} - @echo "" + @echo "${CXX}: $@" + @${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS} # how to make a depend file from a source file %.d: %.cpp @echo "DEP: $@" @${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@ - #@${CXX} -M ${CXXFLAGS} $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ +%.o: %.cpp + @echo "${CXX}: $@" + @${CXX} ${CXXFLAGS} -c -o $@ $< + .PHONY: clean clean: diff --git a/src/entityCreator.cpp b/src/entityCreator.cpp new file mode 100644 index 0000000..6ed785d --- /dev/null +++ b/src/entityCreator.cpp @@ -0,0 +1,23 @@ +#include "entityCreator.h" + +void creator::init() +{ + +} +void creator::clean() +{ + +} + +void creator::addBall() +{ + +} +void creator::removeBall() +{ + +} +void creator::removeAllBalls() +{ + +} diff --git a/src/entityCreator.h b/src/entityCreator.h new file mode 100644 index 0000000..5e19eca --- /dev/null +++ b/src/entityCreator.h @@ -0,0 +1,16 @@ +#ifndef ENTITYCREATOR_H +#define ENTITYCREATOR_H + +//#include "Entities/Entity.h" + +/// ***** Header Methods ***** +namespace creator +{ + void init(); + void clean(); + + void addBall(); + void removeBall(); + void removeAllBalls(); +} +#endif // ENTITYCREATOR_H diff --git a/src/entityManager.cpp b/src/entityManager.cpp index 5a6249d..815571b 100644 --- a/src/entityManager.cpp +++ b/src/entityManager.cpp @@ -1,13 +1,13 @@ -#include "entityManager.h" -#include "Entities/Entity.h" -#include "Entities/Particle.h" -#include "Entities/PhysicsEntity.h" - #include using std::set; #include +#include "entityManager.h" +#include "Entities/Entity.h" +#include "Entities/Particle.h" +#include "Entities/PhysicsEntity.h" + /// ***** Private Method Headers ***** void updateParticles(float); void updatePhysics(float); diff --git a/src/game.cpp b/src/game.cpp index 8800e06..32a9e0b 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1,14 +1,16 @@ +#include +using std::vector; + #include "game.h" +#include "debug.h" +#include "entityCreator.h" + #include "GameStates/GameState.h" #include "GameStates/Running.h" #include "GameStates/Paused.h" #include "GameStates/CreatingPolygon.h" -#include -using std::vector; - - /// ***** Private Variables ***** // The stack of active game states @@ -27,10 +29,20 @@ void gameInit() running = new Running(); paused = new Paused(); creating_Polygon = new CreatingPolygon(); + + // create starting entities + + creator::init(); + +#ifdef DEBUGGING + cout << "World Created" << endl; +#endif } void gameClean() { + creator::clean(); + delete creating_Polygon; delete paused; delete running; diff --git a/src/main.cpp b/src/main.cpp index 629ca9b..5053640 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -76,12 +76,6 @@ void init() #ifdef DEBUGGING cout << "Initialization Complete" << endl; #endif - - // create starting entities - -#ifdef DEBUGGING - cout << "World Created" << endl; -#endif } void cleanUp()