- Timestamp:
- Apr 13, 2006, 7:15:37 PM (19 years ago)
- Location:
- trunk/src/story_entities
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/campaign.cc
r7193 r7283 79 79 PRINTF(2)("Starting Campaign nr. %i\n", this->getStoryID()); 80 80 81 this-> isRunning = true;81 this->bRunning = true; 82 82 this->bReturnToMenu = false; 83 83 this->run(); … … 90 90 bool Campaign::pause() 91 91 { 92 this-> isPaused = true;92 this->bPaused = true; 93 93 } 94 94 … … 100 100 { 101 101 PRINTF(4)("Resuming the current Campaign\n"); 102 this-> isPaused = false;102 this->bPaused = false; 103 103 } 104 104 … … 113 113 this->bReturnToMenu = true; 114 114 else 115 this-> isRunning = false; // fast exit115 this->bRunning = false; // fast exit 116 116 if( this->currentEntity != NULL) 117 117 { … … 129 129 int storyID = WORLD_ID_0; 130 130 131 for( this->currentEntity = this->campaignData->getFirstLevel(), this-> isRunning = true;132 this->currentEntity != NULL && this-> isRunning;131 for( this->currentEntity = this->campaignData->getFirstLevel(), this->bRunning = true; 132 this->currentEntity != NULL && this->bRunning; 133 133 this->currentEntity = this->campaignData->getNextLevel()) 134 134 { -
trunk/src/story_entities/game_world.cc
r7221 r7283 89 89 90 90 this->dataXML = NULL; 91 92 this->audioThread = NULL; 91 93 } 92 94 … … 100 102 { 101 103 PRINTF(4)("Deleted GameWorld\n"); 104 105 if (this->audioThread != NULL) 106 SDL_KillThread(this->audioThread); 102 107 } 103 108 … … 131 136 } 132 137 138 int GameWorld::createAudioThread(void* gameWorld) 139 { 140 GameWorld* gw = (GameWorld*)gameWorld; 141 printf("STARTIG AUDIO THREAD\n"); 142 while (gw->bRunning) 143 { 144 if(gw->dataTank->music != NULL) 145 gw->dataTank->music->playback(); 146 SDL_Delay(5); 147 } 148 printf("End the AudioThread\n"); 149 } 133 150 134 151 /** … … 199 216 bool GameWorld::start() 200 217 { 201 this->isPaused = false; 202 this->isRunning = true; 218 this->bPaused = false; 219 this->bRunning = true; 220 221 if (this->audioThread == NULL) 222 this->audioThread = SDL_CreateThread(GameWorld::createAudioThread, (void*)this); 203 223 204 224 this->run(); … … 212 232 { 213 233 PRINTF(3)("GameWorld::stop() - got stop signal\n"); 214 this->isRunning = false; 234 this->bRunning = false; 235 236 // SDL_KillThread(this->audioThread); 237 this->audioThread = NULL; 215 238 } 216 239 … … 221 244 bool GameWorld::pause() 222 245 { 223 this-> isPaused = true;246 this->bPaused = true; 224 247 } 225 248 … … 230 253 bool GameWorld::resume() 231 254 { 232 this-> isPaused = false;255 this->bPaused = false; 233 256 } 234 257 … … 243 266 void GameWorld::run() 244 267 { 245 /* start the music */246 if(this->dataTank->music != NULL)247 this->dataTank->music->playback();248 249 268 PRINTF(3)("GameWorld::mainLoop() - Entering main loop\n"); 250 269 … … 256 275 this->lastFrame = SDL_GetTicks (); 257 276 258 while( this-> isRunning) /* @todo implement pause */277 while( this->bRunning) /* @todo implement pause */ 259 278 { 260 279 /* process intput */ 261 280 this->handleInput (); 262 if( !this-> isRunning)281 if( !this->bRunning) 263 282 break; 264 283 … … 326 345 Uint32 currentFrame = SDL_GetTicks(); 327 346 328 if( !this-> isPaused)347 if( !this->bPaused) 329 348 { 330 349 // CALCULATE FRAMERATE -
trunk/src/story_entities/game_world.h
r7131 r7283 10 10 #include "story_entity.h" 11 11 #include "game_world_data.h" 12 13 #include <SDL_thread.h> 12 14 13 15 class Shell; … … 54 56 static void toggleBVVisibility(); 55 57 56 58 static int createAudioThread(void* GameWorld); 57 59 58 60 … … 78 80 79 81 protected: 82 SDL_Thread* audioThread; 80 83 GameWorldData* dataTank; //!< reference to the GameWorld Data Tank 81 84 TiXmlElement* dataXML; //!< The XML-Element this World has been loaded with. -
trunk/src/story_entities/movie_loader.cc
r7221 r7283 79 79 this->movie_player->start(0); 80 80 81 this-> isRunning = true;81 this->bRunning = true; 82 82 this->run(); 83 83 } … … 87 87 EventHandler::getInstance()->popState(); 88 88 89 this-> isRunning = false;89 this->bRunning = false; 90 90 } 91 91 … … 98 98 this->lastFrame = SDL_GetTicks (); 99 99 100 while( this-> isRunning)100 while( this->bRunning) 101 101 { 102 102 EventHandler::getInstance()->process(); … … 146 146 147 147 if (movie_player->getStatus() == STOP) 148 this-> isRunning = false;148 this->bRunning = false; 149 149 150 150 this->lastFrame = currentFrame; -
trunk/src/story_entities/story_entity.cc
r7221 r7283 36 36 this->setClassID(CL_STORY_ENTITY, "StoryEntity"); 37 37 38 this-> isInit = false;39 this-> isPaused = false;40 this-> isRunning = false;38 this->bInit = false; 39 this->bPaused = false; 40 this->bRunning = false; 41 41 42 42 this->loadFile = ""; -
trunk/src/story_entities/story_entity.h
r7221 r7283 24 24 25 25 //! A class that represents something to play in orxonox. it is a container for worlds, movies, mission briefings, etc... 26 class StoryEntity : virtual public BaseObject { 26 class StoryEntity : virtual public BaseObject 27 { 27 28 28 29 public: 29 30 StoryEntity (); 30 31 virtual ~StoryEntity (); … … 85 86 inline const std::string& getMenuScreenshoot() { return this->menuScreenshoot; } 86 87 87 88 bool isInit;//!< if the entity is initialized, this has to be true.89 bool isRunning;//!< is true if the entity is running90 bool isPaused;//!< is true if the entity is paused88 protected: 89 bool bInit; //!< if the entity is initialized, this has to be true. 90 bool bRunning; //!< is true if the entity is running 91 bool bPaused; //!< is true if the entity is paused 91 92 92 93 93 94 95 96 94 private: 95 int storyID; //!< this is the number of this entity, identifying it in a list/tree... 96 int nextStoryID; //!< if this entity has finished, this entity shall be called 97 std::string loadFile; //!< The file from which this world is loaded 97 98 98 99 100 101 99 std::string description; //!< the description of the StoryEntity 100 std::string menuItemImage; //!< the item image of the StoryEntity 101 std::string menuScreenshoot; //!< the screenshoot of the StoryEntity 102 bool bMenuEntry; //!< If true, this GameWorld apears in the SimpleMenu: SimpleMenu specific 102 103 }; 103 104
Note: See TracChangeset
for help on using the changeset viewer.