Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 23, 2009, 11:31:02 PM (15 years ago)
Author:
rgrieder
Message:

Removed almost everything. Should be working already, but not yet tested on Unix.

Location:
code/trunk/src/orxonox
Files:
29 deleted
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/CMakeLists.txt

    r5752 r5774  
    2626SET_SOURCE_FILES(ORXONOX_SRC_FILES
    2727  Main.cc
    28 
    29   CameraManager.cc
    30   LevelManager.cc
    31   PawnManager.cc
    32   PlayerManager.cc
    33 
    34   Level.cc
    35   Radar.cc
    36   Scene.cc
     28  GSRoot.cc
    3729)
    38 
    39 ADD_SUBDIRECTORY(collisionshapes)
    40 ADD_SUBDIRECTORY(controllers)
    41 ADD_SUBDIRECTORY(gametypes)
    42 ADD_SUBDIRECTORY(graphics)
    43 ADD_SUBDIRECTORY(infos)
    44 ADD_SUBDIRECTORY(interfaces)
    45 ADD_SUBDIRECTORY(items)
    46 ADD_SUBDIRECTORY(overlays)
    47 ADD_SUBDIRECTORY(pickup)
    48 ADD_SUBDIRECTORY(sound)
    49 ADD_SUBDIRECTORY(weaponsystem)
    50 ADD_SUBDIRECTORY(worldentities)
    5130
    5231ORXONOX_ADD_LIBRARY(orxonox
    5332  FIND_HEADER_FILES
    54   TOLUA_FILES
    55     LevelManager.h
    56     pickup/BaseItem.h
    57     pickup/PickupInventory.h
    5833  DEFINE_SYMBOL
    5934    "ORXONOX_SHARED_BUILD"
    60   PCH_FILE
    61     OrxonoxPrecompiledHeaders.h
    6235  LINK_LIBRARIES
    63     ${Boost_FILESYSTEM_LIBRARY}
    64     ${Boost_SYSTEM_LIBRARY} # Filesystem dependency
    65     ${Boost_THREAD_LIBRARY}
    66     ${Boost_DATE_TIME_LIBRARY} # Thread dependency
    67     ${OGRE_LIBRARY}
    68     ${OPENAL_LIBRARY}
    69     ${ALUT_LIBRARY}
    70     ${VORBISFILE_LIBRARY}
    71     ${VORBIS_LIBRARY}
    72     ${OGG_LIBRARY}
    73     tinyxml++_orxonox
    7436    tolua++_orxonox
    75     bullet_orxonox
    7637    util
    7738    core
    78     network
    79     tools
    8039  SOURCE_FILES ${ORXONOX_SRC_FILES}
    8140)
  • code/trunk/src/orxonox/GSRoot.cc

    r5758 r5774  
    3030
    3131#include "core/Clock.h"
    32 #include "core/ConsoleCommand.h"
    3332#include "core/Game.h"
    34 #include "core/GameMode.h"
    35 #include "network/NetworkFunction.h"
    36 #include "tools/Timer.h"
    37 #include "tools/interfaces/TimeFactorListener.h"
    38 #include "tools/interfaces/Tickable.h"
    39 #include "LevelManager.h"
    4033
    4134namespace orxonox
     
    4538    GSRoot::GSRoot(const GameStateInfo& info)
    4639        : GameState(info)
    47         , timeFactor_(1.0f)
    48         , bPaused_(false)
    49         , timeFactorPauseBackup_(1.0f)
    5040    {
    51         this->ccSetTimeFactor_ = 0;
    52         this->ccPause_ = 0;
    5341    }
    5442
    5543    GSRoot::~GSRoot()
    5644    {
    57         NetworkFunctionBase::destroyAllNetworkFunctions();
    5845    }
    5946
    6047    void GSRoot::activate()
    6148    {
    62         // reset game speed to normal
    63         this->timeFactor_ = 1.0f;
    64 
    65         {
    66             // time factor console command
    67             FunctorMember<GSRoot>* functor = createFunctor(&GSRoot::setTimeFactor);
    68             functor->setObject(this);
    69             this->ccSetTimeFactor_ = createConsoleCommand(functor, "setTimeFactor");
    70             CommandExecutor::addConsoleCommandShortcut(this->ccSetTimeFactor_).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);
    71         }
    72 
    73         {
    74             // time factor console command
    75             FunctorMember<GSRoot>* functor = createFunctor(&GSRoot::pause);
    76             functor->setObject(this);
    77             this->ccPause_ = createConsoleCommand(functor, "pause");
    78             CommandExecutor::addConsoleCommandShortcut(this->ccPause_).accessLevel(AccessLevel::Offline);
    79         }
    80 
    81         // create the LevelManager
    82         this->levelManager_ = new LevelManager();
    8349    }
    8450
    8551    void GSRoot::deactivate()
    8652    {
    87 /*
    88         if (this->ccSetTimeFactor_)
    89         {
    90             delete this->ccSetTimeFactor_;
    91             this->ccSetTimeFactor_ = 0;
    92         }
    93 
    94         if (this->ccPause_)
    95         {
    96             delete this->ccPause_;
    97             this->ccPause_ = 0;
    98         }
    99 */
    100 
    101         delete this->levelManager_;
    10253    }
    10354
    10455    void GSRoot::update(const Clock& time)
    10556    {
    106         if (this->getActivity().topState)
    107         {
    108             // This state can not 'survive' on its own.
    109             // Load a user interface therefore
    110             Game::getInstance().requestState("ioConsole");
    111         }
    112 
    113         for (ObjectList<TimerBase>::iterator it = ObjectList<TimerBase>::begin(); it; ++it)
    114             it->tick(time);
    115 
    116         /*** HACK *** HACK ***/
    117         // Call the Tickable objects
    118         float leveldt = time.getDeltaTime();
    119         if (leveldt > 1.0f)
    120         {
    121             // just loaded
    122             leveldt = 0.0f;
    123         }
    124         for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
    125             it->tick(leveldt * this->timeFactor_);
    126         /*** HACK *** HACK ***/
    127     }
    128 
    129     /**
    130     @brief
    131         Changes the speed of Orxonox
    132     @remark
    133         This function is a hack when placed here!
    134         Timefactor should be related to the scene (level or so), not the game
    135     */
    136     void GSRoot::setTimeFactor(float factor)
    137     {
    138         if (GameMode::isMaster())
    139         {
    140             if (!this->bPaused_)
    141             {
    142                 TimeFactorListener::timefactor_s = factor;
    143 
    144                 for (ObjectList<TimeFactorListener>::iterator it = ObjectList<TimeFactorListener>::begin(); it != ObjectList<TimeFactorListener>::end(); ++it)
    145                     it->changedTimeFactor(factor, this->timeFactor_);
    146 
    147                 this->timeFactor_ = factor;
    148             }
    149             else
    150                 this->timeFactorPauseBackup_ = factor;
    151         }
    152     }
    153 
    154     void GSRoot::pause()
    155     {
    156         if (GameMode::isMaster())
    157         {
    158             if (!this->bPaused_)
    159             {
    160                 this->timeFactorPauseBackup_ = this->timeFactor_;
    161                 this->setTimeFactor(0.0f);
    162                 this->bPaused_ = true;
    163             }
    164             else
    165             {
    166                 this->bPaused_ = false;
    167                 this->setTimeFactor(this->timeFactorPauseBackup_);
    168             }
    169         }
    17057    }
    17158}
  • code/trunk/src/orxonox/GSRoot.h

    r5758 r5774  
    3030#define _GSRoot_H__
    3131
    32 #include "gamestates/GameStatesPrereqs.h"
     32#include "OrxonoxPrereqs.h"
    3333#include "core/GameState.h"
    3434
    3535namespace orxonox
    3636{
    37     class _GameStatesExport GSRoot : public GameState
     37    class _OrxonoxExport GSRoot : public GameState
    3838    {
    3939    public:
     
    4545        void update(const Clock& time);
    4646
    47         // this has to be public because proteced triggers a bug in msvc
    48         // when taking the function address.
    49         void setTimeFactor(float factor);
    50         void pause();
    51         float getTimeFactor() { return this->timeFactor_; }
    52 
    5347    private:
    54         float                 timeFactor_;              //!< A factor that sets the gamespeed. 1 is normal.
    55         bool                  bPaused_;
    56         float                 timeFactorPauseBackup_;
    57 
    58         LevelManager*         levelManager_;            //!< global level manager
    59 
    60         // console commands
    61         ConsoleCommand*       ccSetTimeFactor_;
    62         ConsoleCommand*       ccPause_;
    6348    };
    6449}
  • code/trunk/src/orxonox/Main.cc

    r5695 r5774  
    4141#include "core/Game.h"
    4242#include "core/LuaState.h"
    43 #include "ToluaBindOrxonox.h"
    4443#include "Main.h"
    45 
    46 SetCommandLineSwitch(console).information("Start in console mode (text IO only)");
    47 // Shortcuts for easy direct loading
    48 SetCommandLineSwitch(server).information("Start in server mode");
    49 SetCommandLineSwitch(client).information("Start in client mode");
    50 SetCommandLineSwitch(dedicated).information("Start in dedicated server mode");
    51 SetCommandLineSwitch(standalone).information("Start in standalone mode");
    52 
    53 DeclareToluaInterface(Orxonox);
    5444
    5545namespace orxonox
     
    6555        game->setStateHierarchy(
    6656        "root"
    67         " graphics"
    68         "  mainMenu"
    69         "  standalone"
    70         "   level"
    71         "  server"
    72         "   level"
    73         "  client"
    74         "   level"
    75         " dedicated"
    76         "  level"
    77         " ioConsole"
    7857        );
    7958
    8059        game->requestState("root");
    81 
    82         // Some development hacks (not really, but in the future, this calls won't make sense anymore)
    83         if (CommandLine::getValue("standalone").getBool())
    84             Game::getInstance().requestStates("graphics, standalone, level");
    85         else if (CommandLine::getValue("server").getBool())
    86             Game::getInstance().requestStates("graphics, server, level");
    87         else if (CommandLine::getValue("client").getBool())
    88             Game::getInstance().requestStates("graphics, client, level");
    89         else if (CommandLine::getValue("dedicated").getBool())
    90             Game::getInstance().requestStates("dedicated, level");
    91         else if (CommandLine::getValue("console").getBool())
    92             Game::getInstance().requestStates("ioConsole");
    93         else
    94             Game::getInstance().requestStates("graphics, mainMenu");
    9560
    9661        game->run();
  • code/trunk/src/orxonox/OrxonoxPrereqs.h

    r5738 r5774  
    3636
    3737#include "OrxonoxConfig.h"
    38 
    39 #include "tools/ToolsPrereqs.h"
    4038
    4139//-----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.