Implement the NegativeLight flag

This commit is contained in:
Evil Eye 2023-07-17 18:00:15 +02:00
parent bb8ac466d1
commit 7573004efc
4 changed files with 20 additions and 19 deletions

View file

@ -603,6 +603,14 @@ namespace ESM
mDescription.clear();
}
osg::Vec4f MagicEffect::getColor() const
{
osg::Vec4f color{ mData.mRed / 255.f, mData.mGreen / 255.f, mData.mBlue / 255.f, 1.f };
if (mData.mFlags & NegativeLight)
return osg::Vec4f(1.f, 1.f, 1.f, 2.f) - color;
return color;
}
const std::string& MagicEffect::indexToGmstString(int effectID)
{
if (effectID < 0 || static_cast<std::size_t>(effectID) >= sGmstEffectIds.size())

View file

@ -10,6 +10,8 @@
#include "components/esm/refid.hpp"
#include "components/misc/strings/algorithm.hpp"
#include <osg/Vec4>
namespace ESM
{
@ -55,7 +57,7 @@ namespace ESM
// Originally modifiable flags
AllowSpellmaking = 0x200, // Can be used for spellmaking
AllowEnchanting = 0x400, // Can be used for enchanting
NegativeLight = 0x800 // Unused
NegativeLight = 0x800 // Inverts the effect's color
};
enum MagnitudeDisplayType
@ -113,6 +115,8 @@ namespace ESM
/// Set record to default state (does not touch the ID/index).
void blank();
osg::Vec4f getColor() const;
enum Effects
{
WaterBreathing = 0,