//! Create Scene void CtfPlugIn::open(){ irr::scene::ISceneManager* SMgr = 0; irr::scene::ISceneNode* SRoot = 0; if(irrPointers.SMgr){ SMgr = irrPointers.SMgr; SRoot = irrPointers.SMgr->getRootSceneNode(); #ifdef useIrrExtensions13 //! Create "ground plane" if(nGround) irrPointers.SMgr->addToDeletionQueue(nGround); nGround = irrPointers.SMgr->addGridSceneNode(); nGround->setPosition(irr::core::vector3df(0,0,0)); nGround->setAccentlineColor(nGround->getGridColor()); #endif } resetCount = 0; // create the seeker ("hero"/"attacker") ctfSeeker = new CtfSeeker(SMgr, SRoot); all.push_back(ctfSeeker); // create the specified number of enemies, // storing pointers to them in an array. for(int i = 0; i < maxEnemyCount; i++){ ctfEnemies[i] = new CtfEnemy(SMgr, SRoot); all.push_back(ctfEnemies[i]); } lstObstacleMesh.clear(); CtfBase::obstacleCount = -1; CtfBase::initializeObstacles(); setInfoText(Text2); }
//! Clear Scene void MapDrivePlugIn::close(){ #ifdef useIrrExtensions13 if(nGround) irrPointers.SMgr->addToDeletionQueue(nGround); nGround = NULL; #endif vehicles.clear(); irrPointers.SMgr->addToDeletionQueue(vehicle); lstObstacleMesh.clear(); }
//! Clear Scene void CtfPlugIn::close(){ #ifdef useIrrExtensions13 if(nGround) irrPointers.SMgr->addToDeletionQueue(nGround); nGround = NULL; #endif // delete seeker irrPointers.SMgr->addToDeletionQueue(ctfSeeker); ctfSeeker = NULL; // delete each enemy for(int i = 0; i < maxEnemyCount; i++){ irrPointers.SMgr->addToDeletionQueue(ctfEnemies[i]); ctfEnemies[i] = NULL; } // clear the group of all vehicles all.clear(); // delete obstacles while(CtfBase::obstacleCount > 0) CtfBase::removeOneObstacle(); CtfBase::obstacleCount = -1; lstObstacleMesh.clear(); }