2023-02-07 10:30:57 +00:00
|
|
|
#include "light4.hpp"
|
|
|
|
|
|
|
|
#include "../mwrender/objects.hpp"
|
|
|
|
#include "../mwrender/renderinginterface.hpp"
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
|
|
|
#include <components/esm4/loadligh.hpp>
|
|
|
|
|
|
|
|
namespace MWClass
|
|
|
|
{
|
|
|
|
ESM4Light::ESM4Light()
|
2023-04-10 00:42:27 +00:00
|
|
|
: MWWorld::RegisteredClass<ESM4Light, ESM4Base<ESM4::Light>>(ESM4::Light::sRecordId)
|
2023-02-07 10:30:57 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ESM4Light ::insertObjectRendering(
|
|
|
|
const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const
|
|
|
|
{
|
|
|
|
MWWorld::LiveCellRef<ESM4::Light>* ref = ptr.get<ESM4::Light>();
|
|
|
|
|
|
|
|
// Insert even if model is empty, so that the light is added
|
|
|
|
renderingInterface.getObjects().insertModel(ptr, model, !(ref->mBase->mData.flags & ESM4::Light::OffDefault));
|
|
|
|
}
|
|
|
|
}
|