Moved OpenEngine systems into their appropriate classes

actorid
Cris Mihalache 13 years ago
parent a17c193f56
commit 6d4fa9274e

@ -1,5 +1,191 @@
esmtool_cmd.c: esmtool.ggo # CMAKE generated file: DO NOT EDIT!
gengetopt < esmtool.ggo # 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: 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

@ -35,8 +35,6 @@
#include "mwsound/soundmanager.hpp" #include "mwsound/soundmanager.hpp"
#include "mwworld/world.hpp" #include "mwworld/world.hpp"
#include "mwworld/ptr.hpp"
#include "mwworld/environment.hpp"
#include "mwworld/class.hpp" #include "mwworld/class.hpp"
#include "mwworld/player.hpp" #include "mwworld/player.hpp"
@ -175,7 +173,6 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager) OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager)
: mOgre (0) : mOgre (0)
, mPhysicEngine (0)
, mFpsLevel(0) , mFpsLevel(0)
, mDebug (false) , mDebug (false)
, mVerboseScripts (false) , mVerboseScripts (false)
@ -186,7 +183,6 @@ OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager)
, mFocusTDiff (0) , mFocusTDiff (0)
, mScriptManager (0) , mScriptManager (0)
, mScriptContext (0) , mScriptContext (0)
, mGuiManager (0)
, mFSStrict (false) , mFSStrict (false)
, mCfgMgr(configurationManager) , mCfgMgr(configurationManager)
{ {
@ -196,7 +192,6 @@ OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager)
OMW::Engine::~Engine() OMW::Engine::~Engine()
{ {
delete mGuiManager;
delete mEnvironment.mWorld; delete mEnvironment.mWorld;
delete mEnvironment.mSoundManager; delete mEnvironment.mSoundManager;
delete mEnvironment.mGlobalScripts; delete mEnvironment.mGlobalScripts;
@ -205,7 +200,6 @@ OMW::Engine::~Engine()
delete mEnvironment.mJournal; delete mEnvironment.mJournal;
delete mScriptManager; delete mScriptManager;
delete mScriptContext; delete mScriptContext;
delete mPhysicEngine;
delete mOgre; delete mOgre;
} }
@ -332,27 +326,20 @@ void OMW::Engine::go()
mOgre->createWindow("OpenMW"); mOgre->createWindow("OpenMW");
loadBSA(); loadBSA();
/// \todo move this into the physics manager // Create the physics system
// Create physics. shapeLoader is deleted by the physic engine mPhysicsSystem = new MWWorld::PhysicsSystem(*mOgre);
NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader(); mPhysicEngine = mPhysicsSystem->getEngine();
mPhysicEngine = new OEngine::Physic::PhysicEngine(shapeLoader);
// Create the world // Create the world
mEnvironment.mWorld = new MWWorld::World (*mOgre, mPhysicEngine, mFileCollections, mMaster, mEnvironment.mWorld = new MWWorld::World (*mOgre, mPhysicEngine, mFileCollections, mMaster,
mResDir, mNewGame, mEnvironment, mEncoding); 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 // Create window manager - this manages all the MW-specific GUI windows
MWScript::registerExtensions (mExtensions); MWScript::registerExtensions (mExtensions);
mEnvironment.mWindowManager = new MWGui::WindowManager(mGuiManager->getGui(), mEnvironment, mEnvironment.mWindowManager = new MWGui::WindowManager(mEnvironment,
mExtensions, mFpsLevel, mNewGame); mExtensions, mFpsLevel, mNewGame, mOgre, mCfgMgr.getLogPath().string() + std::string("/"));
// Create sound system // Create sound system
mEnvironment.mSoundManager = new MWSound::SoundManager(mOgre->getRoot(), mEnvironment.mSoundManager = new MWSound::SoundManager(mOgre->getRoot(),

@ -14,6 +14,7 @@
#include <components/cfg/configurationmanager.hpp> #include <components/cfg/configurationmanager.hpp>
#include "mwworld/environment.hpp" #include "mwworld/environment.hpp"
#include "mwworld/physicssystem.hpp"
#include "mwworld/ptr.hpp" #include "mwworld/ptr.hpp"
namespace Compiler namespace Compiler
@ -77,10 +78,11 @@ namespace OMW
std::string mFocusName; std::string mFocusName;
MWWorld::Environment mEnvironment; MWWorld::Environment mEnvironment;
MWWorld::PhysicsSystem *mPhysicsSystem;
MWScript::ScriptManager *mScriptManager; MWScript::ScriptManager *mScriptManager;
Compiler::Extensions mExtensions; Compiler::Extensions mExtensions;
Compiler::Context *mScriptContext; Compiler::Context *mScriptContext;
OEngine::GUI::MyGUIManager *mGuiManager;
Files::Collections mFileCollections; Files::Collections mFileCollections;
bool mFSStrict; bool mFSStrict;

@ -22,12 +22,13 @@
using namespace MWGui; using namespace MWGui;
WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment, WindowManager::WindowManager(MWWorld::Environment& environment,
const Compiler::Extensions& extensions, int fpsLevel, bool newGame) const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string logpath)
: environment(environment) : environment(environment)
, nameDialog(nullptr) , nameDialog(nullptr)
, raceDialog(nullptr) , raceDialog(nullptr)
, dialogueWindow(nullptr) , dialogueWindow(nullptr)
, mGuiManager (0)
, classChoiceDialog(nullptr) , classChoiceDialog(nullptr)
, generateClassQuestionDialog(nullptr) , generateClassQuestionDialog(nullptr)
, generateClassResultDialog(nullptr) , generateClassResultDialog(nullptr)
@ -35,7 +36,6 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
, createClassDialog(nullptr) , createClassDialog(nullptr)
, birthSignDialog(nullptr) , birthSignDialog(nullptr)
, reviewDialog(nullptr) , reviewDialog(nullptr)
, gui(_gui)
, mode(GM_Game) , mode(GM_Game)
, nextMode(GM_Game) , nextMode(GM_Game)
, needModeChange(false) , needModeChange(false)
@ -46,6 +46,10 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
creationStage = NotStarted; 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 //Register own widgets with MyGUI
MyGUI::FactoryManager::getInstance().registerFactory<DialogeHistory>("Widget"); MyGUI::FactoryManager::getInstance().registerFactory<DialogeHistory>("Widget");
@ -91,6 +95,7 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
WindowManager::~WindowManager() WindowManager::~WindowManager()
{ {
delete mGuiManager;
delete console; delete console;
delete mMessageBoxManager; delete mMessageBoxManager;
delete hud; delete hud;

@ -15,6 +15,8 @@
#include <set> #include <set>
#include <components/esm_store/store.hpp> #include <components/esm_store/store.hpp>
#include <openengine/ogre/renderer.hpp>
#include <openengine/gui/manager.hpp>
#include "../mwmechanics/stat.hpp" #include "../mwmechanics/stat.hpp"
#include "mode.hpp" #include "mode.hpp"
@ -81,6 +83,7 @@ namespace MWGui
typedef std::vector<int> SkillList; typedef std::vector<int> SkillList;
private: private:
OEngine::GUI::MyGUIManager *mGuiManager;
MWWorld::Environment& environment; MWWorld::Environment& environment;
HUD *hud; HUD *hud;
MapWindow *map; MapWindow *map;
@ -165,8 +168,8 @@ namespace MWGui
public: public:
/// The constructor needs the main Gui object /// The constructor needs the main Gui object
WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment, WindowManager(MWWorld::Environment& environment,
const Compiler::Extensions& extensions, int fpsLevel, bool newGame); const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string logpath);
virtual ~WindowManager(); virtual ~WindowManager();
/** /**

@ -3,6 +3,7 @@
#include "physicssystem.hpp" #include "physicssystem.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/world.hpp" // FIXME #include "../mwworld/world.hpp" // FIXME
#include <components/nifbullet/bullet_nif_loader.hpp>
#include "OgreRoot.h" #include "OgreRoot.h"
#include "OgreRenderWindow.h" #include "OgreRenderWindow.h"
@ -16,16 +17,24 @@ using namespace Ogre;
namespace MWWorld namespace MWWorld
{ {
PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng) : PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend) :
mRender(_rend), mEngine(physEng), mFreeFly (true) 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() PhysicsSystem::~PhysicsSystem()
{ {
delete mEngine;
}
OEngine::Physic::PhysicEngine* PhysicsSystem::getEngine()
{
return mEngine;
} }
std::pair<std::string, float> PhysicsSystem::getFacedHandle (MWWorld::World& world) std::pair<std::string, float> PhysicsSystem::getFacedHandle (MWWorld::World& world)
{ {
std::string handle = ""; std::string handle = "";

@ -12,7 +12,7 @@ namespace MWWorld
class PhysicsSystem class PhysicsSystem
{ {
public: public:
PhysicsSystem (OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng); PhysicsSystem (OEngine::Render::OgreRenderer &_rend);
~PhysicsSystem (); ~PhysicsSystem ();
std::vector< std::pair<std::string, Ogre::Vector3> > doPhysics (float duration, std::vector< std::pair<std::string, Ogre::Vector3> > doPhysics (float duration,
@ -39,6 +39,8 @@ namespace MWWorld
void insertActorPhysics(const MWWorld::Ptr&, std::string model); void insertActorPhysics(const MWWorld::Ptr&, std::string model);
OEngine::Physic::PhysicEngine* getEngine();
private: private:
OEngine::Render::OgreRenderer &mRender; OEngine::Render::OgreRenderer &mRender;
OEngine::Physic::PhysicEngine* mEngine; OEngine::Physic::PhysicEngine* mEngine;

@ -152,7 +152,7 @@ namespace MWWorld
{ {
mPhysEngine = physEng; mPhysEngine = physEng;
mPhysics = new PhysicsSystem(renderer, physEng); mPhysics = new PhysicsSystem(renderer);
boost::filesystem::path masterPath (fileCollections.getCollection (".esm").getPath (master)); boost::filesystem::path masterPath (fileCollections.getCollection (".esm").getPath (master));

@ -19,7 +19,7 @@ along with Caelum. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef __APPLE__ #ifdef __APPLE__
#include "Ogre/Ogre.h" #include "OGRE/Ogre.h"
#else #else
#include "Ogre.h" #include "Ogre.h"
#endif #endif

@ -75,7 +75,7 @@ namespace Caelum
stream.unsetf(std::ios::dec); stream.unsetf(std::ios::dec);
stream.setf(std::ios::hex); stream.setf(std::ios::hex);
stream.setf(std::ios::uppercase); stream.setf(std::ios::uppercase);
stream << reinterpret_cast<ptrdiff_t>(pointer); stream << reinterpret_cast<std::ptrdiff_t>(pointer);
return stream.str(); return stream.str();
} }

Loading…
Cancel
Save