mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 07:06:45 +00:00
Dead code removal
This commit is contained in:
parent
26766b8e0a
commit
dfd8e08698
6 changed files with 3 additions and 285 deletions
|
@ -21,9 +21,9 @@ source_group(game FILES ${GAME} ${GAME_HEADER})
|
||||||
|
|
||||||
add_openmw_dir (mwrender
|
add_openmw_dir (mwrender
|
||||||
actors objects renderingmanager animation sky npcanimation vismask
|
actors objects renderingmanager animation sky npcanimation vismask
|
||||||
creatureanimation effectmanager util
|
creatureanimation effectmanager util renderinginterface
|
||||||
# debugging camera activatoranimation
|
# debugging camera activatoranimation
|
||||||
# renderinginterface localmap occlusionquery water shadows
|
# localmap occlusionquery water shadows
|
||||||
# characterpreview globalmap ripplesimulation refraction
|
# characterpreview globalmap ripplesimulation refraction
|
||||||
# terrainstorage renderconst weaponanimation
|
# terrainstorage renderconst weaponanimation
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,211 +0,0 @@
|
||||||
#include "actors.hpp"
|
|
||||||
|
|
||||||
#include <OgreSceneNode.h>
|
|
||||||
#include <OgreSceneManager.h>
|
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
|
||||||
#include "../mwworld/class.hpp"
|
|
||||||
|
|
||||||
//#include "../mwrender/renderingmanager.hpp"
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include "animation.hpp"
|
|
||||||
#include "activatoranimation.hpp"
|
|
||||||
#include "creatureanimation.hpp"
|
|
||||||
#include "npcanimation.hpp"
|
|
||||||
*/
|
|
||||||
#include "renderconst.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
namespace MWRender
|
|
||||||
{
|
|
||||||
using namespace Ogre;
|
|
||||||
|
|
||||||
Actors::~Actors()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
PtrAnimationMap::iterator it = mAllActors.begin();
|
|
||||||
for(;it != mAllActors.end();++it)
|
|
||||||
{
|
|
||||||
delete it->second;
|
|
||||||
it->second = NULL;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
//void Actors::setRootNode(Ogre::SceneNode* root)
|
|
||||||
//{ mRootNode = root; }
|
|
||||||
|
|
||||||
void Actors::insertBegin(const MWWorld::Ptr &ptr)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
Ogre::SceneNode* cellnode;
|
|
||||||
CellSceneNodeMap::const_iterator celliter = mCellSceneNodes.find(ptr.getCell());
|
|
||||||
if(celliter != mCellSceneNodes.end())
|
|
||||||
cellnode = celliter->second;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Create the scenenode and put it in the map
|
|
||||||
cellnode = mRootNode->createChildSceneNode();
|
|
||||||
mCellSceneNodes[ptr.getCell()] = cellnode;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ogre::SceneNode* insert = cellnode->createChildSceneNode();
|
|
||||||
const float *f = ptr.getRefData().getPosition().pos;
|
|
||||||
insert->setPosition(f[0], f[1], f[2]);
|
|
||||||
insert->setScale(ptr.getCellRef().getScale(), ptr.getCellRef().getScale(), ptr.getCellRef().getScale());
|
|
||||||
|
|
||||||
// Convert MW rotation to a quaternion:
|
|
||||||
f = ptr.getCellRef().getPosition().rot;
|
|
||||||
|
|
||||||
// For rendering purposes, actors should only rotate around the Z axis.
|
|
||||||
// X rotation is used for camera rotation (for the player) and for
|
|
||||||
// ranged magic / ranged weapon aiming.
|
|
||||||
Ogre::Quaternion zr(Ogre::Radian(-f[2]), Ogre::Vector3::UNIT_Z);
|
|
||||||
|
|
||||||
insert->setOrientation(zr);
|
|
||||||
ptr.getRefData().setBaseNode(insert);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void Actors::insertNPC(const MWWorld::Ptr& ptr)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
insertBegin(ptr);
|
|
||||||
NpcAnimation* anim = new NpcAnimation(ptr, ptr.getRefData().getBaseNode(), RV_Actors);
|
|
||||||
delete mAllActors[ptr];
|
|
||||||
mAllActors[ptr] = anim;
|
|
||||||
mRendering->addWaterRippleEmitter (ptr);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
void Actors::insertCreature (const MWWorld::Ptr& ptr, const std::string &model, bool weaponsShields)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
insertBegin(ptr);
|
|
||||||
Animation* anim = NULL;
|
|
||||||
if (weaponsShields)
|
|
||||||
anim = new CreatureWeaponAnimation(ptr, model);
|
|
||||||
else
|
|
||||||
anim = new CreatureAnimation(ptr, model);
|
|
||||||
delete mAllActors[ptr];
|
|
||||||
mAllActors[ptr] = anim;
|
|
||||||
mRendering->addWaterRippleEmitter (ptr);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
void Actors::insertActivator (const MWWorld::Ptr& ptr, const std::string &model, bool addLight)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
insertBegin(ptr);
|
|
||||||
ActivatorAnimation* anim = new ActivatorAnimation(ptr, model);
|
|
||||||
|
|
||||||
if(ptr.getTypeName() == typeid(ESM::Light).name())
|
|
||||||
{
|
|
||||||
if (addLight)
|
|
||||||
anim->addLight(ptr.get<ESM::Light>()->mBase);
|
|
||||||
else
|
|
||||||
anim->removeParticles();
|
|
||||||
}
|
|
||||||
|
|
||||||
delete mAllActors[ptr];
|
|
||||||
mAllActors[ptr] = anim;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Actors::deleteObject (const MWWorld::Ptr& ptr)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
if (mAllActors.find(ptr) == mAllActors.end())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
mRendering->removeWaterRippleEmitter (ptr);
|
|
||||||
|
|
||||||
delete mAllActors[ptr];
|
|
||||||
mAllActors.erase(ptr);
|
|
||||||
|
|
||||||
if(Ogre::SceneNode *base=ptr.getRefData().getBaseNode())
|
|
||||||
{
|
|
||||||
Ogre::SceneNode *parent = base->getParentSceneNode();
|
|
||||||
CellSceneNodeMap::const_iterator iter(mCellSceneNodes.begin());
|
|
||||||
for(;iter != mCellSceneNodes.end();++iter)
|
|
||||||
{
|
|
||||||
if(iter->second == parent)
|
|
||||||
{
|
|
||||||
base->removeAndDestroyAllChildren();
|
|
||||||
mRend.getScene()->destroySceneNode (base);
|
|
||||||
ptr.getRefData().setBaseNode (0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Actors::removeCell(MWWorld::CellStore* store)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
for(PtrAnimationMap::iterator iter = mAllActors.begin();iter != mAllActors.end();)
|
|
||||||
{
|
|
||||||
if(iter->first.getCell() == store)
|
|
||||||
{
|
|
||||||
mRendering->removeWaterRippleEmitter (iter->first);
|
|
||||||
delete iter->second;
|
|
||||||
mAllActors.erase(iter++);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
++iter;
|
|
||||||
}
|
|
||||||
CellSceneNodeMap::iterator celliter = mCellSceneNodes.find(store);
|
|
||||||
if(celliter != mCellSceneNodes.end())
|
|
||||||
{
|
|
||||||
Ogre::SceneNode *base = celliter->second;
|
|
||||||
base->removeAndDestroyAllChildren();
|
|
||||||
mRend.getScene()->destroySceneNode(base);
|
|
||||||
|
|
||||||
mCellSceneNodes.erase(celliter);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
Animation* Actors::getAnimation(const MWWorld::Ptr &ptr)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
PtrAnimationMap::const_iterator iter = mAllActors.find(ptr);
|
|
||||||
if(iter != mAllActors.end())
|
|
||||||
return iter->second;
|
|
||||||
*/
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Actors::updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
Ogre::SceneNode *node;
|
|
||||||
MWWorld::CellStore *newCell = cur.getCell();
|
|
||||||
|
|
||||||
CellSceneNodeMap::const_iterator celliter = mCellSceneNodes.find(newCell);
|
|
||||||
if(celliter != mCellSceneNodes.end())
|
|
||||||
node = celliter->second;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
node = mRootNode->createChildSceneNode();
|
|
||||||
mCellSceneNodes[newCell] = node;
|
|
||||||
}
|
|
||||||
node->addChild(cur.getRefData().getBaseNode());
|
|
||||||
|
|
||||||
PtrAnimationMap::iterator iter = mAllActors.find(old);
|
|
||||||
if(iter != mAllActors.end())
|
|
||||||
{
|
|
||||||
Animation *anim = iter->second;
|
|
||||||
mAllActors.erase(iter);
|
|
||||||
anim->updatePtr(cur);
|
|
||||||
mAllActors[cur] = anim;
|
|
||||||
}
|
|
||||||
|
|
||||||
mRendering->updateWaterRippleEmitterPtr (old, cur);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
#ifndef GAME_RENDER_ACTORS_H
|
|
||||||
#define GAME_RENDER_ACTORS_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace OEngine
|
|
||||||
{
|
|
||||||
namespace Render
|
|
||||||
{
|
|
||||||
class OgreRenderer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace MWWorld
|
|
||||||
{
|
|
||||||
class Ptr;
|
|
||||||
class CellStore;
|
|
||||||
class InventoryStore;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace MWRender
|
|
||||||
{
|
|
||||||
class Animation;
|
|
||||||
class RenderingManager;
|
|
||||||
|
|
||||||
class Actors
|
|
||||||
{
|
|
||||||
//typedef std::map<MWWorld::CellStore*,Ogre::SceneNode*> CellSceneNodeMap;
|
|
||||||
//typedef std::map<MWWorld::Ptr,Animation*> PtrAnimationMap;
|
|
||||||
|
|
||||||
OEngine::Render::OgreRenderer &mRend;
|
|
||||||
MWRender::RenderingManager* mRendering;
|
|
||||||
//Ogre::SceneNode* mRootNode;
|
|
||||||
|
|
||||||
//CellSceneNodeMap mCellSceneNodes;
|
|
||||||
//PtrAnimationMap mAllActors;
|
|
||||||
|
|
||||||
void insertBegin(const MWWorld::Ptr &ptr);
|
|
||||||
|
|
||||||
public:
|
|
||||||
Actors(OEngine::Render::OgreRenderer& _rend, MWRender::RenderingManager* rendering)
|
|
||||||
: mRend(_rend)
|
|
||||||
, mRendering(rendering)
|
|
||||||
//, mRootNode(NULL)
|
|
||||||
{}
|
|
||||||
~Actors();
|
|
||||||
|
|
||||||
//void setRootNode(Ogre::SceneNode* root);
|
|
||||||
|
|
||||||
void insertNPC(const MWWorld::Ptr& ptr);
|
|
||||||
void insertCreature (const MWWorld::Ptr& ptr, const std::string& model, bool weaponsShields);
|
|
||||||
void insertActivator (const MWWorld::Ptr& ptr, const std::string& model, bool addLight=false);
|
|
||||||
bool deleteObject (const MWWorld::Ptr& ptr);
|
|
||||||
///< \return found?
|
|
||||||
|
|
||||||
void removeCell(MWWorld::CellStore* store);
|
|
||||||
|
|
||||||
/// Updates containing cell for object rendering data
|
|
||||||
void updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur);
|
|
||||||
|
|
||||||
Animation* getAnimation(const MWWorld::Ptr &ptr);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#endif
|
|
|
@ -10,8 +10,7 @@ namespace MWRender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual MWRender::Objects& getObjects() = 0;
|
virtual MWRender::Objects& getObjects() = 0;
|
||||||
virtual MWRender::Actors& getActors() = 0;
|
virtual ~RenderingInterface(){}
|
||||||
virtual ~RenderingInterface(){};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -138,11 +138,6 @@ namespace MWRender
|
||||||
return *mObjects.get();
|
return *mObjects.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
MWRender::Actors& RenderingManager::getActors()
|
|
||||||
{
|
|
||||||
throw std::runtime_error("unimplemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
Resource::ResourceSystem* RenderingManager::getResourceSystem()
|
Resource::ResourceSystem* RenderingManager::getResourceSystem()
|
||||||
{
|
{
|
||||||
return mResourceSystem;
|
return mResourceSystem;
|
||||||
|
|
|
@ -43,7 +43,6 @@ namespace MWRender
|
||||||
~RenderingManager();
|
~RenderingManager();
|
||||||
|
|
||||||
MWRender::Objects& getObjects();
|
MWRender::Objects& getObjects();
|
||||||
MWRender::Actors& getActors();
|
|
||||||
|
|
||||||
Resource::ResourceSystem* getResourceSystem();
|
Resource::ResourceSystem* getResourceSystem();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue