1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-11-29 14:34:29 +00:00
openmw/components/sceneutil/lightcommon.cpp
2025-09-18 00:38:08 +01:00

33 lines
1.3 KiB
C++

#include "lightcommon.hpp"
#include <components/esm3/loadligh.hpp>
#include <components/esm4/loadligh.hpp>
#include <components/sceneutil/util.hpp>
namespace SceneUtil
{
LightCommon::LightCommon(const ESM::Light& light)
: mFlicker(light.mData.mFlags & ESM::Light::Flicker)
, mFlickerSlow(light.mData.mFlags & ESM::Light::FlickerSlow)
, mNegative(light.mData.mFlags & ESM::Light::Negative)
, mPulse(light.mData.mFlags & ESM::Light::Pulse)
, mPulseSlow(light.mData.mFlags & ESM::Light::PulseSlow)
, mOffDefault(light.mData.mFlags & ESM::Light::OffDefault)
, mColor(SceneUtil::colourFromRGB(light.mData.mColor))
, mRadius(static_cast<float>(light.mData.mRadius))
{
}
LightCommon::LightCommon(const ESM4::Light& light)
: mFlicker(light.mData.flags & ESM4::Light::Flicker)
, mFlickerSlow(light.mData.flags & ESM4::Light::FlickerSlow)
, mNegative(light.mData.flags & ESM::Light::Negative)
, mPulse(light.mData.flags & ESM4::Light::Pulse)
, mPulseSlow(light.mData.flags & ESM4::Light::PulseSlow)
, mOffDefault(light.mData.flags & ESM4::Light::OffDefault)
, mColor(SceneUtil::colourFromRGB(light.mData.colour))
, mRadius(static_cast<float>(light.mData.radius))
{
}
}