- Timestamp:
- Aug 10, 2005, 4:47:23 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r4978 r4979 133 133 SoundEngine::getInstance()->flushAllBuffers(); 134 134 SoundEngine::getInstance()->flushAllSources(); 135 FastFactory::flushAll( );135 FastFactory::flushAll(true); 136 136 137 137 // erease everything that is left. … … 850 850 // tick the engines 851 851 AnimationPlayer::getInstance()->tick(this->dtS); 852 if (this->cycle > 5)852 // if (this->cycle > 5) 853 853 PhysicsEngine::getInstance()->tick(this->dtS); 854 854 -
orxonox/trunk/src/util/fast_factory.cc
r4951 r4979 81 81 } 82 82 83 84 83 /** 85 84 * searches for a FastFactory … … 135 134 while (tmpFac != NULL) 136 135 { 136 printf("DELETEING ALL OF %s\n",tmpFac->getName()); 137 137 tmpFac->flush(hardFLUSH); 138 138 tmpFac = tmpFac->next; … … 140 140 } 141 141 142 143 142 /** 144 143 * ereases all the remaining containers, without deleting the stored Objects inside of them. … … 152 151 delMember = tmpMember; 153 152 tmpMember = tmpMember->next; 154 if (unlikely(hardFLUSH == true)) 153 if (hardFLUSH) 154 { 155 PRINTF(1)("COOL\n"); 155 156 delete delMember->objectPointer; 157 } 156 158 delete delMember; 157 159 } … … 267 269 tmpFac = tmpFac->next; 268 270 } 269 270 } 271 } 271 } 272 } -
orxonox/trunk/src/util/fast_factory.h
r4969 r4979 15 15 * afterwards one can just retrieve an Object form the Class with 16 16 * this->bulletFactory->resurrect(); // this returns a BaseObject an Object of the class. 17 * 18 * The big difference to the FastFactory-class is, that this one is used more for the purpose 19 * of fast game-interaction than for loading. althought one can also load FastFactorized classes 20 * it is not the main topic. 17 21 */ 18 19 22 20 23 #ifndef _FAST_FACTORY_H -
orxonox/trunk/src/util/garbage_collector.cc
r4975 r4979 25 25 26 26 using namespace std; 27 28 27 29 28 GarbageCollector* GarbageCollector::singletonRef = 0; … … 119 118 void GarbageCollector::update() 120 119 { 121 if (this->time < this->delay) 122 { 123 return; 124 } 125 if (this->collectedObjects == NULL) 120 if (this->time < this->delay || this->collectedObjects == NULL) 126 121 return; 127 122 else … … 131 126 while (tmpC != NULL) 132 127 { 133 WorldEntity* entity = dynamic_cast<WorldEntity*>(tmpC->objectPointer);128 //WorldEntity* entity = dynamic_cast<WorldEntity*>(tmpC->objectPointer); 134 129 //State::getWorldEntityList()->remove(entity); 135 entity->remove();136 FastFactory::kill( entity, true);130 //entity->remove(); 131 FastFactory::kill(tmpC->objectPointer, true); 137 132 138 133 moveC = tmpC->next; -
orxonox/trunk/src/util/garbage_collector.h
r4941 r4979 1 1 /*! 2 2 * @file garbage_collector.h 3 * Definition of the proto class template, used quickly start work4 * @todo Example: this shows how to use simply add a Marker that here has to be done something.5 *6 * The Protoclass exists, to help you quikly getting the run for how to develop in orxonox.7 * It is an example for the CODING-CONVENTION, and a starting-point for every class.8 3 */ 9 4 … … 17 12 //! this class maintains the garbage collection. 18 13 /** 19 the class is been ticked by the world.cc and goes through the 20 world_entity list to clean out all unused entities. 14 * you can pass everything to this class that you want to be collected 15 * just use GarbageCollector->collect(POINTER); to pass a collectable to the GarbageCollector 16 * it will then be handled acording to the class 21 17 */ 22 18 class GarbageCollector : public BaseObject { -
orxonox/trunk/src/world_entities/weapons/projectile.cc
r4955 r4979 39 39 this->lifeCycle = 0.0; 40 40 this->lifeSpan = 0.75f; /* sec */ 41 42 this->remove(); 41 43 } 42 44 -
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4974 r4979 33 33 #include "animation3d.h" 34 34 #include "sound_engine.h" 35 36 #include "null_parent.h" 35 37 36 38 #include "fast_factory.h" … … 175 177 Projectile* pj = dynamic_cast<Projectile*>(this->getProjectileFactory()->resurrect()); 176 178 179 pj->setParent(NullParent::getInstance()); 177 180 /* 178 181 PNode* target = this->getWeaponManager()->getFixedTarget(); -
orxonox/trunk/src/world_entities/weapons/weapon.cc
r4972 r4979 127 127 this->projectileFactory = FastFactory::searchFastFactory(projectile); 128 128 if (this->projectileFactory == NULL) 129 { 130 PRINTF(1)("unable to find FastFactory for the Projectile.\n"); 129 131 return; 132 } 130 133 else 131 134 { 132 135 // grabbing Parameters from the Projectile to have them at hand here. 133 this->projectileFactory->prepare(1);134 136 Projectile* pj = dynamic_cast<Projectile*>(this->projectileFactory->resurrect()); 135 137 this->minCharge = pj->getEnergyMin(); 136 138 this->maxCharge = pj->getEnergyMax(); 137 139 this->chargeable = pj->isChageable(); 138 } 139 }; 140 this->projectileFactory->kill(pj); 141 } 142 } 140 143 141 144 /**
Note: See TracChangeset
for help on using the changeset viewer.