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