- Timestamp:
- Dec 18, 2004, 3:28:01 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/command_node.cc
r3213 r3214 33 33 CommandNode::CommandNode (int ID) 34 34 { 35 this->bound = new List();35 this->bound = new tList<WorldEntity>(); 36 36 this->aliases = NULL; 37 37 this->netID = ID; … … 49 49 this->bLocalInput = true; 50 50 this->netID = 0; 51 this->bound = new List();51 this->bound = new tList<WorldEntity>(); 52 52 this->bEnabled = true; 53 53 this->load_bindings (filename); -
orxonox/trunk/src/command_node.h
r3213 r3214 42 42 int netID; //!< Unique identifier that is used to determine between remote CommandNodes 43 43 KeyBindings* aliases; 44 List* bound; //!< List of WorldEntites that recieve commands from this CommandNode44 tList<WorldEntity>* bound; //!< List of WorldEntites that recieve commands from this CommandNode 45 45 Sint32 coord[2]; 46 46 -
orxonox/trunk/src/list_template.h
r2816 r3214 46 46 ~ListTemplate (); 47 47 48 int add 48 int add(T* obj, ADDMODE mode, bool bRef); 49 49 T* get_object(); 50 ListTemplate<T>* get_next 51 ListTemplate<T>* get_previous 52 ListTemplate<T>* get_last 53 ListTemplate<T>* get_first 54 void set_next 55 void set_prev 50 ListTemplate<T>* get_next(); 51 ListTemplate<T>* get_previous(); 52 ListTemplate<T>* get_last(); 53 ListTemplate<T>* get_first(); 54 void set_next(ListTemplate<T>* ptr); 55 void set_prev(ListTemplate<T>* ptr); 56 56 int remove (T* obj, FINDMODE mode); 57 57 int getSize(); 58 void destroy(); 58 59 }; 59 60 … … 297 298 } 298 299 300 301 template<class T> 302 void ListTemplate<T>::destroy() 303 { 304 /* \todo at the moment - doing nothing. should delete everything */ 305 } 306 299 307 #endif 300 308 -
orxonox/trunk/src/orxonox.cc
r3213 r3214 74 74 void Orxonox::get_config_file (int argc, char** argv) 75 75 { 76 /* char* path;77 #ifdef __WIN32__78 path = getenv("");79 #else80 path = getenv("HOME");81 #endif82 83 if( path != NULL) strcpy (configfilename, path);84 else strcpy (configfilename, "./");85 strcat (configfilename, "/.orxonox.conf");*/86 87 76 strcpy (configfilename, "orxonox.conf"); 88 77 } … … 176 165 } 177 166 167 178 168 /** 179 169 \brief initializes the sound engine … … 187 177 } 188 178 179 189 180 /** 190 181 \brief initializes input functions … … 198 189 } 199 190 191 200 192 /** 201 193 \brief initializes network system … … 207 199 } 208 200 201 209 202 /** 210 203 \brief initializes and loads resource files … … 215 208 return 0; 216 209 } 210 217 211 218 212 /** … … 247 241 } 248 242 243 249 244 /** 250 245 \brief exits Orxonox … … 255 250 } 256 251 257 /** 258 \brief this runs all of Orxonox 259 */ 260 void Orxonox::mainLoop() 261 { 262 lastframe = SDL_GetTicks(); 263 bQuitOrxonox = false; 264 // This is where everything is run 265 printf("Orxonox|Entering main loop\n"); 266 while( !bQuitOrxonox) 267 { 268 // Network 269 synchronize(); 270 // Process input 271 handle_input(); 272 // Process time 273 time_slice(); 274 // Process collision 275 collision(); 276 // Draw 277 display(); 278 } 279 printf("Orxonox|Exiting the main loop\n"); 280 } 252 281 253 282 254 /** … … 288 260 // Handle special events such as reshape, quit, focus changes 289 261 } 290 291 /** 292 \brief synchronize local data with remote data 293 */ 294 void Orxonox::synchronize () 295 { 296 // Get remote input 297 // Update synchronizables 298 } 299 300 /** 301 \brief run all input processing 302 */ 303 void Orxonox::handle_input () 304 { 305 // localinput 306 //localinput->process(); 307 // remoteinput 308 } 309 310 /** 311 \brief advance the timeline 312 */ 313 void Orxonox::time_slice () 314 { 315 Uint32 curframe = SDL_GetTicks(); 316 if( !pause) 317 { 318 Uint32 dt = curframe - lastframe; 319 320 if(dt > 0) 321 { 322 float fps = 1000/dt; 323 printf("fps = %f\n", fps); 324 } 325 326 world->time_slice (dt); 327 world->update (); 328 localcamera->time_slice (dt); 329 } 330 lastframe = curframe; 331 } 332 333 /** 334 \brief compute collision detection 335 */ 336 void Orxonox::collision () 337 { 338 world->collide (); 339 } 262 340 263 341 264 /** … … 354 277 } 355 278 356 /**357 \brief render the current frame358 */359 void Orxonox::display ()360 {361 // clear buffer362 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);363 // set camera364 localcamera->apply ();365 // draw world366 world->draw ();367 // draw HUD368 // flip buffers369 SDL_GL_SwapBuffers();370 }371 279 372 280 /** … … 379 287 } 380 288 289 381 290 /** 382 291 \brief retrieve a pointer to the local CommandNode … … 388 297 } 389 298 299 390 300 /** 391 301 \brief retrieve a pointer to the local World … … 396 306 return world; 397 307 } 308 309 310 398 311 399 312 int main (int argc, char** argv) -
orxonox/trunk/src/orxonox.h
r3204 r3214 41 41 42 42 // main loop functions 43 void synchronize ();44 void handle_input ();45 void time_slice ();46 void collision ();47 void display ();43 // void synchronize (); 44 //void handle_input (); 45 //void time_slice (); 46 //void collision (); 47 //void display (); 48 48 49 49 // subsystem initialization … … 69 69 World* get_world(); 70 70 71 void mainLoop();71 //void mainLoop(); 72 72 }; 73 73
Note: See TracChangeset
for help on using the changeset viewer.