From 3d43a4cd33fcac91c7109ab27c90f7d1b95c69fe Mon Sep 17 00:00:00 2001 From: Jason Hooks Date: Tue, 1 Nov 2011 13:46:57 -0400 Subject: [PATCH] Made recommended changes --- apps/openmw/mwrender/objects.cpp | 9 +++------ apps/openmw/mwrender/objects.hpp | 14 ++++++++------ apps/openmw/mwrender/renderingmanager.cpp | 4 ++-- apps/openmw/mwrender/renderingmanager.hpp | 4 ++-- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index 9f91eb791..3ad011b93 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -2,15 +2,12 @@ using namespace MWRender; -void Objects::insertBegin (ESM::CellRef &ref, bool static_){ +void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_){ } -void Objects::insertMesh(const std::string &mesh){ +void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh){ } -void Objects::insertLight(float r, float g, float b, float radius){ +void Objects::insertLight (const MWWorld::Ptr& ptr, 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 index 8a8b1ceae..75752284d 100644 --- a/apps/openmw/mwrender/objects.hpp +++ b/apps/openmw/mwrender/objects.hpp @@ -1,18 +1,20 @@ #include "components/esm_store/cell_store.hpp" #include "../mwworld/refdata.hpp" +#include "../mwworld/ptr.hpp" namespace MWRender{ class Objects{ +private: + OEngine::Render::OgreRenderer &rend; public: - Objects(){} + Objects(OEngine::Render::OgreRenderer& _rend): rend(_rend){} ~Objects(){} - void insertBegin (ESM::CellRef &ref, bool static_ = false); - void insertMesh(const std::string &mesh); + void insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_); + void insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh); + void insertLight (const MWWorld::Ptr& ptr, float r, float g, float b, float radius); /// 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 d3d17b86b..61fe9bf17 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -77,8 +77,8 @@ MWRender::Objects& RenderingManager::getObjects(){ MWRender::Creatures& RenderingManager::getCreatures(){ return creatures; } -MWRender::Player* RenderingManager::getPlayer(){ - return mPlayer; +MWRender::Player& RenderingManager::getPlayer(){ + return (*mPlayer); } diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 0e7fc87a9..9f751959d 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -43,7 +43,7 @@ namespace MWRender virtual MWRender::Npcs& getNPCs(); virtual MWRender::Creatures& getCreatures(); virtual MWRender::Objects& getObjects(); - virtual MWRender::Player* getPlayer(); + virtual MWRender::Player& getPlayer(); }; class RenderingManager: private RenderingInterface { @@ -71,7 +71,7 @@ class RenderingManager: private RenderingInterface { virtual MWRender::Npcs& getNPCs(); virtual MWRender::Creatures& getCreatures(); virtual MWRender::Objects& getObjects(); - virtual MWRender::Player* getPlayer(); + virtual MWRender::Player& getPlayer(); bool toggleRenderMode(int mode); void removeCell (MWWorld::Ptr::CellStore *store); // TODO do we want this?