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