- Timestamp:
- Oct 25, 2004, 2:01:06 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.in
r2636 r2640 159 159 HEADERS = $(noinst_HEADERS) 160 160 161 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in ChangeLogINSTALL \161 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in INSTALL \ 162 162 Makefile.am 163 163 SOURCES = $(orxonox_SOURCES) -
orxonox/trunk/src/player.cc
r2636 r2640 71 71 72 72 void Player::draw () 73 { 73 { 74 74 glMatrixMode(GL_MODELVIEW); 75 75 glLoadIdentity(); -
orxonox/trunk/src/world.cc
r2636 r2640 50 50 World::~World () 51 51 { 52 unload (); 52 Orxonox *orx = Orxonox::getInstance(); 53 orx->get_localinput()->unbind (localPlayer); 53 54 delete entities; 54 55 } … … 72 73 this->bQuitCurrentGame = true; 73 74 this->localCamera->setWorld(NULL); 75 this->~World(); 74 76 } 75 77 … … 111 113 // create a player 112 114 WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>(); 113 115 this->localPlayer = myPlayer; 116 114 117 // bind input 115 118 Orxonox *orx = Orxonox::getInstance(); … … 142 145 // create a player 143 146 WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>(); 147 this->localPlayer = myPlayer; 144 148 145 149 // bind input … … 394 398 } 395 399 400 void World::debug() 401 { 402 List<WorldEntity> *l; 403 WorldEntity* entity; 404 405 printf("counting all entities\n"); 406 l = entities->get_next(); 407 while( l != NULL ) 408 { 409 entity = l->get_object(); 410 if( entity->bDraw ) printf("got an entity\n"); 411 l = l->get_next(); 412 } 413 } 414 396 415 397 416 void World::mainLoop() … … 403 422 while(!this->bQuitOrxonox && !this->bQuitCurrentGame) /* pause pause pause ?!?!?*/ 404 423 { 424 //debug routine 425 //debug(); 405 426 // Network 406 427 synchronize(); -
orxonox/trunk/src/world.h
r2636 r2640 68 68 int debugWorldNr; 69 69 70 WorldEntity* localPlayer; 71 70 72 void mainLoop(); 71 73 void synchronize(); … … 74 76 void collision(); 75 77 void display(); 78 void debug(); 76 79 }; 77 80 … … 89 92 template<typename T> T* World::spawn(Location* loc = NULL, WorldEntity* owner = NULL) 90 93 { 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 94 Location zeroloc; 95 T* entity = new T(); 96 entities->add ((WorldEntity*)entity, LIST_ADD_NEXT); 97 if( loc == NULL) 98 { 99 zeroloc.dist = 0; 100 zeroloc.part = 0; 101 zeroloc.pos = Vector(); 102 zeroloc.rot = Quaternion(); 103 loc = &zeroloc; 104 } 105 entity->init (loc, owner); 106 if (entity->bFree) 107 { 108 track[loc->part].map_coords( loc, entity->get_placement()); 109 } 110 entity->post_spawn (); 111 return entity; 109 112 } 110 113 … … 123 126 template<typename T> T* World::spawn(Placement* plc, WorldEntity* owner = NULL) 124 127 { 125 126 127 128 129 130 131 132 133 134 135 128 T* entity = new T(); 129 entities->add ((WorldEntity*)entity, LIST_ADD_NEXT); 130 entity->init (plc, owner); 131 if (!entity->bFree) 132 { 133 printf("Can't spawn unfree entity with placement\n"); 134 entities->remove( (WorldEntity*)entity, LIST_FIND_FW); 135 return NULL; 136 } 137 entity->post_spawn (); 138 return entity; 136 139 } 137 140
Note: See TracChangeset
for help on using the changeset viewer.