Skip to content

Commit

Permalink
RE BGSDynamicPersistenceManager
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Dec 30, 2024
1 parent c6521b0 commit b4660c3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ set(SOURCES
include/RE/B/BGSDirectionalAmbientLightingColors.h
include/RE/B/BGSDistantTreeBlock.h
include/RE/B/BGSDualCastData.h
include/RE/B/BGSDynamicPersistenceManager.h
include/RE/B/BGSEncounterZone.h
include/RE/B/BGSEntryPoint.h
include/RE/B/BGSEntryPointFunctionData.h
Expand Down
41 changes: 41 additions & 0 deletions include/RE/B/BGSDynamicPersistenceManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#pragma once

#include "RE/B/BSAtomic.h"
#include "RE/B/BSTArray.h"
#include "RE/B/BSTSingleton.h"
#include "RE/N/NiSmartPointer.h"

namespace RE
{
class QueuedPromoteReferencesTask;

class BGSDynamicPersistenceManager : public BSTSingletonExplicit<BGSDynamicPersistenceManager>
{
public:
[[nodiscard]] static BGSDynamicPersistenceManager* GetSingleton()
{
static REL::Relocation<BGSDynamicPersistenceManager**> singleton{ RELOCATION_ID(514177, 400326) };
return *singleton;
}

bool PromoteReference(TESObjectREFR* a_refr, TESForm* a_owner)
{
using func_t = decltype(&BGSDynamicPersistenceManager::PromoteReference);
static REL::Relocation<func_t> func{ RELOCATION_ID(15157, 15330) };
return func(this, a_refr, a_owner);
}

bool DemoteReference(TESObjectREFR* a_refr, TESForm* a_owner, bool a_allowActors = false)
{
using func_t = decltype(&BGSDynamicPersistenceManager::DemoteReference);
static REL::Relocation<func_t> func{ RELOCATION_ID(15158, 15331) };
return func(this, a_refr, a_owner, a_allowActors);
}

// members
BSTArray<NiPointer<QueuedPromoteReferencesTask>> taskArray; // 00
BSSpinLock taskArrayLock; // 18
volatile std::int32_t pauseCount; // 20
};
static_assert(sizeof(BGSDynamicPersistenceManager) == 0x28);
}
1 change: 1 addition & 0 deletions include/RE/Skyrim.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
#include "RE/B/BGSDirectionalAmbientLightingColors.h"
#include "RE/B/BGSDistantTreeBlock.h"
#include "RE/B/BGSDualCastData.h"
#include "RE/B/BGSDynamicPersistenceManager.h"
#include "RE/B/BGSEncounterZone.h"
#include "RE/B/BGSEntryPoint.h"
#include "RE/B/BGSEntryPointFunctionData.h"
Expand Down

0 comments on commit b4660c3

Please sign in to comment.