Changeset 3459 in orxonox.OLD for orxonox/trunk/src/world.cc
- Timestamp:
- Mar 9, 2005, 1:00:30 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world.cc
r3458 r3459 70 70 cn->unbind(this->localPlayer); 71 71 cn->reset(); 72 72 73 this->localCamera->destroy(); 73 74 this->nullParent->destroy(); 75 74 this->nullParent->destroy(); 76 75 delete this->skySphere; 77 76 … … 97 96 } 98 97 99 GLfloat ctrlpoints[4][3] = {100 {20.0, 10.0, 5.0}, {40.0, -10.0, 0.0},101 {60.0, -10.0, 5.0}, {80.0, 10.0, 5.0}};102 103 /**104 \brief initializes a new World105 */106 ErrorMessage World::init()107 {108 this->bPause = false;109 CommandNode* cn = Orxonox::getInstance()->getLocalInput();110 cn->addToWorld(this);111 cn->enable(true);112 113 //glMap1f (GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]);114 //glEnable (GL_MAP1_VERTEX_3);115 116 //theNurb = gluNewNurbsRenderer ();117 //gluNurbsProperty (theNurb, GLU_NURBS_MODE, GLU_NURBS_TESSELLATOR);118 //gluNurbsProperty (theNurb, GLU_NURBS_VERTEX, vertexCallback );119 120 }121 122 123 /**124 \brief starts the World125 */126 ErrorMessage World::start()127 {128 printf("World::start() - starting current World: nr %i\n", this->debugWorldNr);129 this->bQuitOrxonox = false;130 this->bQuitCurrentGame = false;131 this->mainLoop();132 }133 134 /**135 \brief stops the world.136 137 This happens, when the player decides to end the Level.138 */139 ErrorMessage World::stop()140 {141 printf("World::stop() - got stop signal\n");142 this->bQuitCurrentGame = true;143 }144 145 /**146 \brief pauses the Game147 */148 ErrorMessage World::pause()149 {150 this->isPaused = true;151 }152 153 /**154 \brief ends the pause Phase155 */156 ErrorMessage World::resume()157 {158 this->isPaused = false;159 }160 161 /**162 \brief destroys the World163 */164 void World::destroy()165 {166 delete trackManager;167 }168 169 /**170 \brief shows the loading screen171 */172 void World::displayLoadScreen ()173 {174 printf ("World::displayLoadScreen - start\n");175 176 //GLMenuImageScreen*177 this->glmis = GLMenuImageScreen::getInstance();178 this->glmis->init();179 this->glmis->setMaximum(10);180 this->glmis->draw();181 182 printf ("World::displayLoadScreen - end\n");183 }184 185 /**186 \brief removes the loadscreen, and changes over to the game187 188 \todo take out the delay189 */190 void World::releaseLoadScreen ()191 {192 printf ("World::releaseLoadScreen - start\n");193 this->glmis->setValue(this->glmis->getMaximum());194 SDL_Delay(500);195 printf ("World::releaseLoadScreen - end\n");196 }197 98 198 99 /** 199 100 \brief loads the World by initializing all resources, and set their default values. 200 101 */ 201 voidWorld::load()102 ErrorMessage World::load() 202 103 { 203 104 // BezierCurve* tmpCurve = new BezierCurve(); … … 594 495 } 595 496 497 /** 498 \brief initializes a new World 499 */ 500 ErrorMessage World::init() 501 { 502 this->bPause = false; 503 CommandNode* cn = Orxonox::getInstance()->getLocalInput(); 504 cn->addToWorld(this); 505 cn->enable(true); 506 507 //glMap1f (GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]); 508 //glEnable (GL_MAP1_VERTEX_3); 509 510 //theNurb = gluNewNurbsRenderer (); 511 //gluNurbsProperty (theNurb, GLU_NURBS_MODE, GLU_NURBS_TESSELLATOR); 512 //gluNurbsProperty (theNurb, GLU_NURBS_VERTEX, vertexCallback ); 513 514 } 515 516 517 /** 518 \brief starts the World 519 */ 520 ErrorMessage World::start() 521 { 522 printf("World::start() - starting current World: nr %i\n", this->debugWorldNr); 523 this->bQuitOrxonox = false; 524 this->bQuitCurrentGame = false; 525 this->mainLoop(); 526 } 527 528 /** 529 \brief stops the world. 530 531 This happens, when the player decides to end the Level. 532 */ 533 ErrorMessage World::stop() 534 { 535 printf("World::stop() - got stop signal\n"); 536 this->bQuitCurrentGame = true; 537 } 538 539 /** 540 \brief pauses the Game 541 */ 542 ErrorMessage World::pause() 543 { 544 this->isPaused = true; 545 } 546 547 /** 548 \brief ends the pause Phase 549 */ 550 ErrorMessage World::resume() 551 { 552 this->isPaused = false; 553 } 554 555 /** 556 \brief destroys the World 557 */ 558 ErrorMessage World::destroy() 559 { 560 delete trackManager; 561 } 562 563 /** 564 \brief shows the loading screen 565 */ 566 void World::displayLoadScreen () 567 { 568 printf ("World::displayLoadScreen - start\n"); 569 570 //GLMenuImageScreen* 571 this->glmis = GLMenuImageScreen::getInstance(); 572 this->glmis->init(); 573 this->glmis->setMaximum(10); 574 this->glmis->draw(); 575 576 printf ("World::displayLoadScreen - end\n"); 577 } 578 579 /** 580 \brief removes the loadscreen, and changes over to the game 581 582 \todo take out the delay 583 */ 584 void World::releaseLoadScreen () 585 { 586 printf ("World::releaseLoadScreen - start\n"); 587 this->glmis->setValue(this->glmis->getMaximum()); 588 SDL_Delay(500); 589 printf ("World::releaseLoadScreen - end\n"); 590 } 591 596 592 597 593 /** … … 722 718 } 723 719 724 /**725 \brief relays the passed time since the last frame to entities and Track parts726 \param deltaT: the time passed since the last frame in milliseconds727 */728 void World::timeSlice (Uint32 deltaT)729 {730 //List<WorldEntity> *l;731 WorldEntity* entity;732 float seconds = deltaT / 1000.0;733 734 this->nullParent->update (seconds);735 //this->nullParent->processTick (seconds);736 737 entity = entities->enumerate();738 while( entity != NULL)739 {740 entity->tick (seconds);741 entity = entities->nextElement();742 }743 744 skySphere->updatePosition(localCamera->absCoordinate);745 //for( int i = 0; i < tracklen; i++) track[i].tick (seconds);746 }747 748 /**749 \brief removes level data from memory750 */751 void World::unload()752 {753 754 }755 756 720 757 721 /** … … 848 812 this->timeSlice (); 849 813 // Process collision 850 this->colli sion();814 this->collide (); 851 815 // Draw 852 816 this->display (); … … 858 822 } 859 823 824 860 825 /** 861 826 \brief synchronize local data with remote data … … 866 831 // Update synchronizables 867 832 } 833 868 834 869 835 /** … … 880 846 // remoteinput 881 847 } 848 882 849 883 850 /** … … 909 876 dt = 10; 910 877 } 911 this->timeSlice (dt); 878 //this->timeSlice (dt); 879 880 /* function to let all entities tick (iterate through list) */ 881 WorldEntity* entity; 882 float seconds = dt / 1000.0; 883 this->nullParent->update (seconds); 884 entity = entities->enumerate(); 885 while( entity != NULL) 886 { 887 entity->tick (seconds); 888 entity = entities->nextElement(); 889 } 890 skySphere->updatePosition(localCamera->absCoordinate); 891 892 /* update tick the rest */ 912 893 this->update (); 913 894 this->localCamera->timeSlice(dt); … … 915 896 } 916 897 this->lastFrame = currentFrame; 917 }918 919 920 /**921 \brief compute collision detection922 */923 void World::collision ()924 {925 this->collide ();926 898 } 927 899
Note: See TracChangeset
for help on using the changeset viewer.