From: Ryan Flegel Date: Tue, 18 May 2004 19:17:33 +0000 (+0000) Subject: - ObjectManager stuff X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c1a047586177a23f892e9d051858466e4a9b9f3f;p=supertux.git - ObjectManager stuff SVN-Revision: 1260 --- diff --git a/src/gameobjs.cpp b/src/gameobjs.cpp index 10b87c391..bb212aa27 100644 --- a/src/gameobjs.cpp +++ b/src/gameobjs.cpp @@ -479,5 +479,69 @@ void ObjectManager::load_badguys(std::string filename) */ } +void ObjectManager::draw_bg() +{ +/* + for (unsigned int i = 0; i < bouncy_bricks.size(); ++i) + bouncy_bricks[i]->draw(); + + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) + (*i)->draw(); + + for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) + (*i)->draw(); +*/ +} + +void ObjectManager::draw_fg() +{ +/* + for (unsigned int i = 0; i < bullets.size(); ++i) + bullets[i].draw(); + + for (unsigned int i = 0; i < floating_scores.size(); ++i) + floating_scores[i]->draw(); + + for (unsigned int i = 0; i < upgrades.size(); ++i) + upgrades[i].draw(); + + for (unsigned int i = 0; i < bouncy_distros.size(); ++i) + bouncy_distros[i]->draw(); + + for (unsigned int i = 0; i < broken_bricks.size(); ++i) + broken_bricks[i]->draw(); +*/ +} + +void ObjectManager::actions() +{ +/* + for (unsigned int i = 0; i < bouncy_distros.size(); i++) + bouncy_distros[i]->action(frame_ratio); + + for (unsigned int i = 0; i < broken_bricks.size(); i++) + broken_bricks[i]->action(frame_ratio); + + // Handle all kinds of game objects + for (unsigned int i = 0; i < bouncy_bricks.size(); i++) + bouncy_bricks[i]->action(frame_ratio); + + for (unsigned int i = 0; i < floating_scores.size(); i++) + floating_scores[i]->action(frame_ratio); + + for (unsigned int i = 0; i < bullets.size(); ++i) + bullets[i].action(frame_ratio); + + for (unsigned int i = 0; i < upgrades.size(); i++) + upgrades[i].action(frame_ratio); + + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) + (*i)->action(frame_ratio); + + for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) + (*i)->action(frame_ratio); +*/ +} + /* EOF */ diff --git a/src/gameobjs.h b/src/gameobjs.h index af9e5c201..b6cec5541 100644 --- a/src/gameobjs.h +++ b/src/gameobjs.h @@ -152,10 +152,10 @@ class ObjectManager // XXX Objects will have to be split up into two categories: // - Drawn before tux // - Drawn after tux + // Eventually Player should be a part of ObjectManager std::vector badguys; std::vector trampolines; - //std::vector particle_systems; std::vector bouncy_distros; std::vector broken_bricks; std::vector bouncy_bricks; @@ -167,6 +167,10 @@ class ObjectManager public: static ObjectManager* instance() { return instance_ ? instance_ : instance_ = new ObjectManager(); } static void destroy_instance() { delete instance_; instance_ = 0; } + + void draw_bg(); + void draw_fg(); + void actions(); /* Object* get(unsigned int id) { if(id < badguys.size())