Changeset 6361 in orxonox.OLD for branches/network/src/story_entities
- Timestamp:
- Dec 30, 2005, 11:25:05 PM (19 years ago)
- Location:
- branches/network/src/story_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/story_entities/game_world.cc
r6358 r6361 144 144 { 145 145 this->setClassID(CL_GAME_WORLD, "GameWorld"); 146 147 146 this->setName(name); 147 148 148 this->gameTime = 0.0f; 149 149 this->setSpeed(1.0); -
branches/network/src/story_entities/multi_player_world.cc
r6358 r6361 25 25 26 26 27 28 29 SHELL_COMMAND(speed, MultiPlayerWorld, setSpeed);30 SHELL_COMMAND(togglePNodeVisibility, MultiPlayerWorld, togglePNodeVisibility);31 SHELL_COMMAND(toggleBVVisibility, MultiPlayerWorld, toggleBVVisibility);32 33 27 using namespace std; 34 28 35 29 //! This creates a Factory to fabricate a MultiPlayerWorld 36 CREATE_FACTORY(MultiPlayerWorld, CL_WORLD); 30 CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD); 31 37 32 38 33 MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root) … … 44 39 } 45 40 41 46 42 /** 47 43 * remove the MultiPlayerWorld from memory … … 52 48 MultiPlayerWorld::~MultiPlayerWorld () 53 49 { 54 delete this->shell;55 50 PRINTF(3)("MultiPlayerWorld::~MultiPlayerWorld() - deleting current world\n"); 51 } 56 52 57 delete this->localPlayer;58 59 // delete all the initialized Engines.60 FastFactory::flushAll(true);61 delete LightManager::getInstance();62 delete ParticleEngine::getInstance();63 delete AnimationPlayer::getInstance();64 delete PhysicsEngine::getInstance();65 66 // external engines initialized by the orxonox-class get deleted67 SoundEngine::getInstance()->flushAllBuffers();68 SoundEngine::getInstance()->flushAllSources();69 70 if (State::getObjectManager() == &this->objectManager)71 State::setObjectManager(NULL);72 // erease everything that is left.73 delete PNode::getNullParent();74 75 //secondary cleanup of PNodes;76 const std::list<BaseObject*>* nodeList = ClassList::getList(CL_PARENT_NODE);77 if (nodeList != NULL)78 while (!nodeList->empty())79 delete nodeList->front();80 81 Shader::suspendShader();82 83 // unload the resources !!84 ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);85 }86 53 87 54 /** … … 98 65 void MultiPlayerWorld::constuctorInit(const char* name, int worldID) 99 66 { 100 this->setClassID(CL_ WORLD, "MultiPlayerWorld");101 PRINTF(0)("START\n");67 this->setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld"); 68 this->setName(name); 102 69 103 this->setName(name);104 70 this->gameTime = 0.0f; 105 71 this->setSpeed(1.0); … … 149 115 150 116 /* the the single player specific stuff here */ 151 152 /* some static world entities */153 for(int i = 0; i < 100; i++)154 {155 WorldEntity* tmp = new NPCTest1();156 char npcChar[10];157 sprintf (npcChar, "NPC_%d", i);158 tmp->setName(npcChar);159 tmp->setAbsCoor(((float)rand()/RAND_MAX) * 5000, 50/*+ (float)rand()/RAND_MAX*20*/, ((float)rand()/RAND_MAX -.5) *30);160 this->spawn(tmp);161 }162 117 } 163 118 -
branches/network/src/story_entities/multi_player_world.h
r6359 r6361 12 12 class TiXmlElement; 13 13 14 14 15 //! The multiplayer game world 15 16 /** 16 this class initializes everything that should be displayed inside of the current level.17 it is the main driving factor during gameplay.18 */17 * this class initializes everything that should be displayed inside of the current level. 18 * it is the main driving factor during gameplay. 19 */ 19 20 class MultiPlayerWorld : public GameWorld { 20 21 … … 28 29 ErrorMessage load (); 29 30 ErrorMessage postLoad(); 31 32 private: 33 void constuctorInit(const char* name, int worldID); 34 30 35 }; 31 36
Note: See TracChangeset
for help on using the changeset viewer.