diff --git a/apps/esmtool/Makefile b/apps/esmtool/Makefile index ee92cf4c84..42ef5e88cf 100644 --- a/apps/esmtool/Makefile +++ b/apps/esmtool/Makefile @@ -1,5 +1,191 @@ -esmtool_cmd.c: esmtool.ggo - gengetopt < esmtool.ggo +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# The program to use to edit the cache. +CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/cris/projects/openmw + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/cris/projects/openmw + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + cd /home/cris/projects/openmw && $(CMAKE_COMMAND) -E cmake_progress_start /home/cris/projects/openmw/CMakeFiles /home/cris/projects/openmw/apps/esmtool/CMakeFiles/progress.marks + cd /home/cris/projects/openmw && $(MAKE) -f CMakeFiles/Makefile2 apps/esmtool/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/cris/projects/openmw/CMakeFiles 0 +.PHONY : all + +# The main clean target clean: - rm esmtool_cmd.c esmtool_cmd.h + cd /home/cris/projects/openmw && $(MAKE) -f CMakeFiles/Makefile2 apps/esmtool/clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /home/cris/projects/openmw && $(MAKE) -f CMakeFiles/Makefile2 apps/esmtool/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /home/cris/projects/openmw && $(MAKE) -f CMakeFiles/Makefile2 apps/esmtool/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /home/cris/projects/openmw && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Convenience name for target. +apps/esmtool/CMakeFiles/esmtool.dir/rule: + cd /home/cris/projects/openmw && $(MAKE) -f CMakeFiles/Makefile2 apps/esmtool/CMakeFiles/esmtool.dir/rule +.PHONY : apps/esmtool/CMakeFiles/esmtool.dir/rule + +# Convenience name for target. +esmtool: apps/esmtool/CMakeFiles/esmtool.dir/rule +.PHONY : esmtool + +# fast build rule for target. +esmtool/fast: + cd /home/cris/projects/openmw && $(MAKE) -f apps/esmtool/CMakeFiles/esmtool.dir/build.make apps/esmtool/CMakeFiles/esmtool.dir/build +.PHONY : esmtool/fast + +esmtool.o: esmtool.cpp.o +.PHONY : esmtool.o + +# target to build an object file +esmtool.cpp.o: + cd /home/cris/projects/openmw && $(MAKE) -f apps/esmtool/CMakeFiles/esmtool.dir/build.make apps/esmtool/CMakeFiles/esmtool.dir/esmtool.cpp.o +.PHONY : esmtool.cpp.o + +esmtool.i: esmtool.cpp.i +.PHONY : esmtool.i + +# target to preprocess a source file +esmtool.cpp.i: + cd /home/cris/projects/openmw && $(MAKE) -f apps/esmtool/CMakeFiles/esmtool.dir/build.make apps/esmtool/CMakeFiles/esmtool.dir/esmtool.cpp.i +.PHONY : esmtool.cpp.i + +esmtool.s: esmtool.cpp.s +.PHONY : esmtool.s + +# target to generate assembly for a file +esmtool.cpp.s: + cd /home/cris/projects/openmw && $(MAKE) -f apps/esmtool/CMakeFiles/esmtool.dir/build.make apps/esmtool/CMakeFiles/esmtool.dir/esmtool.cpp.s +.PHONY : esmtool.cpp.s + +esmtool_cmd.o: esmtool_cmd.c.o +.PHONY : esmtool_cmd.o + +# target to build an object file +esmtool_cmd.c.o: + cd /home/cris/projects/openmw && $(MAKE) -f apps/esmtool/CMakeFiles/esmtool.dir/build.make apps/esmtool/CMakeFiles/esmtool.dir/esmtool_cmd.c.o +.PHONY : esmtool_cmd.c.o + +esmtool_cmd.i: esmtool_cmd.c.i +.PHONY : esmtool_cmd.i + +# target to preprocess a source file +esmtool_cmd.c.i: + cd /home/cris/projects/openmw && $(MAKE) -f apps/esmtool/CMakeFiles/esmtool.dir/build.make apps/esmtool/CMakeFiles/esmtool.dir/esmtool_cmd.c.i +.PHONY : esmtool_cmd.c.i + +esmtool_cmd.s: esmtool_cmd.c.s +.PHONY : esmtool_cmd.s + +# target to generate assembly for a file +esmtool_cmd.c.s: + cd /home/cris/projects/openmw && $(MAKE) -f apps/esmtool/CMakeFiles/esmtool.dir/build.make apps/esmtool/CMakeFiles/esmtool.dir/esmtool_cmd.c.s +.PHONY : esmtool_cmd.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... esmtool" + @echo "... rebuild_cache" + @echo "... esmtool.o" + @echo "... esmtool.i" + @echo "... esmtool.s" + @echo "... esmtool_cmd.o" + @echo "... esmtool_cmd.i" + @echo "... esmtool_cmd.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /home/cris/projects/openmw && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index ee3a6181ae..8a0efd5ed6 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -35,8 +35,6 @@ #include "mwsound/soundmanager.hpp" #include "mwworld/world.hpp" -#include "mwworld/ptr.hpp" -#include "mwworld/environment.hpp" #include "mwworld/class.hpp" #include "mwworld/player.hpp" @@ -175,7 +173,6 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt) OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager) : mOgre (0) - , mPhysicEngine (0) , mFpsLevel(0) , mDebug (false) , mVerboseScripts (false) @@ -186,7 +183,6 @@ OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager) , mFocusTDiff (0) , mScriptManager (0) , mScriptContext (0) - , mGuiManager (0) , mFSStrict (false) , mCfgMgr(configurationManager) { @@ -196,7 +192,6 @@ OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager) OMW::Engine::~Engine() { - delete mGuiManager; delete mEnvironment.mWorld; delete mEnvironment.mSoundManager; delete mEnvironment.mGlobalScripts; @@ -205,7 +200,6 @@ OMW::Engine::~Engine() delete mEnvironment.mJournal; delete mScriptManager; delete mScriptContext; - delete mPhysicEngine; delete mOgre; } @@ -332,27 +326,20 @@ void OMW::Engine::go() mOgre->createWindow("OpenMW"); loadBSA(); - - /// \todo move this into the physics manager - // Create physics. shapeLoader is deleted by the physic engine - NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader(); - mPhysicEngine = new OEngine::Physic::PhysicEngine(shapeLoader); + + // Create the physics system + mPhysicsSystem = new MWWorld::PhysicsSystem(*mOgre); + mPhysicEngine = mPhysicsSystem->getEngine(); // Create the world mEnvironment.mWorld = new MWWorld::World (*mOgre, mPhysicEngine, mFileCollections, mMaster, mResDir, mNewGame, mEnvironment, mEncoding); - /// \todo move this into the GUI manager (a.k.a WindowManager) - // Set up the GUI system - mGuiManager = new OEngine::GUI::MyGUIManager(mOgre->getWindow(), mOgre->getScene(), false, - mCfgMgr.getLogPath().string() + std::string("/")); - - // Create window manager - this manages all the MW-specific GUI windows MWScript::registerExtensions (mExtensions); - mEnvironment.mWindowManager = new MWGui::WindowManager(mGuiManager->getGui(), mEnvironment, - mExtensions, mFpsLevel, mNewGame); + mEnvironment.mWindowManager = new MWGui::WindowManager(mEnvironment, + mExtensions, mFpsLevel, mNewGame, mOgre, mCfgMgr.getLogPath().string() + std::string("/")); // Create sound system mEnvironment.mSoundManager = new MWSound::SoundManager(mOgre->getRoot(), diff --git a/apps/openmw/engine.hpp b/apps/openmw/engine.hpp index 02d108f0ab..553bf7efa6 100644 --- a/apps/openmw/engine.hpp +++ b/apps/openmw/engine.hpp @@ -14,6 +14,7 @@ #include #include "mwworld/environment.hpp" +#include "mwworld/physicssystem.hpp" #include "mwworld/ptr.hpp" namespace Compiler @@ -77,10 +78,11 @@ namespace OMW std::string mFocusName; MWWorld::Environment mEnvironment; + MWWorld::PhysicsSystem *mPhysicsSystem; MWScript::ScriptManager *mScriptManager; Compiler::Extensions mExtensions; Compiler::Context *mScriptContext; - OEngine::GUI::MyGUIManager *mGuiManager; + Files::Collections mFileCollections; bool mFSStrict; diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index d16611794d..fc17bece50 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -22,12 +22,13 @@ using namespace MWGui; -WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment, - const Compiler::Extensions& extensions, int fpsLevel, bool newGame) +WindowManager::WindowManager(MWWorld::Environment& environment, + const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string logpath) : environment(environment) , nameDialog(nullptr) , raceDialog(nullptr) , dialogueWindow(nullptr) + , mGuiManager (0) , classChoiceDialog(nullptr) , generateClassQuestionDialog(nullptr) , generateClassResultDialog(nullptr) @@ -35,7 +36,6 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment , createClassDialog(nullptr) , birthSignDialog(nullptr) , reviewDialog(nullptr) - , gui(_gui) , mode(GM_Game) , nextMode(GM_Game) , needModeChange(false) @@ -46,6 +46,10 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment creationStage = NotStarted; + // Set up the GUI system + mGuiManager = new OEngine::GUI::MyGUIManager(mOgre->getWindow(), mOgre->getScene(), false, logpath); + gui = mGuiManager->getGui(); + //Register own widgets with MyGUI MyGUI::FactoryManager::getInstance().registerFactory("Widget"); @@ -91,6 +95,7 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment WindowManager::~WindowManager() { + delete mGuiManager; delete console; delete mMessageBoxManager; delete hud; diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index a47e53fed8..b3e81c7f0e 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -15,6 +15,8 @@ #include #include +#include +#include #include "../mwmechanics/stat.hpp" #include "mode.hpp" @@ -81,6 +83,7 @@ namespace MWGui typedef std::vector SkillList; private: + OEngine::GUI::MyGUIManager *mGuiManager; MWWorld::Environment& environment; HUD *hud; MapWindow *map; @@ -165,8 +168,8 @@ namespace MWGui public: /// The constructor needs the main Gui object - WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment, - const Compiler::Extensions& extensions, int fpsLevel, bool newGame); + WindowManager(MWWorld::Environment& environment, + const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string logpath); virtual ~WindowManager(); /** diff --git a/apps/openmw/mwworld/physicssystem.cpp b/apps/openmw/mwworld/physicssystem.cpp index e74e201f53..f32cf97030 100644 --- a/apps/openmw/mwworld/physicssystem.cpp +++ b/apps/openmw/mwworld/physicssystem.cpp @@ -3,6 +3,7 @@ #include "physicssystem.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/world.hpp" // FIXME +#include #include "OgreRoot.h" #include "OgreRenderWindow.h" @@ -16,16 +17,24 @@ using namespace Ogre; namespace MWWorld { - PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng) : - mRender(_rend), mEngine(physEng), mFreeFly (true) + PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend) : + mRender(_rend), mEngine(0), mFreeFly (true) { - + // Create physics. shapeLoader is deleted by the physic engine + NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader(); + mEngine = new OEngine::Physic::PhysicEngine(shapeLoader); } PhysicsSystem::~PhysicsSystem() { - + delete mEngine; + + } + OEngine::Physic::PhysicEngine* PhysicsSystem::getEngine() + { + return mEngine; } + std::pair PhysicsSystem::getFacedHandle (MWWorld::World& world) { std::string handle = ""; diff --git a/apps/openmw/mwworld/physicssystem.hpp b/apps/openmw/mwworld/physicssystem.hpp index a447d7bc19..e534ee2080 100644 --- a/apps/openmw/mwworld/physicssystem.hpp +++ b/apps/openmw/mwworld/physicssystem.hpp @@ -12,7 +12,7 @@ namespace MWWorld class PhysicsSystem { public: - PhysicsSystem (OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng); + PhysicsSystem (OEngine::Render::OgreRenderer &_rend); ~PhysicsSystem (); std::vector< std::pair > doPhysics (float duration, @@ -39,6 +39,8 @@ namespace MWWorld void insertActorPhysics(const MWWorld::Ptr&, std::string model); + OEngine::Physic::PhysicEngine* getEngine(); + private: OEngine::Render::OgreRenderer &mRender; OEngine::Physic::PhysicEngine* mEngine; diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index e66dc01dc7..51b66f9390 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -152,7 +152,7 @@ namespace MWWorld { mPhysEngine = physEng; - mPhysics = new PhysicsSystem(renderer, physEng); + mPhysics = new PhysicsSystem(renderer); boost::filesystem::path masterPath (fileCollections.getCollection (".esm").getPath (master)); diff --git a/extern/caelum/include/CaelumPrecompiled.h b/extern/caelum/include/CaelumPrecompiled.h index e93bd8404e..c7d9d4ca44 100644 --- a/extern/caelum/include/CaelumPrecompiled.h +++ b/extern/caelum/include/CaelumPrecompiled.h @@ -19,7 +19,7 @@ along with Caelum. If not, see . */ #ifdef __APPLE__ -#include "Ogre/Ogre.h" +#include "OGRE/Ogre.h" #else #include "Ogre.h" #endif diff --git a/extern/caelum/src/InternalUtilities.cpp b/extern/caelum/src/InternalUtilities.cpp index f70b0f2670..a308fcb7f3 100644 --- a/extern/caelum/src/InternalUtilities.cpp +++ b/extern/caelum/src/InternalUtilities.cpp @@ -75,7 +75,7 @@ namespace Caelum stream.unsetf(std::ios::dec); stream.setf(std::ios::hex); stream.setf(std::ios::uppercase); - stream << reinterpret_cast(pointer); + stream << reinterpret_cast(pointer); return stream.str(); }