CommonLibSSE (Parapets fork)
BGSSaveLoadGame.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/B/BGSFormChanges.h"
6 #include "RE/B/BSAtomic.h"
7 #include "RE/B/BSCoreTypes.h"
8 #include "RE/B/BSPointerHandle.h"
9 #include "RE/B/BSTArray.h"
10 #include "RE/B/BSTHashMap.h"
11 #include "RE/T/TESDataHandler.h"
12 
13 namespace RE
14 {
15  class BGSLoadFormData;
16 
18  {
19  public:
22  std::uint32_t nextIndex; // 60
23  std::uint32_t pad64; // 64
24  };
25  static_assert(sizeof(BGSSaveLoadFormIDMap) == 0x68);
26 
27  class BGSCellNumericIDArrayMap : public BSTHashMap<FormID, BSTArray<FormID>>
28  {
29  };
30  static_assert(sizeof(BGSCellNumericIDArrayMap) == 0x30);
31 
33  {
34  public:
36  BGSCellNumericIDArrayMap cellReferences; // 30 - interior or sky cells
38  };
39  static_assert(sizeof(BGSSaveLoadReferencesMap) == 0x90);
40 
42  {
43  };
44  static_assert(sizeof(BGSReconstructFormsInAllFilesMap) == 0x80);
45 
47  {
49  {
53 
54  kTotal
55  };
56  };
58 
60  {
61  public:
63  };
64  static_assert(sizeof(BGSSaveLoadQueuedSubBufferMap) == 0x90);
65 
67  {
68  public:
70  };
71  static_assert(sizeof(BGSSaveLoadHistory) == 0x18);
72 
74  {
75  public:
78  };
79  static_assert(sizeof(BGSSaveLoadChangesMap) == 0x38);
80 
82  {
83  public:
84  enum class GlobalFlags
85  {
86  kAllowChanges = 1 << 0,
87  kSaveGameLoading = 1 << 1,
88  kSaveGameSaving = 1 << 2,
89  kInitingForms = 1 << 3,
90  kDeferInitForms = 1 << 4,
92  kPlayerLocationInvalid = 1 << 6
93  };
94 
95  [[nodiscard]] static BGSSaveLoadGame* GetSingleton();
96 
97  [[nodiscard]] bool GetGlobalAllowChanges() const noexcept { return globalFlags.all(GlobalFlags::kAllowChanges); }
98  [[nodiscard]] bool GetSaveGameLoading() const noexcept { return globalFlags.all(GlobalFlags::kSaveGameLoading); }
99  [[nodiscard]] bool GetSaveGameSaving() const noexcept { return globalFlags.all(GlobalFlags::kSaveGameSaving); }
100  [[nodiscard]] bool GetInitingForms() const noexcept { return globalFlags.all(GlobalFlags::kInitingForms); }
101  [[nodiscard]] bool GetDeferInitForms() const noexcept { return globalFlags.all(GlobalFlags::kDeferInitForms); }
103 
104  // members
105 #ifndef SKYRIMVR
107 #else
108  std::uint8_t fileIndexMap[0xFF]; // 000
109  std::uint8_t reverseFileIndexMap[0xFF]; // 0FF
110 #endif
123  std::uint8_t currentMinorVersion; // 344
124  std::uint8_t pad345; // 345
125  std::uint16_t pad346; // 346
126  };
127 #ifndef SKYRIMVR
128  static_assert(sizeof(BGSSaveLoadGame) == 0x348);
129 #else
130  static_assert(sizeof(BGSSaveLoadGame) == 0x518);
131 #endif
132 }
Definition: BGSSaveLoadGame.h:28
Definition: BGSConstructFormsInAllFilesMap.h:75
Definition: BGSSaveLoadGame.h:42
Definition: BGSSaveLoadGame.h:74
BSTHashMap< FormID, BGSFormChanges > changes
Definition: BGSSaveLoadGame.h:76
BSReadWriteLock lock
Definition: BGSSaveLoadGame.h:77
Definition: BGSSaveLoadGame.h:18
std::uint32_t pad64
Definition: BGSSaveLoadGame.h:23
BSTHashMap< FormID, std::uint32_t > formIDToIndex
Definition: BGSSaveLoadGame.h:20
std::uint32_t nextIndex
Definition: BGSSaveLoadGame.h:22
BSTHashMap< std::uint32_t, FormID > indexToFormID
Definition: BGSSaveLoadGame.h:21
Definition: BGSSaveLoadGame.h:82
BGSSaveLoadFormIDMap worldspaceFormIDMap
Definition: BGSSaveLoadGame.h:111
BGSReconstructFormsInAllFilesMap reconstructFormsMap
Definition: BGSSaveLoadGame.h:115
BSTArray< BGSLoadFormData * > loadFormData
Definition: BGSSaveLoadGame.h:119
BGSSaveLoadChangesMap * changesMap
Definition: BGSSaveLoadGame.h:120
bool GetPositioningPlayerCharacter() const noexcept
Definition: BGSSaveLoadGame.h:102
stl::enumeration< GlobalFlags, std::uint32_t > globalFlags
Definition: BGSSaveLoadGame.h:122
BGSSaveLoadQueuedSubBufferMap queuedSubBuffers
Definition: BGSSaveLoadGame.h:116
bool GetSaveGameLoading() const noexcept
Definition: BGSSaveLoadGame.h:98
bool GetInitingForms() const noexcept
Definition: BGSSaveLoadGame.h:100
TESFileCollection files
Definition: BGSSaveLoadGame.h:106
BGSSaveLoadHistory history
Definition: BGSSaveLoadGame.h:118
BGSSaveLoadReferencesMap references
Definition: BGSSaveLoadGame.h:113
static BGSSaveLoadGame * GetSingleton()
GlobalFlags
Definition: BGSSaveLoadGame.h:85
BSTHashMap< FormID, FormID > changedFormIDs
Definition: BGSSaveLoadGame.h:114
bool GetDeferInitForms() const noexcept
Definition: BGSSaveLoadGame.h:101
bool GetSaveGameSaving() const noexcept
Definition: BGSSaveLoadGame.h:99
BGSSaveLoadChangesMap * oldChangesMap
Definition: BGSSaveLoadGame.h:121
std::uint16_t pad346
Definition: BGSSaveLoadGame.h:125
BSTHashMap< std::uint32_t, ActorHandle > queuedInitPackageLocations
Definition: BGSSaveLoadGame.h:112
bool GetGlobalAllowChanges() const noexcept
Definition: BGSSaveLoadGame.h:97
BGSSaveLoadFormIDMap formIDMap
Definition: BGSSaveLoadGame.h:117
std::uint8_t currentMinorVersion
Definition: BGSSaveLoadGame.h:123
std::uint8_t pad345
Definition: BGSSaveLoadGame.h:124
Definition: BGSSaveLoadGame.h:67
BSTArray< const char * > notes
Definition: BGSSaveLoadGame.h:69
Definition: BGSSaveLoadGame.h:60
BSTHashMap< TESForm *, BGSLoadGameSubBuffer > maps[QUEUED_SUB_BUFFER_TYPES::kTotal]
Definition: BGSSaveLoadGame.h:62
Definition: BGSSaveLoadGame.h:33
BSTHashMap< std::uint32_t, BGSCellNumericIDArrayMap * > worldReferences
Definition: BGSSaveLoadGame.h:37
BSTHashMap< FormID, FormID > movedReferences
Definition: BGSSaveLoadGame.h:35
BGSCellNumericIDArrayMap cellReferences
Definition: BGSSaveLoadGame.h:36
Definition: BSAtomic.h:69
Definition: BSTHashMap.h:21
constexpr bool all(Args... a_args) const noexcept requires(std
Definition: PCH.h:329
Definition: AbsorbEffect.h:6
Definition: BGSSaveLoadGame.h:47
QUEUED_SUB_BUFFER_TYPE
Definition: BGSSaveLoadGame.h:49
@ kUnk1
Definition: BGSSaveLoadGame.h:51
@ kUnk0
Definition: BGSSaveLoadGame.h:50
@ kTotal
Definition: BGSSaveLoadGame.h:54
@ kUnk2
Definition: BGSSaveLoadGame.h:52
Definition: TESDataHandler.h:26