diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index 16d0bedae..6cf40300a 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -21,62 +21,9 @@ #include "animation.hpp" using namespace MWRender; -float Objects::lightLinearValue() -{ - return mFallback->getFallbackFloat("LightAttenuation_LinearValue"); -} -float Objects::lightLinearRadiusMult() -{ - return mFallback->getFallbackFloat("LightAttenuation_LinearRadiusMult"); -} -float Objects::lightQuadraticValue() -{ - return mFallback->getFallbackFloat("LightAttenuation_QuadraticValue"); -} -float Objects::lightQuadraticRadiusMult() -{ - return mFallback->getFallbackFloat("LightAttenuation_QuadraticRadiusMult"); -} - -bool Objects::lightOutQuadInLin() -{ - return mFallback->getFallbackBool("LightAttenuation_OutQuadInLin"); -} -bool Objects::lightQuadratic() -{ - return mFallback->getFallbackBool("LightAttenuation_UseQuadratic"); -} int Objects::uniqueID = 0; -void Objects::clearSceneNode (Ogre::SceneNode *node) -{ - for (int i=node->numAttachedObjects()-1; i>=0; --i) - { - Ogre::MovableObject *object = node->getAttachedObject (i); - - // for entities, destroy any objects attached to bones - if (object->getTypeFlags () == Ogre::SceneManager::ENTITY_TYPE_MASK) - { - Ogre::Entity* ent = static_cast(object); - Ogre::Entity::ChildObjectListIterator children = ent->getAttachedObjectIterator (); - while (children.hasMoreElements()) - { - mRenderer.getScene ()->destroyMovableObject (children.getNext ()); - } - } - - node->detachObject (object); - mRenderer.getScene()->destroyMovableObject (object); - } - - Ogre::Node::ChildNodeIterator it = node->getChildIterator (); - while (it.hasMoreElements ()) - { - clearSceneNode(static_cast(it.getNext ())); - } -} - void Objects::setRootNode(Ogre::SceneNode* root) { mRootNode = root; diff --git a/apps/openmw/mwrender/objects.hpp b/apps/openmw/mwrender/objects.hpp index 1e3ce3ddf..949486732 100644 --- a/apps/openmw/mwrender/objects.hpp +++ b/apps/openmw/mwrender/objects.hpp @@ -5,7 +5,6 @@ #include #include -#include "../mwworld/fallback.hpp" namespace MWWorld { @@ -17,38 +16,6 @@ namespace MWRender{ class ObjectAnimation; -/// information about light needed for rendering -enum LightType -{ - // These are all mutually exclusive - LT_Normal=0, - LT_Flicker=1, - LT_FlickerSlow=2, - LT_Pulse=3, - LT_PulseSlow=4 -}; - -struct LightInfo -{ - // Constants - std::string name; // ogre handle - Ogre::ColourValue colour; - float radius; - bool interior; // Does this light belong to an interior or exterior cell - LightType type; - - // Runtime variables - float dir; // direction time is running... - float time; // current time - float phase; // current phase - - LightInfo() : - dir(1.0f), time(0.0f), phase (0.0f), - interior(true), type(LT_Normal), radius(1.0) - { - } -}; - class Objects{ typedef std::map PtrAnimationMap; @@ -64,24 +31,10 @@ class Objects{ bool mIsStatic; static int uniqueID; - MWWorld::Fallback* mFallback; - float lightLinearValue(); - float lightLinearRadiusMult(); - - bool lightQuadratic(); - float lightQuadraticValue(); - float lightQuadraticRadiusMult(); - - bool lightOutQuadInLin(); - - void clearSceneNode (Ogre::SceneNode *node); - ///< Remove all movable objects from \a node. - public: - Objects(OEngine::Render::OgreRenderer& renderer, MWWorld::Fallback* fallback) - : mRenderer (renderer) + Objects(OEngine::Render::OgreRenderer &renderer) + : mRenderer(renderer) , mIsStatic(false) - , mFallback(fallback) , mRootNode(NULL) {} ~Objects(){} diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 65fe5014c..bc5d0ef20 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -57,7 +57,7 @@ RenderingManager::RenderingManager(OEngine::Render::OgreRenderer& _rend, const b MWWorld::Fallback* fallback) : mRendering(_rend) , mFallback(fallback) - , mObjects(mRendering, mFallback) + , mObjects(mRendering) , mActors(mRendering, this) , mPlayerAnimation(NULL) , mAmbientMode(0)