Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 568 for code/branches


Ignore:
Timestamp:
Dec 17, 2007, 12:09:13 PM (17 years ago)
Author:
scheusso
Message:

added capability for presentation mode

Location:
code/branches/FICN/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/GameStateManager.cc

    r514 r568  
    9090
    9191  GameState *retval=new GameState; //return value
    92   retval->id=id;
     92  retval->id=id++;
    9393  // reserve a little memory and increase it later on
    9494  retval->data = (unsigned char*)malloc(1);
     
    100100    //get size of the synchronisable
    101101    tempsize=it->getSize();
     102    COUT(2) << "size of synchronisable: " << tempsize << std::endl;
    102103    // add place for data and 3 ints (length,classid,objectid)
    103104    totalsize+=tempsize+3*sizeof(int);
  • code/branches/FICN/src/orxonox/objects/BaseEntity.h

    r566 r568  
    1616      void loadParams(TiXmlElement* xmlElem);
    1717      bool create();
     18    protected:
     19      void registerAllVariables();
    1820    private:
    19       void registerAllVariables();
    20      
    2121    // membervariables to be synchronised
    2222      std::string name_;
  • code/branches/FICN/src/orxonox/orxonox.cc

    r565 r568  
    217217    //TODO: read config file
    218218    //TODO: give config file to Ogre
    219     std::string mode = "";
     219    std::string mode;
     220    if(argc>=2)
     221      mode = std::string(argv[1]);
     222    else
     223      mode = "";
    220224    ArgReader ar = ArgReader(argc, argv);
    221225    ar.checkArgument("mode", mode, false);
     
    226230    {
    227231      serverInit(path);
     232      mode = SERVER;
    228233    }
    229234    else if(mode == std::string("client"))
    230235    {
    231236      clientInit(path);
     237      mode = CLIENT;
    232238    }
    233239    else if(mode == std::string("presentation"))
    234240    {
    235       playableServer(path);
    236     }
    237     else
    238       standalone(path);
     241      serverInit(path);
     242      mode = PRESENTATION;
     243    }
     244    else{
     245      standaloneInit(path);
     246      mode = STANDALONE;
     247    }
    239248  }
    240249
     
    252261    createFrameListener();
    253262    Factory::createClassHierarchy();
     263    switch(mode_){
     264    case PRESENTATION:
     265      server_g->open();
     266      break;
     267    case SERVER:
     268    case CLIENT:
     269    case STANDALONE:
     270    default:
     271      break;
     272    }
    254273    startRenderLoop();
    255274  }
     
    274293  }
    275294
    276   void Orxonox::standalone(std::string path)
     295  void Orxonox::standaloneInit(std::string path)
    277296  {
    278297    ogre_->setConfigPath(path);
     
    320339    startRenderLoop();
    321340  }
     341 
     342  void Orxonox::standalone(){
     343   
     344   
     345   
     346  }
    322347
    323348  void Orxonox::serverInit(std::string path)
     
    327352    server_g = new network::Server(); // add some settings if wanted
    328353    if(!ogre_->load()) die(/* unable to load */);
     354    // add network framelistener
    329355    ogre_->getRoot()->addFrameListener(new network::ServerFrameListener());
    330     ogre_->startRender();
    331 
    332     createScene();
    333     setupScene();
    334356  }
    335357
     
    341363    if(!ogre_->load()) die(/* unable to load */);
    342364    ogre_->getRoot()->addFrameListener(new network::ClientFrameListener());
    343     ogre_->startRender();
    344 
    345     createScene();
    346     setupScene();
    347     setupInputSystem();
    348     createFrameListener();
    349     startRenderLoop();
    350365  }
    351366
  • code/branches/FICN/src/orxonox/orxonox.h

    r531 r568  
    2323namespace orxonox {
    2424
     25  enum gameMode{
     26    STANDALONE,
     27    SERVER,
     28    CLIENT,
     29    PRESENTATION
     30  };
     31 
    2532  class OrxListener;
    2633
     
    3946      Orxonox();
    4047      virtual ~Orxonox();
     48      // init functions
    4149      void serverInit(std::string path);
    4250      void clientInit(std::string path);
    43       void standalone(std::string path);
     51      void standaloneInit(std::string path);
     52      // run functions
    4453      void playableServer(std::string path);
     54      void standalone();
    4555      void defineResources();
    4656      void setupRenderSystem();
     
    6575      OrxListener*          frameListener_;
    6676      Ogre::Root*           root_;
     77     
     78      // this is used to identify the mode (server/client/...) we're in
     79      gameMode              mode_;
    6780  };
    6881}
Note: See TracChangeset for help on using the changeset viewer.