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
"
4
#include "
AWorldMaterial_DX8.h
"
5
6
#include <
Platform/DX8/TRenderInterface_DX8.h
>
7
#include <
Platform/DX8/TRenderContext_DX8.h
>
8
9
//-----------------------------------------------------------------------------
10
// Enables memory debugging.
11
// Note: Should be the last include!
12
//-----------------------------------------------------------------------------
13
#include <
Core/TMemoryDebugOn.h
>
14
15
TOSHI_NAMESPACE_USING
16
17
TDEFINE_CLASS
(
AWorldMeshHAL
);
18
19
TBOOL
AWorldMeshHAL::Render
()
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
}
pch.h
TMemoryDebugOn.h
TRenderContext_DX8.h
TRenderInterface_DX8.h
TSTATICCAST
#define TSTATICCAST(POINTERTYPE, VALUE)
Definition
Defines.h:69
TOSHI_NAMESPACE_USING
#define TOSHI_NAMESPACE_USING
Definition
Defines.h:46
TDEFINE_CLASS
#define TDEFINE_CLASS(...)
Definition
TObject.h:120
TTRUE
#define TTRUE
Definition
Typedefs.h:25
TBOOL
bool TBOOL
Definition
Typedefs.h:6
AWorldMaterial_DX8.h
AWorldMesh_DX8.h
AWorldShader_DX8.h
TRenderContextD3D::Upcast
static TRenderContextD3D * Upcast(TRenderContext *a_pRenderContext)
Definition
TRenderContext_DX8.h:25
TRenderD3DInterface::Interface
static TFORCEINLINE TRenderD3DInterface * Interface()
Gets the render interface singleton.
Definition
TRenderInterface_DX8.h:453
AWorldMaterialHAL
Definition
AWorldMaterial_DX8.h:7
AWorldMeshHAL
Definition
AWorldMesh_DX8.h:5
AWorldMeshHAL::Render
virtual TBOOL Render() override
Definition
AWorldMesh_DX8.cpp:19
AWorldShaderHAL
Definition
AWorldShader_DX8.h:8
D:
_dev
OpenBarnyard
Source
OpenBarnyard
Source
Platform
DX8
AWorldShader
AWorldMesh_DX8.cpp
Generated by
1.13.2