Changeset 993 for code/branches/core2/src
- Timestamp:
- Apr 5, 2008, 3:40:10 AM (17 years ago)
- Location:
- code/branches/core2/src/orxonox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/GraphicsEngine.cc
r790 r993 42 42 namespace orxonox { 43 43 44 using namespace Ogre;45 46 44 GraphicsEngine::GraphicsEngine() 47 45 { … … 71 69 std::string plugin_filename = "plugins.cfg"; 72 70 #endif 73 root_ = new Root(plugin_filename);71 root_ = new Ogre::Root(plugin_filename); 74 72 } 75 73 … … 77 75 * @return scene manager 78 76 */ 79 SceneManager* GraphicsEngine::getSceneManager()77 Ogre::SceneManager* GraphicsEngine::getSceneManager() 80 78 { 81 79 if(!scene_) 82 80 { 83 scene_ = root_->createSceneManager( ST_GENERIC, "Default SceneManager");81 scene_ = root_->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager"); 84 82 COUT(3) << "Info: Created SceneMan: " << scene_ << std::endl; 85 83 } … … 98 96 { 99 97 root_->initialise(true, "OrxonoxV2"); 100 TextureManager::getSingleton().setDefaultNumMipmaps(5);101 ResourceGroupManager::getSingleton().initialiseAllResourceGroups();98 Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); 99 Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); 102 100 } 103 101 … … 107 105 //TODO: Work with ressource groups (should be generated by a special loader) 108 106 // Load resource paths from data file using configfile ressource type 109 ConfigFile cf;107 Ogre::ConfigFile cf; 110 108 cf.load(dataPath + "resources.cfg"); 111 109 112 110 // Go through all sections & settings in the file 113 ConfigFile::SectionIterator seci = cf.getSectionIterator();111 Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator(); 114 112 115 113 std::string secName, typeName, archName; … … 117 115 { 118 116 secName = seci.peekNextKey(); 119 ConfigFile::SettingsMultiMap *settings = seci.getNext();120 ConfigFile::SettingsMultiMap::iterator i;117 Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext(); 118 Ogre::ConfigFile::SettingsMultiMap::iterator i; 121 119 for (i = settings->begin(); i != settings->end(); ++i) 122 120 { … … 124 122 archName = i->second; // name (and location) of archive 125 123 126 ResourceGroupManager::getSingleton().addResourceLocation(124 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( 127 125 std::string(dataPath + archName), 128 126 typeName, secName); -
code/branches/core2/src/orxonox/Orxonox.cc
r972 r993 86 86 #include "objects/test3.h" 87 87 88 #include "core/ConsoleCommand.h" 88 89 #include "core/CommandExecutor.h" 89 90 #include "core/InputBuffer.h" … … 93 94 namespace orxonox 94 95 { 96 ConsoleCommandShortcut(Orxonox, exit, AccessLevel::None); 97 95 98 class Testlistener : public InputBufferListener 96 99 { … … 150 153 151 154 mKeyboard->capture(); 152 return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);155 return (!mKeyboard->isKeyDown(OIS::KC_ESCAPE) && !Orxonox::getSingleton()->shouldExit()); 153 156 } 154 157 /* … … 185 188 this->frameListener_ = 0; 186 189 this->root_ = 0; 190 this->bExit_ = false; 187 191 } 188 192 -
code/branches/core2/src/orxonox/Orxonox.h
r873 r993 45 45 inline OIS::Mouse* getMouse() { return this->mouse_; } 46 46 // inline BulletManager* getBulletMgr() { return this->bulletMgr_; } 47 static inline void exit() { Orxonox::getSingleton()->bExit_ = true; } 48 inline bool shouldExit() { return this->bExit_; } 47 49 48 50 private: … … 78 80 OrxListener* frameListener_; 79 81 Ogre::Root* root_; 82 bool bExit_; 80 83 81 84 // this is used to identify the mode (server/client/...) we're in -
code/branches/core2/src/orxonox/core/CommandExecutor.cc
r972 r993 45 45 ConsoleCommandShortcutGeneric(keyword3, createExecutor((FunctorStatic*)0, "bind", AccessLevel::User)); 46 46 47 ConsoleCommandShortcutExtern(exec, AccessLevel::None); 48 49 void exec(const std::string& filename) 50 { 51 static std::set<std::string> executingFiles; 52 53 std::set<std::string>::const_iterator it = executingFiles.find(filename); 54 if (it != executingFiles.end()) 55 { 56 COUT(1) << "Error: Recurring exec command in \"" << filename << "\". Stopped execution." << std::endl; 57 return; 58 } 59 60 // Open the file 61 std::ifstream file; 62 file.open(filename.c_str(), std::fstream::in); 63 64 if (!file.is_open()) 65 { 66 COUT(1) << "Error: Couldn't execute file \"" << filename << "\"." << std::endl; 67 return; 68 } 69 70 executingFiles.insert(filename); 71 72 // Iterate through the file and put the lines into the CommandExecutor 73 char line[1024]; 74 while (file.good() && !file.eof()) 75 { 76 file.getline(line, 1024); 77 CommandExecutor::execute(line); 78 } 79 80 executingFiles.erase(filename); 81 } 82 47 83 48 84 /////////////////////// -
code/branches/core2/src/orxonox/core/CommandExecutor.h
r972 r993 60 60 CS_Error 61 61 }; 62 63 void exec(const std::string& filename); 62 64 63 65 enum KeybindMode {}; // temporary -
code/branches/core2/src/orxonox/core/ConsoleCommand.h
r949 r993 43 43 44 44 45 #define ConsoleCommandShortcut( function, accesslevel) \45 #define ConsoleCommandShortcut(classname, function, accesslevel) \ 46 46 ConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createExecutor(orxonox::createFunctor(&classname::function), #function, accesslevel)) 47 48 #define ConsoleCommandShortcutExtern(function, accesslevel) \ 49 ConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createExecutor(orxonox::createFunctor(&function), #function, accesslevel)) 47 50 48 51 #define ConsoleCommandShortcutGeneric(fakevariable, executor) \ -
code/branches/core2/src/orxonox/core/CorePrereqs.h
r952 r993 93 93 class CommandEvaluation; 94 94 class CommandExecutor; 95 class ConfigFile; 96 class ConfigFileEntry; 97 class ConfigFileEntryComment; 98 class ConfigFileEntryValue; 99 class ConfigFileManager; 100 class ConfigFileSection; 95 101 class ConfigValueContainer; 96 102 class DebugLevel;
Note: See TracChangeset
for help on using the changeset viewer.