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

#include <ASkinMesh_DX8.h>

Inheritance diagram for ASkinMeshHAL:
ASkinMesh

Public Member Functions

 TDECLARE_CLASS (ASkinMeshHAL, ASkinMesh)
 
virtual TBOOL Render () override
 
- Public Member Functions inherited from ASkinMesh
 TDECLARE_CLASS (ASkinMesh, Toshi::TMesh)
 
 ASkinMesh ()
 
 ~ASkinMesh ()
 
virtual TBOOL Validate () override
 
virtual void Invalidate () override
 
virtual void OnDestroy () override
 
virtual void Create (TUINT32 a_uiFlags, TUINT16 a_uiMaxVertices, TUINT16 a_uiNumSubMeshes)
 
virtual TBOOL Lock (LockBuffer &a_rLockBuffer)
 
virtual void Unlock (TUINT32 a_uiNumVertices)
 
virtual Toshi::TVertexPoolResourceInterface * GetVertexPool ()
 
TUINT16 GetNumSubMeshes () const
 
ASkinSubMeshGetSubMesh (TUINT16 a_uiIndex)
 

Additional Inherited Members

- Public Types inherited from ASkinMesh
using LockBuffer = Toshi::TVertexPoolResourceInterface::LockBuffer
 
- Protected Attributes inherited from ASkinMesh
TUINT32 m_uiFlags
 
TUINT16 m_uiMaxVertices
 
TUINT16 m_uiNumSubMeshes
 
Toshi::TVertexPoolResourceInterface * m_pVertexPool
 
ASkinSubMeshm_pSubMeshes
 
void * m_Unk
 

Detailed Description

Definition at line 4 of file ASkinMesh_DX8.h.

Member Function Documentation

◆ Render()

TBOOL ASkinMeshHAL::Render ( )
overridevirtual

Reimplemented from ASkinMesh.

Definition at line 21 of file ASkinMesh_DX8.cpp.

22{
23 auto pRenderInterface = TRenderD3DInterface::Interface();
24 auto pCurrentContext = TRenderContextD3D::Upcast( pRenderInterface->GetCurrentContext() );
25
26 if ( TSkeletonInstance* pSkeletonInstance = pCurrentContext->GetSkeletonInstance() )
27 {
28 TMaterial* pMaterial;
29
30 if ( !TDYNAMICCAST( ASkinShaderHAL, m_pOwnerShader )->IsAlphaBlendMaterial() ||
31 pCurrentContext->GetAlphaBlend() >= 1.0f )
32 {
33 pMaterial = TDYNAMICCAST( ASkinMaterialHAL, m_pMaterial );
34 }
35 else
36 {
37 pMaterial = TDYNAMICCAST( ASkinMaterialHAL, m_pMaterial )->GetAlphaBlendMaterial();
38 }
39
40 auto pRenderPacket = pMaterial->AddRenderPacket( this );
41 pRenderPacket->SetModelViewMatrix( pCurrentContext->GetModelViewMatrix() );
42 pRenderPacket->SetSkeletonInstance( pSkeletonInstance );
43 pRenderPacket->SetAmbientColour( pCurrentContext->GetAmbientColour().AsVector3() );
44 pRenderPacket->SetLightColour( pRenderInterface->GetLightColour().AsBasisVector3( 0 ) );
45 pRenderPacket->SetLightDirection( pRenderInterface->GetLightDirection().AsBasisVector3( 0 ) );
46 pRenderPacket->SetAlpha( pCurrentContext->GetAlphaBlend() );
47 pRenderPacket->SetShadeCoeff( TUINT( pCurrentContext->GetShadeCoeff() * 255.0f ) );
48
49 ASkinShaderHAL::sm_oWorldViewMatrix = pCurrentContext->GetWorldViewMatrix();
50 ASkinShaderHAL::sm_oViewModelMatrix = pCurrentContext->GetViewModelMatrix();
51 }
52
53 return TTRUE;
54}
#define TDYNAMICCAST(T, OBJECT)
Definition TObject.h:227
unsigned int TUINT
Definition Typedefs.h:8
#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)
static Toshi::TMatrix44 sm_oViewModelMatrix
static Toshi::TMatrix44 sm_oWorldViewMatrix

◆ TDECLARE_CLASS()

ASkinMeshHAL::TDECLARE_CLASS ( ASkinMeshHAL ,
ASkinMesh  )

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