mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-09 03:57:51 +03:00
Merge branch 'darkmagic' into 'master'
Implement the NegativeLight flag Closes #7477 See merge request OpenMW/openmw!3240
This commit is contained in:
commit
85822eca45
5 changed files with 21 additions and 19 deletions
|
@ -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())
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue