Changeset 3459 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Mar 9, 2005, 1:00:30 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.in
r3458 r3459 324 324 esac; \ 325 325 done; \ 326 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/Makefile'; \326 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ 327 327 cd $(top_srcdir) && \ 328 $(AUTOMAKE) -- gnusrc/Makefile328 $(AUTOMAKE) --foreign src/Makefile 329 329 .PRECIOUS: Makefile 330 330 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/trunk/src/campaign.cc
r3231 r3459 39 39 } 40 40 41 /**42 \brief adds an game stroy entity to the campaign43 44 \param se: The entity45 \param storyID: The number that identifies the entity in the campaign. Each ID only used once in a Campaign46 47 An entity can be a world (playable), a cinematic, a shop, sounds, whatever you48 want to queue up in the campaign.49 */50 void Campaign::addEntity(StoryEntity* se, int storyID)51 {52 se->setStoryID(storyID);53 this->addEntity(se);54 }55 56 void Campaign::addEntity(StoryEntity* se)57 {58 this->entities->add(se);59 }60 61 62 void Campaign::removeEntity(int storyID)63 {64 this->removeEntity(this->getStoryEntity(storyID));65 66 }67 68 69 void Campaign::removeEntity(StoryEntity* se)70 {71 this->entities->remove(se);72 }73 74 41 75 42 ErrorMessage Campaign::start() … … 77 44 this->start(0); 78 45 } 46 79 47 80 48 ErrorMessage Campaign::start(int storyID = 0) … … 113 81 } 114 82 83 84 ErrorMessage Campaign::pause() 85 { 86 if(this->currentEntity != NULL) 87 this->isPaused = true; 88 } 89 90 91 ErrorMessage Campaign::resume() 92 { 93 if(this->currentEntity != NULL) 94 this->isPaused = false; 95 } 96 97 115 98 ErrorMessage Campaign::stop() 116 99 { … … 124 107 } 125 108 126 ErrorMessage Campaign::pause() 127 { 128 if(this->currentEntity != NULL) 129 this->isPaused = true; 130 } 131 132 133 ErrorMessage Campaign::resume() 134 { 135 if(this->currentEntity != NULL) 136 this->isPaused = false; 137 } 138 139 140 void Campaign::destroy() 109 110 ErrorMessage Campaign::destroy() 141 111 { 142 112 if(this->currentEntity != NULL) … … 147 117 } 148 118 } 119 120 121 /** 122 \brief adds an game stroy entity to the campaign 123 124 \param se: The entity 125 \param storyID: The number that identifies the entity in the campaign. Each ID only used once in a Campaign 126 127 An entity can be a world (playable), a cinematic, a shop, sounds, whatever you 128 want to queue up in the campaign. 129 */ 130 void Campaign::addEntity(StoryEntity* se, int storyID) 131 { 132 se->setStoryID(storyID); 133 this->addEntity(se); 134 } 135 136 void Campaign::addEntity(StoryEntity* se) 137 { 138 this->entities->add(se); 139 } 140 141 142 void Campaign::removeEntity(int storyID) 143 { 144 this->removeEntity(this->getStoryEntity(storyID)); 145 146 } 147 148 149 void Campaign::removeEntity(StoryEntity* se) 150 { 151 this->entities->remove(se); 152 } 153 149 154 150 155 /* -
orxonox/trunk/src/campaign.h
r3224 r3459 20 20 virtual ErrorMessage start(); 21 21 virtual ErrorMessage start(int storyID); 22 virtual ErrorMessage stop();23 22 virtual ErrorMessage pause(); 24 23 virtual ErrorMessage resume(); 25 26 virtual voiddestroy();24 virtual ErrorMessage stop(); 25 virtual ErrorMessage destroy(); 27 26 28 27 void addEntity(StoryEntity* se, int storyID); -
orxonox/trunk/src/console/Makefile.in
r3458 r3459 203 203 esac; \ 204 204 done; \ 205 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/console/Makefile'; \205 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/console/Makefile'; \ 206 206 cd $(top_srcdir) && \ 207 $(AUTOMAKE) -- gnusrc/console/Makefile207 $(AUTOMAKE) --foreign src/console/Makefile 208 208 .PRECIOUS: Makefile 209 209 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/trunk/src/gui/Makefile.in
r3458 r3459 234 234 esac; \ 235 235 done; \ 236 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/gui/Makefile'; \236 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gui/Makefile'; \ 237 237 cd $(top_srcdir) && \ 238 $(AUTOMAKE) -- gnusrc/gui/Makefile238 $(AUTOMAKE) --foreign src/gui/Makefile 239 239 .PRECIOUS: Makefile 240 240 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/trunk/src/importer/Makefile.in
r3458 r3459 215 215 esac; \ 216 216 done; \ 217 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/importer/Makefile'; \217 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/importer/Makefile'; \ 218 218 cd $(top_srcdir) && \ 219 $(AUTOMAKE) -- gnusrc/importer/Makefile219 $(AUTOMAKE) --foreign src/importer/Makefile 220 220 .PRECIOUS: Makefile 221 221 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/trunk/src/story_entity.cc
r3222 r3459 26 26 StoryEntity::StoryEntity () {} 27 27 StoryEntity::~StoryEntity () {} 28 29 30 /**31 \brief initialize the entity before use.32 \returns an error code if not able to apply.33 34 After execution of this function, the Entity is ready to be played/executed,35 this shifts the initialisation work before the execution - very important...36 */37 ErrorMessage StoryEntity::init()38 {}39 28 40 29 … … 84 73 85 74 /** 75 \brief initialize the entity before use. 76 \returns an error code if not able to apply. 77 78 After execution of this function, the Entity is ready to be played/executed, 79 this shifts the initialisation work before the execution - very important... 80 */ 81 ErrorMessage StoryEntity::init() 82 {} 83 84 85 /** 86 \brief loads the current entity 87 88 this is here to enable you loading maps into the entities. for all other actions you 89 should take the init() function. 90 */ 91 ErrorMessage StoryEntity::load() 92 {} 93 94 /** 86 95 \brief starts the entity with the choosen id. only for entities with lists. 87 96 \param story id … … 102 111 */ 103 112 ErrorMessage StoryEntity::start() 104 {}105 106 107 /**108 \brief stops the current entity109 \returns error code if this action has caused a error110 111 ATTENTION: this function shouldn't call other functions, or if so, they must return112 after finishing. If you ignore or forget to do so, the current entity is not able to113 terminate and it will run in the background or the ressources can't be freed or even114 worse: are freed and the program will end in a segmentation fault!115 hehehe, all seen... :)116 */117 ErrorMessage StoryEntity::stop()118 113 {} 119 114 … … 140 135 141 136 /** 142 \brief loads the current entity 137 \brief stops the current entity 138 \returns error code if this action has caused a error 143 139 144 this is here to enable you loading maps into the entities. for all other actions you 145 should take the init() function. 140 ATTENTION: this function shouldn't call other functions, or if so, they must return 141 after finishing. If you ignore or forget to do so, the current entity is not able to 142 terminate and it will run in the background or the ressources can't be freed or even 143 worse: are freed and the program will end in a segmentation fault! 144 hehehe, all seen... :) 146 145 */ 147 void StoryEntity::load()146 ErrorMessage StoryEntity::stop() 148 147 {} 149 148 … … 155 154 the entity please use the stop() function. 156 155 */ 157 voidStoryEntity::destroy()156 ErrorMessage StoryEntity::destroy() 158 157 {} 159 158 -
orxonox/trunk/src/story_entity.h
r3365 r3459 21 21 bool isPaused; //! is true if the entity is paused 22 22 23 virtual ErrorMessage load(); 23 24 virtual ErrorMessage init(); 24 25 virtual ErrorMessage start(int storyID); 25 26 virtual ErrorMessage start(); 26 virtual ErrorMessage stop();27 27 virtual ErrorMessage pause(); 28 28 virtual ErrorMessage resume(); 29 virtual ErrorMessage stop(); 30 virtual ErrorMessage destroy(); 29 31 30 virtual void load();31 virtual void destroy();32 32 33 33 virtual void displayLoadScreen(); -
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 -
orxonox/trunk/src/world.h
r3456 r3459 31 31 World (int worldID); 32 32 virtual ~World (); 33 33 34 35 /* classes from story-entity */ 36 virtual ErrorMessage load (); 34 37 virtual ErrorMessage init (); 35 38 virtual ErrorMessage start (); … … 37 40 virtual ErrorMessage pause (); 38 41 virtual ErrorMessage resume (); 42 virtual ErrorMessage destroy (); 39 43 40 virtual void load();41 virtual void destroy();44 virtual void displayLoadScreen(); 45 virtual void releaseLoadScreen(); 42 46 43 //static void vertexCallback (GLfloat* vertex);44 47 45 void timeSlice (Uint32 deltaT);46 void collide (); 48 /* main functions for world-looping */ 49 47 50 void draw (); 48 51 void update (); // maps Locations to Placements 49 52 //void calcCameraPos (Location* loc, Placement* plc); 50 53 51 void unload ();52 54 bool command (Command* cmd); 53 virtual void displayLoadScreen(); 54 virtual void releaseLoadScreen(); 55 55 56 56 57 //bool system_command (Command* cmd); … … 90 91 void handleInput (); 91 92 void timeSlice (); 92 void colli sion();93 void collide (); 93 94 void display (); 94 95 void debug ();
Note: See TracChangeset
for help on using the changeset viewer.