From 27b748208e91c2e802cbc2b8f7ab3620adaf6cb6 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Wed, 16 Jul 2008 21:12:19 -0400 Subject: [PATCH] cleaned make file, removed allegro stuff, fixed entity name space issues --- src/Entities/Polygon.cpp | 2 +- src/Makefile | 2 +- src/Vector2.cpp | 3 ++- src/entityManager.cpp | 16 ++++++++-------- src/mathw.cpp | 15 --------------- src/mathw.h | 4 ---- 6 files changed, 12 insertions(+), 30 deletions(-) diff --git a/src/Entities/Polygon.cpp b/src/Entities/Polygon.cpp index 6b272bd..bd2a38d 100644 --- a/src/Entities/Polygon.cpp +++ b/src/Entities/Polygon.cpp @@ -18,7 +18,7 @@ void Polygon::draw() const } /// ***** Private Class Methods ***** -void CreateBindingBox() +void Polygon::CreateBindingBox() { // TODO } diff --git a/src/Makefile b/src/Makefile index d830a80..7ef5006 100644 --- a/src/Makefile +++ b/src/Makefile @@ -63,7 +63,7 @@ tar: clean .PHONY: run run: all - ../${TARGET} + ${TARGET} include ${DEPEND} diff --git a/src/Vector2.cpp b/src/Vector2.cpp index 7985ef8..8028aa3 100644 --- a/src/Vector2.cpp +++ b/src/Vector2.cpp @@ -29,7 +29,8 @@ void Vector2::unit() float Vector2::angle() const { - return atan2A(y,x); + //return atan2A(y,x); + return 0; } float Vector2::length() const { diff --git a/src/entityManager.cpp b/src/entityManager.cpp index f189c7d..351808a 100644 --- a/src/entityManager.cpp +++ b/src/entityManager.cpp @@ -27,14 +27,14 @@ bool clearPhysics; /// ***** Public Methods ***** -void entityMInit() +void entityManager::init() { } -void entityMClean() +void entityManager::clean() { } -void addEntity(Entity* e) +void entityManager::add(Entity* e) { { Particle* p = dynamic_cast(e); @@ -57,7 +57,7 @@ void addEntity(Entity* e) std::cerr << "ENTITY TYPE NOT SUPPORTED BY addEntity()!!"; std::cerr << std::endl; } -void deleteEntity(Entity* e) +void entityManager::remove(Entity* e) { { Particle* p = dynamic_cast(e); @@ -81,22 +81,22 @@ void deleteEntity(Entity* e) std::cerr << std::endl; } -void clear() +void entityManager::clear() { clearParticles = true; clearPhysics = true; } -void handleInput() +void entityManager::handleInput() { // TODO } -void updateEntities(float time_step) +void entityManager::update(float time_step) { updateParticles(time_step); updatePhysics(time_step); } -void drawEntities() +void entityManager::draw() { // update active Particle*s for( setPart::iterator it = active_Particles.begin(); diff --git a/src/mathw.cpp b/src/mathw.cpp index c25df98..430a601 100644 --- a/src/mathw.cpp +++ b/src/mathw.cpp @@ -13,21 +13,6 @@ int mod(int x, int y) return x % y + (x < 0 ? y : 0); } -float radsToA(float rads) -{ - return ftofix(rads * 128/PI); -} - -float atanA(float c) -{ - return radsToA(atan(c)) + itofix(64); -} - -float atan2A(float y, float x) -{ - return radsToA(atan2(y,x)) + itofix(64); -} - /// Vector2 Math Vector2 perp(const Vector2& vec) diff --git a/src/mathw.h b/src/mathw.h index 0d9e3ab..d752838 100644 --- a/src/mathw.h +++ b/src/mathw.h @@ -9,10 +9,6 @@ int mod(int,int); -float radsToA(float); -float atanA(float); -float atan2A(float, float); - /// Vector2 Math //Vector2 vectorToLine(float, float, float, float) const; -- 2.10.2