mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 12:53:53 +00:00
Make insertBegin internal
This commit is contained in:
parent
2b2101958d
commit
076e7d8e16
18 changed files with 28 additions and 62 deletions
|
@ -25,9 +25,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,9 +30,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,9 +23,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,9 +27,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,9 +61,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,9 +36,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,18 +26,10 @@ namespace MWClass
|
|||
{
|
||||
void Light::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
assert (ref->mBase != NULL);
|
||||
|
||||
const std::string &model = ref->mBase->mModel;
|
||||
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
if(!model.empty())
|
||||
objects.insertMesh(ptr, "meshes\\" + model);
|
||||
else
|
||||
objects.insertMesh(ptr, "");
|
||||
const std::string model = getModel(ptr);
|
||||
if(!model.empty()) {
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
void Light::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
|
|
|
@ -26,9 +26,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,9 +42,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,9 +25,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,9 +15,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,9 +33,7 @@ namespace MWClass
|
|||
{
|
||||
const std::string model = getModel(ptr);
|
||||
if (!model.empty()) {
|
||||
MWRender::Objects& objects = renderingInterface.getObjects();
|
||||
objects.insertBegin(ptr);
|
||||
objects.insertMesh(ptr, model);
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ namespace MWRender
|
|||
CellSceneNodeMap mCellSceneNodes;
|
||||
PtrAnimationMap mAllActors;
|
||||
|
||||
void insertBegin(const MWWorld::Ptr &ptr);
|
||||
|
||||
public:
|
||||
Actors(OEngine::Render::OgreRenderer& _rend, MWRender::RenderingManager* rendering)
|
||||
: mRend(_rend)
|
||||
|
@ -36,7 +38,7 @@ namespace MWRender
|
|||
~Actors();
|
||||
|
||||
void setRootNode(Ogre::SceneNode* root);
|
||||
void insertBegin (const MWWorld::Ptr& ptr);
|
||||
|
||||
void insertNPC(const MWWorld::Ptr& ptr, MWWorld::InventoryStore& inv);
|
||||
void insertCreature (const MWWorld::Ptr& ptr);
|
||||
void insertActivator (const MWWorld::Ptr& ptr);
|
||||
|
|
|
@ -29,7 +29,7 @@ void Objects::setRootNode(Ogre::SceneNode* root)
|
|||
mRootNode = root;
|
||||
}
|
||||
|
||||
void Objects::insertBegin (const MWWorld::Ptr& ptr)
|
||||
void Objects::insertBegin(const MWWorld::Ptr& ptr)
|
||||
{
|
||||
Ogre::SceneNode* root = mRootNode;
|
||||
Ogre::SceneNode* cellnode;
|
||||
|
@ -69,16 +69,15 @@ void Objects::insertBegin (const MWWorld::Ptr& ptr)
|
|||
ptr.getRefData().setBaseNode(insert);
|
||||
}
|
||||
|
||||
void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
|
||||
void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh)
|
||||
{
|
||||
Ogre::SceneNode* insert = ptr.getRefData().getBaseNode();
|
||||
assert(insert);
|
||||
insertBegin(ptr);
|
||||
|
||||
std::auto_ptr<ObjectAnimation> anim(new ObjectAnimation(ptr, mesh));
|
||||
|
||||
Ogre::AxisAlignedBox bounds = anim->getWorldBounds();
|
||||
Ogre::Vector3 extents = bounds.getSize();
|
||||
extents *= insert->getScale();
|
||||
extents *= ptr.getRefData().getBaseNode()->getScale();
|
||||
float size = std::max(std::max(extents.x, extents.y), extents.z);
|
||||
|
||||
bool small = (size < Settings::Manager::getInt("small object size", "Viewing distance")) &&
|
||||
|
|
|
@ -31,14 +31,15 @@ class Objects{
|
|||
|
||||
static int uniqueID;
|
||||
|
||||
void insertBegin(const MWWorld::Ptr& ptr);
|
||||
|
||||
public:
|
||||
Objects(OEngine::Render::OgreRenderer &renderer)
|
||||
: mRenderer(renderer)
|
||||
, mRootNode(NULL)
|
||||
{}
|
||||
~Objects(){}
|
||||
void insertBegin (const MWWorld::Ptr& ptr);
|
||||
void insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh);
|
||||
void insertModel(const MWWorld::Ptr& ptr, const std::string &model);
|
||||
|
||||
void enableLights();
|
||||
void disableLights();
|
||||
|
|
Loading…
Reference in a new issue