Changeset 3225 in orxonox.OLD for orxonox/trunk/src/world.cc
- Timestamp:
- Dec 20, 2004, 12:23:58 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world.cc
r3222 r3225 72 72 73 73 74 /**75 \brief initialize the world before use.76 */77 74 ErrorMessage World::init() 78 75 { … … 118 115 switch(this->debugWorldNr) 119 116 { 117 /* 118 this loads the hard-coded debug world. this only for simplicity and will be 119 removed by a reald world-loader, which interprets a world-file. 120 if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and 121 make whatever you want... 122 */ 120 123 case DEBUG_WORLD_0: 121 124 { … … 497 500 else 498 501 { 499 /* TO DO: implement check whether this particular free entity502 /* \todo: implement check whether this particular free entity 500 503 is out of the game area 501 TO DO: call function to notify the entity that it left504 \todo: call function to notify the entity that it left 502 505 the game area 503 506 */ … … 513 516 \param deltaT: the time passed since the last frame in milliseconds 514 517 */ 515 void World::time _slice (Uint32 deltaT)518 void World::timeSlice (Uint32 deltaT) 516 519 { 517 520 //List<WorldEntity> *l; … … 544 547 Camera Placement 545 548 */ 546 void World::calc _camera_pos (Location* loc, Placement* plc)549 void World::calcCameraPos (Location* loc, Placement* plc) 547 550 { 548 551 track[loc->part].map_camera (loc, plc); … … 560 563 } 561 564 565 566 567 /** 568 \brief function to put your own debug stuff into it. it can display informations about 569 the current class/procedure 570 */ 562 571 void World::debug() 563 572 { … … 576 585 577 586 587 /* 588 \brief main loop of the world: executing all world relevant function 589 590 in this loop we synchronize (if networked), handle input events, give the heart-beat to 591 all other member-entities of the world (tick to player, enemies etc.), checking for 592 collisions drawing everything to the screen. 593 */ 578 594 void World::mainLoop() 579 595 { … … 582 598 while( !this->bQuitOrxonox && !this->bQuitCurrentGame) /* \todo implement pause */ 583 599 { 584 //debug routine585 //debug();586 600 // Network 587 601 synchronize(); … … 594 608 } 595 609 // Process time 596 time _slice();610 timeSlice(); 597 611 // Process collision 598 612 collision(); … … 616 630 /** 617 631 \brief run all input processing 618 */ 619 void World::handle_input () 632 633 the command node is the central input event dispatcher. the node uses the even-queue from 634 sdl and has its own event-passing-queue. 635 */ 636 void World::handleInput () 620 637 { 621 638 // localinput 622 CommandNode* cn = Orxonox::getInstance()->get _localinput();639 CommandNode* cn = Orxonox::getInstance()->getLocalInput(); 623 640 cn->process(); 624 641 // remoteinput … … 627 644 /** 628 645 \brief advance the timeline 629 */ 630 void World::time_slice () 646 647 this calculates the time used to process one frame (with all input handling, drawing, etc) 648 the time is mesured in ms and passed to all world-entities and other classes that need 649 a heart-beat. 650 */ 651 void World::timeSlice () 631 652 { 632 653 Uint32 currentFrame = SDL_GetTicks(); … … 642 663 else 643 664 { 665 /* the frame-rate is limited to 100 frames per second, all other things are for 666 nothing. 667 */ 644 668 printf("fps = 1000 - frame rate is adjusted\n"); 645 669 SDL_Delay(10); 646 670 dt = 10; 647 671 } 648 649 this->time_slice (dt); 672 this->timeSlice (dt); 650 673 this->update (); 651 this->localCamera->time _slice(dt);674 this->localCamera->timeSlice(dt); 652 675 } 653 676 this->lastFrame = currentFrame; … … 665 688 666 689 /** 667 \brief render the current frame 690 \brief render the current frame 691 692 clear all buffers and draw the world 668 693 */ 669 694 void World::display () … … 680 705 } 681 706 707 /** 708 \brief give back active camera 709 710 this passes back the actualy active camera 711 \todo ability to define more than one camera or camera-places 712 */ 682 713 Camera* World::getCamera() 683 714 { … … 686 717 687 718 719 /** 720 \brief add and spawn a new entity to this world 721 \param entity to be added 722 */ 688 723 void World::spawn(WorldEntity* entity) 689 724 { … … 707 742 708 743 744 /** 745 \brief add and spawn a new entity to this world 746 \param entity to be added 747 \param location where to add 748 */ 709 749 void World::spawn(WorldEntity* entity, Location* loc) 710 750 { … … 730 770 731 771 772 /** 773 \brief add and spawn a new entity to this world 774 \param entity to be added 775 \param place where to be added 776 */ 732 777 void World::spawn(WorldEntity* entity, Placement* plc) 733 778 { … … 747 792 748 793 794 /* 795 \brief commands that the world must catch 796 \returns false if not used by the world 797 */ 749 798 bool World::command(Command* cmd) 750 799 {
Note: See TracChangeset
for help on using the changeset viewer.