Mirage API mapping.

This commit is contained in:
Skyth 2024-11-25 21:20:20 +03:00
parent 2dd8d539c5
commit 3258d92bd3
21 changed files with 1089 additions and 6 deletions

View file

@ -0,0 +1,378 @@
#pragma once
#include <Hedgehog/Base/System/hhAllocator.h>
namespace hh
{
template<
class Key,
class T,
class Compare = std::less<Key>,
class Allocator = Hedgehog::Base::TAllocator<std::pair<const Key, T>>>
class map
{
protected:
enum EColor
{
eColor_Red,
eColor_Black
};
struct SNode
{
using allocator_type = typename std::allocator_traits<Allocator>::template rebind_alloc<SNode>;
xpointer<SNode> pLeft;
xpointer<SNode> pParent;
xpointer<SNode> pRight;
std::pair<const Key, T> Value;
uint8_t Color;
bool IsNil;
};
Compare m_Comp;
typename SNode::allocator_type m_Alloc;
xpointer<SNode> m_pHead;
be<uint32_t> m_Count;
struct SFindResult
{
SNode* pParent;
bool IsRight;
SNode* pBound;
};
bool LowerBoundDuplicate(const SNode* pBound, const Key& in_rKey) const
{
return !pBound->IsNil && !m_Comp(in_rKey, pBound->Value.first);
}
SFindResult FindLowerBound(const Key& in_rKey) const
{
SFindResult result{ m_pHead->pParent, true, m_pHead };
SNode* pNode = result.pParent;
while (!pNode->IsNil)
{
result.pParent = pNode;
if (m_Comp(pNode->Value.first, in_rKey))
{
result.IsRight = true;
pNode = pNode->pRight;
}
else
{
result.IsRight = false;
result.pBound = pNode;
pNode = pNode->pLeft;
}
}
return result;
}
SNode* Find(const Key& in_rKey) const
{
const SFindResult result = FindLowerBound(in_rKey);
return LowerBoundDuplicate(result.pBound, in_rKey) ? result.pBound : m_pHead;
}
static SNode* Max(SNode* pNode)
{
while (!pNode->pRight->IsNil)
pNode = pNode->pRight;
return pNode;
}
static SNode* Min(SNode* pNode)
{
while (!pNode->pLeft->IsNil)
pNode = pNode->pLeft;
return pNode;
}
public:
using key_type = Key;
using mapped_type = T;
using value_type = std::pair<const Key, T>;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
using key_compare = Compare;
using allocator_type = Allocator;
using reference = value_type&;
using const_reference = const value_type&;
using pointer = typename std::allocator_traits<Allocator>::pointer;
using const_pointer = typename std::allocator_traits<Allocator>::const_pointer;
class iterator
{
public:
using iterator_category = std::bidirectional_iterator_tag;
using value_type = std::pair<const Key, T>;
using difference_type = std::ptrdiff_t;
using pointer = value_type*;
using reference = value_type&;
iterator(const std::nullptr_t&) = delete;
iterator(SNode* pNode) : m_pNode(pNode) {}
reference operator*() const { return m_pNode->Value; }
pointer operator->() const { return &m_pNode->Value; }
iterator& operator++()
{
if (m_pNode->pRight->IsNil)
{
SNode* pNode;
while (!(pNode = m_pNode->pParent)->IsNil && m_pNode == pNode->pRight)
m_pNode = pNode;
m_pNode = pNode;
}
else
{
m_pNode = map::Min(m_pNode->pRight);
}
return *this;
}
iterator operator++(int)
{
iterator temp(*this);
++(*this);
return temp;
}
iterator& operator--()
{
if (m_pNode->IsNil)
{
m_pNode = m_pNode->pRight;
}
else if (m_pNode->pLeft->IsNil)
{
SNode* pNode;
while (!(pNode = m_pNode->pParent)->IsNil && m_pNode == pNode->pLeft)
m_pNode = pNode;
if (!m_pNode->IsNil)
m_pNode = pNode;
}
else
{
m_pNode = map::Max(m_pNode->pLeft);
}
return *this;
}
iterator operator--(int)
{
iterator temp(*this);
--(*this);
return temp;
}
bool operator==(const iterator& rhs) const { return m_pNode == rhs.m_pNode; }
bool operator!=(const iterator& rhs) const { return !(*this == rhs); }
private:
SNode* m_pNode;
friend class iterator;
friend class map;
};
class const_iterator
{
public:
using iterator_category = std::bidirectional_iterator_tag;
using value_type = std::pair<const Key, T>;
using difference_type = std::ptrdiff_t;
using pointer = const value_type*;
using reference = const value_type&;
const_iterator(const std::nullptr_t&) = delete;
const_iterator(SNode* pNode) : m_pNode(pNode) {}
const_iterator(const iterator& iterator) : m_pNode(iterator.m_pNode) {}
reference operator*() const { return m_pNode->Value; }
pointer operator->() const { return &m_pNode->Value; }
const_iterator& operator++()
{
if (m_pNode->pRight->IsNil)
{
SNode* pNode;
while (!(pNode = m_pNode->pParent)->IsNil && m_pNode == pNode->pRight)
m_pNode = pNode;
m_pNode = pNode;
}
else
{
m_pNode = map::Min(m_pNode->pRight);
}
return *this;
}
const_iterator operator++(int)
{
const_iterator temp(*this);
++(*this);
return temp;
}
const_iterator& operator--()
{
if (m_pNode->IsNil)
{
m_pNode = m_pNode->pRight;
}
else if (m_pNode->pLeft->IsNil)
{
SNode* pNode;
while (!(pNode = m_pNode->pParent)->IsNil && m_pNode == pNode->pLeft)
m_pNode = pNode;
if (!m_pNode->IsNil)
m_pNode = pNode;
}
else
{
m_pNode = map::Max(m_pNode->pLeft);
}
return *this;
}
const_iterator operator--(int)
{
const_iterator temp(*this);
--(*this);
return temp;
}
bool operator==(const const_iterator& rhs) const { return m_pNode == rhs.m_pNode; }
bool operator!=(const const_iterator& rhs) const { return !(*this == rhs); }
private:
SNode* m_pNode;
friend class map;
};
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
public:
allocator_type get_allocator() const
{
return m_Alloc;
}
T& at(const Key& key)
{
return Find(key)->Value.second;
}
const T& at(const Key& key) const
{
return Find(key)->Value.second;
}
iterator begin()
{
return iterator(m_pHead->pLeft);
}
const_iterator begin() const
{
return const_iterator(m_pHead->pLeft);
}
const_iterator cbegin() const
{
return const_iterator(m_pHead->pLeft);
}
iterator end()
{
return iterator(m_pHead);
}
const_iterator end() const
{
return const_iterator(m_pHead);
}
const_iterator cend() const
{
return const_iterator(m_pHead);
}
reverse_iterator rbegin()
{
return reverse_iterator(end());
}
const_reverse_iterator rbegin() const
{
return const_reverse_iterator(end());
}
const_reverse_iterator crbegin() const
{
return const_reverse_iterator(cend());
}
reverse_iterator rend()
{
return reverse_iterator(begin());
}
const_reverse_iterator rend() const
{
return const_reverse_iterator(begin());
}
const_reverse_iterator crend() const
{
return const_reverse_iterator(cbegin());
}
bool empty() const
{
return m_Count == 0;
}
size_type size() const
{
return m_Count;
}
size_type max_size() const
{
return ~0u;
}
size_type count(const Key& key) const
{
return LowerBoundDuplicate(FindLowerBound(key).pBound, key) ? 1u : 0u;
}
iterator find(const Key& key)
{
return iterator(Find(key));
}
const_iterator find(const Key& key) const
{
return const_iterator(Find(key));
}
};
static_assert(sizeof(map<int, int>) == 0xC);
}

View file

@ -0,0 +1,255 @@
#pragma once
#include <Hedgehog/Base/System/hhAllocator.h>
namespace hh
{
template<typename T, typename Allocator = Hedgehog::Base::TAllocator<T>>
class vector
{
protected:
Allocator m_Alloc;
xpointer<T> m_pFirst;
xpointer<T> m_pLast;
xpointer<T> m_pEnd;
public:
using value_type = T;
using allocator_type = Allocator;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
using reference = value_type&;
using const_reference = const value_type&;
using pointer = typename std::allocator_traits<Allocator>::pointer;
using const_pointer = typename std::allocator_traits<Allocator>::const_pointer;
class iterator
{
public:
using iterator_category = std::random_access_iterator_tag;
using value_type = T;
using difference_type = std::ptrdiff_t;
using pointer = T*;
using reference = T&;
iterator() : m_pPtr(nullptr) {}
iterator(T* p) : m_pPtr(p) {}
reference operator*() const { return *m_pPtr; }
pointer operator->() const { return m_pPtr; }
iterator& operator++() { ++m_pPtr; return *this; }
iterator operator++(int) { iterator tmp = *this; ++(*this); return tmp; }
iterator& operator--() { --m_pPtr; return *this; }
iterator operator--(int) { iterator tmp = *this; --(*this); return tmp; }
iterator& operator+=(difference_type n) { m_pPtr += n; return *this; }
iterator operator+(difference_type n) const { iterator tmp = *this; return tmp += n; }
friend iterator operator+(difference_type n, iterator it) { return it + n; }
iterator& operator-=(difference_type n) { return *this += -n; }
iterator operator-(difference_type n) const { iterator tmp = *this; return tmp -= n; }
difference_type operator-(const iterator& other) const { return m_pPtr - other.m_pPtr; }
reference operator[](difference_type n) const { return *(*this + n); }
bool operator==(const iterator& other) const { return m_pPtr == other.m_pPtr; }
bool operator!=(const iterator& other) const { return !(*this == other); }
bool operator<(const iterator& other) const { return m_pPtr < other.m_pPtr; }
bool operator<=(const iterator& other) const { return !(other < *this); }
bool operator>(const iterator& other) const { return other < *this; }
bool operator>=(const iterator& other) const { return !(*this < other); }
private:
T* m_pPtr;
friend class vector;
friend class const_iterator;
};
class const_iterator
{
public:
using iterator_category = std::random_access_iterator_tag;
using value_type = T;
using difference_type = std::ptrdiff_t;
using pointer = const T*;
using reference = const T&;
const_iterator() : m_pPtr(nullptr) {}
const_iterator(T* p) : m_pPtr(p) {}
const_iterator(const iterator& other) : m_pPtr(other.m_pPtr) {}
reference operator*() const { return *m_pPtr; }
pointer operator->() const { return m_pPtr; }
const_iterator& operator++() { ++m_pPtr; return *this; }
const_iterator operator++(int) { const_iterator tmp = *this; ++(*this); return tmp; }
const_iterator& operator--() { --m_pPtr; return *this; }
const_iterator operator--(int) { const_iterator tmp = *this; --(*this); return tmp; }
const_iterator& operator+=(difference_type n) { m_pPtr += n; return *this; }
const_iterator operator+(difference_type n) const { const_iterator tmp = *this; return tmp += n; }
friend const_iterator operator+(difference_type n, const_iterator it) { return it + n; }
const_iterator& operator-=(difference_type n) { return *this += -n; }
const_iterator operator-(difference_type n) const { const_iterator tmp = *this; return tmp -= n; }
difference_type operator-(const const_iterator& other) const { return m_pPtr - other.m_pPtr; }
reference operator[](difference_type n) const { return *(*this + n); }
bool operator==(const const_iterator& other) const { return m_pPtr == other.m_pPtr; }
bool operator!=(const const_iterator& other) const { return !(*this == other); }
bool operator<(const const_iterator& other) const { return m_pPtr < other.m_pPtr; }
bool operator<=(const const_iterator& other) const { return !(other < *this); }
bool operator>(const const_iterator& other) const { return other < *this; }
bool operator>=(const const_iterator& other) const { return !(*this < other); }
private:
T* m_pPtr;
friend class vector;
};
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
allocator_type get_allocator() const
{
return m_Alloc;
}
reference at(size_type pos)
{
return m_pFirst[pos];
}
const_reference at(size_type pos) const
{
return m_pFirst[pos];
}
reference operator[](size_type pos)
{
return m_pFirst[pos];
}
const_reference operator[](size_type pos) const
{
return m_pFirst[pos];
}
reference front()
{
return m_pFirst[0];
}
const_reference front() const
{
return m_pFirst[0];
}
reference back()
{
return m_pLast[-1];
}
const_reference back() const
{
return m_pLast[-1];
}
T* data()
{
return m_pFirst;
}
const T* data() const
{
return m_pFirst;
}
iterator begin()
{
return iterator(m_pFirst);
}
const_iterator begin() const
{
return const_iterator(m_pFirst);
}
const_iterator cbegin() const
{
return const_iterator(m_pFirst);
}
iterator end()
{
return iterator(m_pLast);
}
const_iterator end() const
{
return const_iterator(m_pLast);
}
const_iterator cend() const
{
return const_iterator(m_pLast);
}
reverse_iterator rbegin()
{
return reverse_iterator(end());
}
const_reverse_iterator rbegin() const
{
return const_reverse_iterator(end());
}
const_reverse_iterator crbegin() const
{
return const_reverse_iterator(cend());
}
reverse_iterator rend()
{
return reverse_iterator(begin());
}
const_reverse_iterator rend() const
{
return const_reverse_iterator(begin());
}
const_reverse_iterator crend() const
{
return const_reverse_iterator(cbegin());
}
bool empty() const
{
return m_pFirst == m_pLast;
}
size_type size() const
{
return m_pLast - m_pFirst;
}
size_type max_size() const
{
return ~0u;
}
size_type capacity() const
{
return m_pEnd - m_pFirst;
}
};
SWA_ASSERT_SIZEOF(vector<int>, 0x10);
}

View file

@ -0,0 +1,38 @@
#pragma once
#include <SWA.inl>
namespace Hedgehog::Base
{
struct SSymbolNode
{
xpointer<SSymbolNode> pPrev;
xpointer<SSymbolNode> pNext;
be<uint32_t> Hash;
const char* GetValue() const;
};
class CSharedString;
class CStringSymbol
{
public:
xpointer<SSymbolNode> m_pSymbolNode;
CStringSymbol();
CStringSymbol(const char* in_pName);
CStringSymbol(const CSharedString& in_rName);
const char* GetValue() const;
bool operator==(const CStringSymbol& in_rOther) const;
bool operator!=(const CStringSymbol& in_rOther) const;
bool operator<(const CStringSymbol& in_rOther) const;
};
SWA_ASSERT_OFFSETOF(CStringSymbol, m_pSymbolNode, 0);
SWA_ASSERT_SIZEOF(CStringSymbol, 4);
}
#include <Hedgehog/Base/System/hhSymbol.inl>

View file

@ -0,0 +1,41 @@
namespace Hedgehog::Base
{
inline const char* SSymbolNode::GetValue() const
{
return reinterpret_cast<const char*>(this) + sizeof(SSymbolNode);
}
inline CStringSymbol::CStringSymbol()
{
}
inline CStringSymbol::CStringSymbol(const char* in_pName)
{
GuestToHostFunction<void>(sub_82E014D8, this, in_pName);
}
inline CStringSymbol::CStringSymbol(const CSharedString& in_rName)
{
GuestToHostFunction<void>(sub_82E013B0, this, &in_rName);
}
inline const char* CStringSymbol::GetValue() const
{
return m_pSymbolNode->GetValue();
}
inline bool CStringSymbol::operator==(const CStringSymbol& in_rOther) const
{
return m_pSymbolNode == in_rOther.m_pSymbolNode;
}
inline bool CStringSymbol::operator!=(const CStringSymbol& in_rOther) const
{
return m_pSymbolNode != in_rOther.m_pSymbolNode;
}
inline bool CStringSymbol::operator<(const CStringSymbol& in_rOther) const
{
return m_pSymbolNode < in_rOther.m_pSymbolNode;
}
}

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "SWA.inl" #include <SWA.inl>
namespace Hedgehog::Base namespace Hedgehog::Base
{ {
@ -41,4 +41,4 @@ namespace Hedgehog::Base
}; };
} }
#include "Hedgehog/Base/Type/detail/hhStringHolder.inl" #include <Hedgehog/Base/Type/detail/hhStringHolder.inl>

View file

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "Hedgehog/Base/hhObject.h" #include <Hedgehog/Base/hhObject.h>
#include <Hedgehog/Base/Type/hhSharedString.h>
namespace Hedgehog::Database namespace Hedgehog::Database
{ {

View file

@ -7,7 +7,7 @@ namespace Hedgehog::Database
inline bool CDatabaseData::CheckMadeAll() inline bool CDatabaseData::CheckMadeAll()
{ {
return true; return GuestToHostFunction<bool>(m_pVftable->m_fpCheckMadeAll, this);
} }
inline bool CDatabaseData::IsMadeOne() const inline bool CDatabaseData::IsMadeOne() const

View file

@ -0,0 +1,19 @@
#pragma once
#include <SWA.inl>
namespace Hedgehog::Mirage
{
class CRenderingInfrastructure;
class CVertexDeclarationPtr
{
public:
xpointer<void> m_pD3DVertexDeclaration;
xpointer<CRenderingInfrastructure> m_pRenderingInfrastructure;
};
SWA_ASSERT_OFFSETOF(CVertexDeclarationPtr, m_pD3DVertexDeclaration, 0x0);
SWA_ASSERT_OFFSETOF(CVertexDeclarationPtr, m_pRenderingInfrastructure, 0x4);
SWA_ASSERT_SIZEOF(CVertexDeclarationPtr, 0x8);
}

View file

@ -0,0 +1,39 @@
#pragma once
#include <boost/smart_ptr/shared_ptr.h>
#include <Hedgehog/Base/Container/hhVector.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
namespace Hedgehog::Mirage
{
class CMaterialData;
class CTexsetData;
class CShaderListData;
class CParameterFloat4Element;
class CParameterInt4Element;
class CParameterBoolElement;
class CMaterialData : public Database::CDatabaseData
{
public:
boost::shared_ptr<CTexsetData> m_spTexsetData;
boost::shared_ptr<CShaderListData> m_spShaderListData;
hh::vector<boost::shared_ptr<CParameterFloat4Element>> m_Float4Params;
hh::vector<boost::shared_ptr<CParameterInt4Element>> m_Int4Params;
hh::vector<boost::shared_ptr<CParameterBoolElement>> m_Bool4Params;
uint8_t m_AlphaThreshold;
bool m_DoubleSided;
bool m_Additive;
};
SWA_ASSERT_OFFSETOF(CMaterialData, m_spTexsetData, 0xC);
SWA_ASSERT_OFFSETOF(CMaterialData, m_spShaderListData, 0x14);
SWA_ASSERT_OFFSETOF(CMaterialData, m_Float4Params, 0x1C);
SWA_ASSERT_OFFSETOF(CMaterialData, m_Int4Params, 0x2C);
SWA_ASSERT_OFFSETOF(CMaterialData, m_Bool4Params, 0x3C);
SWA_ASSERT_OFFSETOF(CMaterialData, m_AlphaThreshold, 0x4C);
SWA_ASSERT_OFFSETOF(CMaterialData, m_DoubleSided, 0x4D);
SWA_ASSERT_OFFSETOF(CMaterialData, m_Additive, 0x4E);
SWA_ASSERT_SIZEOF(CMaterialData, 0x50);
}

View file

@ -0,0 +1,43 @@
#pragma once
#include <boost/smart_ptr/shared_ptr.h>
#include <Hedgehog/Base/Type/hhSharedString.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
#include <Hedgehog/MirageCore/Misc/hhVertexDeclarationPtr.h>
namespace Hedgehog::Mirage
{
class CMaterialData;
class CMeshData : public Database::CDatabaseData
{
public:
be<uint32_t> m_IndexNum;
be<uint32_t> m_VertexNum;
be<uint32_t> m_VertexSize;
be<uint32_t> m_NodeNum;
xpointer<uint8_t> m_pNodeIndices;
be<uint32_t> m_VertexOffset;
be<uint32_t> m_IndexOffset;
xpointer<void> m_pD3DIndexBuffer;
xpointer<void> m_pD3DVertexBuffer;
CVertexDeclarationPtr m_VertexDeclarationPtr;
SWA_INSERT_PADDING(0x4);
boost::shared_ptr<CMaterialData> m_spMaterial;
SWA_INSERT_PADDING(0xC);
};
SWA_ASSERT_OFFSETOF(CMeshData, m_IndexNum, 0xC);
SWA_ASSERT_OFFSETOF(CMeshData, m_VertexNum, 0x10);
SWA_ASSERT_OFFSETOF(CMeshData, m_VertexSize, 0x14);
SWA_ASSERT_OFFSETOF(CMeshData, m_NodeNum, 0x18);
SWA_ASSERT_OFFSETOF(CMeshData, m_pNodeIndices, 0x1C);
SWA_ASSERT_OFFSETOF(CMeshData, m_VertexOffset, 0x20);
SWA_ASSERT_OFFSETOF(CMeshData, m_IndexOffset, 0x24);
SWA_ASSERT_OFFSETOF(CMeshData, m_pD3DIndexBuffer, 0x28);
SWA_ASSERT_OFFSETOF(CMeshData, m_pD3DVertexBuffer, 0x2C);
SWA_ASSERT_OFFSETOF(CMeshData, m_VertexDeclarationPtr, 0x30);
SWA_ASSERT_OFFSETOF(CMeshData, m_spMaterial, 0x3C);
SWA_ASSERT_SIZEOF(CMeshData, 0x50);
}

View file

@ -0,0 +1,46 @@
#pragma once
#include <Hedgehog/Base/Container/hhVector.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
namespace Hedgehog::Mirage
{
class CNodeGroupModelData;
class CMeshData;
class CModelNodeData;
class CMatrixData;
class CAabbData;
class CSphereData;
class CMorphModelData;
class CModelData : public Database::CDatabaseData
{
public:
be<uint32_t> m_NodeGroupModelNum;
hh::vector<boost::shared_ptr<CNodeGroupModelData>> m_NodeGroupModels;
hh::vector<boost::shared_ptr<CMeshData>> m_OpaqueMeshes;
hh::vector<boost::shared_ptr<CMeshData>> m_TransparentMeshes;
hh::vector<boost::shared_ptr<CMeshData>> m_PunchThroughMeshes;
be<uint32_t> m_NodeNum;
boost::shared_ptr<uint8_t[]> m_spNodeParentIndices;
boost::shared_ptr<CModelNodeData[]> m_spNodes;
boost::shared_ptr<CMatrixData[]> m_spNodeMatrices;
boost::shared_ptr<CAabbData> m_spAabb;
boost::shared_ptr<CSphereData> m_spSphere;
hh::vector<boost::shared_ptr<CMorphModelData>> m_MorphModels;
};
SWA_ASSERT_OFFSETOF(CModelData, m_NodeGroupModelNum, 0xC);
SWA_ASSERT_OFFSETOF(CModelData, m_NodeGroupModels, 0x10);
SWA_ASSERT_OFFSETOF(CModelData, m_OpaqueMeshes, 0x20);
SWA_ASSERT_OFFSETOF(CModelData, m_TransparentMeshes, 0x30);
SWA_ASSERT_OFFSETOF(CModelData, m_PunchThroughMeshes, 0x40);
SWA_ASSERT_OFFSETOF(CModelData, m_NodeNum, 0x50);
SWA_ASSERT_OFFSETOF(CModelData, m_spNodeParentIndices, 0x54);
SWA_ASSERT_OFFSETOF(CModelData, m_spNodes, 0x5C);
SWA_ASSERT_OFFSETOF(CModelData, m_spNodeMatrices, 0x64);
SWA_ASSERT_OFFSETOF(CModelData, m_spAabb, 0x6C);
SWA_ASSERT_OFFSETOF(CModelData, m_spSphere, 0x74);
SWA_ASSERT_OFFSETOF(CModelData, m_MorphModels, 0x7C);
SWA_ASSERT_SIZEOF(CModelData, 0x8C);
}

View file

@ -0,0 +1,30 @@
#pragma once
#include <Hedgehog/Base/Container/hhVector.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
namespace Hedgehog::Mirage
{
class CMeshData;
class CNodeGroupModelData : public Database::CDatabaseData
{
public:
hh::vector<boost::shared_ptr<CMeshData>> m_OpaqueMeshes;
hh::vector<boost::shared_ptr<CMeshData>> m_TransparentMeshes;
hh::vector<boost::shared_ptr<CMeshData>> m_PunchThroughMeshes;
be<uint32_t> m_SpecialMeshGroupNum;
boost::shared_ptr<be<uint32_t>> m_SpecialMeshGroupModes;
hh::vector<hh::vector<boost::shared_ptr<CMeshData>>> m_SpecialMeshGroups;
Base::CSharedString m_Name;
};
SWA_ASSERT_OFFSETOF(CNodeGroupModelData, m_OpaqueMeshes, 0xC);
SWA_ASSERT_OFFSETOF(CNodeGroupModelData, m_TransparentMeshes, 0x1C);
SWA_ASSERT_OFFSETOF(CNodeGroupModelData, m_PunchThroughMeshes, 0x2C);
SWA_ASSERT_OFFSETOF(CNodeGroupModelData, m_SpecialMeshGroupNum, 0x3C);
SWA_ASSERT_OFFSETOF(CNodeGroupModelData, m_SpecialMeshGroupModes, 0x40);
SWA_ASSERT_OFFSETOF(CNodeGroupModelData, m_SpecialMeshGroups, 0x48);
SWA_ASSERT_OFFSETOF(CNodeGroupModelData, m_Name, 0x58);
SWA_ASSERT_SIZEOF(CNodeGroupModelData, 0x5C);
}

View file

@ -0,0 +1,30 @@
#pragma once
#include <boost/smart_ptr/shared_ptr.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
namespace Hedgehog::Base
{
class CCriticalSectionD3D9;
}
namespace Hedgehog::Mirage
{
class CRenderingInfrastructure;
class CPixelShaderCodeData : public Database::CDatabaseData
{
public:
xpointer<void> m_pD3DPixelShader;
xpointer<uint8_t> m_spFunction;
boost::shared_ptr<Base::CCriticalSectionD3D9> m_spCriticalSection;
xpointer<CRenderingInfrastructure> m_pRenderingInfrastructure;
};
SWA_ASSERT_OFFSETOF(CPixelShaderCodeData, m_pD3DPixelShader, 0xC);
SWA_ASSERT_OFFSETOF(CPixelShaderCodeData, m_spFunction, 0x10);
SWA_ASSERT_OFFSETOF(CPixelShaderCodeData, m_spCriticalSection, 0x14);
SWA_ASSERT_OFFSETOF(CPixelShaderCodeData, m_pRenderingInfrastructure, 0x1C);
SWA_ASSERT_SIZEOF(CPixelShaderCodeData, 0x20);
}

View file

@ -0,0 +1,22 @@
#pragma once
#include <Hedgehog/Base/Container/hhVector.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
namespace Hedgehog::Mirage
{
class CPixelShaderCodeData;
class CPixelShaderParameterData;
class CPixelShaderData : public Hedgehog::Database::CDatabaseData
{
public:
boost::shared_ptr<CPixelShaderCodeData> m_spCode;
SWA_INSERT_PADDING(0x4);
hh::vector<boost::shared_ptr<CPixelShaderParameterData>> m_ParameterList;
};
SWA_ASSERT_OFFSETOF(CPixelShaderData, m_spCode, 0xC);
SWA_ASSERT_OFFSETOF(CPixelShaderData, m_ParameterList, 0x18);
SWA_ASSERT_SIZEOF(CPixelShaderData, 0x28);
}

View file

@ -0,0 +1,46 @@
#pragma once
#include <boost/smart_ptr/shared_ptr.h>
#include <Hedgehog/Base/Container/hhMap.h>
#include <Hedgehog/Base/System/hhSymbol.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
namespace Hedgehog::Mirage
{
class CVertexShaderData;
class CPixelShaderData;
class CVertexShaderPermutationData
{
public:
hh::map<be<uint32_t>, boost::shared_ptr<CVertexShaderData>> m_VertexShaders;
be<uint32_t> m_SubPermutations;
};
SWA_ASSERT_OFFSETOF(CVertexShaderPermutationData, m_VertexShaders, 0x0);
SWA_ASSERT_OFFSETOF(CVertexShaderPermutationData, m_SubPermutations, 0xC);
SWA_ASSERT_SIZEOF(CVertexShaderPermutationData, 0x10);
class CPixelShaderPermutationData
{
public:
hh::map<Base::CStringSymbol, boost::shared_ptr<CVertexShaderPermutationData>> m_VertexShaderPermutations;
hh::map<be<uint32_t>, boost::shared_ptr<CPixelShaderData>> m_PixelShaders;
uint32_t m_SubPermutations;
};
SWA_ASSERT_OFFSETOF(CPixelShaderPermutationData, m_VertexShaderPermutations, 0x0);
SWA_ASSERT_OFFSETOF(CPixelShaderPermutationData, m_PixelShaders, 0xC);
SWA_ASSERT_OFFSETOF(CPixelShaderPermutationData, m_SubPermutations, 0x18);
SWA_ASSERT_SIZEOF(CPixelShaderPermutationData, 0x1C);
class CShaderListData : public Database::CDatabaseData
{
public:
hh::map<Base::CStringSymbol, CPixelShaderPermutationData> m_PixelShaderPermutations;
};
SWA_ASSERT_OFFSETOF(CShaderListData, m_PixelShaderPermutations, 0xC);
SWA_ASSERT_SIZEOF(CShaderListData, 0x18);
}

View file

@ -0,0 +1,29 @@
#pragma once
#include <Hedgehog/Base/Container/hhVector.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
namespace Hedgehog::Mirage
{
class CSphereData;
class CNodeGroupModelData;
class CMeshData;
class CTerrainModelData : public Database::CDatabaseData
{
public:
SWA_INSERT_PADDING(0x4);
hh::vector<boost::shared_ptr<CNodeGroupModelData>> m_NodeGroupModels;
hh::vector<boost::shared_ptr<CMeshData>> m_OpaqueMeshes;
hh::vector<boost::shared_ptr<CMeshData>> m_TransparentMeshes;
hh::vector<boost::shared_ptr<CMeshData>> m_PunchThroughMeshes;
boost::shared_ptr<CSphereData> m_spSphere;
};
SWA_ASSERT_OFFSETOF(CTerrainModelData, m_NodeGroupModels, 0x10);
SWA_ASSERT_OFFSETOF(CTerrainModelData, m_OpaqueMeshes, 0x20);
SWA_ASSERT_OFFSETOF(CTerrainModelData, m_TransparentMeshes, 0x30);
SWA_ASSERT_OFFSETOF(CTerrainModelData, m_PunchThroughMeshes, 0x40);
SWA_ASSERT_OFFSETOF(CTerrainModelData, m_spSphere, 0x50);
SWA_ASSERT_SIZEOF(CTerrainModelData, 0x58);
}

View file

@ -0,0 +1,30 @@
#pragma once
#include <boost/smart_ptr/shared_ptr.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
namespace Hedgehog::Base
{
class CCriticalSectionD3D9;
}
namespace Hedgehog::Mirage
{
class CRenderingInfrastructure;
class CVertexShaderCodeData : public Database::CDatabaseData
{
public:
xpointer<void> m_pD3DVertexShader;
xpointer<uint8_t> m_spFunction;
boost::shared_ptr<Base::CCriticalSectionD3D9> m_spCriticalSection;
xpointer<CRenderingInfrastructure> m_pRenderingInfrastructure;
};
SWA_ASSERT_OFFSETOF(CVertexShaderCodeData, m_pD3DVertexShader, 0xC);
SWA_ASSERT_OFFSETOF(CVertexShaderCodeData, m_spFunction, 0x10);
SWA_ASSERT_OFFSETOF(CVertexShaderCodeData, m_spCriticalSection, 0x14);
SWA_ASSERT_OFFSETOF(CVertexShaderCodeData, m_pRenderingInfrastructure, 0x1C);
SWA_ASSERT_SIZEOF(CVertexShaderCodeData, 0x20);
}

View file

@ -0,0 +1,22 @@
#pragma once
#include <Hedgehog/Base/Container/hhVector.h>
#include <Hedgehog/Database/System/hhDatabaseData.h>
namespace Hedgehog::Mirage
{
class CVertexShaderCodeData;
class CVertexShaderParameterData;
class CVertexShaderData : public Hedgehog::Database::CDatabaseData
{
public:
boost::shared_ptr<CVertexShaderCodeData> m_spCode;
SWA_INSERT_PADDING(0x4);
hh::vector<boost::shared_ptr<CVertexShaderParameterData>> m_ParameterList;
};
SWA_ASSERT_OFFSETOF(CVertexShaderData, m_spCode, 0xC);
SWA_ASSERT_OFFSETOF(CVertexShaderData, m_ParameterList, 0x18);
SWA_ASSERT_SIZEOF(CVertexShaderData, 0x28);
}

View file

@ -15,7 +15,10 @@
#include "CSD/Manager/csdmSceneObserver.h" #include "CSD/Manager/csdmSceneObserver.h"
#include "CSD/Manager/csdmSubjectBase.h" #include "CSD/Manager/csdmSubjectBase.h"
#include "CSD/Platform/csdTexList.h" #include "CSD/Platform/csdTexList.h"
#include "Hedgehog/Base/Container/hhMap.h"
#include "Hedgehog/Base/Container/hhVector.h"
#include "Hedgehog/Base/System/hhAllocator.h" #include "Hedgehog/Base/System/hhAllocator.h"
#include "Hedgehog/Base/System/hhSymbol.h"
#include "Hedgehog/Base/Thread/hhHolder.h" #include "Hedgehog/Base/Thread/hhHolder.h"
#include "Hedgehog/Base/Thread/hhHolderBase.h" #include "Hedgehog/Base/Thread/hhHolderBase.h"
#include "Hedgehog/Base/Thread/hhSynchronizedObject.h" #include "Hedgehog/Base/Thread/hhSynchronizedObject.h"
@ -25,6 +28,17 @@
#include "Hedgehog/Base/hhObject.h" #include "Hedgehog/Base/hhObject.h"
#include "Hedgehog/Database/System/hhDatabaseData.h" #include "Hedgehog/Database/System/hhDatabaseData.h"
#include "Hedgehog/Math/Vector2.h" #include "Hedgehog/Math/Vector2.h"
#include "Hedgehog/MirageCore/Misc/hhVertexDeclarationPtr.h"
#include "Hedgehog/MirageCore/RenderData/hhMaterialData.h"
#include "Hedgehog/MirageCore/RenderData/hhMeshData.h"
#include "Hedgehog/MirageCore/RenderData/hhModelData.h"
#include "Hedgehog/MirageCore/RenderData/hhNodeGroupModelData.h"
#include "Hedgehog/MirageCore/RenderData/hhPixelShaderCodeData.h"
#include "Hedgehog/MirageCore/RenderData/hhPixelShaderData.h"
#include "Hedgehog/MirageCore/RenderData/hhShaderListData.h"
#include "Hedgehog/MirageCore/RenderData/hhTerrainModelData.h"
#include "Hedgehog/MirageCore/RenderData/hhVertexShaderCodeData.h"
#include "Hedgehog/MirageCore/RenderData/hhVertexShaderData.h"
#include "Hedgehog/MirageCore/Renderable/hhRenderable.h" #include "Hedgehog/MirageCore/Renderable/hhRenderable.h"
#include "Hedgehog/Universe/Engine/hhMessageActor.h" #include "Hedgehog/Universe/Engine/hhMessageActor.h"
#include "Hedgehog/Universe/Engine/hhMessageProcess.h" #include "Hedgehog/Universe/Engine/hhMessageProcess.h"

View file

@ -1,4 +1,4 @@
#include "../../../thirdparty/ShaderRecomp/ShaderRecomp/shader_common.hlsli" #include "../../../thirdparty/ShaderRecomp/ShaderRecomp/shader_common.h"
#ifdef __spirv__ #ifdef __spirv__

@ -1 +1 @@
Subproject commit 11128441c618f7c8ff3f9520f0b6c5e868473ae2 Subproject commit 31513fbfbbd91a2062c700e4ac060bd0e92b6f2e