Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7723 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
May 19, 2006, 4:28:19 AM (19 years ago)
Author:
bensch
Message:

trunk: Changed away from the Static stuff in GameWorld

Location:
trunk/src/story_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/game_world.cc

    r7677 r7723  
    6464SHELL_COMMAND(speed, GameWorld, setSpeed) ->describe("set the Speed of the Level");
    6565SHELL_COMMAND(playmode, GameWorld, setPlaymode)
    66     ->describe("Set the Playmode of the current Level")
    67     ->completionPlugin(0, OrxShell::CompletorStringArray(Playable::playmodeNames, Playable::PlaymodeCount));
    68 
    69 SHELL_COMMAND_STATIC(togglePNodeVisibility, GameWorld, GameWorld::togglePNodeVisibility);
    70 SHELL_COMMAND_STATIC(toggleBVVisibility, GameWorld, GameWorld::toggleBVVisibility);
     66->describe("Set the Playmode of the current Level")
     67->completionPlugin(0, OrxShell::CompletorStringArray(Playable::playmodeNames, Playable::PlaymodeCount));
     68
     69SHELL_COMMAND(togglePNodeVisibility, GameWorld, GameWorld::togglePNodeVisibility);
     70SHELL_COMMAND(toggleBVVisibility, GameWorld, GameWorld::toggleBVVisibility);
    7171
    7272
     
    477477  /* draw all WorldEntiy groups */
    478478  for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    479    this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
     479    this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
    480480
    481481
     
    526526void GameWorld::togglePNodeVisibility()
    527527{
    528   if (State::getCurrentStoryEntity() != NULL &&
    529       State::getCurrentStoryEntity()->isA(CL_GAME_WORLD))
    530   {
    531     dynamic_cast<GameWorld*>(State::getCurrentStoryEntity())->showPNodes = !dynamic_cast<GameWorld*>(State::getCurrentStoryEntity())->showPNodes;
    532   }
    533   else
    534     PRINTF(2)("The Current Story entity is not a GameWorld\n");
     528  this->showPNodes = !this->showPNodes;
    535529};
    536530
     
    541535void GameWorld::toggleBVVisibility()
    542536{
    543   if (State::getCurrentStoryEntity() != NULL &&
    544       State::getCurrentStoryEntity()->isA(CL_GAME_WORLD))
    545   {
    546     dynamic_cast<GameWorld*>(State::getCurrentStoryEntity())->showBV = !dynamic_cast<GameWorld*>(State::getCurrentStoryEntity())->showBV;
    547   }
    548   else
    549     PRINTF(2)("The Current Story entity is not a GameWorld\n");
     537  this->showBV = !this->showBV;
    550538};
    551539
  • trunk/src/story_entities/game_world.h

    r7391 r7723  
    5454    /**  returns the track path of this world @returns the track path */
    5555
    56     static void togglePNodeVisibility();
    57     static void toggleBVVisibility();
     56    void togglePNodeVisibility();
     57    void toggleBVVisibility();
    5858
    5959    inline void setSky(WorldEntity* sky) { this->dataTank->sky = sky; }
Note: See TracChangeset for help on using the changeset viewer.