Skip to content

Commit

Permalink
feat: TES
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed Nov 5, 2024
1 parent fd4d74f commit 50299fa
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 5 deletions.
1 change: 1 addition & 0 deletions include/RE/IDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ namespace RE::ID

namespace TES
{
inline constexpr REL::ID GetDeadCount{ 84704 };
inline constexpr REL::ID Singleton{ 881024 };
}

Expand Down
34 changes: 34 additions & 0 deletions include/RE/S/Sky.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once

#include "RE/B/BSTSingleton.h"

namespace RE
{
class IExternalEmittanceManager
{
public:
SF_RTTI(IExternalEmittanceManager);
};

class ILightEmittanceManager
{
public:
SF_RTTI(ILightEmittanceManager);
};

class __declspec(novtable) Sky :
public BSTSingletonSDM<Sky>,
public IExternalEmittanceManager,
public ILightEmittanceManager
{
public:
SF_RTTI_VTABLE(Sky);

virtual ~Sky(); // 00

// members
std::byte pad[0xEB8]; // 00?
float windSpeed; // EC4
};
static_assert(offsetof(Sky, windSpeed) == 0xEC4);
}
1 change: 1 addition & 0 deletions include/RE/Starfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@
#include "RE/S/SettingCollectionMap.h"
#include "RE/S/Sexes.h"
#include "RE/S/SimpleAllocMemoryPagePolicy.h"
#include "RE/S/Sky.h"
#include "RE/S/SpellItem.h"
#include "RE/S/Stack.h"
#include "RE/S/StackFrame.h"
Expand Down
20 changes: 16 additions & 4 deletions include/RE/T/TES.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ namespace RE
class StreamOpenedEvent;
}

class Sky;
class TESActorBase;
class TESObjectCELL;

struct PositionPlayerEvent;

class TES :
class __declspec(novtable) TES :
public BSTEventSink<BSResource::Archive2::StreamOpenedEvent>, // 000
public BSTEventSink<PositionPlayerEvent> // 008
{
Expand All @@ -22,7 +24,7 @@ namespace RE

virtual ~TES(); // 00

// override (BSTEventSink<BSResource::ArchiveStreamOpenedEvent>)
// override (BSTEventSink<BSResource::Archive2::StreamOpenedEvent>)
BSEventNotifyControl ProcessEvent(const BSResource::Archive2::StreamOpenedEvent& a_event, BSTEventSource<BSResource::Archive2::StreamOpenedEvent>* a_eventSource) override; // 01 - { return BSEventNotifyControl::kContinue; }

// override (BSTEventSink<PositionPlayerEvent>)
Expand All @@ -34,9 +36,19 @@ namespace RE
return *singleton;
}

std::uint16_t GetDeadCount(TESActorBase* a_actorBase)
{
using func_t = decltype(&TES::GetDeadCount);
static REL::Relocation<func_t> func{ ID::TES::GetDeadCount };
return func(this, a_actorBase);
}

// members
std::byte pad[0xD8]; // 010
TESObjectCELL* interiorCell; // 0E8
std::byte pad010[0x18]; // 010
Sky* sky; // 028
std::byte pad030[0xB8]; // 030
TESObjectCELL* interiorCell; // 0E8
};
static_assert(offsetof(TES, sky) == 0x28);
static_assert(offsetof(TES, interiorCell) == 0xE8);
}
3 changes: 2 additions & 1 deletion include/RE/T/TESGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

namespace RE
{
class TESGlobal : public TESForm
class __declspec(novtable) TESGlobal :
public TESForm
{
public:
SF_RTTI_VTABLE(TESGlobal);
Expand Down

0 comments on commit 50299fa

Please sign in to comment.