Skip to content

Commit acd77a2

Browse files
committed
feat: BGSLoadGameBuffer & BGSSaveGameBuffer
1 parent 09163d9 commit acd77a2

3 files changed

Lines changed: 69 additions & 0 deletions

File tree

include/RE/B/BGSLoadGameBuffer.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#pragma once
2+
3+
namespace RE
4+
{
5+
class __declspec(novtable) BGSLoadGameBuffer
6+
{
7+
public:
8+
static constexpr auto RTTI{ RTTI::BGSLoadGameBuffer };
9+
static constexpr auto VTABLE{ VTABLE::BGSLoadGameBuffer };
10+
11+
virtual ~BGSLoadGameBuffer(); // 00
12+
13+
// add
14+
virtual std::uint8_t GetVersion(void); // 01
15+
16+
void LoadDataEndian(void* a_data, std::uint32_t a_offset, std::uint32_t a_size)
17+
{
18+
using func_t = decltype(&BGSLoadGameBuffer::LoadDataEndian);
19+
static REL::Relocation<func_t> func{ REL::ID(1451631) };
20+
return func(this, a_data, a_offset, a_size);
21+
}
22+
23+
// members
24+
void* buffer; // 008
25+
std::uint64_t unk10; // 010
26+
std::uint32_t unk18; // 018
27+
std::uint32_t unk1C; // 01C
28+
std::uint32_t unk20; // 020
29+
std::uint32_t bufferPosition; // 024
30+
};
31+
static_assert(sizeof(BGSLoadGameBuffer) == 0x28);
32+
}

include/RE/B/BGSSaveGameBuffer.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#pragma once
2+
3+
namespace RE
4+
{
5+
class Actor;
6+
class TESForm;
7+
class TESObjectREFR;
8+
9+
class __declspec(novtable) BGSSaveGameBuffer
10+
{
11+
public:
12+
static constexpr auto RTTI{ RTTI::BGSSaveGameBuffer };
13+
static constexpr auto VTABLE{ VTABLE::BGSSaveGameBuffer };
14+
15+
virtual ~BGSSaveGameBuffer(); // 00
16+
17+
// add
18+
virtual TESForm* GetForm(); // 01 - { return nullptr; }
19+
virtual TESObjectREFR* GetReference(); // 02 - { return nullptr; }
20+
virtual Actor* GetActor(); // 03 - { return nullptr; }
21+
22+
void SaveDataEndian(const void* a_data, std::uint32_t a_size)
23+
{
24+
using func_t = decltype(&BGSSaveGameBuffer::SaveDataEndian);
25+
static REL::Relocation<func_t> func{ REL::ID(594281) };
26+
return func(this, a_data, a_size);
27+
}
28+
29+
// members
30+
void* buffer; // 008
31+
std::uint32_t size; // 010
32+
std::uint32_t bufferPosition; // 014
33+
};
34+
static_assert(sizeof(BGSSaveGameBuffer) == 0x18);
35+
}

include/RE/Fallout.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
#include "RE/B/BGSLensFlare.h"
133133
#include "RE/B/BGSLightingTemplate.h"
134134
#include "RE/B/BGSListForm.h"
135+
#include "RE/B/BGSLoadGameBuffer.h"
135136
#include "RE/B/BGSLocalizedString.h"
136137
#include "RE/B/BGSLocation.h"
137138
#include "RE/B/BGSLocationRefType.h"
@@ -174,6 +175,7 @@
174175
#include "RE/B/BGSReferenceEffect.h"
175176
#include "RE/B/BGSRelationship.h"
176177
#include "RE/B/BGSReverbParameters.h"
178+
#include "RE/B/BGSSaveGameBuffer.h"
177179
#include "RE/B/BGSSaveLoadFileEntry.h"
178180
#include "RE/B/BGSSaveLoadManager.h"
179181
#include "RE/B/BGSSaveLoadThread.h"

0 commit comments

Comments
 (0)