Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Misc. (#9) #22

Merged
merged 4 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CommonLibF4/cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ set(SOURCES
include/RE/Bethesda/BSModelDB.h
include/RE/Bethesda/BSPointerHandle.h
include/RE/Bethesda/BSPreCulledObjects.h
include/RE/Bethesda/BSRandom.h
include/RE/Bethesda/BSResource.h
include/RE/Bethesda/BSResource/AsyncStream.h
include/RE/Bethesda/BSResource/BSResourceEnums.h
Expand Down
18 changes: 18 additions & 0 deletions CommonLibF4/include/RE/Bethesda/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "RE/Bethesda/BSLock.h"
#include "RE/Bethesda/BSPointerHandle.h"
#include "RE/Bethesda/BSSoundHandle.h"
#include "RE/Bethesda/BSSpring.h"
#include "RE/Bethesda/BSTArray.h"
#include "RE/Bethesda/BSTEvent.h"
#include "RE/Bethesda/BSTSingleton.h"
Expand Down Expand Up @@ -235,6 +236,23 @@ namespace RE
};
static_assert(sizeof(SubGraphIdleRootData) == 0x18);

class __declspec(novtable) AimModel
{
public:
BGSAimModel::Data aimModelData; // 00
BSSpring::SpringState<NiPoint2> recoilSpring; // 40
BSSpring::SpringState<NiPoint2> recoilDiminishSpring; // 54
NiPoint2 targetRecoilHead; // 68
NiPoint2 currentRecoilHead; // 70
NiPoint2 prevRecoilRad; // 78
NiPoint2 preShotAimRad; // 80
Actor* actor; // 88
float fireConeSize; // 90
float lastShotDeltaMs; // 94
unsigned int continuousShots; // 98
};
static_assert(sizeof(AimModel) == 0xA0);

class __declspec(novtable) EquippedItemData :
public NiRefObject // 00
{
Expand Down
38 changes: 36 additions & 2 deletions CommonLibF4/include/RE/Bethesda/BSExtraData.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "RE/Bethesda/BSTArray.h"
#include "RE/Bethesda/BSTSmartPointer.h"
#include "RE/Bethesda/BSTTuple.h"
#include "RE/Bethesda/FormComponents.h"
#include "RE/Bethesda/MemoryManager.h"
#include "RE/NetImmerse/NiPoint.h"

Expand Down Expand Up @@ -66,7 +67,7 @@ namespace RE
kRangeDistOverride,
kTimeLeft,
kCharge,
kLight,
kLight, // ExtraLight
kLock, // ExtraLock
kTeleport, // ExtraTeleport
kMapMarker,
Expand Down Expand Up @@ -170,7 +171,7 @@ namespace RE
kOutfitItem,
kEditorLocation,
kLeveledItemBase,
kLightData,
kLightData, // ExtraLightData
kScene,
kBadPosition,
kHeadTrackingWeight,
Expand Down Expand Up @@ -363,6 +364,39 @@ namespace RE
};
static_assert(sizeof(ExtraHealth) == 0x20);

class __declspec(novtable) ExtraCharge :
public BSExtraData // 00
{
public:
static constexpr auto RTTI{ RTTI::ExtraCharge };
static constexpr auto VTABLE{ VTABLE::ExtraCharge };
static constexpr auto TYPE{ EXTRA_DATA_TYPE::kCharge };

// members
float charge; // 18
};
static_assert(sizeof(ExtraCharge) == 0x20);

struct __declspec(novtable) MapMarkerData :
public TESFullName // 00
{
std::uint32_t flags; // 10
};
static_assert(sizeof(MapMarkerData) == 0x18);

class __declspec(novtable) ExtraMapMarker :
public BSExtraData // 00
{
public:
static constexpr auto RTTI{ RTTI::ExtraMapMarker };
static constexpr auto VTABLE{ VTABLE::ExtraMapMarker };
static constexpr auto TYPE{ EXTRA_DATA_TYPE::kMapMarker };

// members
MapMarkerData* mapMarkerData; // 18
};
static_assert(sizeof(ExtraMapMarker) == 0x20);

class __declspec(novtable) ExtraLock :
public BSExtraData // 00
{
Expand Down
14 changes: 14 additions & 0 deletions CommonLibF4/include/RE/Bethesda/BSRandom.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

namespace RE
{
namespace BSRandom
{
inline std::uint32_t UnsignedInt(std::uint32_t a_min, std::uint32_t a_max)
{
using func_t = decltype(&BSRandom::UnsignedInt);
static REL::Relocation<func_t> func{ REL::ID(2267950) };
return func(a_min, a_max);
}
}
}
1 change: 1 addition & 0 deletions CommonLibF4/include/RE/Fallout.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "RE/Bethesda/BSModelDB.h"
#include "RE/Bethesda/BSPointerHandle.h"
#include "RE/Bethesda/BSPreCulledObjects.h"
#include "RE/Bethesda/BSRandom.h"
#include "RE/Bethesda/BSResource.h"
#include "RE/Bethesda/BSResource/AsyncStream.h"
#include "RE/Bethesda/BSResource/BSResourceEnums.h"
Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Scaleform/Kernel/SF_Memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ namespace RE::Scaleform
public:
static void SetGlobalHeap(MemoryHeap* a_heap)
{
static REL::Relocation<MemoryHeap**> heap{ REL::ID(939898) };
static REL::Relocation<MemoryHeap**> heap{ REL::ID(2707353) };
*heap = a_heap;
}

[[nodiscard]] static MemoryHeap* GetGlobalHeap()
{
static REL::Relocation<MemoryHeap**> heap{ REL::ID(939898) };
static REL::Relocation<MemoryHeap**> heap{ REL::ID(2707353) };
return *heap;
}

Expand Down
Loading