OpenBarnyard
 
Loading...
Searching...
No Matches
AWorldMeshHAL Class Reference

#include <AWorldMesh_DX8.h>

Inheritance diagram for AWorldMeshHAL:
AWorldMesh

Public Member Functions

 TDECLARE_CLASS (AWorldMeshHAL, AWorldMesh)
 
virtual TBOOL Render () override
 
- Public Member Functions inherited from AWorldMesh
 TDECLARE_CLASS (AWorldMesh, Toshi::TMesh)
 
 AWorldMesh ()
 
virtual TBOOL Validate () override
 
virtual void Invalidate () override
 
virtual void OnDestroy () override
 
virtual void Create (TUINT32 a_uiFlags, TUINT16 a_uiMaxVertices)
 
virtual TBOOL Lock (LockBuffer &a_rLockBuffer)
 
virtual void Unlock (TUINT32 a_uiNumVertices)
 
virtual Toshi::TVertexPoolResourceInterface * GetVertexPool ()
 
SubMeshGetSubMesh (TUINT a_uiIndex)
 

Additional Inherited Members

- Public Types inherited from AWorldMesh
using LockBuffer = Toshi::TVertexPoolResourceInterface::LockBuffer
 
- Static Public Attributes inherited from AWorldMesh
static constexpr TUINT NUM_SUBMESHES = 1
 
- Protected Attributes inherited from AWorldMesh
TUINT32 m_uiFlags
 
TUINT16 m_uiMaxVertices
 
Toshi::TVertexPoolResourceInterface * m_pVertexPool
 
SubMeshm_pSubMeshes
 

Detailed Description

Definition at line 4 of file AWorldMesh_DX8.h.

Member Function Documentation

◆ Render()

TBOOL AWorldMeshHAL::Render ( )
overridevirtual

Implements AWorldMesh.

Definition at line 19 of file AWorldMesh_DX8.cpp.

20{
21 auto pRenderInterface = TRenderD3DInterface::Interface();
22 auto pCurrentContext = TRenderContextD3D::Upcast( pRenderInterface->GetCurrentContext() );
23
24 TMaterial* pMaterial;
25
26 if ( !TSTATICCAST( AWorldShaderHAL, m_pOwnerShader )->IsAlphaBlendMaterial() ||
27 pCurrentContext->GetAlphaBlend() >= 1.0f )
28 {
29 pMaterial = TSTATICCAST( AWorldMaterialHAL, m_pMaterial );
30 }
31 else
32 {
33 pMaterial = TSTATICCAST( AWorldMaterialHAL, m_pMaterial )->GetAlphaBlendMaterial();
34 }
35
36 auto pRenderPacket = pMaterial->AddRenderPacket( this );
37 pRenderPacket->SetModelViewMatrix( pCurrentContext->GetModelViewMatrix() );
38 pRenderPacket->SetAlpha( 1.0f );
39
40 return TTRUE;
41}
#define TSTATICCAST(POINTERTYPE, VALUE)
Definition Defines.h:69
#define TTRUE
Definition Typedefs.h:25
static TRenderContextD3D * Upcast(TRenderContext *a_pRenderContext)
static TFORCEINLINE TRenderD3DInterface * Interface()
Gets the render interface singleton.
TRenderPacket * AddRenderPacket(TMesh *a_pMesh)
void SetModelViewMatrix(TMatrix44 &a_rMatrix44)

◆ TDECLARE_CLASS()

AWorldMeshHAL::TDECLARE_CLASS ( AWorldMeshHAL ,
AWorldMesh  )

The documentation for this class was generated from the following files: