annotate ParticleEngine.cpp @ 165:572d821561f3

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