insertObjectRendering proposed

actorid
Jason Hooks 13 years ago
parent a7652bcb0c
commit 1faa07b279

@ -9,25 +9,22 @@
#include "../mwworld/actiontake.hpp"
#include "../mwrender/cellimp.hpp"
#include "../mwrender/renderinginterface.hpp"
#include "containerutil.hpp"
namespace MWClass
{
void Lockpick::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
MWWorld::Environment& environment) const
void Lockpick::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
{
ESMS::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
ptr.get<ESM::Tool>();
assert (ref->base != NULL);
const std::string &model = ref->base->model;
MWRender::Objects objects = renderingInterface.getObjects();
if (!model.empty())
{
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
cellRender.insertMesh ("meshes\\" + model);
cellRender.insertObjectPhysics();
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
objects.insertMesh(ptr, "meshes\\" + model);
}
}

@ -9,8 +9,7 @@ namespace MWClass
{
public:
virtual void insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender,
MWWorld::Environment& environment) const;
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
///< Add reference into a cell for rendering
virtual std::string getName (const MWWorld::Ptr& ptr) const;

@ -21,8 +21,7 @@ namespace MWWorld
throw std::runtime_error ("class does not support ID retrieval");
}
void Class::insertObj (const Ptr& ptr, MWRender::CellRenderImp& cellRender,
MWWorld::Environment& environment) const
void Class::insertObjectRendering (const Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
{
}

@ -9,6 +9,7 @@
#include "action.hpp"
#include "containerstore.hpp"
#include "refdata.hpp"
#include "../mwrender/renderinginterface.hpp"
namespace Ogre
{
@ -59,8 +60,9 @@ namespace MWWorld
///< Return ID of \a ptr or throw an exception, if class does not support ID retrieval
/// (default implementation: throw an exception)
virtual void insertObj (const Ptr& ptr, MWRender::CellRenderImp& cellRender,
MWWorld::Environment& environment) const;
virtual void insertObjectRendering (const Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
///< Add reference into a cell for rendering (default implementation: don't render anything).
virtual void enable (const Ptr& ptr, MWWorld::Environment& environment) const;

@ -180,7 +180,6 @@ namespace MWWorld
: mRendering (renderer,resDir, physEng),mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
mSky (false), mEnvironment (environment), mNextDynamicRecord (0), mCells (mStore, mEsm, *this)
{
std::cout << "Creating myworld\n";
mPhysEngine = physEng;
mPhysics = new PhysicsSystem(renderer, physEng);

Loading…
Cancel
Save