forked from Ryan-rsm-McKenzie/CommonLibSSE
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
ModelDBHandle
, BSResource
classes
- Loading branch information
Showing
12 changed files
with
341 additions
and
74 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
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
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,37 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSAtomic.h" | ||
#include "RE/B/BSFixedString.h" | ||
#include "RE/B/BSTSmartPointer.h" | ||
#include "RE/I/ID.h" | ||
|
||
namespace RE | ||
{ | ||
namespace BSResource | ||
{ | ||
class Stream; | ||
|
||
template <class T_Type, class T_EntryDBTraitsCArgs> | ||
class Entry | ||
{ | ||
public: | ||
using U_Type = T_Type; | ||
using U_EntryDBTraitsCArgs = T_EntryDBTraitsCArgs; | ||
|
||
union UserData | ||
{ | ||
std::uint32_t flags; | ||
T_EntryDBTraitsCArgs* traits; | ||
}; | ||
static_assert(sizeof(UserData) == 0x8); | ||
|
||
// members | ||
ID name; // 00 | ||
BSTAtomicValue<std::uint32_t> ctrl; // 0C | ||
UserData userData; // 10 | ||
Entry<T_Type, T_EntryDBTraitsCArgs>* next; // 18 | ||
BSTSmartPointer<Stream> stream; // 20 | ||
T_Type data; // 28 | ||
}; | ||
} | ||
} |
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,42 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSAtomic.h" | ||
|
||
namespace RE | ||
{ | ||
namespace BSResource | ||
{ | ||
template <class T_Type, class T_EntryDBTraitsCArgs> | ||
class Entry; | ||
|
||
struct DAP | ||
{ | ||
public: | ||
}; | ||
static_assert(std::is_empty_v<DAP>); | ||
|
||
template <class T_Type, class T_EntryDBTraitsCArgs, class T_DAP, std::uint32_t T_SIZE> | ||
class EntryCacheTraits | ||
{ | ||
public: | ||
using U_Entry = Entry<T_Type, T_EntryDBTraitsCArgs>; | ||
}; | ||
static_assert(std::is_empty_v<EntryCacheTraits<void, void, void, 0>>); | ||
|
||
template <class T_EntryCacheTraits> | ||
class REntryCache | ||
{ | ||
public: | ||
using U_EntryCacheTraits = T_EntryCacheTraits; | ||
|
||
// members | ||
T_EntryCacheTraits::U_Entry** table; // 00 | ||
std::uint32_t tableSize; // 08 | ||
std::uint32_t tombstoneCount; // 10 | ||
std::uint32_t active; // 14 | ||
std::uint32_t maxActive; // 18 | ||
std::uint32_t misses; // 1C | ||
BSTAtomicValue<std::uint32_t> ctrl; // 20 | ||
}; | ||
} | ||
} |
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,30 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSAtomic.h" | ||
|
||
namespace RE | ||
{ | ||
namespace BSResource | ||
{ | ||
template <class T> | ||
class EntryQueue | ||
{ | ||
public: | ||
// members | ||
BSNonReentrantSpinLock lock; // 00 | ||
T* head; // 08 | ||
T** tail; // 10 | ||
}; | ||
static_assert(sizeof(EntryQueue<void>) == 0x18); | ||
|
||
template <class T, std::uint32_t SIZE> | ||
class EntryBucketQueue | ||
{ | ||
public: | ||
// members | ||
EntryQueue<T> buckets[SIZE]; // 00 | ||
volatile std::uint32_t step; // ?? | ||
}; | ||
static_assert(sizeof(EntryBucketQueue<void, 8>) == 0xC8); | ||
} | ||
} |
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,30 @@ | ||
#pragma once | ||
|
||
#include "RE/N/NiSmartPointer.h" | ||
#include "RE/B/BSResourceEntryDB.h" | ||
|
||
namespace RE | ||
{ | ||
class NiNode; | ||
|
||
namespace BSModelDB | ||
{ | ||
struct DBTraits; | ||
} | ||
|
||
namespace BSResource | ||
{ | ||
template <class T_Entry, class T_EntryDB> | ||
class RHandleType | ||
{ | ||
public: | ||
using U_Entry = T_Entry; | ||
using U_EntryDB = T_EntryDB; | ||
|
||
// members | ||
T_Entry* entry; // 00 | ||
}; | ||
} | ||
|
||
using ModelDBHandle = BSResource::RHandleType<BSResource::Entry<NiPointer<NiNode>, BSResource::EntryDBTraits<BSModelDB::DBTraits, BSResource::EntryDB<BSModelDB::DBTraits>>::CArgs>, BSResource::EntryDB<BSModelDB::DBTraits>>; | ||
} |
Oops, something went wrong.