Changeset 7908 for code/forks/sandbox_light/src
- Timestamp:
- Feb 17, 2011, 5:47:22 AM (14 years ago)
- Location:
- code/forks/sandbox_light/src
- Files:
-
- 35 added
- 132 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
code/forks/sandbox_light/src/CMakeLists.txt
r7819 r7908 38 38 # If no defines are specified, these libs get linked statically 39 39 ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC) 40 #ADD_COMPILER_FLAGS("-DENET_DLL" WIN32 LINK_ENET_DYNAMIC)41 ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL" WIN32 LINK_LUA_DYNAMIC)42 ADD_COMPILER_FLAGS("-DZLIB_DLL" WIN32 LINK_ZLIB_DYNAMIC)43 40 # If no defines are specified, these libs get linked dynamically 44 ADD_COMPILER_FLAGS("-DCEGUI_STATIC" WIN32 NOT LINK_CEGUI_DYNAMIC) 45 ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB" WIN32 NOT LINK_OGRE_DYNAMIC) 46 ADD_COMPILER_FLAGS("-DSTATIC_BUILD" WIN32 NOT LINK_TCL_DYNAMIC) 41 #ADD_COMPILER_FLAGS("-DSTATIC_BUILD" WIN32 NOT LINK_TCL_DYNAMIC) 47 42 48 43 ######### Library Behaviour (external) ########## 49 50 # Use TinyXML++51 ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP")52 44 53 45 # Default linking for externals is SHARED … … 59 51 SET(_external_shared_link FALSE) 60 52 ENDIF() 61 # If no defines are specified, these libs get linked dynamically62 ADD_COMPILER_FLAGS("-DCEGUILUA_STATIC" WIN32 NOT _external_shared_link)63 ADD_COMPILER_FLAGS("-DENET_DLL" WIN32 _external_shared_link)64 ADD_COMPILER_FLAGS("-DOGRE_GUIRENDERER_STATIC_LIB" WIN32 NOT _external_shared_link)65 ADD_COMPILER_FLAGS("-DOIS_STATIC_LIB" WIN32 NOT _external_shared_link)66 ADD_COMPILER_FLAGS("-DTOLUA_STATIC_BUILD" WIN32 NOT _external_shared_link)67 53 68 54 ############## Include Directories ############## … … 71 57 INCLUDE_DIRECTORIES( 72 58 # External 73 ${OGRE_INCLUDE_DIR}74 ${CEGUI_INCLUDE_DIR}75 #${ENET_INCLUDE_DIR}76 59 ${Boost_INCLUDE_DIRS} 77 60 ${POCO_INCLUDE_DIR} 78 ${OPENAL_INCLUDE_DIRS}79 ${ALUT_INCLUDE_DIR}80 ${VORBIS_INCLUDE_DIR}81 ${OGG_INCLUDE_DIR}82 ${LUA_INCLUDE_DIR}83 ${TCL_INCLUDE_PATH}84 ${DIRECTX_INCLUDE_DIR}85 ${ZLIB_INCLUDE_DIR}86 61 87 62 # All includes in "externals" should be prefixed with the path … … 89 64 ${CMAKE_CURRENT_SOURCE_DIR}/external 90 65 # Include directories needed even if only included by Orxonox 91 ${CMAKE_CURRENT_SOURCE_DIR}/external/bullet 92 ${CMAKE_CURRENT_SOURCE_DIR}/external/ois 66 #${CMAKE_CURRENT_SOURCE_DIR}/external/ois 93 67 94 68 # OrxonoxConfig.h … … 96 70 ) 97 71 98 IF(CEGUILUA_USE_INTERNAL_LIBRARY)99 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/external/ceguilua/ceguilua-${CEGUI_VERSION})100 ENDIF()101 102 72 IF (DBGHELP_FOUND) 103 73 INCLUDE_DIRECTORIES(${DBGHELP_INCLUDE_DIR}) 104 74 ENDIF() 105 106 ################### Tolua Bind ##################107 108 # Create directory because the tolua application doesn't work otherwise109 IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/toluabind/${CMAKE_CFG_INTDIR})110 FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/toluabind/${CMAKE_CFG_INTDIR})111 ENDIF()112 113 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/toluabind/${CMAKE_CFG_INTDIR})114 75 115 76 ################ Sub Directories ################ … … 118 79 ADD_SUBDIRECTORY(libraries) 119 80 ADD_SUBDIRECTORY(orxonox) 120 ADD_SUBDIRECTORY(modules)121 81 122 82 ################## Executable ################### … … 141 101 OUTPUT_NAME orxonox 142 102 ) 143 # Main executable should depend on all modules144 ADD_DEPENDENCIES(orxonox-main ${ORXONOX_MODULES})145 103 146 104 # Get name to configure the run scripts -
code/forks/sandbox_light/src/SpecialConfig.h.in
r7818 r7908 42 42 #include "OrxonoxConfig.h" 43 43 44 #cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY ///< Set whether we must suffix "ceguilua/" for the CEGUILua.h include45 46 44 #cmakedefine DEPENDENCY_PACKAGE_ENABLE ///< Defined if a precompiled depdency package was used. We then copy all libraries too when installing. 47 45 … … 61 59 const char defaultLibraryPath[] = "@DEFAULT_LIBRARY_PATH@"; 62 60 const char defaultArchivePath[] = "@DEFAULT_ARCHIVE_PATH@"; 63 const char defaultModulePath[] = "@DEFAULT_MODULE_PATH@";64 61 const char defaultDocPath[] = "@DEFAULT_DOC_PATH@"; 65 62 const char defaultDataPath[] = "@DEFAULT_DATA_PATH@"; … … 70 67 // INSTALLATION PATHS 71 68 const char dataInstallDirectory[] = "@DATA_INSTALL_DIRECTORY@"; 72 const char moduleInstallDirectory[] = "@MODULE_INSTALL_DIRECTORY@";73 69 #endif 74 70 75 71 // DEVELOPMENT RUN PATHS 76 72 const char dataDevDirectory[] = "@DATA_DIRECTORY@"; 77 const char externalDataDevDirectory[] = "@EXTERNAL_DATA_DIRECTORY@";78 73 #ifdef CMAKE_CONFIGURATION_TYPES 79 const char moduleDevDirectory[] = "@CMAKE_MODULE_OUTPUT_DIRECTORY@/" CMAKE_INTDIR;80 74 const char configDevDirectory[] = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" CMAKE_INTDIR; 81 75 const char logDevDirectory[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@/" CMAKE_INTDIR; 82 76 #else 83 const char moduleDevDirectory[] = "@CMAKE_MODULE_OUTPUT_DIRECTORY@";84 77 const char configDevDirectory[] = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@"; 85 78 const char logDevDirectory[] = "@CMAKE_LOG_OUTPUT_DIRECTORY@"; … … 90 83 #endif 91 84 92 // Module extension93 const char moduleExtension[] = "@ORXONOX_MODULE_EXTENSION@";94 95 // OGRE PLUGINS96 #ifdef NDEBUG97 const char ogrePlugins[] = "@OGRE_PLUGINS_RELEASE@";98 # ifdef DEPENDENCY_PACKAGE_ENABLE99 const char ogrePluginsDirectory[] = ".";100 # else101 const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_RELEASE@";102 # endif103 #else104 const char ogrePlugins[] = "@OGRE_PLUGINS_DEBUG@";105 # ifdef DEPENDENCY_PACKAGE_ENABLE106 const char ogrePluginsDirectory[] = ".";107 # else108 const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";109 # endif110 #endif111 85 } } 112 86 -
code/forks/sandbox_light/src/external/CMakeLists.txt
r7459 r7908 20 20 ################ Sub Directories ################ 21 21 22 ADD_SUBDIRECTORY(tolua)23 24 # Include CEGUILua if not requested otherwise25 IF(CEGUILUA_USE_INTERNAL_LIBRARY)26 IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})27 MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!")28 ENDIF()29 30 ADD_SUBDIRECTORY(ceguilua)31 SET(CEGUILUA_LIBRARY ${CEGUILUA_LIBRARY} PARENT_SCOPE)32 ENDIF()33 34 ADD_SUBDIRECTORY(bullet)35 ADD_SUBDIRECTORY(cpptcl)36 ADD_SUBDIRECTORY(enet)37 22 ADD_SUBDIRECTORY(loki) 38 ADD_SUBDIRECTORY(ogreceguirenderer) 39 ADD_SUBDIRECTORY(ois) 40 ADD_SUBDIRECTORY(tinyxml) 23 ADD_SUBDIRECTORY(ogremath) -
code/forks/sandbox_light/src/libraries/CMakeLists.txt
r7401 r7908 24 24 ADD_SUBDIRECTORY(util) 25 25 ADD_SUBDIRECTORY(core) 26 ADD_SUBDIRECTORY(network)27 ADD_SUBDIRECTORY(tools) -
code/forks/sandbox_light/src/libraries/core/CMakeLists.txt
r7284 r7908 20 20 SET_SOURCE_FILES(CORE_SRC_FILES 21 21 CommandLineParser.cc 22 ConfigValueContainer.cc23 22 Core.cc 24 DynLib.cc25 DynLibManager.cc26 Event.cc27 Game.cc28 GameMode.cc29 GameState.cc30 GraphicsManager.cc31 GUIManager.cc32 Language.cc33 LuaState.cc34 ObjectListBase.cc35 OrxonoxClass.cc36 Resource.cc37 WindowEventListener.cc38 39 # hierarchy40 Identifier.cc41 MetaObjectList.cc42 43 # level44 BaseObject.cc45 ClassTreeMask.cc46 Loader.cc47 Namespace.cc48 NamespaceNode.cc49 Template.cc50 XMLPort.cc51 XMLNameListener.cc52 53 COMPILATION_BEGIN FilesystemCompilation.cc54 command/ArgumentCompletionFunctions.cc55 ConfigFileManager.cc56 MemoryArchive.cc57 23 PathConfig.cc 58 COMPILATION_END59 60 # multithreading61 ThreadPool.cc62 COMPILATION_BEGIN ThreadCompilation.cc63 command/TclThreadManager.cc64 Thread.cc65 COMPILATION_END66 24 ) 67 68 ADD_SUBDIRECTORY(command)69 ADD_SUBDIRECTORY(input)70 25 71 26 ORXONOX_ADD_LIBRARY(core 72 27 FIND_HEADER_FILES 73 TOLUA_FILES74 command/CommandExecutor.h75 ConfigFileManager.h76 Game.h77 GameMode.h78 GUIManager.h79 Loader.h80 LuaState.h81 PathConfig.h82 input/InputManager.h83 input/KeyBinder.h84 input/KeyBinderManager.h85 PCH_FILE86 CorePrecompiledHeaders.h87 28 LINK_LIBRARIES 88 ${OGRE_LIBRARY}89 29 ${Boost_FILESYSTEM_LIBRARY} 90 30 ${Boost_SYSTEM_LIBRARY} # Filesystem dependency 91 ${Boost_THREAD_LIBRARY}92 ${Boost_DATE_TIME_LIBRARY} # Thread dependency93 ${CEGUI_LIBRARY}94 ${CEGUILUA_LIBRARY}95 ${LUA_LIBRARIES}96 cpptcl_orxonox97 ogreceguirenderer_orxonox98 ois_orxonox99 tinyxml_orxonox100 tolua_orxonox101 31 util 102 32 SOURCE_FILES -
code/forks/sandbox_light/src/libraries/core/Core.cc
r7872 r7908 51 51 #endif 52 52 53 #include "util/Clock.h"54 53 #include "util/Debug.h" 55 #include "util/Exception.h"56 #include "util/Scope.h"57 #include "util/ScopedSingletonManager.h"58 54 #include "util/SignalHandler.h" 59 55 #include "PathConfig.h" 60 56 #include "CommandLineParser.h" 61 #include "ConfigFileManager.h"62 #include "ConfigValueIncludes.h"63 #include "CoreIncludes.h"64 #include "DynLibManager.h"65 #include "GameMode.h"66 #include "GraphicsManager.h"67 #include "GUIManager.h"68 #include "Identifier.h"69 #include "Language.h"70 #include "LuaState.h"71 #include "command/ConsoleCommand.h"72 #include "command/IOConsole.h"73 #include "command/TclBind.h"74 #include "command/TclThreadManager.h"75 #include "input/InputManager.h"76 57 77 58 namespace orxonox … … 80 61 Core* Core::singletonPtr_s = 0; 81 62 82 SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");83 SetCommandLineSwitch(noIOConsole).information("Use this if you don't want to use the IOConsole (for instance for Lua debugging)");84 85 63 #ifdef ORXONOX_PLATFORM_WINDOWS 86 64 SetCommandLineArgument(limitToCPU, 1).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is the first core (faster than off)"); … … 88 66 89 67 Core::Core(const std::string& cmdLine) 90 // Cleanup guard for identifier destruction (incl. XMLPort, configValues, consoleCommands)91 : identifierDestroyer_(Identifier::destroyAllIdentifiers)92 // Cleanup guard for external console commands that don't belong to an Identifier93 , consoleCommandDestroyer_(ConsoleCommand::destroyAll)94 , bGraphicsLoaded_(false)95 , bStartIOConsole_(true)96 , lastLevelTimestamp_(0)97 , ogreConfigTimestamp_(0)98 68 { 99 69 // Set the hard coded fixed paths 100 70 this->pathConfig_.reset(new PathConfig()); 101 102 // Create a new dynamic library manager103 this->dynLibManager_.reset(new DynLibManager());104 105 // Load modules106 const std::vector<std::string>& modulePaths = this->pathConfig_->getModulePaths();107 for (std::vector<std::string>::const_iterator it = modulePaths.begin(); it != modulePaths.end(); ++it)108 {109 try110 {111 this->dynLibManager_->load(*it);112 }113 catch (...)114 {115 COUT(1) << "Couldn't load module \"" << *it << "\": " << Exception::handleMessage() << std::endl;116 }117 }118 71 119 72 // Parse command line arguments AFTER the modules have been loaded (static code!) … … 143 96 #endif 144 97 145 // Manage ini files and set the default settings file (usually orxonox.ini)146 this->configFileManager_.reset(new ConfigFileManager());147 this->configFileManager_->setFilename(ConfigFileType::Settings,148 CommandLineParser::getValue("settingsFile").getString());149 150 // Required as well for the config values151 this->languageInstance_.reset(new Language());152 153 // Do this soon after the ConfigFileManager has been created to open up the154 // possibility to configure everything below here155 ClassIdentifier<Core>::getIdentifier("Core")->initialiseObject(this, "Core", true);156 this->setConfigValues();157 158 // create persistent io console159 if (CommandLineParser::getValue("noIOConsole").getBool())160 {161 ModifyConfigValue(bStartIOConsole_, tset, false);162 }163 if (this->bStartIOConsole_)164 this->ioConsole_.reset(new IOConsole());165 166 // creates the class hierarchy for all classes with factories167 Identifier::createClassHierarchy();168 169 // Load OGRE excluding the renderer and the render window170 this->graphicsManager_.reset(new GraphicsManager(false));171 172 // initialise Tcl173 this->tclBind_.reset(new TclBind(PathConfig::getDataPathString()));174 this->tclThreadManager_.reset(new TclThreadManager(tclBind_->getTclInterpreter()));175 176 // Create singletons that always exist (in other libraries)177 this->rootScope_.reset(new Scope<ScopeID::Root>());178 179 98 // Generate documentation instead of normal run? 180 99 std::string docFilename; … … 199 118 Core::~Core() 200 119 { 201 // Remove us from the object lists again to avoid problems when destroying them202 this->unregisterObject();203 }204 205 //! Function to collect the SetConfigValue-macro calls.206 void Core::setConfigValues()207 {208 #ifdef ORXONOX_RELEASE209 const unsigned int defaultLevelLogFile = 3;210 #else211 const unsigned int defaultLevelLogFile = 4;212 #endif213 SetConfigValueExternal(softDebugLevelLogFile_, "OutputHandler", "softDebugLevelLogFile", defaultLevelLogFile)214 .description("The maximum level of debug output shown in the log file");215 OutputHandler::getInstance().setSoftDebugLevel(OutputHandler::logFileOutputListenerName_s, this->softDebugLevelLogFile_);216 217 SetConfigValue(language_, Language::getInstance().defaultLanguage_)218 .description("The language of the in game text")219 .callback(this, &Core::languageChanged);220 SetConfigValue(bInitRandomNumberGenerator_, true)221 .description("If true, all random actions are different each time you start the game")222 .callback(this, &Core::initRandomNumberGenerator);223 SetConfigValue(bStartIOConsole_, true)224 .description("Set to false if you don't want to use the IOConsole (for Lua debugging for instance)");225 SetConfigValue(lastLevelTimestamp_, 0)226 .description("Timestamp when the last level was started.");227 SetConfigValue(ogreConfigTimestamp_, 0)228 .description("Timestamp when the ogre config file was changed.");229 }230 231 //! Callback function if the language has changed.232 void Core::languageChanged()233 {234 // Read the translation file after the language was configured235 Language::getInstance().readTranslatedLanguageFile();236 120 } 237 121 … … 245 129 bInitialized = true; 246 130 } 247 }248 249 void Core::loadGraphics()250 {251 // Any exception should trigger this, even in upgradeToGraphics (see its remarks)252 Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics);253 254 // Upgrade OGRE to receive a render window255 try256 {257 graphicsManager_->upgradeToGraphics();258 }259 catch (const InitialisationFailedException&)260 {261 // Exit the application if the Ogre config dialog was canceled262 COUT(1) << Exception::handleMessage() << std::endl;263 exit(EXIT_FAILURE);264 }265 catch (...)266 {267 // Recovery from this is very difficult. It requires to completely268 // destroy Ogre related objects and load again (without graphics).269 // However since Ogre 1.7 there seems to be a problem when Ogre270 // throws an exception and the graphics engine then gets destroyed271 // and reloaded between throw and catch (access violation in MSVC).272 // That's why we abort completely and only display the exception.273 COUT(1) << "An exception occurred during upgrade to graphics. "274 << "That is unrecoverable. The message was:" << endl275 << Exception::handleMessage() << endl;276 abort();277 }278 279 // Calls the InputManager which sets up the input devices.280 inputManager_.reset(new InputManager());281 282 // Load the CEGUI interface283 guiManager_.reset(new GUIManager(inputManager_->getMousePosition()));284 285 bGraphicsLoaded_ = true;286 GameMode::bShowsGraphics_s = true;287 288 // Load some sort of a debug overlay (only denoted by its name, "debug.oxo")289 graphicsManager_->loadDebugOverlay();290 291 // Create singletons associated with graphics (in other libraries)292 graphicsScope_.reset(new Scope<ScopeID::Graphics>());293 294 unloader.Dismiss();295 }296 297 void Core::unloadGraphics()298 {299 this->graphicsScope_.reset();300 this->guiManager_.reset();301 this->inputManager_.reset();302 this->graphicsManager_.reset();303 304 // Load Ogre::Root again, but without the render system305 try306 { this->graphicsManager_.reset(new GraphicsManager(false)); }307 catch (...)308 {309 COUT(0) << "An exception occurred during 'unloadGraphics':" << Exception::handleMessage() << std::endl310 << "Another exception might be being handled which may lead to undefined behaviour!" << std::endl311 << "Terminating the program." << std::endl;312 abort();313 }314 315 bGraphicsLoaded_ = false;316 GameMode::bShowsGraphics_s = false;317 }318 319 //! Sets the language in the config-file back to the default.320 void Core::resetLanguage()321 {322 ResetConfigValue(language_);323 131 } 324 132 … … 368 176 #endif 369 177 } 370 371 void Core::preUpdate(const Clock& time)372 {373 // Update singletons before general ticking374 ScopedSingletonManager::preUpdate<ScopeID::Root>(time);375 if (this->bGraphicsLoaded_)376 {377 // Process input events378 this->inputManager_->preUpdate(time);379 // Update GUI380 this->guiManager_->preUpdate(time);381 // Update singletons before general ticking382 ScopedSingletonManager::preUpdate<ScopeID::Graphics>(time);383 }384 // Process console events and status line385 if (this->ioConsole_ != NULL)386 this->ioConsole_->preUpdate(time);387 // Process thread commands388 this->tclThreadManager_->preUpdate(time);389 }390 391 void Core::postUpdate(const Clock& time)392 {393 // Update singletons just before rendering394 ScopedSingletonManager::postUpdate<ScopeID::Root>(time);395 if (this->bGraphicsLoaded_)396 {397 // Update singletons just before rendering398 ScopedSingletonManager::postUpdate<ScopeID::Graphics>(time);399 // Render (doesn't throw)400 this->graphicsManager_->postUpdate(time);401 }402 }403 404 void Core::updateLastLevelTimestamp()405 {406 ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time(NULL)));407 }408 409 void Core::updateOgreConfigTimestamp()410 {411 ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(NULL)));412 }413 178 } -
code/forks/sandbox_light/src/libraries/core/Core.h
r7870 r7908 46 46 #include <string> 47 47 #include <boost/scoped_ptr.hpp> 48 #include <loki/ScopeGuard.h>49 48 50 49 #include "util/Singleton.h" 51 #include "OrxonoxClass.h"52 50 53 51 namespace orxonox … … 59 57 You should only create this singleton once because it destroys the identifiers! 60 58 */ 61 class _CoreExport Core : public Singleton<Core> , public OrxonoxClass59 class _CoreExport Core : public Singleton<Core> 62 60 { 63 typedef Loki::ScopeGuardImpl0<void (*)()> SimpleScopeGuard;64 61 friend class Singleton<Core>; 65 friend class Game;66 62 67 63 public: … … 76 72 ~Core(); 77 73 78 void setConfigValues();79 80 //! Returns the configured language.81 const std::string& getLanguage()82 { return this->language_; }83 void resetLanguage();84 85 void updateLastLevelTimestamp();86 inline long long getLastLevelTimestamp() const87 { return this->lastLevelTimestamp_; }88 89 void updateOgreConfigTimestamp();90 inline long long getOgreConfigTimestamp() const91 { return this->ogreConfigTimestamp_; }92 93 74 private: 94 75 Core(const Core&); //!< Don't use (undefined symbol) 95 76 96 void languageChanged();97 77 void initRandomNumberGenerator(); 98 78 99 void preUpdate(const Clock& time); 100 void postUpdate(const Clock& time); 79 void setThreadAffinity(int limitToCPU); 101 80 102 void loadGraphics();103 void unloadGraphics();104 105 void setThreadAffinity(int limitToCPU);106 81 // MANAGED SINGLETONS/OBJECTS 107 82 // Mind the order for the destruction! 108 83 scoped_ptr<PathConfig> pathConfig_; 109 scoped_ptr<DynLibManager> dynLibManager_;110 84 scoped_ptr<SignalHandler> signalHandler_; 111 SimpleScopeGuard identifierDestroyer_;112 SimpleScopeGuard consoleCommandDestroyer_;113 scoped_ptr<ConfigFileManager> configFileManager_;114 scoped_ptr<Language> languageInstance_;115 scoped_ptr<IOConsole> ioConsole_;116 scoped_ptr<TclBind> tclBind_;117 scoped_ptr<TclThreadManager> tclThreadManager_;118 scoped_ptr<Scope<ScopeID::Root> > rootScope_;119 // graphical120 scoped_ptr<GraphicsManager> graphicsManager_; //!< Interface to OGRE121 scoped_ptr<InputManager> inputManager_; //!< Interface to OIS122 scoped_ptr<GUIManager> guiManager_; //!< Interface to GUI123 scoped_ptr<Scope<ScopeID::Graphics> > graphicsScope_;124 85 125 bool bGraphicsLoaded_;126 86 int softDebugLevelLogFile_; //!< The debug level for the log file (belongs to OutputHandler) 127 std::string language_; //!< The language128 87 bool bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called 129 bool bStartIOConsole_; //!< Set to false if you don't want to use the IOConsole130 long long lastLevelTimestamp_; ///< Timestamp when the last level was started131 long long ogreConfigTimestamp_; ///< Timestamp wehen the ogre config level was modified132 88 133 89 static Core* singletonPtr_s; -
code/forks/sandbox_light/src/libraries/core/CorePrereqs.h
r7849 r7908 65 65 namespace orxonox 66 66 { 67 static const uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1);68 67 } 69 68 … … 74 73 namespace orxonox 75 74 { 76 namespace XMLPort77 {78 enum Mode79 {80 NOP,81 LoadObject,82 SaveObject,83 ExpandObject84 };85 }86 87 namespace ConfigFileType88 {89 enum Value90 {91 Settings,92 JoyStickCalibration,93 CommandHistory94 // Don't forget to adjust the array size in the ConfigFileManager when adding a new entry here!95 };96 }97 98 namespace KeybindMode99 {100 enum Value101 {102 OnPress,103 OnHold,104 OnRelease,105 None106 };107 };108 75 } 109 76 … … 114 81 namespace orxonox 115 82 { 116 typedef std::string LanguageEntryLabel;117 118 template <class T, class U>119 T orxonox_cast(U*);120 121 class BaseObject;122 template <class T>123 class ClassFactory;124 template <class T>125 class ClassIdentifier;126 class ClassTreeMask;127 class ClassTreeMaskIterator;128 class ClassTreeMaskNode;129 class ClassTreeMaskObjectIterator;130 83 class CommandLineParser; 131 84 class CommandLineArgument; 132 class ConfigFile;133 class ConfigFileEntry;134 class ConfigFileEntryComment;135 class ConfigFileEntryValue;136 class ConfigFileManager;137 class ConfigFileSection;138 class ConfigValueContainer;139 85 class Core; 140 class DestructionListener;141 class DynLib;142 class DynLibManager;143 struct Event;144 class EventState;145 class Factory;146 class Game;147 class GameState;148 struct GameStateInfo;149 struct GameStateTreeNode;150 class GraphicsManager;151 class GUIManager;152 class Identifier;153 template <class T>154 class Iterator;155 class Language;156 class LuaFunctor;157 class LuaState;158 class MemoryArchive;159 class MemoryArchiveFactory;160 class MetaObjectList;161 class MetaObjectListElement;162 class Namespace;163 class NamespaceNode;164 template <class T>165 class ObjectList;166 class ObjectListBase;167 class ObjectListBaseElement;168 template <class T>169 class ObjectListElement;170 template <class T>171 class ObjectListIterator;172 class OgreWindowEventListener;173 class OrxonoxClass;174 86 class PathConfig; 175 struct ResourceInfo;176 class SettingsConfigFile;177 template <class T>178 class SmartPtr;179 template <class T>180 class SubclassIdentifier;181 class Template;182 class Thread;183 class ThreadPool;184 template <class T>185 class WeakPtr;186 class WindowEventListener;187 class XMLFile;188 class XMLNameListener;189 template <class T, class O>190 class XMLPortClassObjectContainer;191 template <class T>192 class XMLPortClassParamContainer;193 class XMLPortObjectContainer;194 class XMLPortParamContainer;195 196 // Command197 class ArgumentCompleter;198 class ArgumentCompletionListElement;199 class CommandEvaluation;200 class ConsoleCommand;201 class Executor;202 template <class T>203 class ExecutorMember;204 class ExecutorStatic;205 class Functor;206 template <class O>207 class FunctorMember;208 typedef FunctorMember<void> FunctorStatic;209 template <class F, class O>210 class FunctorPointer;211 class IOConsole;212 class IRC;213 class Shell;214 class ShellListener;215 class TclBind;216 struct TclInterpreterBundle;217 template <class T>218 class TclThreadList;219 class TclThreadManager;220 221 // Input222 class BaseCommand;223 class BufferedParamCommand;224 class Button;225 class HalfAxis;226 class InputBuffer;227 class InputDevice;228 template <class Traits>229 class InputDeviceTemplated;230 class InputHandler;231 class InputManager;232 class InputState;233 struct InputStatePriority;234 class JoyStickQuantityListener;235 class JoyStick;236 class KeyBinder;237 class KeyBinderManager;238 class Keyboard;239 class KeyDetector;240 class KeyEvent;241 class Mouse;242 class ParamCommand;243 class SimpleCommand;244 }245 246 #include "command/FunctorPtr.h"247 #include "command/ExecutorPtr.h"248 249 // CppTcl250 namespace Tcl251 {252 class interpreter;253 class object;254 87 } 255 88 … … 278 111 } 279 112 #endif 280 class thread;281 class mutex;282 class shared_mutex;283 class condition_variable;284 }285 286 // Ogre287 namespace Ogre288 {289 class DataStream;290 template <class T> class SharedPtr;291 typedef SharedPtr<DataStream> DataStreamPtr;292 }293 namespace orxonox294 {295 // Import the Ogre::DataStream296 using Ogre::DataStream;297 using Ogre::DataStreamPtr;298 }299 300 // CEGUI301 namespace CEGUI302 {303 class DefaultLogger;304 class Logger;305 class LuaScriptModule;306 307 class OgreCEGUIRenderer;308 class OgreCEGUIResourceProvider;309 class OgreCEGUITexture;310 }311 312 // Lua313 struct lua_State;314 315 // TinyXML and TinyXML++316 class TiXmlString;317 class TiXmlOutStream;318 class TiXmlNode;319 class TiXmlHandle;320 class TiXmlDocument;321 class TiXmlElement;322 class TiXmlComment;323 class TiXmlUnknown;324 class TiXmlAttribute;325 class TiXmlText;326 class TiXmlDeclaration;327 class TiXmlParsingData;328 namespace ticpp329 {330 class Document;331 class Element;332 class Declaration;333 class StylesheetReference;334 class Text;335 class Comment;336 class Attribute;337 }338 namespace orxonox339 {340 using ticpp::Element;341 113 } 342 114 -
code/forks/sandbox_light/src/libraries/core/PathConfig.cc
r6417 r7908 76 76 : rootPath_(*(new bf::path())) 77 77 , executablePath_(*(new bf::path())) 78 , modulePath_(*(new bf::path()))79 78 , dataPath_(*(new bf::path())) 80 , externalDataPath_(*(new bf::path()))81 79 , configPath_(*(new bf::path())) 82 80 , logPath_(*(new bf::path())) … … 138 136 COUT(1) << "Running from the build tree." << std::endl; 139 137 PathConfig::bDevRun_ = true; 140 modulePath_ = specialConfig::moduleDevDirectory;141 138 } 142 139 else … … 153 150 ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?"); 154 151 155 // Module path is fixed as well156 modulePath_ = rootPath_ / specialConfig::defaultModulePath;157 158 152 #else 159 153 160 154 // There is no root path, so don't set it at all 161 // Module path is fixed as well162 modulePath_ = specialConfig::moduleInstallDirectory;163 155 164 156 #endif … … 170 162 delete &rootPath_; 171 163 delete &executablePath_; 172 delete &modulePath_;173 164 delete &dataPath_; 174 delete &externalDataPath_;175 165 delete &configPath_; 176 166 delete &logPath_; … … 184 174 configPath_ = specialConfig::configDevDirectory; 185 175 logPath_ = specialConfig::logDevDirectory; 186 187 // Check for data path override by the command line188 if (!CommandLineParser::getArgument("externalDataPath")->hasDefaultValue())189 externalDataPath_ = CommandLineParser::getValue("externalDataPath").getString();190 else191 externalDataPath_ = specialConfig::externalDataDevDirectory;192 176 } 193 177 else … … 251 235 } 252 236 253 std::vector<std::string> PathConfig::getModulePaths()254 {255 std::vector<std::string> modulePaths;256 257 // We search for helper files with the following extension258 const std::string& moduleextension = specialConfig::moduleExtension;259 size_t moduleextensionlength = moduleextension.size();260 261 // Add that path to the PATH variable in case a module depends on another one262 std::string pathVariable(getenv("PATH"));263 putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + modulePath_.string()).c_str()));264 265 // Make sure the path exists, otherwise don't load modules266 if (!boost::filesystem::exists(modulePath_))267 return modulePaths;268 269 boost::filesystem::directory_iterator file(modulePath_);270 boost::filesystem::directory_iterator end;271 272 // Iterate through all files273 while (file != end)274 {275 const std::string& filename = file->BOOST_LEAF_FUNCTION();276 277 // Check if the file ends with the exension in question278 if (filename.size() > moduleextensionlength)279 {280 if (filename.substr(filename.size() - moduleextensionlength) == moduleextension)281 {282 // We've found a helper file283 const std::string& library = filename.substr(0, filename.size() - moduleextensionlength);284 modulePaths.push_back((modulePath_ / library).file_string());285 }286 }287 ++file;288 }289 290 return modulePaths;291 }292 293 237 /*static*/ std::string PathConfig::getRootPathString() 294 238 { … … 306 250 } 307 251 308 /*static*/ std::string PathConfig::getExternalDataPathString()309 {310 return getInstance().externalDataPath_.string() + '/';311 }312 313 252 /*static*/ std::string PathConfig::getConfigPathString() 314 253 { … … 320 259 return getInstance().logPath_.string() + '/'; 321 260 } 322 323 /*static*/ std::string PathConfig::getModulePathString()324 {325 return getInstance().modulePath_.string() + '/';326 }327 261 } -
code/forks/sandbox_light/src/libraries/core/PathConfig.h
r7427 r7908 85 85 static const boost::filesystem::path& getDataPath() 86 86 { return getInstance().dataPath_; } 87 //! Returns the path to the external data files as boost::filesystem::path88 static const boost::filesystem::path& getExternalDataPath()89 { return getInstance().externalDataPath_; }90 87 //! Returns the path to the config files as boost::filesystem::path 91 88 static const boost::filesystem::path& getConfigPath() … … 94 91 static const boost::filesystem::path& getLogPath() 95 92 { return getInstance().logPath_; } 96 //! Returns the path to the modules as boost::filesystem::path97 static const boost::filesystem::path& getModulePath()98 { return getInstance().modulePath_; }99 93 100 94 //! Returns the path to the root folder as std::string … … 104 98 //! Returns the path to the data files as std::string 105 99 static std::string getDataPathString(); 106 //! Returns the path to the external data files as std::string107 static std::string getExternalDataPathString();108 100 //! Returns the path to the config files as std::string 109 101 static std::string getConfigPathString(); //tolua_export 110 102 //! Returns the path to the log files as std::string 111 103 static std::string getLogPathString(); 112 //! Returns the path to the modules as std::string113 static std::string getModulePathString();114 104 115 105 //! Return trrue for runs in the build directory (not installed) … … 126 116 */ 127 117 void setConfigurablePaths(); 128 //! Returns a list with all modules declared by a *.module file in the module folder.129 std::vector<std::string> getModulePaths();130 118 131 119 //! Path to the parent directory of the ones above if program was installed with relativ paths 132 120 boost::filesystem::path& rootPath_; 133 121 boost::filesystem::path& executablePath_; //!< Path to the executable 134 boost::filesystem::path& modulePath_; //!< Path to the modules135 122 boost::filesystem::path& dataPath_; //!< Path to the data files folder 136 boost::filesystem::path& externalDataPath_; //!< Path to the external data files folder137 123 boost::filesystem::path& configPath_; //!< Path to the config files folder 138 124 boost::filesystem::path& logPath_; //!< Path to the log files folder -
code/forks/sandbox_light/src/libraries/util/CMakeLists.txt
r7449 r7908 21 21 Clock.cc 22 22 Exception.cc 23 ExprParser.cc24 23 Math.cc 25 24 MultiType.cc 26 Scope.cc27 25 StringUtils.cc 28 26 COMPILATION_BEGIN StableCompilation.cc 29 Clipboard.cc30 27 Convert.cc 31 28 CRC32.cc 32 29 OutputHandler.cc 33 ScopedSingletonManager.cc34 30 SharedPtr.cc 35 31 SignalHandler.cc … … 54 50 FIND_HEADER_FILES 55 51 LINK_LIBRARIES 56 ${CEGUI_LIBRARY} 57 ${OGRE_LIBRARY} 52 ogremath_orxonox 58 53 SOURCE_FILES 59 54 ${UTIL_SRC_FILES} -
code/forks/sandbox_light/src/libraries/util/Clock.cc
r7401 r7908 28 28 29 29 #include "Clock.h" 30 #include < OgreTimer.h>30 #include <ogremath/OgreTimer.h> 31 31 32 32 namespace orxonox -
code/forks/sandbox_light/src/libraries/util/Exception.cc
r7401 r7908 35 35 #include "Exception.h" 36 36 37 #include <CEGUIExceptions.h>38 37 #include "Debug.h" 39 38 … … 99 98 return ex.what(); 100 99 } 101 catch (const CEGUI::Exception& ex)102 {103 #if CEGUI_VERSION_MAJOR == 0 && CEGUI_VERSION_MINOR < 6104 return GeneralException(ex.getMessage().c_str()).getDescription();105 #else106 return GeneralException(ex.getMessage().c_str(), ex.getLine(),107 ex.getFileName().c_str(), ex.getName().c_str()).getDescription();108 #endif109 }110 100 catch (...) 111 101 { -
code/forks/sandbox_light/src/libraries/util/Math.cc
r7401 r7908 34 34 #include "Math.h" 35 35 36 #include < OgrePlane.h>36 #include <ogremath/OgrePlane.h> 37 37 38 38 #include "MathConvert.h" -
code/forks/sandbox_light/src/libraries/util/Math.h
r7427 r7908 47 47 #include <cstdlib> 48 48 49 #include < OgreMath.h>50 #include < OgreVector2.h>51 #include < OgreVector3.h>52 #include < OgreVector4.h>53 #include < OgreQuaternion.h>54 #include < OgreColourValue.h>49 #include <ogremath/OgreMath.h> 50 #include <ogremath/OgreVector2.h> 51 #include <ogremath/OgreVector3.h> 52 #include <ogremath/OgreVector4.h> 53 #include <ogremath/OgreQuaternion.h> 54 #include <ogremath/OgreColourValue.h> 55 55 56 56 // Certain headers might define unwanted macros... -
code/forks/sandbox_light/src/libraries/util/MultiType.h
r7401 r7908 100 100 #include <cassert> 101 101 #include <string> 102 #include < OgreVector2.h>103 #include < OgreVector3.h>104 #include < OgreVector4.h>105 #include < OgreQuaternion.h>106 #include < OgreColourValue.h>102 #include <ogremath/OgreVector2.h> 103 #include <ogremath/OgreVector3.h> 104 #include <ogremath/OgreVector4.h> 105 #include <ogremath/OgreQuaternion.h> 106 #include <ogremath/OgreColourValue.h> 107 107 #include <loki/TypeTraits.h> 108 108 #include "mbool.h" … … 260 260 261 261 virtual void toString(std::ostream& outstream) const = 0; 262 263 virtual void importData( uint8_t*& mem )=0;264 virtual void exportData( uint8_t*& mem ) const=0;265 virtual uint8_t getSize() const=0;266 262 267 263 MT_Type::Value type_; ///< The type of the current value … … 374 370 std::string getTypename() const; 375 371 376 /// Saves the value of the MT to a bytestream (pointed at by mem) and increases mem pointer by size of MT377 inline void exportData(uint8_t*& mem) const { assert(sizeof(MT_Type::Value)<=8); *static_cast<uint8_t*>(mem) = this->getType(); mem+=sizeof(uint8_t); this->value_->exportData(mem); }378 /// Loads the value of the MT from a bytestream (pointed at by mem) and increases mem pointer by size of MT379 inline void importData(uint8_t*& mem) { assert(sizeof(MT_Type::Value)<=8); this->setType(static_cast<MT_Type::Value>(*static_cast<uint8_t*>(mem))); mem+=sizeof(uint8_t); this->value_->importData(mem); }380 /// Saves the value of the MT to a bytestream and increases pointer to bytestream by size of MT381 inline uint8_t*& operator << (uint8_t*& mem) { importData(mem); return mem; }382 /// Loads the value of the MT to a bytestream and increases pointer to bytestream by size of MT383 inline void operator >> (uint8_t*& mem) const { exportData(mem); }384 inline uint32_t getNetworkSize() const { assert(this->value_); return this->value_->getSize() + sizeof(uint8_t); }385 386 372 /// Checks whether the value is a default one (assigned after a failed conversion) 387 373 bool hasDefaultValue() const { return this->value_->hasDefaultValue(); } -
code/forks/sandbox_light/src/libraries/util/MultiTypeValue.h
r7401 r7908 43 43 #include "MathConvert.h" 44 44 #include "MultiType.h" 45 #include "Serialise.h"46 45 47 46 namespace orxonox … … 155 154 inline void toString(std::ostream& outstream) const { outstream << this->value_; } 156 155 157 /// loads data from the bytestream (mem) into the MT and increases the bytestream pointer by the size of the data158 inline void importData( uint8_t*& mem ) { loadAndIncrease( /*(const T&)*/this->value_, mem ); }159 /// saves data from the MT into the bytestream (mem) and increases the bytestream pointer by the size of the data160 inline void exportData( uint8_t*& mem ) const { saveAndIncrease( /*(const T&)*/this->value_, mem ); }161 /// returns the size of the data that would be saved by exportData162 inline uint8_t getSize() const { return returnSize( this->value_ ); }163 164 156 T value_; ///< The stored value 165 157 }; 166 167 // Import / Export specialisation168 // ColourValue169 template <> inline void MT_Value<ColourValue>::importData( uint8_t*& mem )170 {171 loadAndIncrease( this->value_.r, mem );172 loadAndIncrease( this->value_.g, mem );173 loadAndIncrease( this->value_.b, mem );174 loadAndIncrease( this->value_.a, mem );175 }176 template <> inline void MT_Value<ColourValue>::exportData( uint8_t*& mem ) const177 {178 saveAndIncrease( this->value_.r, mem );179 saveAndIncrease( this->value_.g, mem );180 saveAndIncrease( this->value_.b, mem );181 saveAndIncrease( this->value_.a, mem );182 }183 template <> inline uint8_t MT_Value<ColourValue>::getSize() const184 {185 return 4*returnSize(this->value_.r);186 }187 // Ogre::Quaternion188 template <> inline void MT_Value<Ogre::Quaternion>::importData( uint8_t*& mem )189 {190 loadAndIncrease( this->value_.x, mem );191 loadAndIncrease( this->value_.y, mem );192 loadAndIncrease( this->value_.z, mem );193 loadAndIncrease( this->value_.w, mem );194 }195 template <> inline void MT_Value<Ogre::Quaternion>::exportData( uint8_t*& mem ) const196 {197 saveAndIncrease( this->value_.x, mem );198 saveAndIncrease( this->value_.y, mem );199 saveAndIncrease( this->value_.z, mem );200 saveAndIncrease( this->value_.w, mem );201 }202 template <> inline uint8_t MT_Value<Ogre::Quaternion>::getSize() const203 {204 return 4*returnSize(this->value_.x);205 }206 // Ogre::Vector2207 template <> inline void MT_Value<Ogre::Vector2>::importData( uint8_t*& mem )208 {209 loadAndIncrease( this->value_.x, mem );210 loadAndIncrease( this->value_.y, mem );211 }212 template <> inline void MT_Value<Ogre::Vector2>::exportData( uint8_t*& mem ) const213 {214 saveAndIncrease( this->value_.x, mem );215 saveAndIncrease( this->value_.y, mem );216 }217 template <> inline uint8_t MT_Value<Ogre::Vector2>::getSize() const218 {219 return 2*returnSize(this->value_.x);220 }221 // Ogre::Vector3222 template <> inline void MT_Value<Ogre::Vector3>::importData( uint8_t*& mem )223 {224 loadAndIncrease( this->value_.x, mem );225 loadAndIncrease( this->value_.y, mem );226 loadAndIncrease( this->value_.z, mem );227 }228 template <> inline void MT_Value<Ogre::Vector3>::exportData( uint8_t*& mem ) const229 {230 saveAndIncrease( this->value_.x, mem );231 saveAndIncrease( this->value_.y, mem );232 saveAndIncrease( this->value_.z, mem );233 }234 template <> inline uint8_t MT_Value<Ogre::Vector3>::getSize() const235 {236 return 3*returnSize(this->value_.x);237 }238 // Ogre::Vector4239 template <> inline void MT_Value<Ogre::Vector4>::importData( uint8_t*& mem )240 {241 loadAndIncrease( this->value_.x, mem );242 loadAndIncrease( this->value_.y, mem );243 loadAndIncrease( this->value_.z, mem );244 loadAndIncrease( this->value_.w, mem );245 }246 template <> inline void MT_Value<Ogre::Vector4>::exportData( uint8_t*& mem ) const247 {248 saveAndIncrease( this->value_.x, mem );249 saveAndIncrease( this->value_.y, mem );250 saveAndIncrease( this->value_.z, mem );251 saveAndIncrease( this->value_.w, mem );252 }253 template <> inline uint8_t MT_Value<Ogre::Vector4>::getSize() const254 {255 return 4*returnSize(this->value_.x);256 }257 template <> inline void MT_Value<void*>::importData( uint8_t*& mem )258 {259 assert(0);260 }261 template <> inline void MT_Value<void*>::exportData( uint8_t*& mem ) const262 {263 assert(0);264 }265 template <> inline uint8_t MT_Value<void*>::getSize() const266 {267 assert(0); return 0;268 }269 158 } 270 159 -
code/forks/sandbox_light/src/libraries/util/UtilPrereqs.h
r6417 r7908 64 64 namespace orxonox 65 65 { 66 namespace ScopeID67 {68 //!A list of available scopes for the Scope template.69 enum Value70 {71 Root,72 Graphics73 };74 }75 66 } 76 67 … … 83 74 class Clock; 84 75 class Exception; 85 class ExprParser;86 76 class IntVector2; 87 77 class IntVector3; … … 89 79 class OutputHandler; 90 80 class OutputListener; 91 template <ScopeID::Value>92 class Scope;93 template <class, ScopeID::Value>94 class ScopedSingleton;95 class ScopeListener;96 81 class SignalHandler; 97 82 template <class T> -
code/forks/sandbox_light/src/orxonox/CMakeLists.txt
r7648 r7908 24 24 25 25 SET_SOURCE_FILES(ORXONOX_SRC_FILES 26 Level.cc27 LevelInfo.cc28 LevelManager.cc29 26 Main.cc 30 MoodManager.cc31 PawnManager.cc32 PlayerManager.cc33 Radar.cc34 ChatHistory.cc35 ChatInputHandler.cc36 # Test.cc37 COMPILATION_BEGIN SceneCompilation.cc38 CameraManager.cc39 Scene.cc40 COMPILATION_END41 27 ) 42 43 ADD_SUBDIRECTORY(collisionshapes)44 ADD_SUBDIRECTORY(controllers)45 ADD_SUBDIRECTORY(gamestates)46 ADD_SUBDIRECTORY(gametypes)47 ADD_SUBDIRECTORY(graphics)48 ADD_SUBDIRECTORY(infos)49 ADD_SUBDIRECTORY(interfaces)50 ADD_SUBDIRECTORY(items)51 ADD_SUBDIRECTORY(overlays)52 ADD_SUBDIRECTORY(pickup)53 ADD_SUBDIRECTORY(sound)54 ADD_SUBDIRECTORY(weaponsystem)55 ADD_SUBDIRECTORY(worldentities)56 28 57 29 ORXONOX_ADD_LIBRARY(orxonox 58 30 FIND_HEADER_FILES 59 TOLUA_FILES60 ChatInputHandler.h61 LevelInfo.h62 LevelManager.h63 MoodManager.h64 controllers/HumanController.h65 infos/PlayerInfo.h66 sound/SoundManager.h67 31 PCH_FILE 68 32 OrxonoxPrecompiledHeaders.h … … 70 34 ${Boost_FILESYSTEM_LIBRARY} 71 35 ${Boost_SYSTEM_LIBRARY} # Filesystem dependency 72 ${Boost_THREAD_LIBRARY}73 ${Boost_DATE_TIME_LIBRARY} # Thread dependency74 ${OGRE_LIBRARY}75 ${OPENAL_LIBRARY}76 ${ALUT_LIBRARY}77 ${VORBISFILE_LIBRARY}78 ${VORBIS_LIBRARY}79 ${OGG_LIBRARY}80 tinyxml_orxonox81 tolua_orxonox82 bullet_orxonox83 36 util 84 37 core 85 network86 tools87 38 SOURCE_FILES ${ORXONOX_SRC_FILES} 88 39 ) -
code/forks/sandbox_light/src/orxonox/Main.cc
r7801 r7908 37 37 38 38 #include "core/CommandLineParser.h" 39 #include "core/Game.h" 40 #include "core/LuaState.h" 41 #include "ToluaBindOrxonox.h" 42 #include "ToluaBindNetwork.h" 43 44 DeclareToluaInterface(Orxonox); 45 DeclareToluaInterface(Network); 39 #include "core/Core.h" 46 40 47 41 namespace orxonox 48 42 { 49 SetCommandLineSwitch(console).information("Start in console mode (text IO only)");50 SetCommandLineSwitch(server).information("Start in server mode");51 SetCommandLineSwitch(client).information("Start in client mode");52 SetCommandLineSwitch(dedicated).information("Start in dedicated server mode");53 SetCommandLineSwitch(standalone).information("Start in standalone mode");54 SetCommandLineSwitch(dedicatedClient).information("Start in dedicated client mode");55 56 /* ADD masterserver command */57 SetCommandLineSwitch(masterserver).information("Start in masterserver mode");58 59 43 SetCommandLineArgument(generateDoc, "") 60 44 .information("Generates a Doxygen file from things like SetConsoleCommand"); … … 66 50 int main(const std::string& strCmdLine) 67 51 { 68 Game* game = new Game(strCmdLine);52 Core* core = new Core(strCmdLine); 69 53 70 54 if (CommandLineParser::getValue("generateDoc").getString().empty()) 71 55 { 72 /* TODO make this clear */ 73 game->setStateHierarchy( 74 "root" 75 " graphics" 76 " mainMenu" 77 " standalone,server,client" 78 " level" 79 " server,client,masterserver" 80 " level" 81 ); 82 83 game->requestState("root"); 84 85 // Some development hacks (not really, but in the future, these calls won't make sense anymore) 86 if (CommandLineParser::getValue("standalone").getBool()) 87 Game::getInstance().requestStates("graphics, standalone, level"); 88 else if (CommandLineParser::getValue("server").getBool()) 89 Game::getInstance().requestStates("graphics, server, level"); 90 else if (CommandLineParser::getValue("client").getBool()) 91 Game::getInstance().requestStates("graphics, client, level"); 92 else if (CommandLineParser::getValue("dedicated").getBool()) 93 Game::getInstance().requestStates("server, level"); 94 else if (CommandLineParser::getValue("dedicatedClient").getBool()) 95 Game::getInstance().requestStates("client, level"); 96 /* ADD masterserver command */ 97 else if (CommandLineParser::getValue("masterserver").getBool()) 98 Game::getInstance().requestStates("masterserver"); 99 else 100 { 101 if (!CommandLineParser::getValue("console").getBool()) 102 Game::getInstance().requestStates("graphics, mainMenu"); 103 } 104 105 game->run(); 56 // Start your program here 106 57 } 107 58 108 delete game;59 delete core; 109 60 110 61 return 0; -
code/forks/sandbox_light/src/orxonox/OrxonoxPrecompiledHeaders.h
r7284 r7908 38 38 #include "OrxonoxConfig.h" 39 39 40 ///////////////////////////////////////////41 ///// Stable Headers /////42 ///////////////////////////////////////////43 44 #include <cassert> // 8745 #include <cstring> // 8746 #include <fstream> // 8747 #include <iostream> // 8748 #include <map> // 8749 #include <set> // 8750 #include <sstream> // 8751 #include <string> // 8752 #include <vector> // 8753 #include <list> // 8654 #include <ctime> // 8255 #include <cmath> // 8156 #include <deque> // 8157 #include <queue> // 8158 59 #include <OgreMath.h> // 8160 #include <OgreVector2.h> // 8161 #include <OgreVector3.h> // 8162 #include <OgreVector4.h> // 8163 #include <OgreQuaternion.h> // 8164 #include <OgreColourValue.h> // 8165 66 #include "util/OgreForwardRefs.h" // 6767 #include <LinearMath/btMotionState.h> // 6068 #include "util/SubString.h" // 5569 #include <tinyxml/ticpp.h> // 4170 71 //#include <OgreRenderable.h> // 14, 5.1MB72 //#include <OgreSceneNode.h> // 13, 1MB73 //#include <OgreResourceGroupManager.h> // 12, 1.5MB74 //#include <OgreTexture.h> // 11, 0.6MB75 //#include <OgreMovableObject.h> // 10, 1.6MB76 //#include <OgreSceneManager.h> // 9, 8.7MB77 78 ///////////////////////////////////////////79 ///// All Rebuild Headers /////80 ///////////////////////////////////////////81 82 #include "core/BaseObject.h" // 8283 #include "core/CoreIncludes.h" // 8084 85 ///////////////////////////////////////////86 ///// Not so Stable Headers /////87 ///////////////////////////////////////////88 89 #include "network/synchronisable/Synchronisable.h" // 7090 #include "util/MultiType.h" // 6591 #include "core/command/Executor.h" // 5592 //#include "core/XMLPort.h" // 4193 94 95 40 // Just in case some header included windows.h 96 41 #undef min -
code/forks/sandbox_light/src/orxonox/OrxonoxPrereqs.h
r7854 r7908 37 37 38 38 #include "OrxonoxConfig.h" 39 #include "tools/ToolsPrereqs.h"40 39 41 40 //----------------------------------------------------------------------- … … 65 64 namespace orxonox 66 65 { 67 class CameraManager;68 class Level;69 class LevelInfo;70 class LevelInfoItem;71 class LevelManager;72 class PawnManager;73 class PlayerManager;74 class Radar;75 class Scene;76 77 // collisionshapes78 class CollisionShape;79 class CompoundCollisionShape;80 class WorldEntityCollisionShape;81 82 // controllers83 class AIController;84 class ArtificialController;85 class Controller;86 class DroneController;87 class HumanController;88 class ScriptController;89 class WaypointController;90 class WaypointPatrolController;91 92 // gametypes93 class Asteroids;94 class Deathmatch;95 class Dynamicmatch;96 class Gametype;97 class LastManStanding;98 class TeamBaseMatch;99 class TeamDeathmatch;100 class UnderAttack;101 102 // graphics103 class Backlight;104 class Billboard;105 class BlinkingBillboard;106 class Camera;107 class FadingBillboard;108 class GlobalShader;109 class Light;110 class Model;111 class ParticleEmitter;112 class ParticleSpawner;113 114 // infos115 class Bot;116 class GametypeInfo;117 class HumanPlayer;118 class Info;119 class PlayerInfo;120 121 // interfaces122 class GametypeMessageListener;123 class NotificationListener;124 class Pickupable;125 class PickupCarrier;126 class PlayerTrigger;127 class RadarListener;128 class RadarViewable;129 class Rewardable;130 class TeamColourable;131 132 // items133 class Engine;134 class Item;135 class MultiStateEngine;136 137 // overlays138 class InGameConsole;139 class Map;140 class OrxonoxOverlay;141 class OverlayGroup;142 143 // pickup144 class PickupIdentifier;145 146 //sound147 class AmbientSound;148 class BaseSound;149 class SoundBuffer;150 class SoundManager;151 class SoundStreamer;152 class WorldSound;153 class WorldAmbientSound;154 155 // weaponsystem156 class DefaultWeaponmodeLink;157 class Munition;158 class Weapon;159 class WeaponMode;160 class WeaponPack;161 class WeaponSet;162 class WeaponSlot;163 class WeaponSystem;164 165 // worldentities166 class BigExplosion;167 class CameraPosition;168 class ControllableEntity;169 class Drone;170 class EffectContainer;171 class ExplosionChunk;172 class MobileEntity;173 class MovableEntity;174 class SpawnPoint;175 class StaticEntity;176 class TeamSpawnPoint;177 class WorldEntity;178 class Rocket;179 // worldentities, pawns180 class Destroyer;181 class Pawn;182 class SpaceShip;183 class Spectator;184 class TeamBaseMatchBase;185 66 } 186 67 187 // Bullet Physics Engine188 class btTransform;189 class btVector3;190 191 class btRigidBody;192 class btCollisionObject;193 class btGhostObject;194 class btManifoldPoint;195 196 class btCollisionShape;197 class btSphereShape;198 class btCompoundShape;199 class btStaticPlaneShape;200 201 class btDiscreteDynamicsWorld;202 class bt32BitAxisSweep3;203 class btDefaultCollisionConfiguration;204 class btCollisionDispatcher;205 class btSequentialImpulseConstraintSolver;206 207 // ALUT208 typedef struct ALCcontext_struct ALCcontext;209 typedef struct ALCdevice_struct ALCdevice;210 typedef unsigned int ALuint;211 typedef int ALint;212 typedef int ALenum;213 214 68 #endif /* _OrxonoxPrereqs_H__ */
Note: See TracChangeset
for help on using the changeset viewer.