-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54c2797
commit f6e9011
Showing
18 changed files
with
1,522 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSContainer.h" | ||
#include "RE/B/BSFixedString.h" | ||
#include "RE/B/BSIntrusiveRefCounted.h" | ||
#include "RE/B/BSLock.h" | ||
#include "RE/B/BSTArray.h" | ||
#include "RE/B/BSTEvent.h" | ||
#include "RE/B/BSTSmartPointer.h" | ||
#include "RE/M/MemoryManager.h" | ||
#include "RE/T/TypeInfo.h" | ||
#include "RE/V/Variable.h" | ||
|
||
namespace RE | ||
{ | ||
namespace BSScript | ||
{ | ||
class TypeInfo; | ||
class Variable; | ||
|
||
class Array : | ||
public BSIntrusiveRefCounted // 00 | ||
{ | ||
private: | ||
Array* ctor(const TypeInfo* type_info, std::uint32_t initial_size = 0); | ||
void dtor(); | ||
|
||
public: | ||
using value_type = Variable; | ||
using size_type = std::uint32_t; | ||
using difference_type = std::int32_t; | ||
using reference = value_type&; | ||
using const_reference = const value_type&; | ||
using pointer = value_type*; | ||
using const_pointer = const value_type*; | ||
using iterator = value_type*; | ||
using const_iterator = const value_type*; | ||
using reverse_iterator = std::reverse_iterator<iterator>; | ||
using const_reverse_iterator = std::reverse_iterator<const_iterator>; | ||
|
||
Array(const TypeInfo* type_info, std::uint32_t initial_size = 0); | ||
~Array(); | ||
|
||
[[nodiscard]] reference operator[](size_type a_pos); | ||
[[nodiscard]] const_reference operator[](size_type a_pos) const; | ||
|
||
[[nodiscard]] reference front(); | ||
[[nodiscard]] const_reference front() const; | ||
|
||
[[nodiscard]] reference back(); | ||
[[nodiscard]] const_reference back() const; | ||
|
||
[[nodiscard]] pointer data() noexcept; | ||
[[nodiscard]] const_pointer data() const noexcept; | ||
|
||
[[nodiscard]] iterator begin() noexcept; | ||
[[nodiscard]] const_iterator begin() const noexcept; | ||
[[nodiscard]] const_iterator cbegin() const noexcept; | ||
|
||
[[nodiscard]] iterator end() noexcept; | ||
[[nodiscard]] const_iterator end() const noexcept; | ||
[[nodiscard]] const_iterator cend() const noexcept; | ||
|
||
[[nodiscard]] reverse_iterator rbegin() noexcept; | ||
[[nodiscard]] const_reverse_iterator rbegin() const noexcept; | ||
[[nodiscard]] const_reverse_iterator crbegin() const noexcept; | ||
|
||
[[nodiscard]] reverse_iterator rend() noexcept; | ||
[[nodiscard]] const_reverse_iterator rend() const noexcept; | ||
[[nodiscard]] const_reverse_iterator crend() const noexcept; | ||
|
||
[[nodiscard]] bool empty() const noexcept; | ||
|
||
[[nodiscard]] size_type size() const noexcept; | ||
|
||
[[nodiscard]] size_type max_size() const noexcept; | ||
|
||
[[nodiscard]] TypeInfo& type_info(); | ||
[[nodiscard]] const TypeInfo& type_info() const; | ||
|
||
[[nodiscard]] TypeInfo::RawType type() const; | ||
|
||
// members | ||
TypeInfo elementType; // 08 | ||
BSSpinLock elementsLock; // 10 | ||
BSTArray<Variable> elements; // 18 | ||
}; | ||
static_assert(sizeof(Array) == 0x28); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSIntrusiveRefCounted.h" | ||
#include "RE/T/TypeInfo.h" | ||
|
||
namespace RE | ||
{ | ||
namespace BSScript | ||
{ | ||
class TypeInfo; | ||
|
||
class __declspec(novtable) IComplexType : | ||
public BSIntrusiveRefCounted // 08 | ||
{ | ||
public: | ||
SF_RTTI_VTABLE(BSScript__IComplexType); | ||
|
||
// TODO: Verify that setting this to default doesn't fuck everything up | ||
virtual ~IComplexType() = default; // 00 | ||
|
||
// add | ||
virtual TypeInfo::RawType GetRawType() const = 0; // 01 | ||
|
||
[[nodiscard]] bool IsObject() const { return GetRawType() == TypeInfo::RawType::kObject; } | ||
}; | ||
static_assert(sizeof(IComplexType) == 0x10); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSFixedString.h" | ||
#include "RE/B/BSTSmartPointer.h" | ||
|
||
namespace RE | ||
{ | ||
namespace BSScript | ||
{ | ||
class Object; | ||
|
||
struct __declspec(novtable) IVMObjectBindInterface | ||
{ | ||
public: | ||
SF_RTTI_VTABLE(BSScript__IVMObjectBindInterface); | ||
virtual ~IVMObjectBindInterface(); // 00 | ||
|
||
// add | ||
[[nodiscard]] virtual std::uint64_t GetBoundHandle(const BSTSmartPointer<Object>& a_objPtr) const = 0; // 01 | ||
virtual void TypeCanBeBound(const BSFixedString& a_className, std::uint64_t a_handle) = 0; // 02 | ||
virtual void BindObject(BSTSmartPointer<Object>& a_objPtr, std::uint64_t a_handle, bool a_conditional) = 0; // 03 | ||
virtual void HandleLoadedBinding(BSTSmartPointer<Object>& a_objPtr, std::uint64_t a_handle, bool a_conditional) = 0; // 04 | ||
virtual void RemoveAllBoundObjects(std::uint64_t a_handle) = 0; // 05 | ||
virtual void RemoveAllDiskLoadedBoundObjects(std::uint64_t a_handle) = 0; // 06 | ||
virtual void HandleCObjectDeletion(std::uint64_t a_handle) = 0; // 07 | ||
virtual void UnbindObject(const BSTSmartPointer<Object>& a_objPtr) = 0; // 08 | ||
virtual bool CreateObjectWithProperties(const BSFixedString& a_className, std::uint32_t a_numProperties, BSTSmartPointer<Object>& a_objPtr) = 0; // 09 | ||
virtual bool InitObjectProperties(BSTSmartPointer<Object>& a_objPtr, void* a_property, bool a_arg3) = 0; // 0A | ||
}; | ||
static_assert(sizeof(IVMObjectBindInterface) == 0x8); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSContainer.h" | ||
#include "RE/B/BSFixedString.h" | ||
#include "RE/B/BSLock.h" | ||
#include "RE/B/BSTArray.h" | ||
#include "RE/B/BSTEvent.h" | ||
#include "RE/B/BSTSmartPointer.h" | ||
#include "RE/I/IObjectHandlePolicy.h" | ||
#include "RE/M/MemoryManager.h" | ||
#include "RE/O/ObjectTypeInfo.h" | ||
|
||
namespace RE | ||
{ | ||
namespace BSScript | ||
{ | ||
class ObjectTypeInfo; | ||
class Variable; | ||
|
||
class Object | ||
{ | ||
public: | ||
void dtor() | ||
{ | ||
using func_t = decltype(&Object::dtor); | ||
REL::Relocation<func_t> func{ ID::BSScript::Object::dtor }; | ||
return func(this); | ||
} | ||
|
||
~Object() | ||
{ | ||
dtor(); | ||
} | ||
|
||
Object* ctor(const BSTSmartPointer<ObjectTypeInfo>& a_type, const IObjectHandlePolicy& a_handlePolicy, std::uint32_t a_numProperties) | ||
{ | ||
using func_t = decltype(&Object::ctor); | ||
REL::Relocation<func_t> func{ ID::BSScript::Object::ctor }; | ||
return func(this, a_type, a_handlePolicy, a_numProperties); | ||
} | ||
|
||
Object(const BSTSmartPointer<ObjectTypeInfo>& a_type, const IObjectHandlePolicy& a_handlePolicy, std::uint32_t a_numProperties) | ||
{ | ||
ctor(a_type, a_handlePolicy, a_numProperties); | ||
} | ||
|
||
Object() = delete; | ||
|
||
[[nodiscard]] constexpr bool IsConstructed() const noexcept { return static_cast<bool>(constructed); } | ||
[[nodiscard]] constexpr bool IsInitialized() const noexcept { return static_cast<bool>(initialized); } | ||
[[nodiscard]] constexpr bool IsValid() const noexcept { return static_cast<bool>(valid); } | ||
|
||
[[nodiscard]] std::uint32_t DecRef() const | ||
{ | ||
using func_t = decltype(&Object::DecRef); | ||
REL::Relocation<func_t> func{ ID::BSScript::Object::DecRef }; | ||
return func(this); | ||
} | ||
|
||
[[nodiscard]] std::size_t GetHandle() const | ||
{ | ||
using func_t = decltype(&Object::GetHandle); | ||
REL::Relocation<func_t> func{ ID::BSScript::Object::GetHandle }; | ||
return func(this); | ||
} | ||
|
||
void IncRef() const | ||
{ | ||
using func_t = decltype(&Object::IncRef); | ||
REL::Relocation<func_t> func{ ID::BSScript::Object::IncRef }; | ||
return func(this); | ||
} | ||
|
||
SF_HEAP_REDEFINE_NEW(); | ||
|
||
// members | ||
std::uint16_t unk00; // 00 | ||
std::uint16_t unk02; // 02 | ||
std::uint32_t unk04; // 04 | ||
std::uint64_t unk08; // 08 | ||
std::uint32_t constructed: 1; // 10:00 | ||
std::uint32_t initialized: 1; // 10:01 | ||
std::uint32_t valid: 1; // 10:02 | ||
std::uint32_t remainingPropsToInit: 29; // 10:03 | ||
std::uint32_t unk14; // 14 | ||
std::uint32_t unk18; // 18 | ||
std::uint32_t unk1C; // 1C | ||
BSTSmartPointer<ObjectTypeInfo> type; // 20 | ||
BSFixedString currentState; // 28 | ||
void* lockStructure; // 30 | ||
IObjectHandlePolicy* handlePolicy; // 38 | ||
std::size_t handle; // 40 | ||
std::uint32_t refCountAndHandleLock; // 48 | ||
}; | ||
static_assert(sizeof(Object) == 0x50); | ||
} | ||
} |
Oops, something went wrong.