📄 particle.h
字号:
// Particle.h: interface for the CParticle class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_PARTICLE_H__0DA6D5FC_F870_4069_BC71_16486E46DF44__INCLUDED_)
#define AFX_PARTICLE_H__0DA6D5FC_F870_4069_BC71_16486E46DF44__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
struct POINTVERTEX
{
D3DXVECTOR3 v;
D3DCOLOR color;
static const DWORD FVF;
};
//-----------------------------------------------------------------------------
// Global data for the particles
//-----------------------------------------------------------------------------
struct PARTICLE
{
BOOL m_bSpark; // Sparks are less energetic particles that
// are generated where/when the main particles
// hit the ground
D3DXVECTOR3 m_vPos; // Current position
D3DXVECTOR3 m_vVel; // Current velocity
D3DXVECTOR3 m_vPos0; // Initial position
D3DXVECTOR3 m_vVel0; // Initial velocity
FLOAT m_fTime0; // Time of creation
D3DXCOLOR m_clrDiffuse; // Initial diffuse color
D3DXCOLOR m_clrFade; // Faded diffuse color
FLOAT m_fFade; // Fade progression
PARTICLE* m_pNext; // Next particle in list
};
enum PARTICLE_COLORS { COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, NUM_COLORS };
class CParticle
{
public:
CParticle();
virtual ~CParticle();
public:
void Create( DWORD dwFlush, DWORD dwDiscard, float fRadius );
HRESULT LoadTexture( char * szFileName );
HRESULT CreateVertexBuffer();
//void Update();
void Update( FLOAT fSecsPerFrame );
void Render();
private:
DWORD m_dwCurFrame;
DWORD m_dwNextFrame;
DWORD m_dwLastFrame;
// ANITEXTURE ** m_pTexture;
DWORD * m_nTexIndex;
DWORD m_nParticleCount;
// Geometry
LPDIRECT3DTEXTURE9 m_pTexture; // 快急父 烙矫风 技泼 窍技~~~
LPDIRECT3DVERTEXBUFFER9 m_pVertexBuffer;
FLOAT m_fRadius;
DWORD m_dwBase;
DWORD m_dwFlush;
DWORD m_dwDiscard;
DWORD m_dwParticles;
DWORD m_dwParticlesLim;
PARTICLE* m_pParticles;
PARTICLE* m_pParticlesFree;
float m_fTestTime;
// LPDIRECT3DVERTEXBUFFER9 m_pVB;
};
#endif // !defined(AFX_PARTICLE_H__0DA6D5FC_F870_4069_BC71_16486E46DF44__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -