diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 54abb948a..9510273af 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -16,7 +16,7 @@ set(GAME_HEADER source_group(game FILES ${GAME} ${GAME_HEADER}) set(GAMEREND - mwrender/rendering_manager.cpp + mwrender/renderingmanager.cpp mwrender/mwscene.cpp mwrender/cellimp.cpp mwrender/interior.cpp @@ -25,7 +25,7 @@ set(GAMEREND mwrender/player.cpp ) set(GAMEREND_HEADER - mwrender/rendering_manager.hpp + mwrender/renderingmanager.hpp mwrender/cell.hpp mwrender/cellimp.hpp mwrender/mwscene.hpp diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp new file mode 100644 index 000000000..f083d206d --- /dev/null +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -0,0 +1,85 @@ +#include "renderingmanager.hpp" + +namespace MWRender { + + + +RenderingManager::RenderingManager (Ogre::RenderWindow* window, Ogre::Camera* cam, const boost::filesystem2::path& resDir) +{ + mSkyManager = MWRender::SkyManager::create(window, cam, resDir); +} + +RenderingManager::~RenderingManager () +{ + delete mSkyManager; +} + +void RenderingManager::removeCell (MWWorld::Ptr::CellStore *store){ + +} +void RenderingManager::addObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store){ + +} +void RenderingManager::removeObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store){ + +} +void RenderingManager::moveObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& position){ + +} +void RenderingManager::scaleObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& scale){ + +} +void RenderingManager::rotateObject (const MWWorld::Ptr& ptr, const::Ogre::Quaternion& orientation){ + +} +void RenderingManager::moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Vector3& position, MWWorld::Ptr::CellStore *store){ + +} +void RenderingManager::setPhysicsDebugRendering (bool){ + +} +bool RenderingManager::getPhysicsDebugRendering() const{ + return true; +} +void RenderingManager::update (float duration){ + + +} + +void RenderingManager::skyEnable () +{ + mSkyManager->enable(); +} + +void RenderingManager::skyDisable () +{ + mSkyManager->disable(); +} + +void RenderingManager::skySetHour (double hour) +{ + mSkyManager->setHour(hour); +} + + +void RenderingManager::skySetDate (int day, int month) +{ + mSkyManager->setDate(day, month); +} + +int RenderingManager::skyGetMasserPhase() const +{ + return mSkyManager->getMasserPhase(); +} + +int RenderingManager::skyGetSecundaPhase() const +{ + return mSkyManager->getSecundaPhase(); +} + +void RenderingManager::skySetMoonColour (bool red) +{ + mSkyManager->setMoonColour(red); +} + +} diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp new file mode 100644 index 000000000..ac14ee389 --- /dev/null +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -0,0 +1,52 @@ +#ifndef _GAME_RENDERING_MANAGER_H +#define _GAME_RENDERING_MANAGER_H + + +#include "sky.hpp" + +#include "../mwworld/ptr.hpp" +#include +#include +#include + +namespace MWRender +{ + +class RenderingManager { + public: + RenderingManager(Ogre::RenderWindow* window, Ogre::Camera* cam, const boost::filesystem2::path& resDir); + ~RenderingManager(); + + void removeCell (MWWorld::Ptr::CellStore *store); // TODO do we want this? + + void addObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store); + void removeObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store); + + void moveObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& position); + void scaleObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& scale); + void rotateObject (const MWWorld::Ptr& ptr, const::Ogre::Quaternion& orientation); + void moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Vector3& position, MWWorld::Ptr::CellStore *store); + + void setPhysicsDebugRendering (bool); + bool getPhysicsDebugRendering() const; + + void update (float duration); + + void skyEnable (); + void skyDisable (); + void skySetHour (double hour); + void skySetDate (int day, int month); + int skyGetMasserPhase() const; + int skyGetSecundaPhase() const; + void skySetMoonColour (bool red); + + private: + + SkyManager* mSkyManager; + + +}; + +} + +#endif diff --git a/apps/openmw/mwworld/world.hpp b/apps/openmw/mwworld/world.hpp index 978f14c8e..e661ef362 100644 --- a/apps/openmw/mwworld/world.hpp +++ b/apps/openmw/mwworld/world.hpp @@ -9,7 +9,7 @@ #include #include "../mwrender/mwscene.hpp" -#include "../mwrender/rendering_manager.hpp" +#include "../mwrender/renderingmanager.hpp" #include "refdata.hpp" #include "ptr.hpp"