cleaned Make output, added base for entity Creator, and calling hooks
authorPatrik Gornicz <Gornicz.P@gmail.com>
Sat, 19 Jul 2008 16:49:22 +0000 (12:49 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Sat, 19 Jul 2008 16:49:22 +0000 (12:49 -0400)
src/Makefile
src/entityCreator.cpp [new file with mode: 0644]
src/entityCreator.h [new file with mode: 0644]
src/entityManager.cpp
src/game.cpp
src/main.cpp

index 885bc9e..10f3f93 100644 (file)
@@ -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 (file)
index 0000000..6ed785d
--- /dev/null
@@ -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 (file)
index 0000000..5e19eca
--- /dev/null
@@ -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
index 5a6249d..815571b 100644 (file)
@@ -1,13 +1,13 @@
-#include "entityManager.h"
-#include "Entities/Entity.h"
-#include "Entities/Particle.h"
-#include "Entities/PhysicsEntity.h"
-
 #include <set>
 using std::set;
 
 #include <iostream>
 
+#include "entityManager.h"
+#include "Entities/Entity.h"
+#include "Entities/Particle.h"
+#include "Entities/PhysicsEntity.h"
+
 /// ***** Private Method Headers *****
 void updateParticles(float);
 void updatePhysics(float);
index 8800e06..32a9e0b 100644 (file)
@@ -1,14 +1,16 @@
+#include <vector>
+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 <vector>
-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;
index 629ca9b..5053640 100644 (file)
@@ -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()