Line | |
---|
1 | #pragma once
|
---|
2 |
|
---|
3 | #include <vector>
|
---|
4 | #include "Particle.h"
|
---|
5 | #include "Media.h"
|
---|
6 | #include "Parameters.h"
|
---|
7 |
|
---|
8 | using namespace std;
|
---|
9 |
|
---|
10 | struct vertexFormat
|
---|
11 | {
|
---|
12 | FLOAT x, y, z;
|
---|
13 | DWORD color;
|
---|
14 | FLOAT u1, v1, s1, t1;
|
---|
15 | FLOAT u2, v2, s2;
|
---|
16 | };
|
---|
17 |
|
---|
18 |
|
---|
19 | class ParticleSystem
|
---|
20 | {
|
---|
21 |
|
---|
22 | public:
|
---|
23 |
|
---|
24 | ParticleSystem(void);
|
---|
25 | ~ParticleSystem(void);
|
---|
26 |
|
---|
27 |
|
---|
28 | void addSystem(char* filename, bool fire, D3DCOLOR particleColor, float minSize, float maxSize);
|
---|
29 | void draw(IDirect3DTexture9* sceneTexture, IDirect3DTexture9* phaseTexture);
|
---|
30 | void SetWorldViewProj(D3DXMATRIXA16& mWorld, D3DXMATRIXA16& mView, D3DXMATRIXA16& mProj );
|
---|
31 | void stepFrame();
|
---|
32 | void initBuffers();
|
---|
33 |
|
---|
34 | void OnCreateDevice( IDirect3DDevice9* pd3dDevice);
|
---|
35 | void OnDestroyDevice();
|
---|
36 | void OnResetDevice();
|
---|
37 | void OnLostDevice();
|
---|
38 |
|
---|
39 | void setParams(Parameters& p){params=&p;}
|
---|
40 | void setCameraPosition(const D3DXVECTOR3& pos);
|
---|
41 |
|
---|
42 | void setScreenDimensions(int width, int height)
|
---|
43 | {
|
---|
44 | screenWidth = width;
|
---|
45 | screenHeight = height;
|
---|
46 | }
|
---|
47 |
|
---|
48 | IDirect3DTexture9* getPlanckTexture(){return planckColors;};
|
---|
49 | float getFireTemperature(){return fireTemperature;}
|
---|
50 | protected:
|
---|
51 |
|
---|
52 | Parameters* params;
|
---|
53 |
|
---|
54 | IDirect3DDevice9* pd3dDevice;
|
---|
55 |
|
---|
56 | typedef vector<Particle*> Frame;
|
---|
57 |
|
---|
58 | vector<Frame*> animFrames;
|
---|
59 | int frameCount;
|
---|
60 | int maxParticleCount;
|
---|
61 | int currentframe;
|
---|
62 | int screenWidth;
|
---|
63 | int screenHeight;
|
---|
64 |
|
---|
65 | vertexFormat** allVertices;
|
---|
66 |
|
---|
67 | IDirect3DTexture9* fireAlpha;
|
---|
68 | IDirect3DTexture9* smokeAlpha;
|
---|
69 | IDirect3DTexture9* planckColors;
|
---|
70 | IDirect3DTexture9* perlinNoise;
|
---|
71 | IDirect3DTexture9* gradTex;
|
---|
72 |
|
---|
73 | ID3DXEffect* sbbEffect;
|
---|
74 |
|
---|
75 | HRESULT hr; // return codes
|
---|
76 |
|
---|
77 | float fireTemperature; // 0 - 1
|
---|
78 | };
|
---|
Note: See
TracBrowser
for help on using the repository browser.