Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6459 in orxonox.OLD


Ignore:
Timestamp:
Jan 10, 2006, 2:00:20 AM (18 years ago)
Author:
patrick
Message:

network: skybox parenting fix

Location:
branches/network/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_game_manager.cc

    r6424 r6459  
    2525
    2626#include "p_node.h"
     27#include "state.h"
     28#include "game_world.h"
     29#include "world_entity.h"
    2730
    2831
     
    474477      s->setIsOutOfSync( true );
    475478    PRINTF(0)("Fabricated %s with id %d\n", s->getClassName(), s->getUniqueID());
     479
     480
     481    if( !strcmp( s->getClassName(), "SkyBox"))
     482    {
     483      PRINTF(0)("==> Created the Sky!\n");
     484      (dynamic_cast<GameWorld*>(State::getCurrentStoryEntity()))->setSky( dynamic_cast<WorldEntity*>(s) );
     485    }
     486//       this->sky = dynamic_cast<WorldEntity*>(created);
     487    if( !strcmp( s->getClassName(), "Terrain"))
     488    {
     489      PRINTF(0)("==> Created the Terrain\n");
     490//       this->terrain = dynamic_cast<Terrain*>(created);
     491//       CDEngine::getInstance()->setTerrain(terrain);
     492    }
     493
    476494    return b;
    477495  }
  • branches/network/src/story_entities/game_world.cc

    r6424 r6459  
    200200  this->isRunning = true;
    201201
     202  State::setCurrentStoryEntity(dynamic_cast<StoryEntity*>(this));
     203
    202204  this->run();
    203205}
  • branches/network/src/story_entities/game_world.h

    r6424 r6459  
    99
    1010#include "story_entity.h"
    11 
     11#include "game_world_data.h"
    1212
    1313class TiXmlElement;
     
    5656
    5757
     58    inline void setSky(WorldEntity* sky) { this->dataTank->sky = sky; }
     59
     60
    5861  protected:
    5962    /* world - running functions */
  • branches/network/src/story_entities/multi_player_world_data.cc

    r6424 r6459  
    4848
    4949#include "glmenu_imagescreen.h"
     50
    5051
    5152
     
    177178    this->localPlayer = new Player();
    178179    Playable* playable;
    179     const list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
     180    const std::list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE);
     181    assert( playableList != NULL);
     182
     183    std::list<BaseObject*>::const_iterator entity;
     184    for (entity = playableList->begin(); entity != playableList->end(); entity++)
     185      PRINTF(0)("Got a playable, class: %s, name: %s\n", (*entity)->getClassName(), (*entity)->getName());
     186
     187
    180188    if (playableList != NULL)
    181189    {
     
    184192    }
    185193
    186 
    187194    /* init the pnode tree */
    188195    PNode::getNullParent()->init();
  • branches/network/src/util/state.cc

    r6222 r6459  
    3131ObjectManager* State::objectManager = NULL;
    3232
     33StoryEntity* State::storyEntity = NULL;
     34
    3335/**
    3436 *  sets camera and target of the current Camera
  • branches/network/src/util/state.h

    r6222 r6459  
    77#define _STATE_H
    88
     9
    910// FORWARD DECLARATION
    1011class PNode;
    1112class WorldEntity;
    1213class ObjectManager;
     14class StoryEntity;
    1315
    1416//! handles states about orxonox's most importatn objects
     
    3941  static inline ObjectManager* getObjectManager() { return State::objectManager; };
    4042
     43  //////////////////////
     44  /// STORY-ENTITY   ///
     45  //////////////////////
     46  /** @param storyEntity sets the current StoryEntity that is been played */
     47  static inline void setCurrentStoryEntity(StoryEntity* storyEntity) { State::storyEntity = storyEntity; };
     48  /** @returns the current StoryEntity played */
     49  static inline StoryEntity* getCurrentStoryEntity() { return State::storyEntity; };
     50
     51
    4152  /////////////////////////
    4253  /// WORLD_ENTITY_LIST ///
     
    4960  static PNode*                 cameraTarget;       //!< A reference to the cameraTarget
    5061  static PNode*                 nullParent;         //!< A reference to the Null-PNode.
    51   static ObjectManager*         objectManager;      //!< A referenct to the current ObjectManager
     62  static ObjectManager*         objectManager;      //!< A reference to the current ObjectManager
     63  static StoryEntity*           storyEntity;        //!< A reference to the current StoryEntity played
    5264
    5365};
Note: See TracChangeset for help on using the changeset viewer.