- Timestamp:
- Dec 18, 2004, 2:54:59 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/camera.cc
r3175 r3213 279 279 \param entity: The enitity to bind the camera to 280 280 281 282 283 281 This sets the focus of the camera to the given entity. This means that it will use the given WorldEntity's 282 Location and get_lookat() to determine the viewpoint the camera will render from. 283 Note that you cannot bind a camera to a free entity. 284 284 */ 285 285 void Camera::bind (WorldEntity* entity) … … 287 287 if( entity != NULL) 288 288 { 289 if( entity->isFree 289 if( entity->isFree()) printf("Cannot bind camera to free entity"); 290 290 else 291 291 { 292 bound = entity;292 this->bound = entity; 293 293 } 294 294 } … … 300 300 this->world = world; 301 301 } 302 303 304 /** 305 \brief destroy, reset the camera so that it doesn't perform anything anymore 306 307 */ 308 void Camera::destroy() 309 { 310 this->bound = NULL; 311 this->world = NULL; 312 } -
orxonox/trunk/src/camera.h
r2636 r3213 64 64 void bind (WorldEntity* entity); 65 65 void jump (Placement* plc); 66 void destroy(); 66 67 67 68 void setWorld(World* world); -
orxonox/trunk/src/command_node.cc
r3194 r3213 33 33 CommandNode::CommandNode (int ID) 34 34 { 35 bound = new List(); 36 aliases = NULL; 37 netID = ID; 38 bLocalInput = false; 35 this->bound = new List(); 36 this->aliases = NULL; 37 this->netID = ID; 38 this->bLocalInput = false; 39 this->bEnabled = true; 39 40 } 40 41 … … 45 46 CommandNode::CommandNode (char* filename = DEFAULT_KEYBIND_FILE) 46 47 { 47 aliases = NULL; 48 bLocalInput = true; 49 netID = 0; 50 bound = new List(); 51 load_bindings (filename); 48 this->aliases = NULL; 49 this->bLocalInput = true; 50 this->netID = 0; 51 this->bound = new List(); 52 this->bEnabled = true; 53 this->load_bindings (filename); 52 54 } 53 55 … … 58 60 { 59 61 if( aliases != NULL) free (aliases); 60 if( bound != NULL) delete bound; 62 if( bound != NULL) delete bound; /* \todo should this delete bound? dangerous FIX */ 61 63 } 62 64 … … 74 76 { 75 77 this->bound->destroy(); 78 //this->bound = NULL; /* \todo this produces a NULLpointer error.. FIX */ 79 this->bEnabled = false; 80 } 81 82 void CommandNode::enable(bool bEnabled) 83 { 84 this->bEnabled = bEnabled; 76 85 } 77 86 … … 173 182 void CommandNode::process () 174 183 { 175 if( bLocalInput) process_local (); 176 else process_network (); 184 if( this->bEnabled) 185 { 186 if( bLocalInput) process_local (); 187 else process_network (); 188 } 177 189 } 178 190 … … 181 193 SDL_Event event; 182 194 Command cmd; 183 184 195 while( SDL_PollEvent (&event)) 185 196 { … … 223 234 Orxonox *orx = Orxonox::getInstance(); 224 235 orx->event_handler (&event); 225 226 236 break; 227 237 } -
orxonox/trunk/src/command_node.h
r2816 r3213 39 39 private: 40 40 bool bLocalInput; //!< Identifies the CommandNode that processes local input 41 bool bEnabled; 41 42 int netID; //!< Unique identifier that is used to determine between remote CommandNodes 42 43 KeyBindings* aliases; … … 56 57 ~CommandNode (); 57 58 58 void reset(); 59 void reset(); 60 void enable(bool bEnabled); 59 61 void load_bindings (char* filename); 60 62 void bind (WorldEntity* entity); -
orxonox/trunk/src/list.cc
r3194 r3213 81 81 printf("List::clear() - clearing all world objects, releasing mem\n"); 82 82 this->currentEl = this->first; 83 listElement* le = NULL; 83 84 while(this->currentEl != NULL) 84 85 { 85 l istElement* le = this->currentEl->next;86 le = this->currentEl->next; 86 87 delete this->currentEl->curr; 87 88 delete this->currentEl; -
orxonox/trunk/src/orxonox.cc
r3174 r3213 171 171 172 172 // create camera 173 localcamera = new Camera(world);173 //localcamera = new Camera(world); /* \todo camera/input node not used anymore*/ 174 174 175 175 return 0; … … 304 304 { 305 305 // localinput 306 localinput->process();306 //localinput->process(); 307 307 // remoteinput 308 308 } -
orxonox/trunk/src/world.cc
r3210 r3213 64 64 { 65 65 this->bPause = false; 66 Orxonox::getInstance()->get_localinput()->enable(true); 66 67 } 67 68 … … 75 76 this->bQuitCurrentGame = true; 76 77 this->localCamera->setWorld(NULL); 78 this->localCamera->destroy(); 79 80 77 81 WorldEntity* entity = entities->enumerate(); 78 82 while( entity != NULL ) … … 581 585 582 586 for(int i = 0; i < 10000000; i++) {} 583 584 587 } 585 588 printf("World|Exiting the main loop\n");
Note: See TracChangeset
for help on using the changeset viewer.