mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:23:54 +00:00
Merge branch 'alignyorefs' into 'master'
Reorder RefData members to decrease its size See merge request OpenMW/openmw!4020
This commit is contained in:
commit
55c5f2112b
2 changed files with 20 additions and 24 deletions
|
@ -58,12 +58,12 @@ namespace MWWorld
|
||||||
|
|
||||||
RefData::RefData()
|
RefData::RefData()
|
||||||
: mBaseNode(nullptr)
|
: mBaseNode(nullptr)
|
||||||
|
, mCustomData(nullptr)
|
||||||
|
, mFlags(0)
|
||||||
, mDeletedByContentFile(false)
|
, mDeletedByContentFile(false)
|
||||||
, mEnabled(true)
|
, mEnabled(true)
|
||||||
, mPhysicsPostponed(false)
|
, mPhysicsPostponed(false)
|
||||||
, mCustomData(nullptr)
|
|
||||||
, mChanged(false)
|
, mChanged(false)
|
||||||
, mFlags(0)
|
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 3; ++i)
|
for (int i = 0; i < 3; ++i)
|
||||||
{
|
{
|
||||||
|
@ -74,50 +74,50 @@ namespace MWWorld
|
||||||
|
|
||||||
RefData::RefData(const ESM::CellRef& cellRef)
|
RefData::RefData(const ESM::CellRef& cellRef)
|
||||||
: mBaseNode(nullptr)
|
: mBaseNode(nullptr)
|
||||||
|
, mPosition(cellRef.mPos)
|
||||||
|
, mCustomData(nullptr)
|
||||||
|
, mFlags(0) // Loading from ESM/ESP files -> assume unchanged
|
||||||
, mDeletedByContentFile(false)
|
, mDeletedByContentFile(false)
|
||||||
, mEnabled(true)
|
, mEnabled(true)
|
||||||
, mPhysicsPostponed(false)
|
, mPhysicsPostponed(false)
|
||||||
, mPosition(cellRef.mPos)
|
|
||||||
, mCustomData(nullptr)
|
|
||||||
, mChanged(false)
|
, mChanged(false)
|
||||||
, mFlags(0) // Loading from ESM/ESP files -> assume unchanged
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RefData::RefData(const ESM4::Reference& ref)
|
RefData::RefData(const ESM4::Reference& ref)
|
||||||
: mBaseNode(nullptr)
|
: mBaseNode(nullptr)
|
||||||
|
, mPosition(ref.mPos)
|
||||||
|
, mCustomData(nullptr)
|
||||||
|
, mFlags(0)
|
||||||
, mDeletedByContentFile(ref.mFlags & ESM4::Rec_Deleted)
|
, mDeletedByContentFile(ref.mFlags & ESM4::Rec_Deleted)
|
||||||
, mEnabled(!(ref.mFlags & ESM4::Rec_Disabled))
|
, mEnabled(!(ref.mFlags & ESM4::Rec_Disabled))
|
||||||
, mPhysicsPostponed(false)
|
, mPhysicsPostponed(false)
|
||||||
, mPosition(ref.mPos)
|
|
||||||
, mCustomData(nullptr)
|
|
||||||
, mChanged(false)
|
, mChanged(false)
|
||||||
, mFlags(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RefData::RefData(const ESM4::ActorCharacter& ref)
|
RefData::RefData(const ESM4::ActorCharacter& ref)
|
||||||
: mBaseNode(nullptr)
|
: mBaseNode(nullptr)
|
||||||
|
, mPosition(ref.mPos)
|
||||||
|
, mCustomData(nullptr)
|
||||||
|
, mFlags(0)
|
||||||
, mDeletedByContentFile(ref.mFlags & ESM4::Rec_Deleted)
|
, mDeletedByContentFile(ref.mFlags & ESM4::Rec_Deleted)
|
||||||
, mEnabled(!(ref.mFlags & ESM4::Rec_Disabled))
|
, mEnabled(!(ref.mFlags & ESM4::Rec_Disabled))
|
||||||
, mPhysicsPostponed(false)
|
, mPhysicsPostponed(false)
|
||||||
, mPosition(ref.mPos)
|
|
||||||
, mCustomData(nullptr)
|
|
||||||
, mChanged(false)
|
, mChanged(false)
|
||||||
, mFlags(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RefData::RefData(const ESM::ObjectState& objectState, bool deletedByContentFile)
|
RefData::RefData(const ESM::ObjectState& objectState, bool deletedByContentFile)
|
||||||
: mBaseNode(nullptr)
|
: mBaseNode(nullptr)
|
||||||
, mDeletedByContentFile(deletedByContentFile)
|
|
||||||
, mEnabled(objectState.mEnabled != 0)
|
|
||||||
, mPhysicsPostponed(false)
|
|
||||||
, mPosition(objectState.mPosition)
|
, mPosition(objectState.mPosition)
|
||||||
, mAnimationState(objectState.mAnimationState)
|
, mAnimationState(objectState.mAnimationState)
|
||||||
, mCustomData(nullptr)
|
, mCustomData(nullptr)
|
||||||
, mChanged(true)
|
|
||||||
, mFlags(objectState.mFlags) // Loading from a savegame -> assume changed
|
, mFlags(objectState.mFlags) // Loading from a savegame -> assume changed
|
||||||
|
, mDeletedByContentFile(deletedByContentFile)
|
||||||
|
, mEnabled(objectState.mEnabled != 0)
|
||||||
|
, mPhysicsPostponed(false)
|
||||||
|
, mChanged(true)
|
||||||
{
|
{
|
||||||
// "Note that the ActivationFlag_UseEnabled is saved to the reference,
|
// "Note that the ActivationFlag_UseEnabled is saved to the reference,
|
||||||
// which will result in permanently suppressed activation if the reference script is removed.
|
// which will result in permanently suppressed activation if the reference script is removed.
|
||||||
|
|
|
@ -47,6 +47,10 @@ namespace MWWorld
|
||||||
|
|
||||||
MWScript::Locals mLocals;
|
MWScript::Locals mLocals;
|
||||||
std::shared_ptr<MWLua::LocalScripts> mLuaScripts;
|
std::shared_ptr<MWLua::LocalScripts> mLuaScripts;
|
||||||
|
ESM::Position mPosition;
|
||||||
|
ESM::AnimationState mAnimationState;
|
||||||
|
std::unique_ptr<CustomData> mCustomData;
|
||||||
|
unsigned int mFlags;
|
||||||
|
|
||||||
/// separate delete flag used for deletion by a content file
|
/// separate delete flag used for deletion by a content file
|
||||||
/// @note not stored in the save game file.
|
/// @note not stored in the save game file.
|
||||||
|
@ -58,20 +62,12 @@ namespace MWWorld
|
||||||
bool mPhysicsPostponed : 1;
|
bool mPhysicsPostponed : 1;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ESM::Position mPosition;
|
bool mChanged : 1;
|
||||||
|
|
||||||
ESM::AnimationState mAnimationState;
|
|
||||||
|
|
||||||
std::unique_ptr<CustomData> mCustomData;
|
|
||||||
|
|
||||||
void copy(const RefData& refData);
|
void copy(const RefData& refData);
|
||||||
|
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
bool mChanged;
|
|
||||||
|
|
||||||
unsigned int mFlags;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RefData();
|
RefData();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue