1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 17:19:39 +00:00

Fix light data being reset for the wrong light

This commit is contained in:
scrawl 2017-02-09 02:46:30 +01:00
parent c68f662c9a
commit 839928e210

View file

@ -294,6 +294,13 @@ namespace SceneUtil
DisableLight(const DisableLight& copy,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) DisableLight(const DisableLight& copy,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY)
: osg::StateAttribute(copy,copyop), mIndex(copy.mIndex) {} : osg::StateAttribute(copy,copyop), mIndex(copy.mIndex) {}
virtual osg::Object* cloneType() const { return new DisableLight(mIndex); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new DisableLight(*this,copyop); }
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const DisableLight *>(obj)!=NULL; }
virtual const char* libraryName() const { return "SceneUtil"; }
virtual const char* className() const { return "DisableLight"; }
virtual Type getType() const { return LIGHT; }
unsigned int getMember() const unsigned int getMember() const
{ {
return mIndex; return mIndex;
@ -310,8 +317,6 @@ namespace SceneUtil
throw std::runtime_error("DisableLight::compare: unimplemented"); throw std::runtime_error("DisableLight::compare: unimplemented");
} }
META_StateAttribute(SceneUtil, DisableLight, osg::StateAttribute::LIGHT)
virtual void apply(osg::State& state) const virtual void apply(osg::State& state) const
{ {
int lightNum = GL_LIGHT0 + mIndex; int lightNum = GL_LIGHT0 + mIndex;