OpenBarnyard
 
Loading...
Searching...
No Matches
AWorldMesh_DX8.cpp
Go to the documentation of this file.
1#include "pch.h"
2#include "AWorldMesh_DX8.h"
3#include "AWorldShader_DX8.h"
5
8
9//-----------------------------------------------------------------------------
10// Enables memory debugging.
11// Note: Should be the last include!
12//-----------------------------------------------------------------------------
13#include <Core/TMemoryDebugOn.h>
14
16
18
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 TOSHI_NAMESPACE_USING
Definition Defines.h:46
#define TDEFINE_CLASS(...)
Definition TObject.h:120
#define TTRUE
Definition Typedefs.h:25
bool TBOOL
Definition Typedefs.h:6
static TRenderContextD3D * Upcast(TRenderContext *a_pRenderContext)
static TFORCEINLINE TRenderD3DInterface * Interface()
Gets the render interface singleton.
virtual TBOOL Render() override