Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
92 lines
2.8 KiB
C++
92 lines
2.8 KiB
C++
// Glare.h: interface for the CGlare class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_GLARE_H__9702E92C_C698_40DC_AA7D_7964C33573D0__INCLUDED_)
|
|
#define AFX_GLARE_H__9702E92C_C698_40DC_AA7D_7964C33573D0__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#define GLARETEXTURE_WIDTH 256
|
|
#define GLARETEXTURE_HEIGHT 256
|
|
|
|
#define NUM_256_TEXTURES 2
|
|
#define NUM_128_TEXTURES 8
|
|
#define NUM_64_TEXTURES 8
|
|
#define NUM_32_TEXTURES 8
|
|
#define NUM_16_TEXTURES 8
|
|
|
|
#define OFFSET1U 0.0f
|
|
#define OFFSET1V 1.0f
|
|
#define OFFSET2U 0.951f
|
|
#define OFFSET2V 0.309f
|
|
#define OFFSET3U 0.5878f
|
|
#define OFFSET3V -0.809f
|
|
#define OFFSET4U -0.5878f
|
|
#define OFFSET4V -0.809f
|
|
#define OFFSET5U -0.951f
|
|
#define OFFSET5V 0.309f
|
|
|
|
struct GLAREDISPLAY_VERTEX
|
|
{
|
|
float x, y, z, rhw;
|
|
DWORD color;
|
|
float u, v;
|
|
static const DWORD FVF;
|
|
};
|
|
|
|
class CGlareScene
|
|
{
|
|
public:
|
|
struct RenderTarget
|
|
{
|
|
UINT nHeight;
|
|
UINT nWidth;
|
|
LPDIRECT3DSURFACE8 pSurface;
|
|
LPDIRECT3DSURFACE8 pZSurface;
|
|
LPDIRECT3DTEXTURE8 pTexture;
|
|
};
|
|
|
|
public:
|
|
LPDIRECT3DDEVICE8 m_pd3dDevice;
|
|
RenderTarget m_RenderTarget256[NUM_256_TEXTURES];
|
|
RenderTarget m_RenderTarget128[NUM_128_TEXTURES];
|
|
RenderTarget m_RenderTarget64[NUM_64_TEXTURES];
|
|
RenderTarget m_RenderTarget32[NUM_32_TEXTURES];
|
|
RenderTarget m_RenderTarget16[NUM_16_TEXTURES];
|
|
LPDIRECT3DSURFACE8 m_pOldRenderTarget;
|
|
LPDIRECT3DSURFACE8 m_pOldZSurface;
|
|
D3DVIEWPORT8 m_OldViewport;
|
|
|
|
public:
|
|
CGlareScene();
|
|
virtual ~CGlareScene();
|
|
|
|
HRESULT Create( LPDIRECT3DDEVICE8 pDevice );
|
|
bool BeginRenderToTexture();
|
|
bool EndRenderToTexture();
|
|
void ShakeGlareImage( float weight16, float weight32, float weight64, float weight128 );
|
|
void Destroy();
|
|
void SetColorFactorShader( D3DCOLOR color );
|
|
void SetDiffuseColorShader();
|
|
|
|
protected:
|
|
HRESULT CreateRenderTarget( RenderTarget* pTarget, UINT nHeight, UINT nWidth );
|
|
void DownImage( RenderTarget* pSrc, RenderTarget* pDst, float offsetU, float offsetV);
|
|
void AccumulateImage( RenderTarget* pResult, RenderTarget* pSrc1, RenderTarget* pSrc2,
|
|
RenderTarget* pSrc3, RenderTarget* pSrc4 = NULL );
|
|
void AddBlurImage( RenderTarget* pResult, RenderTarget* pSrc1, RenderTarget* pSrc2,
|
|
RenderTarget* pSrc3, RenderTarget* pSrc4, float weight1, float weight2,
|
|
float weight3, float weight4 );
|
|
void SetTextureShader( LPDIRECT3DTEXTURE8 pTexture );
|
|
void SetTextureAlphaFactorShader( LPDIRECT3DTEXTURE8 pTexture, D3DCOLOR color );
|
|
void AddAttenuateThreeTextureShader( LPDIRECT3DTEXTURE8 pTex1,
|
|
LPDIRECT3DTEXTURE8 pTex2, LPDIRECT3DTEXTURE8 pTex3, D3DCOLOR color );
|
|
void Set3StageAccumAdderShader( LPDIRECT3DTEXTURE8 pTex1,
|
|
LPDIRECT3DTEXTURE8 pTex2, LPDIRECT3DTEXTURE8 pTex3 );
|
|
};
|
|
|
|
#endif // !defined(AFX_GLARE_H__9702E92C_C698_40DC_AA7D_7964C33573D0__INCLUDED_)
|