Mercurial > mm7
annotate ParticleEngine.h @ 2177:e1199b655710
pParty->vPrevPosition.y = 1816; and pParty->vPrevPosition.z = 0;
author | Ritor1 |
---|---|
date | Tue, 21 Jan 2014 18:45:00 +0600 |
parents | 38df78aba732 |
children |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "Render.h" | |
3 | |
4 | |
5 | |
619 | 6 enum ParticleType: unsigned __int32 |
7 { | |
8 ParticleType_Invalid = 0, | |
9 ParticleType_1 = 0x0001, | |
10 ParticleType_Rotating = 0x0004, | |
11 ParticleType_8 = 0x0008, | |
12 ParticleType_Diffuse = 0x0100, // colored plane | |
13 ParticleType_Line = 0x0200, // line | |
14 ParticleType_Bitmap = 0x0400, // textured planed | |
15 ParticleType_Sprite = 0x0800 | |
16 }; | |
17 | |
0 | 18 /* 305 */ |
19 #pragma pack(push, 1) | |
619 | 20 struct Particle_sw |
0 | 21 { |
619 | 22 unsigned int type; |
0 | 23 float x; |
24 float y; | |
25 float z; | |
1390 | 26 float r; |
27 float g; | |
28 float b; | |
0 | 29 unsigned int uDiffuse; |
30 int timeToLive; | |
31 unsigned int uTextureID; | |
32 float flt_28; | |
33 int field_2C; | |
34 int field_30; | |
35 int field_34; | |
36 int field_38[12]; | |
37 }; | |
38 #pragma pack(pop) | |
39 | |
40 | |
619 | 41 |
0 | 42 /* 109 */ |
43 #pragma pack(push, 1) | |
44 struct Particle | |
45 { | |
619 | 46 unsigned int type; |
0 | 47 float x; |
48 float y; | |
49 float z; | |
50 float flt_10; | |
51 float flt_14; | |
52 float flt_18; | |
53 union | |
54 { | |
55 struct | |
56 { | |
57 unsigned char r, g, b, a; | |
58 }; | |
59 unsigned int uParticleColor; | |
60 }; | |
61 int timeToLive; | |
62 unsigned int uTextureID; | |
63 float flt_28; | |
64 float _x; | |
65 float _y; | |
66 float _z; | |
871 | 67 int rotation_speed; |
68 int angle; | |
0 | 69 int uScreenSpaceX; |
70 int uScreenSpaceY; | |
71 int uScreenSpaceZ; // line end x | |
72 int uScreenSpaceW; // line end y | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
73 union |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
74 { |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
75 int sZValue; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
76 struct |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
77 { |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
78 unsigned short object_pid; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
79 short zbuffer_depth; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
80 }; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
81 }; |
0 | 82 int sZValue2; // line end z |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
0
diff
changeset
|
83 int _screenspace_scale; |
0 | 84 float flt_5C; |
85 float flt_60; | |
871 | 86 int uLightColor_bgr; |
0 | 87 }; |
88 #pragma pack(pop) | |
89 | |
90 | |
91 | |
92 /* 111 */ | |
93 #pragma pack(push, 1) | |
94 struct stru2_LineList | |
95 { | |
96 unsigned int uNumLines; | |
97 RenderVertexD3D3 pLineVertices[48]; | |
98 char field_604[60]; | |
99 }; | |
100 #pragma pack(pop) | |
101 | |
102 | |
103 | |
104 | |
105 | |
106 /* 110 */ | |
107 #pragma pack(push, 1) | |
1103 | 108 class ParticleEngine |
0 | 109 { |
1103 | 110 public: |
0 | 111 ParticleEngine(); |
112 | |
113 void ResetParticles(); | |
619 | 114 void AddParticle(Particle_sw *a2); |
0 | 115 void Draw(); |
619 | 116 void UpdateParticles(); |
871 | 117 bool ViewProject_TrueIfStillVisible_BLV(unsigned int uParticleID); |
118 bool ViewProject_TrueIfStillVisible_ODM(unsigned int uID); | |
0 | 119 void DrawParticles_BLV(); |
120 void DrawParticles_ODM(); | |
121 | |
122 Particle pParticles[500]; | |
123 stru2_LineList pLines; | |
124 char field_D160[4800]; | |
125 float field_E420; | |
126 int uStartParticle; | |
127 int uEndParticle; | |
128 int uTimeElapsed; | |
129 }; | |
1410
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
130 #pragma pack(pop) |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
131 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
132 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
133 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
134 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
135 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
136 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
137 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
138 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
139 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
140 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
141 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
142 /* 160 */ |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
143 #pragma pack(push, 1) |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
144 struct TrailParticle // stru167 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
145 { |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
146 inline TrailParticle() |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
147 { |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
148 x = 0; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
149 y = 0; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
150 z = 0; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
151 time_left = 0; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
152 time_to_live = 0; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
153 bgr16 = 0; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
154 } |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
155 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
156 char field_0; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
157 char field_1; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
158 char field_2; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
159 char field_3; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
160 char field_4; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
161 char field_5; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
162 __int16 x; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
163 __int16 y; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
164 __int16 z; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
165 __int16 time_left; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
166 __int16 time_to_live; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
167 char field_10; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
168 char field_11; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
169 char field_12; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
170 char field_13; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
171 __int16 bgr16; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
172 char field_16; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
173 char field_17; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
174 }; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
175 #pragma pack(pop) |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
176 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
177 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
178 /* 363 */ |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
179 #pragma pack(push, 1) |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
180 struct TrailParticleGenerator // stru167_wrap |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
181 { |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
182 public: |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
183 inline TrailParticleGenerator() |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
184 { |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
185 num_particles = 0; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
186 } |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
187 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
188 void GenerateTrailParticles(int x, int y, int z, int bgr16); |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
189 void UpdateParticles(); |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
190 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
191 protected: |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
192 void AddParticle(int x, int y, int z, int bgr16); |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
193 |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
194 TrailParticle particles[100]; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
195 int num_particles; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
196 int field_964; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
197 }; |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
198 #pragma pack(pop) |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1390
diff
changeset
|
199 extern TrailParticleGenerator trail_particle_generator; // 005118E8 |