diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 54495063b..4d3dace03 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}) add_openmw_dir (mwrender - renderingmanager debugging cellimp interior exterior sky player + renderingmanager debugging cellimp interior exterior sky player npcs creatures objects ) add_openmw_dir (mwinput diff --git a/apps/openmw/mwrender/cellimp.hpp b/apps/openmw/mwrender/cellimp.hpp index 9c600a508..664fed64f 100644 --- a/apps/openmw/mwrender/cellimp.hpp +++ b/apps/openmw/mwrender/cellimp.hpp @@ -28,15 +28,6 @@ namespace MWRender /// Base class for cell render, that implements inserting references into a cell in a /// cell type- and render-engine-independent way. - class NPC{ - - }; - class Creature{ - - }; - class Obj{ - - }; class CellRenderImp { public: diff --git a/apps/openmw/mwrender/creatures.cpp b/apps/openmw/mwrender/creatures.cpp new file mode 100644 index 000000000..998951249 --- /dev/null +++ b/apps/openmw/mwrender/creatures.cpp @@ -0,0 +1,2 @@ +#include "creatures.hpp" +using namespace MWRender; \ No newline at end of file diff --git a/apps/openmw/mwrender/creatures.hpp b/apps/openmw/mwrender/creatures.hpp new file mode 100644 index 000000000..e884d5de4 --- /dev/null +++ b/apps/openmw/mwrender/creatures.hpp @@ -0,0 +1,5 @@ +namespace MWRender{ +class Creatures{ + +}; +} \ No newline at end of file diff --git a/apps/openmw/mwrender/npcs.cpp b/apps/openmw/mwrender/npcs.cpp new file mode 100644 index 000000000..7012ccb18 --- /dev/null +++ b/apps/openmw/mwrender/npcs.cpp @@ -0,0 +1,2 @@ +#include "npcs.hpp" +using namespace MWRender; diff --git a/apps/openmw/mwrender/npcs.hpp b/apps/openmw/mwrender/npcs.hpp new file mode 100644 index 000000000..861be6fc9 --- /dev/null +++ b/apps/openmw/mwrender/npcs.hpp @@ -0,0 +1,5 @@ +namespace MWRender{ +class Npcs{ + +}; +} diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp new file mode 100644 index 000000000..9f91eb791 --- /dev/null +++ b/apps/openmw/mwrender/objects.cpp @@ -0,0 +1,16 @@ +#include "objects.hpp" + +using namespace MWRender; + +void Objects::insertBegin (ESM::CellRef &ref, bool static_){ + +} +void Objects::insertMesh(const std::string &mesh){ + +} +void Objects::insertLight(float r, float g, float b, float radius){ + +} +void Objects::insertObjectPhysics(){ + +} \ No newline at end of file diff --git a/apps/openmw/mwrender/objects.hpp b/apps/openmw/mwrender/objects.hpp new file mode 100644 index 000000000..8a8b1ceae --- /dev/null +++ b/apps/openmw/mwrender/objects.hpp @@ -0,0 +1,18 @@ +#include "components/esm_store/cell_store.hpp" + +#include "../mwworld/refdata.hpp" + +namespace MWRender{ +class Objects{ +public: + Objects(){} + ~Objects(){} + void insertBegin (ESM::CellRef &ref, bool static_ = false); + void insertMesh(const std::string &mesh); + + /// insert a light related to the most recent insertBegin call. + void insertLight(float r, float g, float b, float radius); + void insertObjectPhysics(); + +}; +} \ No newline at end of file diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 89429d061..d3d17b86b 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -15,6 +15,7 @@ #include "player.hpp" + using namespace MWRender; using namespace Ogre; @@ -67,6 +68,20 @@ RenderingManager::~RenderingManager () delete mSkyManager; } +MWRender::Npcs& RenderingManager::getNPCs(){ + return npcs; +} +MWRender::Objects& RenderingManager::getObjects(){ + return objects; +} +MWRender::Creatures& RenderingManager::getCreatures(){ + return creatures; +} +MWRender::Player* RenderingManager::getPlayer(){ + return mPlayer; +} + + void RenderingManager::removeCell (MWWorld::Ptr::CellStore *store){ } diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 917be1b22..0e7fc87a9 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -15,6 +15,9 @@ #include "../mwworld/ptr.hpp" #include +#include "objects.hpp" +#include "npcs.hpp" +#include "creatures.hpp" namespace Ogre { @@ -34,13 +37,22 @@ namespace MWWorld namespace MWRender { - class Player; - + class Player; + class RenderingInterface{ + public: + virtual MWRender::Npcs& getNPCs(); + virtual MWRender::Creatures& getCreatures(); + virtual MWRender::Objects& getObjects(); + virtual MWRender::Player* getPlayer(); + }; -class RenderingManager { +class RenderingManager: private RenderingInterface { OEngine::Render::OgreRenderer &rend; Ogre::Camera* camera; + MWRender::Npcs npcs; + MWRender::Creatures creatures; + MWRender::Objects objects; /// Root node for all objects added to the scene. This is rotated so /// that the OGRE coordinate system matches that used internally in @@ -56,6 +68,10 @@ class RenderingManager { public: RenderingManager(OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine); ~RenderingManager(); + virtual MWRender::Npcs& getNPCs(); + virtual MWRender::Creatures& getCreatures(); + virtual MWRender::Objects& getObjects(); + virtual MWRender::Player* getPlayer(); bool toggleRenderMode(int mode); void removeCell (MWWorld::Ptr::CellStore *store); // TODO do we want this? @@ -83,7 +99,7 @@ class RenderingManager { OEngine::Render::OgreRenderer& getOgreRenderer(){return rend;} Ogre::SceneManager *getMgr() { return rend.getScene(); } Ogre::SceneNode *getRoot() { return mwRoot; } - MWRender::Player *getPlayer() { return mPlayer; } + private: SkyManager* mSkyManager;