Mercurial > mm7
annotate ParticleEngine.cpp @ 992:3a3ab572eff5
Merge
author | Nomad |
---|---|
date | Mon, 13 May 2013 17:07:52 +0200 |
parents | 710cf848ad24 |
children | c45d51b3f4f4 |
rev | line source |
---|---|
0 | 1 #include "ParticleEngine.h" |
2 #include "Time.h" | |
3 #include "Render.h" | |
4 #include "Viewport.h" | |
5 #include "Outdoor.h" | |
6 #include "Game.h" | |
7 #include "IndoorCamera.h" | |
8 #include "Math.h" | |
9 #include "LOD.h" | |
10 | |
11 #include "mm7_data.h" | |
12 | |
13 //----- (0048AAC5) -------------------------------------------------------- | |
14 ParticleEngine::ParticleEngine() | |
15 { | |
16 for (uint i = 0; i < 500; ++i) | |
17 memset(&pParticles[i], 0, sizeof(pParticles[i])); | |
18 | |
19 ResetParticles(); | |
20 } | |
21 | |
22 //----- (0048AAF6) -------------------------------------------------------- | |
23 void ParticleEngine::ResetParticles() | |
24 { | |
25 memset(pParticles, 0, 500 * sizeof(*pParticles)); | |
26 uStartParticle = 500; | |
27 uEndParticle = 0; | |
28 uTimeElapsed = 0; | |
29 } | |
30 | |
31 //----- (0048AB23) -------------------------------------------------------- | |
619 | 32 void ParticleEngine::AddParticle(Particle_sw *a2) |
0 | 33 { |
34 signed int v2; // eax@2 | |
35 Particle *v3; // edx@2 | |
36 Particle *v4; // esi@10 | |
37 int v5; // ecx@10 | |
619 | 38 //char v6; // zf@10 |
0 | 39 |
40 if ( !pMiscTimer->bPaused ) | |
41 { | |
42 v2 = 0; | |
43 v3 = (Particle *)this; | |
44 do | |
45 { | |
619 | 46 if (v3->type == ParticleType_Invalid) |
0 | 47 break; |
48 ++v2; | |
49 ++v3; | |
50 } | |
51 while ( v2 < 500 ); | |
52 if ( v2 < 500 ) | |
53 { | |
54 if ( v2 < this->uStartParticle ) | |
55 this->uStartParticle = v2; | |
56 if ( v2 > this->uEndParticle ) | |
57 this->uEndParticle = v2; | |
58 v4 = &this->pParticles[v2]; | |
619 | 59 v4->type = a2->type; |
0 | 60 v4->x = a2->x; |
61 v4->y = a2->y; | |
62 v4->z = a2->z; | |
63 v4->_x = a2->x; | |
64 v4->_y = a2->y; | |
65 v4->_z = a2->z; | |
66 v4->flt_10 = a2->flt_10; | |
67 v4->flt_14 = a2->flt_14; | |
68 v4->flt_18 = a2->flt_18; | |
69 v5 = a2->uDiffuse; | |
70 v4->uParticleColor = v5; | |
871 | 71 v4->uLightColor_bgr = v5; |
619 | 72 //v6 = (v4->uType & 4) == 0; |
0 | 73 v4->timeToLive = a2->timeToLive; |
74 v4->uTextureID = a2->uTextureID; | |
75 v4->flt_28 = a2->flt_28; | |
619 | 76 if (v4->type & ParticleType_Rotating) |
77 { | |
871 | 78 v4->rotation_speed = (rand() % 256) - 128; |
79 v4->angle = rand(); | |
619 | 80 } |
81 else | |
0 | 82 { |
871 | 83 v4->rotation_speed = 0; |
84 v4->angle = 0; | |
0 | 85 } |
86 } | |
87 } | |
88 } | |
89 | |
90 //----- (0048ABF3) -------------------------------------------------------- | |
91 void ParticleEngine::Draw() | |
92 { | |
93 uTimeElapsed += pEventTimer->uTimeElapsed; | |
94 pLines.uNumLines = 0; | |
95 | |
573 | 96 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
97 DrawParticles_BLV(); | |
98 else | |
99 DrawParticles_ODM(); | |
0 | 100 |
101 if (pRenderer->pRenderD3D) | |
102 { | |
103 if (pLines.uNumLines) | |
104 { | |
105 pRenderer->pRenderD3D->pDevice->SetTexture(0, 0); | |
106 pRenderer->pRenderD3D->pDevice->DrawPrimitive( | |
107 D3DPT_LINELIST, | |
108 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1, | |
109 pLines.pLineVertices, | |
110 pLines.uNumLines, | |
111 D3DDP_DONOTLIGHT); | |
112 } | |
113 } | |
114 } | |
115 | |
116 //----- (0048AC65) -------------------------------------------------------- | |
117 void ParticleEngine::UpdateParticles() | |
118 { | |
119 unsigned int time; // edi@1 | |
871 | 120 //int v5; // eax@3 |
121 //char v6; // sf@4 | |
0 | 122 float v7; // ST4C_4@11 |
123 double v8; // st7@12 | |
871 | 124 //int v9; // eax@12 |
125 //double v10; // st7@14 | |
0 | 126 signed int v19; // [sp+38h] [bp-14h]@1 |
127 int v20; // [sp+3Ch] [bp-10h]@1 | |
128 unsigned int time_; // [sp+40h] [bp-Ch]@1 | |
129 int v22; // [sp+44h] [bp-8h]@12 | |
130 | |
131 v20 = 0; | |
132 time = pMiscTimer->bPaused == 0 ? pEventTimer->uTimeElapsed : 0; | |
133 v19 = 500; | |
134 time_ = pMiscTimer->bPaused == 0 ? pEventTimer->uTimeElapsed : 0; | |
135 | |
871 | 136 for (uint i = uStartParticle; i <= uEndParticle; ++i) |
0 | 137 { |
138 auto p = pParticles + i; | |
139 | |
619 | 140 if (p->type == ParticleType_Invalid) |
0 | 141 continue; |
142 | |
871 | 143 if (p->timeToLive <= time) |
144 { | |
145 p->timeToLive = 0; | |
146 p->type = ParticleType_Invalid; | |
147 continue; | |
148 } | |
0 | 149 p->timeToLive -= time; |
871 | 150 |
151 if (p->type & ParticleType_Line) | |
0 | 152 { |
153 p->_x = p->x; | |
154 p->_y = p->y; | |
155 p->_z = p->z; | |
156 } | |
871 | 157 |
158 if (p->type & ParticleType_1) | |
0 | 159 p->flt_18 = p->flt_18 - (double)(signed int)time_ * 5.0; |
871 | 160 |
161 if (p->type & ParticleType_8) | |
0 | 162 { |
163 v7 = (double)(signed int)time_; | |
164 *(float *)&p->x += (double)(rand() % 5 - 2) * v7 / 16.0f; | |
165 *(float *)&p->y += (double)(rand() % 5 - 2) * v7 / 16.0f; | |
166 *(float *)&p->z += (double)(rand() % 5 + 4) * v7 / 16.0f; | |
167 } | |
168 v8 = (double)(signed int)time_ / 128.0f; | |
871 | 169 //v9 = (signed int)(time * p->rotation_speed) / 16; |
170 | |
171 p->x += v8 * p->flt_10; | |
172 p->y += v8 * p->flt_14; | |
173 p->z += v8 * p->flt_18; | |
174 | |
175 p->angle += time * p->rotation_speed / 16; | |
0 | 176 v22 = 2 * p->timeToLive; |
871 | 177 if (v22 >= 255 ) |
0 | 178 v22 = 255; |
871 | 179 //v10 = (double)v22 * 0.0039215689; |
180 p->uLightColor_bgr = ((uint)floorf(p->b * (v22 / 255.0f) + 0.5) << 16) | | |
181 ((uint)floorf(p->g * (v22 / 255.0f) + 0.5) << 8) | | |
182 ((uint)floorf(p->r * (v22 / 255.0f) + 0.5) << 0); | |
0 | 183 if ( i < v19 ) |
184 v19 = i; | |
185 if ( i > v20 ) | |
186 v20 = i; | |
187 } | |
188 | |
189 uEndParticle = v20; | |
190 uStartParticle = v19; | |
191 } | |
192 | |
193 //----- (0048AE74) -------------------------------------------------------- | |
871 | 194 bool ParticleEngine::ViewProject_TrueIfStillVisible_BLV(unsigned int uParticleID) |
0 | 195 { |
196 Particle *pParticle; // esi@1 | |
619 | 197 //double v56; // ST28_8@2 |
871 | 198 //float v4; // eax@4 |
199 //double v5; // ST34_8@4 | |
0 | 200 signed __int64 v6; // qtt@4 |
619 | 201 //double v7; // st7@4 |
202 //float v8; // ST18_4@4 | |
0 | 203 int v9; // ecx@4 |
619 | 204 //int v10; // eax@4 |
205 //double v11; // ST44_8@7 | |
206 //double v12; // ST4C_8@7 | |
0 | 207 double v13; // ST4C_8@7 |
208 int v14; // ecx@7 | |
871 | 209 //signed __int64 v15; // qtt@7 |
0 | 210 int v16; // eax@7 |
211 int v17; // edx@7 | |
212 float v18; // edx@7 | |
213 int v19; // eax@7 | |
214 int v20; // edx@7 | |
215 int v21; // ST50_4@8 | |
216 int v22; // ebx@8 | |
217 int v23; // ecx@10 | |
218 int v24; // edi@10 | |
871 | 219 //double v25; // ST44_8@12 |
220 //double v26; // ST4C_8@12 | |
0 | 221 int v27; // edi@12 |
222 int v28; // ST40_4@12 | |
223 int v29; // ecx@12 | |
871 | 224 //signed __int64 v30; // qtt@12 |
0 | 225 int v31; // eax@12 |
226 int v32; // edx@12 | |
227 float v33; // edx@12 | |
871 | 228 //int v34; // eax@12 |
0 | 229 int v35; // ecx@12 |
230 int v36; // ST38_4@13 | |
231 int v37; // ST30_4@15 | |
232 int v38; // eax@16 | |
871 | 233 //signed __int64 v40; // qtt@18 |
0 | 234 int v41; // eax@18 |
235 int v42; // ecx@18 | |
236 int v43; // eax@18 | |
237 unsigned __int64 v44; // qax@18 | |
238 double v45; // st7@18 | |
239 int v46; // ecx@18 | |
240 float v47; // ST18_4@18 | |
241 unsigned __int64 v48; // qax@18 | |
619 | 242 int y_int_; // [sp+10h] [bp-40h]@2 |
0 | 243 int a2; // [sp+18h] [bp-38h]@10 |
244 int x_int; // [sp+20h] [bp-30h]@2 | |
619 | 245 int z_int_; // [sp+24h] [bp-2Ch]@2 |
0 | 246 int z_int_4; // [sp+28h] [bp-28h]@8 |
247 int z; // [sp+3Ch] [bp-14h]@3 | |
248 double a5; // [sp+40h] [bp-10h]@4 | |
249 int a6; // [sp+48h] [bp-8h]@4 | |
250 int y; // [sp+4Ch] [bp-4h]@3 | |
251 | |
252 pParticle = &this->pParticles[uParticleID]; | |
619 | 253 if (pParticle->type == ParticleType_Invalid) |
0 | 254 return 0; |
619 | 255 //uParticleID = LODWORD(pParticle->x); |
256 //v56 = *(float *)&uParticleID + 6.7553994e15; | |
257 x_int = floorf(pParticle->x + 0.5f); | |
258 //uParticleID = LODWORD(pParticle->y); | |
259 //y_int_ = *(float *)&uParticleID + 6.7553994e15; | |
260 y_int_ = floorf(pParticle->y + 0.5f); | |
261 //uParticleID = LODWORD(pParticle->z); | |
262 //z_int_ = *(float *)&uParticleID + 6.7553994e15; | |
263 z_int_ = floorf(pParticle->z + 0.5f); | |
0 | 264 if ( !pRenderer->pRenderD3D ) |
265 { | |
266 if ( pBLVRenderParams->sPartyRotX ) | |
267 { | |
619 | 268 if (pParticle->type & ParticleType_Line) |
0 | 269 { |
619 | 270 //v11 = pParticle->_x + 6.7553994e15; |
271 int _uParticleID = (int)(floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; | |
272 //v12 = pParticle->_y + 6.7553994e15; | |
273 y = (int)(floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; | |
0 | 274 z = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sSineY) >> 16; |
619 | 275 HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) |
0 | 276 - z; |
619 | 277 a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineY) >> 16; |
278 //v13 = pParticle->_z + 6.7553994e15; | |
279 _uParticleID = (int)(floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; | |
0 | 280 z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) |
619 | 281 - ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineNegX) >> 16); |
0 | 282 v14 = z; |
283 HIDWORD(v13) = (unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; | |
619 | 284 HIDWORD(a5) = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16; |
871 | 285 //LODWORD(v15) = pBLVRenderParams->field_40 << 16; |
286 //HIDWORD(v15) = pBLVRenderParams->field_40 >> 16; | |
287 //v16 = v15 / z; | |
288 v16 = fixpoint_div(pBLVRenderParams->field_40, z); | |
0 | 289 v17 = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16; |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
290 pParticle->_screenspace_scale = v16; |
619 | 291 _uParticleID = (unsigned __int64)(v16 * (signed __int64)(a6 + v17)) >> 16; |
0 | 292 LODWORD(v18) = pBLVRenderParams->uViewportCenterX |
293 - ((signed int)((unsigned __int64)(v16 * (signed __int64)(a6 + v17)) >> 16) >> 16); | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
294 v19 = pParticle->_screenspace_scale; |
0 | 295 pParticle->uScreenSpaceZ = v18; |
619 | 296 _uParticleID = (unsigned __int64)(v19 * (signed __int64)(HIDWORD(v13) + HIDWORD(a5))) >> 16; |
0 | 297 v20 = pBLVRenderParams->uViewportCenterY |
298 - ((signed int)((unsigned __int64)(v19 * (signed __int64)(HIDWORD(v13) + HIDWORD(a5))) >> 16) >> 16); | |
299 pParticle->sZValue2 = v14; | |
300 pParticle->uScreenSpaceW = v20; | |
301 } | |
619 | 302 int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; |
303 y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; | |
304 HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) | |
0 | 305 - ((unsigned __int64)(y * (signed __int64)pBLVRenderParams->sSineY) >> 16); |
619 | 306 a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineY) >> 16; |
307 z_int_4 = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16; | |
308 _uParticleID = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; | |
309 v21 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; | |
0 | 310 v22 = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v21; |
311 z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v21; | |
312 if ( v22 < (signed int)0x40000u || v22 > (signed int)0x1F400000u ) | |
313 return 0; | |
314 v23 = a6 + z_int_4; | |
315 a2 = a6 + z_int_4; | |
619 | 316 v24 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) |
0 | 317 + ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sSineNegX) >> 16); |
318 } | |
319 else | |
320 { | |
619 | 321 if (pParticle->type & ParticleType_Line) |
0 | 322 { |
871 | 323 //v25 = pParticle->_x + 6.7553994e15; |
324 int _uParticleID = ((int)floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; | |
325 //v26 = pParticle->_y + 6.7553994e15; | |
326 y = ((int)floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; | |
327 auto _hiword_v25 = (__int64)(y * (signed __int64)pBLVRenderParams->sSineY) >> 16; | |
328 v27 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - _hiword_v25; | |
329 z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - _hiword_v25; | |
619 | 330 v28 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineY) >> 16; |
871 | 331 //a5 = pParticle->_z + 6.7553994e15; |
332 v29 = ((int)floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; | |
333 //LODWORD(v30) = pBLVRenderParams->field_40 << 16; | |
334 //HIDWORD(v30) = pBLVRenderParams->field_40 >> 16; | |
335 //v31 = v30 / z; | |
336 v31 = fixpoint_div(pBLVRenderParams->field_40, z); | |
0 | 337 v32 = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16; |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
338 pParticle->_screenspace_scale = v31; |
619 | 339 _uParticleID = (unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16; |
871 | 340 LODWORD(v33) = pBLVRenderParams->uViewportCenterX - ((signed int)((unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16) >> 16); |
341 //v34 = pParticle->_screenspace_scale; | |
0 | 342 pParticle->uScreenSpaceZ = v33; |
871 | 343 v35 = pBLVRenderParams->uViewportCenterY - ((signed int)((unsigned __int64)(pParticle->_screenspace_scale * (signed __int64)v29) >> 16) >> 16); |
0 | 344 pParticle->sZValue2 = v27; |
345 pParticle->uScreenSpaceW = v35; | |
346 } | |
619 | 347 int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; |
348 y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; | |
0 | 349 v36 = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sSineY) >> 16; |
619 | 350 v22 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v36; |
351 z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v36; | |
0 | 352 if ( v22 < 262144 || v22 > 524288000 ) |
353 return 0; | |
619 | 354 v37 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineY) >> 16; |
355 _uParticleID = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16; | |
0 | 356 v23 = v37 + ((unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); |
357 a2 = v37 + ((unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); | |
619 | 358 v24 = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; |
0 | 359 } |
619 | 360 int _uParticleID = abs(v23); |
0 | 361 v38 = abs(v22); |
619 | 362 if ( v38 >= (signed int)_uParticleID ) |
0 | 363 { |
871 | 364 //LODWORD(v40) = pBLVRenderParams->field_40 << 16; |
365 //HIDWORD(v40) = pBLVRenderParams->field_40 >> 16; | |
366 v41 = fixpoint_div(pBLVRenderParams->field_40, z); | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
367 pParticle->_screenspace_scale = v41; |
619 | 368 _uParticleID = (unsigned __int64)(v41 * (signed __int64)a2) >> 16; |
0 | 369 v42 = pBLVRenderParams->uViewportCenterX - ((signed int)((unsigned __int64)(v41 * (signed __int64)a2) >> 16) >> 16); |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
370 v43 = pParticle->_screenspace_scale; |
0 | 371 pParticle->uScreenSpaceX = v42; |
372 v44 = v43 * (signed __int64)v24; | |
619 | 373 //uParticleID = v44 >> 16; |
0 | 374 v45 = pParticle->flt_28; |
375 LODWORD(v44) = (signed int)(v44 >> 16) >> 16; | |
376 v46 = pBLVRenderParams->uViewportCenterY - v44; | |
377 pParticle->uScreenSpaceY = pBLVRenderParams->uViewportCenterY - v44; | |
378 v47 = v45; | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
379 v48 = _48B561_mess_with_scaling_along_z(/*v46, */v47) * (signed __int64)pParticle->_screenspace_scale; |
619 | 380 //_uParticleID = v48 >> 16; |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
381 pParticle->_screenspace_scale = v48 >> 16; |
619 | 382 pParticle->sZValue = z; |
383 return true; | |
0 | 384 } |
619 | 385 return false; |
0 | 386 } |
619 | 387 |
388 int x; | |
0 | 389 if ( !pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( |
390 x_int, | |
619 | 391 y_int_, |
392 z_int_, | |
393 &x, | |
0 | 394 &y, |
395 &z, | |
396 1) ) | |
619 | 397 return false; |
398 pGame->pIndoorCameraD3D->Project(x, y, z, &pParticle->uScreenSpaceX, &pParticle->uScreenSpaceY); | |
0 | 399 pParticle->flt_5C = pGame->pIndoorCameraD3D->fov_x; |
871 | 400 //v4 = pParticle->flt_5C; |
0 | 401 pParticle->flt_60 = pGame->pIndoorCameraD3D->fov_y; |
871 | 402 //v5 = v4 + 6.7553994e15; |
0 | 403 LODWORD(v6) = 0; |
871 | 404 HIDWORD(v6) = floorf(pParticle->flt_5C + 0.5f); |
619 | 405 //v7 = pParticle->flt_28; |
406 pParticle->_screenspace_scale = v6 / x; | |
407 //v8 = v7; | |
408 pParticle->_screenspace_scale = (unsigned __int64)(_48B561_mess_with_scaling_along_z(/*v9, */pParticle->flt_28) * (signed __int64)pParticle->_screenspace_scale) >> 16; | |
409 pParticle->sZValue = x; | |
410 return true; | |
0 | 411 } |
412 | |
413 | |
414 | |
415 | |
416 //----- (0048B5B3) -------------------------------------------------------- | |
871 | 417 bool ParticleEngine::ViewProject_TrueIfStillVisible_ODM(unsigned int uID) |
0 | 418 { |
871 | 419 //ParticleEngine *v2; // ST18_4@1 |
0 | 420 int v3; // ebx@1 |
421 int v4; // edi@1 | |
422 int v5; // ecx@1 | |
423 Particle *v6; // esi@1 | |
871 | 424 //double v7; // ST14_8@2 |
425 //double v8; // ST34_8@4 | |
426 //double v9; // ST3C_8@4 | |
427 //int v10; // ST50_4@4 | |
0 | 428 int v11; // ST44_4@4 |
871 | 429 //double v12; // ST48_8@4 |
0 | 430 signed __int64 v13; // qtt@4 |
871 | 431 //int v14; // eax@4 |
432 //int v15; // ST28_4@4 | |
0 | 433 int v16; // edi@6 |
434 int v17; // eax@6 | |
871 | 435 //double v18; // ST2C_8@8 |
436 //double v19; // ST34_8@8 | |
437 //int v20; // ST50_4@8 | |
438 //double v21; // ST34_8@8 | |
0 | 439 signed __int64 v22; // qtt@8 |
871 | 440 //int v23; // eax@8 |
441 //int v24; // ST28_4@8 | |
442 //int v25; // edx@8 | |
0 | 443 int v26; // edx@9 |
871 | 444 //int v27; // eax@9 |
0 | 445 int v28; // ebx@12 |
446 signed __int64 v29; // qtt@13 | |
871 | 447 //int v30; // eax@13 |
448 //int v31; // ST1C_4@13 | |
0 | 449 double v32; // st7@13 |
450 signed int v33; // eax@13 | |
451 int v34; // ecx@13 | |
452 float v35; // ST04_4@13 | |
453 int v36; // eax@13 | |
454 int v37; // esi@15 | |
871 | 455 //double v39; // [sp+10h] [bp-40h]@2 |
0 | 456 int v40; // [sp+14h] [bp-3Ch]@12 |
871 | 457 //int v41; // [sp+1Ch] [bp-34h]@2 |
458 //double v42; // [sp+20h] [bp-30h]@2 | |
459 //int v43; // [sp+24h] [bp-2Ch]@5 | |
0 | 460 int v44; // [sp+2Ch] [bp-24h]@1 |
461 int v45; // [sp+40h] [bp-10h]@5 | |
462 int X_4; // [sp+48h] [bp-8h]@5 | |
871 | 463 //int v47; // [sp+4Ch] [bp-4h]@5 |
464 //int v48; // [sp+4Ch] [bp-4h]@9 | |
465 //int uIDc; // [sp+58h] [bp+8h]@4 | |
466 //int uIDd; // [sp+58h] [bp+8h]@4 | |
467 //int uIDe; // [sp+58h] [bp+8h]@5 | |
468 //int uIDa; // [sp+58h] [bp+8h]@5 | |
469 //int uIDf; // [sp+58h] [bp+8h]@8 | |
470 //int uIDb; // [sp+58h] [bp+8h]@9 | |
0 | 471 |
323 | 472 v3 = stru_5C6E00->Cos(pIndoorCamera->sRotationX); |
473 v44 = stru_5C6E00->Sin(pIndoorCamera->sRotationX); | |
474 v4 = stru_5C6E00->Cos(pIndoorCamera->sRotationY); | |
475 v5 = stru_5C6E00->Sin(pIndoorCamera->sRotationY); | |
871 | 476 |
477 v6 = &pParticles[uID]; | |
478 if (v6->type == ParticleType_Invalid) | |
479 return false; | |
480 | |
481 //v7 = v6->x + 6.7553994e15; | |
482 //v41 = LODWORD(v7); | |
483 //v39 = v6->y + 6.7553994e15; | |
484 //v42 = v6->z + 6.7553994e15; | |
0 | 485 if ( v3 ) |
486 { | |
619 | 487 if (v6->type & ParticleType_Line) |
0 | 488 { |
871 | 489 //v8 = v6->_x + 6.7553994e15; |
490 //uIDc = (LODWORD(v8) - pIndoorCamera->pos.x) << 16; | |
491 //v9 = v6->_y + 6.7553994e15; | |
492 //v10 = (LODWORD(v9) - pIndoorCamera->pos.y) << 16; | |
493 v11 = fixpoint_mul(v6->x - pIndoorCamera->pos.x, v4) + fixpoint_mul(v6->y - pIndoorCamera->pos.y, v5); | |
494 //HIDWORD(v8) = fixpoint_mul(v6->x - pIndoorCamera->pos.x, v5); | |
495 //v12 = v6->_z + 6.7553994e15; | |
496 //uIDd = (LODWORD(v12) - pIndoorCamera->pos.z) << 16; | |
497 auto _hidword_v12 = fixpoint_sub0(v11, v3) + fixpoint_mul(v6->z - pIndoorCamera->pos.z, v44); | |
0 | 498 LODWORD(v13) = 0; |
499 HIDWORD(v13) = SLOWORD(pOutdoorCamera->int_fov_rad); | |
871 | 500 //v14 = v13 / _hidword_v12; |
501 v6->_screenspace_scale = v13 / _hidword_v12; | |
502 //v15 = v6->_screenspace_scale; | |
0 | 503 v6->uScreenSpaceX = pViewport->uScreenCenterX |
871 | 504 - ((signed int)((unsigned __int64)(v6->_screenspace_scale |
505 * (signed __int64)(fixpoint_mul(v6->y - pIndoorCamera->pos.y, v4) | |
506 - fixpoint_mul(v6->x - pIndoorCamera->pos.x, v5))) >> 16) >> 16); | |
0 | 507 v6->uScreenSpaceY = pViewport->uScreenCenterY |
871 | 508 - ((signed int)((unsigned __int64)(v6->_screenspace_scale |
509 * (signed __int64)(fixpoint_mul(v6->z - pIndoorCamera->pos.z, v3) | |
0 | 510 - ((unsigned __int64)(v11 * (signed __int64)v44) >> 16))) >> 16) >> 16); |
871 | 511 v6->sZValue = _hidword_v12; |
0 | 512 } |
871 | 513 //uIDe = (v41 - pIndoorCamera->pos.x) << 16; |
514 //v47 = (LODWORD(v39) - pIndoorCamera->pos.y) << 16; | |
515 v45 = fixpoint_mul(v6->x - pIndoorCamera->pos.x, v4) + fixpoint_mul(v6->y - pIndoorCamera->pos.y, v5); | |
516 //HIDWORD(v42) = fixpoint_mul(v6->x - pIndoorCamera->pos.x, v5); | |
517 //uIDa = (LODWORD(v42) - pIndoorCamera->pos.z) << 16; | |
518 X_4 = fixpoint_mul(v6->z - pIndoorCamera->pos.z, v44) + fixpoint_sub0(v45, v3); | |
519 if ( X_4 < 0x40000 ) | |
0 | 520 return 0; |
871 | 521 v16 = fixpoint_mul(v6->y - pIndoorCamera->pos.y, v4) - fixpoint_mul(v6->x - pIndoorCamera->pos.x, v5); |
522 v17 = fixpoint_mul(v6->z - pIndoorCamera->pos.z, v3) - fixpoint_sub0(v45, v44); | |
0 | 523 } |
524 else | |
525 { | |
619 | 526 if (v6->type & ParticleType_Line) |
0 | 527 { |
871 | 528 //v18 = v6->_x + 6.7553994e15; |
529 //uIDf = (LODWORD(v18) - pIndoorCamera->pos.x) << 16; | |
530 //v19 = v6->_y + 6.7553994e15; | |
531 //v20 = (LODWORD(v19) - pIndoorCamera->pos.y) << 16; | |
532 //v21 = v6->_z + 6.7553994e15; | |
0 | 533 LODWORD(v22) = 0; |
534 HIDWORD(v22) = SLOWORD(pOutdoorCamera->int_fov_rad); | |
871 | 535 auto _var_123 = fixpoint_mul(v6->x - pIndoorCamera->pos.x, v4) + fixpoint_mul(v6->y - pIndoorCamera->pos.y, v5); |
536 //v23 = v22 / _var_123; | |
537 v6->_screenspace_scale = v22 / _var_123; | |
538 //v24 = v6->_screenspace_scale; | |
0 | 539 v6->uScreenSpaceX = pViewport->uScreenCenterX |
871 | 540 - ((signed int)((unsigned __int64)(v6->_screenspace_scale |
541 * (signed __int64)(fixpoint_mul(v6->y - pIndoorCamera->pos.y, v4) | |
542 - fixpoint_mul(v6->x - pIndoorCamera->pos.x, v5))) >> 16) >> 16); | |
543 v6->uScreenSpaceY = pViewport->uScreenCenterY - (fixpoint_mul(v6->z, v6->_screenspace_scale) >> 16); | |
544 v6->sZValue = _var_123; | |
0 | 545 } |
871 | 546 //uIDb = (v41 - pIndoorCamera->pos.x) << 16; |
547 //v48 = (LODWORD(v39) - pIndoorCamera->pos.y) << 16; | |
548 v26 = fixpoint_mul(v6->y - pIndoorCamera->pos.y, v5); | |
549 //v27 = v26 + ((unsigned __int64)(uIDb * (signed __int64)v4) >> 16); | |
550 X_4 = v26 + fixpoint_mul(v6->x - pIndoorCamera->pos.x, v4); | |
551 if ( X_4 < 0x40000 || X_4 > (pOutdoorCamera->uPickDepth - 1000) << 16 ) | |
0 | 552 return 0; |
871 | 553 v17 = v6->z; |
554 v16 = fixpoint_mul(v6->y - pIndoorCamera->pos.y, v4) - fixpoint_mul(v6->x - pIndoorCamera->pos.x, v5); | |
0 | 555 } |
556 v40 = v17; | |
557 v28 = abs(v16); | |
558 if ( abs(X_4) >= v28 ) | |
559 { | |
560 LODWORD(v29) = 0; | |
561 HIDWORD(v29) = SLOWORD(pOutdoorCamera->int_fov_rad); | |
871 | 562 //v30 = v29 / X_4; |
563 v6->_screenspace_scale = v29 / X_4; | |
564 //v31 = v6->_screenspace_scale; | |
0 | 565 v6->uScreenSpaceX = pViewport->uScreenCenterX |
871 | 566 - ((signed int)((unsigned __int64)(v6->_screenspace_scale * (signed __int64)v16) >> 16) >> 16); |
0 | 567 v32 = v6->flt_28; |
871 | 568 v33 = (signed int)((unsigned __int64)(v6->_screenspace_scale * (signed __int64)v40) >> 16) >> 16; |
0 | 569 v34 = pViewport->uScreenCenterY - v33; |
570 v6->uScreenSpaceY = pViewport->uScreenCenterY - v33; | |
571 v35 = v32; | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
572 v6->_screenspace_scale = (unsigned __int64)(_48B561_mess_with_scaling_along_z(/*v34, */v35) * (signed __int64)v6->_screenspace_scale) >> 16; |
0 | 573 v6->sZValue = X_4; |
574 v36 = v6->uScreenSpaceX; | |
693 | 575 if ( v36 >= (signed int)pViewport->uViewportTL_X ) |
0 | 576 { |
693 | 577 if ( v36 < (signed int)pViewport->uViewportBR_X ) |
0 | 578 { |
579 v37 = v6->uScreenSpaceY; | |
693 | 580 if ( v37 >= (signed int)pViewport->uViewportTL_Y ) |
0 | 581 { |
693 | 582 if ( v37 < (signed int)pViewport->uViewportBR_Y ) |
0 | 583 return 1; |
584 } | |
585 } | |
586 } | |
587 } | |
871 | 588 return false; |
0 | 589 } |
590 | |
591 //----- (0048BBA6) -------------------------------------------------------- | |
592 void ParticleEngine::DrawParticles_BLV() | |
593 { | |
594 int v11; // eax@18 | |
595 int v12; // ecx@20 | |
596 int v13; // edx@20 | |
619 | 597 //Particle *v14; // eax@28 |
0 | 598 RenderBillboardTransform_local0 v15; // [sp+Ch] [bp-58h]@1 |
599 | |
600 v15.uParentBillboardID = -1; | |
601 | |
602 for (uint i = uStartParticle; i < uEndParticle; ++i) | |
603 { | |
604 auto p = pParticles + i; | |
605 | |
619 | 606 if (p->type == ParticleType_Invalid) |
0 | 607 continue; |
608 | |
871 | 609 if (!ViewProject_TrueIfStillVisible_BLV(i)) |
0 | 610 continue; |
611 | |
612 if (p->uScreenSpaceX >= pBLVRenderParams->uViewportX && | |
613 p->uScreenSpaceX < pBLVRenderParams->uViewportZ && | |
614 p->uScreenSpaceY >= pBLVRenderParams->uViewportY && | |
615 p->uScreenSpaceY < pBLVRenderParams->uViewportW) | |
616 { | |
617 if (pRenderer->pRenderD3D) | |
618 { | |
619 | 619 if (p->type & ParticleType_Diffuse) |
0 | 620 { |
619 | 621 //v14 = &pParticles[i]; |
622 v15._screenspace_x_scaler_packedfloat = p->_screenspace_scale / 4; | |
623 v15._screenspace_y_scaler_packedfloat = p->_screenspace_scale / 4; | |
624 v15.uScreenSpaceX = p->uScreenSpaceX; | |
625 v15.uScreenSpaceY = p->uScreenSpaceY; | |
626 v15.sZValue = p->sZValue; | |
871 | 627 pRenderer->MakeParticleBillboardAndPush_BLV(&v15, 0, p->uLightColor_bgr, p->angle); |
0 | 628 return; |
629 } | |
619 | 630 if (p->type & ParticleType_Line) |
0 | 631 { |
632 if (pLines.uNumLines < 100) | |
633 { | |
634 pLines.pLineVertices[2 * pLines.uNumLines].pos.x = p->uScreenSpaceX; | |
635 pLines.pLineVertices[2 * pLines.uNumLines].pos.y = p->uScreenSpaceY; | |
636 pLines.pLineVertices[2 * pLines.uNumLines].pos.z = 1.0 - 1.0 / ((short)p->sZValue * 0.061758894); | |
637 pLines.pLineVertices[2 * pLines.uNumLines].rhw = 1.0; | |
871 | 638 pLines.pLineVertices[2 * pLines.uNumLines].diffuse = p->uLightColor_bgr; |
0 | 639 pLines.pLineVertices[2 * pLines.uNumLines].specular = 0; |
640 pLines.pLineVertices[2 * pLines.uNumLines].texcoord.x = 0.0; | |
641 pLines.pLineVertices[2 * pLines.uNumLines].texcoord.y = 0.0; | |
642 | |
643 pLines.pLineVertices[2 * pLines.uNumLines + 1].pos.x = p->uScreenSpaceZ; | |
644 pLines.pLineVertices[2 * pLines.uNumLines + 1].pos.y = p->uScreenSpaceW; | |
645 pLines.pLineVertices[2 * pLines.uNumLines + 1].pos.z = 1.0 - 1.0 / ((short)p->sZValue2 * 0.061758894); | |
646 pLines.pLineVertices[2 * pLines.uNumLines + 1].rhw = 1.0; | |
871 | 647 pLines.pLineVertices[2 * pLines.uNumLines + 1].diffuse = p->uLightColor_bgr; |
0 | 648 pLines.pLineVertices[2 * pLines.uNumLines + 1].specular = 0; |
649 pLines.pLineVertices[2 * pLines.uNumLines + 1].texcoord.x = 0.0; | |
650 pLines.pLineVertices[2 * pLines.uNumLines++ + 1].texcoord.y = 0.0; | |
651 } | |
652 } | |
619 | 653 if (p->type & ParticleType_Bitmap) |
0 | 654 { |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
655 v15._screenspace_x_scaler_packedfloat = p->_screenspace_scale; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
656 v15._screenspace_y_scaler_packedfloat = p->_screenspace_scale; |
0 | 657 v15.uScreenSpaceX = p->uScreenSpaceX; |
658 v15.uScreenSpaceY = p->uScreenSpaceY; | |
659 v15.sZValue = p->sZValue; | |
871 | 660 pRenderer->MakeParticleBillboardAndPush_BLV(&v15, pBitmaps_LOD->pHardwareTextures[p->uTextureID], p->uLightColor_bgr, p->angle); |
0 | 661 } |
619 | 662 if (p->type & ParticleType_Sprite) |
0 | 663 { |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
664 v15._screenspace_x_scaler_packedfloat = p->_screenspace_scale; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
665 v15._screenspace_y_scaler_packedfloat = p->_screenspace_scale; |
0 | 666 v15.uScreenSpaceX = p->uScreenSpaceX; |
667 v15.uScreenSpaceY = p->uScreenSpaceY; | |
668 v15.sZValue = p->sZValue; | |
871 | 669 pRenderer->MakeParticleBillboardAndPush_BLV(&v15, pSprites_LOD->pHardwareSprites[p->uTextureID].pTexture, p->uLightColor_bgr, p->angle); |
0 | 670 } |
671 } | |
672 else | |
673 { | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
64
diff
changeset
|
674 v11 = 13 * p->_screenspace_scale >> 16; |
0 | 675 if ( v11 > 30 ) |
676 v11 = 30; | |
677 v12 = p->uScreenSpaceY - v11; | |
678 v13 = p->uScreenSpaceX - (v11 >> 1); | |
693 | 679 if ( v13 + v11 < (signed int)pViewport->uViewportTL_X |
680 || v13 >= (signed int)pViewport->uViewportBR_X | |
681 || v12 + v11 < (signed int)pViewport->uViewportTL_Y | |
682 || v12 >= (signed int)pViewport->uViewportBR_Y ) | |
0 | 683 { |
684 ; | |
685 } | |
686 else | |
687 { | |
871 | 688 pRenderer->MakeParticleBillboardAndPush_BLV_Software(v13, v12, p->sZValue, p->uLightColor_bgr, v11); |
0 | 689 } |
690 } | |
691 } | |
692 } | |
693 } | |
694 | |
695 //----- (0048BEEF) -------------------------------------------------------- | |
696 void ParticleEngine::DrawParticles_ODM() | |
697 { | |
62 | 698 ParticleEngine *pParticleEngine; // esi@1 |
871 | 699 //int pParticleNum; // eax@1 |
0 | 700 unsigned __int8 v3; // zf@1 |
701 char v4; // sf@1 | |
702 unsigned __int8 v5; // of@1 | |
871 | 703 //char *v7; // edi@2 |
704 //int v8; // eax@6 | |
705 //signed int pNumLines; // eax@8 | |
0 | 706 int v10; // eax@14 |
707 int v11; // ecx@16 | |
708 int v12; // edx@16 | |
871 | 709 //Particle *pParticle; // eax@24 |
62 | 710 RenderBillboardTransform_local0 pBillboard; // [sp+Ch] [bp-58h]@1 |
871 | 711 //int v15; // [sp+5Ch] [bp-8h]@9 |
0 | 712 int v16; // [sp+60h] [bp-4h]@1 |
713 | |
62 | 714 pBillboard.uParentBillboardID = -1; |
715 pParticleEngine = this; | |
716 //v2 = this->uStartParticle; | |
717 //v5 = v2 > this->uEndParticle;// v5 = __OFSUB__(v2, this->uEndParticle); | |
718 //v3 = v2 == this->uEndParticle; | |
719 //v4 = v2 - this->uEndParticle < 0; | |
720 //v16 = this->uStartParticle; | |
871 | 721 for (uint i = uStartParticle; i <= uEndParticle; ++i) |
0 | 722 { |
871 | 723 auto particle = pParticles + i; |
724 if (particle->type == ParticleType_Invalid || !ViewProject_TrueIfStillVisible_ODM(i)) | |
725 continue; | |
726 | |
0 | 727 if ( pRenderer->pRenderD3D ) |
728 { | |
871 | 729 //v8 = *(_DWORD *)(v7 - 82); |
730 if (particle->type & ParticleType_Diffuse) | |
0 | 731 { |
871 | 732 pBillboard._screenspace_x_scaler_packedfloat = particle->_screenspace_scale / 4; |
733 pBillboard._screenspace_y_scaler_packedfloat = particle->_screenspace_scale / 4; | |
734 pBillboard.uScreenSpaceX = particle->uScreenSpaceX; | |
735 pBillboard.uScreenSpaceY = particle->uScreenSpaceY; | |
736 pBillboard.sZValue = particle->sZValue; | |
737 pRenderer->MakeParticleBillboardAndPush_ODM(&pBillboard, 0, particle->uLightColor_bgr, particle->angle); | |
0 | 738 return; |
739 } | |
871 | 740 if (particle->type & ParticleType_Line) |
0 | 741 { |
871 | 742 if (pLines.uNumLines < 100) |
0 | 743 { |
871 | 744 pLines.pLineVertices[2 * pLines.uNumLines].pos.x = particle->uScreenSpaceX; |
745 pLines.pLineVertices[2 * pLines.uNumLines].pos.y = particle->uScreenSpaceY; | |
746 pLines.pLineVertices[2 * pLines.uNumLines].pos.z = 1.0 - 1.0 / ((double)particle->zbuffer_depth * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); | |
747 pLines.pLineVertices[2 * pLines.uNumLines].rhw = 1.0; | |
748 pLines.pLineVertices[2 * pLines.uNumLines].diffuse = particle->uLightColor_bgr; | |
749 pLines.pLineVertices[2 * pLines.uNumLines].specular = 0; | |
750 pLines.pLineVertices[2 * pLines.uNumLines].texcoord.x = 0.0; | |
751 pLines.pLineVertices[2 * pLines.uNumLines].texcoord.y = 0.0; | |
752 | |
753 pLines.pLineVertices[2 * pLines.uNumLines + 1].pos.x = particle->uScreenSpaceZ; | |
754 pLines.pLineVertices[2 * pLines.uNumLines + 1].pos.y = particle->uScreenSpaceW; | |
755 pLines.pLineVertices[2 * pLines.uNumLines + 1].pos.z = 1.0 - 1.0 / ((double)particle->zbuffer_depth * 1000.0 / (double)pOutdoorCamera->shading_dist_mist); | |
756 pLines.pLineVertices[2 * pLines.uNumLines + 1].rhw = 1.0; | |
757 pLines.pLineVertices[2 * pLines.uNumLines + 1].diffuse = particle->uLightColor_bgr; | |
758 pLines.pLineVertices[2 * pLines.uNumLines + 1].specular = 0; | |
759 pLines.pLineVertices[2 * pLines.uNumLines + 1].texcoord.x = 0.0; | |
760 pLines.pLineVertices[2 * pLines.uNumLines + 1].texcoord.y = 0.0; | |
761 pLines.uNumLines++; | |
0 | 762 } |
763 } | |
871 | 764 if (particle->type & ParticleType_Bitmap) |
0 | 765 { |
871 | 766 pBillboard._screenspace_x_scaler_packedfloat = particle->_screenspace_scale; |
767 pBillboard._screenspace_y_scaler_packedfloat = particle->_screenspace_scale; | |
768 pBillboard.uScreenSpaceX = particle->uScreenSpaceX; | |
769 pBillboard.uScreenSpaceY = particle->uScreenSpaceY; | |
770 pBillboard.sZValue = particle->sZValue; | |
771 pRenderer->MakeParticleBillboardAndPush_ODM(&pBillboard, pBitmaps_LOD->pHardwareTextures[particle->uTextureID], particle->uLightColor_bgr, particle->angle); | |
0 | 772 } |
871 | 773 if (particle->type & ParticleType_Sprite) |
0 | 774 { |
871 | 775 pBillboard._screenspace_x_scaler_packedfloat = particle->_screenspace_scale; |
776 pBillboard._screenspace_y_scaler_packedfloat = particle->_screenspace_scale; | |
777 pBillboard.uScreenSpaceX = particle->uScreenSpaceX; | |
778 pBillboard.uScreenSpaceY = particle->uScreenSpaceY; | |
779 pBillboard.sZValue = particle->sZValue; | |
780 pRenderer->MakeParticleBillboardAndPush_ODM(&pBillboard, pSprites_LOD->pHardwareSprites[particle->uTextureID].pTexture, particle->uLightColor_bgr, particle->angle); | |
0 | 781 } |
782 } | |
783 else | |
784 { | |
871 | 785 v10 = 13 * particle->_screenspace_scale >> 16; |
0 | 786 if ( v10 > 30 ) |
787 v10 = 30; | |
871 | 788 v11 = particle->uScreenSpaceX - (v10 >> 1); |
789 v12 = particle->uScreenSpaceY - v10; | |
693 | 790 if ( v11 + v10 < pViewport->uViewportTL_X |
791 || v11 >= pViewport->uViewportBR_X | |
871 | 792 || particle->uScreenSpaceY < pViewport->uViewportTL_Y |
693 | 793 || v12 >= (signed int)pViewport->uViewportBR_Y ) |
0 | 794 { |
795 ; | |
796 } | |
797 else | |
798 { | |
871 | 799 pRenderer->MakeParticleBillboardAndPush_BLV_Software(v11, v12, particle->sZValue, particle->uLightColor_bgr, v10); |
0 | 800 } |
871 | 801 } |
0 | 802 } |
803 } |