-
Notifications
You must be signed in to change notification settings - Fork 1
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
a6fdfc0
commit ba151f5
Showing
18 changed files
with
497 additions
and
29 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
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,46 @@ | ||
#pragma once | ||
#include "TVertexFactoryResourceInterface.h" | ||
|
||
TOSHI_NAMESPACE_BEGIN | ||
|
||
class TVertexPoolResourceInterface : public TResource | ||
{ | ||
DECLARE_DYNAMIC(TVertexPoolResourceInterface) | ||
|
||
public: | ||
|
||
class LockBuffer | ||
{ | ||
LockBuffer(); | ||
|
||
TUINT uiNumStreams; | ||
TUINT32 uiOffset; | ||
unsigned char* apStreams[TVertexFactoryFormat::MAX_NUM_STREAMS]; | ||
}; | ||
|
||
TVertexPoolResourceInterface(); | ||
|
||
protected: | ||
virtual void OnDestroy() override; | ||
virtual TBOOL Lock(LockBuffer* a_pLockBuffer) = 0; | ||
virtual void Unlock(TUSHORT a_uiNewNumVertices) = 0; | ||
virtual TBOOL Create(TVertexFactoryResourceInterface* a_pFactory, TUINT a_uiMaxVertices, TUINT a_uiFlags); | ||
|
||
public: | ||
|
||
TVertexFactoryResourceInterface* GetFactory() { return m_pFactory; } | ||
TUINT GetFlags() const { return m_usFlags; } | ||
TUINT GetMaxVertices() const { return m_usMaxVertices; } | ||
TUINT GetNumVertices() const { return m_usNumVertices; } | ||
TBOOL IsLocked() const { return m_uiLockCount != 0; } | ||
|
||
private: | ||
// TResource base 0x0 -> 0x30 | ||
TVertexFactoryResourceInterface* m_pFactory; // 0x30 | ||
TUSHORT m_usFlags; // 0x34 | ||
TUSHORT m_usMaxVertices; // 0x36 | ||
TUSHORT m_usNumVertices; // 0x38 | ||
TUINT m_uiLockCount; // 0x3A | ||
}; | ||
|
||
TOSHI_NAMESPACE_END |
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,47 @@ | ||
#pragma once | ||
#include "TRender/TResource.h" | ||
#include "TKernel/TFreeList.h" | ||
#include "TRender/TVertexFactoryResourceInterface.h" | ||
#include <d3d8.h> | ||
|
||
TOSHI_NAMESPACE_BEGIN | ||
|
||
class TVertexPoolResource; | ||
class TVertexFactoryResource; | ||
|
||
class TVertexBlockResource : public TResource | ||
{ | ||
DECLARE_DYNAMIC(TVertexBlockResource) | ||
DECLARE_FREELIST(TVertexBlockResource) | ||
|
||
public: | ||
|
||
struct HALBuffer | ||
{ | ||
HALBuffer(); | ||
|
||
TUINT uiNumStreams; | ||
TUSHORT uiVertexOffset; | ||
IDirect3DVertexBuffer8* apVertexBuffers[TVertexFactoryFormat::MAX_NUM_STREAMS]; | ||
}; | ||
|
||
TBOOL Create(TVertexFactoryResource* a_pFactory, TUSHORT a_uiMaxVertices, TUINT a_uiFlags); | ||
|
||
TBOOL AttachPool(TVertexPoolResource* a_pPool); | ||
TBOOL CanFit(TVertexPoolResource* a_pPoolResource); | ||
|
||
TVertexFactoryResourceInterface* GetFactory() { return m_pFactory; } | ||
TUINT GetFlags() { return m_uiFlags; } | ||
|
||
private: | ||
TVertexFactoryResourceInterface* m_pFactory; // 0x30 | ||
TUINT m_uiFlags; // 0x34 | ||
TUSHORT m_uiMaxVertices; | ||
TUINT m_uiOffset; | ||
TUINT m_uiVerticesUsed; | ||
TUINT m_uiLockCount; | ||
TUINT m_Unk1; | ||
HALBuffer m_HALBuffer; | ||
}; | ||
|
||
TOSHI_NAMESPACE_END |
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,20 @@ | ||
#pragma once | ||
|
||
#include "TRender/TVertexFactoryResourceInterface.h" | ||
#include "TD3DVertexPoolResource.h" | ||
#include "TD3DVertexBlockResource.h" | ||
|
||
TOSHI_NAMESPACE_BEGIN | ||
|
||
class TVertexFactoryResource : public TVertexFactoryResourceInterface | ||
{ | ||
DECLARE_DYNAMIC(TVertexFactoryResource) | ||
|
||
public: | ||
virtual TVertexPoolResourceInterface* CreatePoolResource(TUSHORT a_uiMaxStaticVertices, TUINT a_uiFlags); | ||
|
||
TVertexBlockResource* FindBlockResource(TVertexPoolResource* a_pResource); | ||
TVertexBlockResource* CreateBlockResource(TUSHORT a_uiMaxVertices, TUINT a_uiFlags); | ||
}; | ||
|
||
TOSHI_NAMESPACE_END |
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,23 @@ | ||
#pragma once | ||
|
||
#include "TRender/TVertexPoolResourceInterface.h" | ||
|
||
|
||
TOSHI_NAMESPACE_BEGIN | ||
|
||
class TVertexPoolResource : public TVertexPoolResourceInterface | ||
{ | ||
DECLARE_DYNAMIC(TVertexPoolResource) | ||
|
||
friend class TVertexFactoryResource; | ||
|
||
protected: | ||
virtual TBOOL Validate() override; | ||
virtual void Invalidate() override; | ||
virtual void OnDestroy() override; | ||
virtual TBOOL Lock(LockBuffer* a_pLockBuffer) override; | ||
virtual void Unlock(TUSHORT a_uiNewNumVertices) override; | ||
virtual TBOOL Create(TVertexFactoryResourceInterface* a_pFactory, TUINT a_uiMaxVertices, TUINT a_uiFlags) override; | ||
}; | ||
|
||
TOSHI_NAMESPACE_END |
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
Oops, something went wrong.