0
|
1 #include "stru6.h"
|
|
2 #include "LayingItem.h"
|
|
3 #include "IndoorCameraD3D.h"
|
|
4 #include "ParticleEngine.h"
|
|
5 #include "Game.h"
|
|
6 #include "LOD.h"
|
|
7 #include "Sprites.h"
|
|
8 #include "DecalBuilder.h"
|
|
9 #include "ObjectList.h"
|
|
10 #include "Actor.h"
|
|
11 #include "Random.h"
|
|
12 #include "Spells.h"
|
|
13 #include "IconFrameTable.h"
|
|
14 #include "Time.h"
|
|
15 #include "Viewport.h"
|
|
16 #include "PaletteManager.h"
|
|
17 #include "Overlays.h"
|
|
18 #include "stru160.h"
|
|
19
|
|
20
|
|
21
|
|
22
|
|
23
|
|
24
|
|
25 //----- (00478211) --------------------------------------------------------
|
|
26 void stru6_stru1_indoor_sw_billboard::Initialize(int a2)
|
|
27 {
|
|
28 uNumVec4sInArray1 = 66;
|
|
29 pArray1 = new stru16x[66];
|
|
30
|
|
31 uNumVec3sInArray2 = 128;
|
|
32 pArray2 = new stru160[128];
|
|
33
|
|
34 for (uint i = 0; i < uNumVec4sInArray1; ++i)
|
|
35 {
|
|
36 pArray1[i].field_0 = array_4EB8B8[i].field_0;
|
|
37 pArray1[i].field_4 = array_4EB8B8[i].field_4;
|
|
38 pArray1[i].field_8 = array_4EB8B8[i].field_8;
|
|
39 pArray1[i].field_C = a2;
|
|
40 }
|
|
41 memcpy(pArray2, array_4EBBD0_x/*array_4EBBD0*/, uNumVec3sInArray2 * sizeof(stru160));
|
|
42 }
|
|
43
|
|
44 //----- (0047829F) --------------------------------------------------------
|
|
45 void stru6_stru1_indoor_sw_billboard::_47829F_fireball_collision(float arg0, float a3, float a4, float a5, int a2)
|
|
46 {
|
|
47 stru6_stru1_indoor_sw_billboard *v6; // esi@1
|
|
48 int v7; // edi@1
|
|
49 char *v8; // eax@2
|
|
50 signed int v9; // ecx@2
|
|
51 int v10; // edx@3
|
|
52 signed int i; // [sp+8h] [bp-4h]@1
|
|
53
|
|
54 auto a1 = this;
|
|
55
|
|
56 v6 = a1;
|
|
57 v7 = 0;
|
|
58 for ( i = 0; i < (signed int)v6->uNumVec3sInArray2; ++i )
|
|
59 {
|
|
60 v8 = (char *)&v6->field_14[1];
|
|
61 v9 = 3;
|
|
62 do
|
|
63 {
|
|
64 *((float *)v8 - 1) = a5 * *(&v6->pArray1->field_0 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + arg0;
|
|
65 *(float *)v8 = a5 * *(&v6->pArray1->field_4 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + a3;
|
|
66 v8 += 16;
|
|
67 *((float *)v8 - 3) = a5 * *(&v6->pArray1->field_8 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + a4;
|
|
68 v10 = *(int *)((char *)&v6->pArray2->field_0 + v7);
|
|
69 v7 += 4;
|
|
70 --v9;
|
|
71 *((int *)v8 - 2) = *((int *)&v6->pArray1[1].field_0 + 4 * v10);
|
|
72 }
|
|
73 while ( v9 );
|
|
74 v6->field_10 = 3;
|
|
75 if ( v6->sub_477C61() && v6->sub_477F63() )
|
|
76 {
|
|
77 if ( v6->sub_47802A() )
|
|
78 pRenderer->_4A4CC9(v6, a2);
|
|
79 }
|
|
80 }
|
|
81 }
|
|
82
|
|
83
|
|
84
|
|
85
|
|
86 //----- (004A71FE) --------------------------------------------------------
|
|
87 void stru6::DoAddProjectile(float srcX, float srcY, float srcZ, float dstX, float dstY, float dstZ, unsigned int uTextureID)
|
|
88 {
|
|
89 int v8; // eax@1
|
|
90
|
45
|
91 v8 = uNumProjectiles;
|
0
|
92 if ( v8 != 32 )
|
|
93 {
|
45
|
94 pProjectiles[v8].srcX = srcX;
|
|
95 *((float *)&this->array_0[0].uSpellAnimLength + 7 * (uNumProjectiles + 21)) = srcY;
|
|
96 pProjectiles[uNumProjectiles].srcZ = srcZ;
|
|
97 pProjectiles[uNumProjectiles].dstX = dstX;
|
|
98 pProjectiles[uNumProjectiles].dstY = dstY;
|
|
99 pProjectiles[uNumProjectiles].dstZ = dstZ;
|
|
100 pProjectiles[uNumProjectiles++].uTextureID = uTextureID;
|
0
|
101 }
|
|
102 }
|
|
103
|
|
104 //----- (004A7298) --------------------------------------------------------
|
45
|
105 void stru6::DrawProjectiles()
|
0
|
106 {
|
|
107 float v10; // ST1C_4@8
|
|
108 float v11; // ST0C_4@8
|
|
109 IDirect3DTexture2 *v12; // [sp+20h] [bp-78h]@6
|
45
|
110 RenderVertexSoft v[2]; // [sp+30h] [bp-68h]@1
|
|
111
|
|
112 for (uint i = 0; i < uNumProjectiles; ++i)
|
0
|
113 {
|
45
|
114 auto p = pProjectiles + i;
|
|
115
|
|
116 v[0].vWorldPosition.x = p->srcX;
|
|
117 v[0].vWorldPosition.y = p->srcY;
|
|
118 v[0].vWorldPosition.z = p->srcZ;
|
|
119 v[1].vWorldPosition.x = p->dstX;
|
|
120 v[1].vWorldPosition.y = p->dstY;
|
|
121 v[1].vWorldPosition.z = p->dstZ;
|
|
122 pGame->pIndoorCameraD3D->ViewTransform(v, 2);
|
|
123
|
|
124 sr_42620A(v);
|
|
125
|
59
|
126 pGame->pIndoorCameraD3D->Project(v, 2, 0);
|
45
|
127
|
|
128 if (p->uTextureID != -1)
|
|
129 v12 = pBitmaps_LOD->pHardwareTextures[p->uTextureID];
|
|
130 else
|
|
131 v12 = 0;
|
|
132
|
59
|
133 v10 = pGame->pIndoorCameraD3D->fov_x / v[1].vWorldViewPosition.x * 20.0;
|
|
134 v11 = pGame->pIndoorCameraD3D->fov_x / v[0].vWorldViewPosition.x * 20.0;
|
45
|
135 pRenderer->DrawProjectile(
|
|
136 v[0].vWorldViewProjX,
|
|
137 v[0].vWorldViewProjY,
|
|
138 v[0].vWorldViewPosition.x,
|
|
139 v11,
|
|
140 v[1].vWorldViewProjX,
|
|
141 v[1].vWorldViewProjY,
|
|
142 v[1].vWorldViewPosition.x,
|
|
143 v10,
|
|
144 v12);
|
|
145 }
|
0
|
146 }
|
|
147
|
|
148 //----- (004A73AA) --------------------------------------------------------
|
|
149 void stru6::_4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(LayingItem *a2, unsigned int uDiffuse, unsigned int uTextureID)
|
|
150 {
|
|
151 stru6 *v4; // edi@1
|
|
152 LayingItem *v5; // esi@1
|
|
153 int v6; // eax@1
|
|
154 stru6_stru2 *v7; // eax@2
|
|
155 double v8; // st7@2
|
|
156 double v9; // st6@2
|
|
157 double v10; // st7@3
|
|
158 Particle_ local_0; // [sp+8h] [bp-68h]@1
|
|
159 float x; // [sp+78h] [bp+8h]@2
|
|
160
|
|
161 v4 = this;
|
|
162 memset(&local_0, 0, 0x68u);
|
|
163 v5 = a2;
|
|
164 v6 = a2->field_54;
|
|
165 if ( v6 )
|
|
166 {
|
|
167 v7 = &v4->array_0[v6 & 0x1F];
|
|
168 x = ((double)a2->vPosition.x - v7->flt_4) * 0.5 + v7->flt_4;
|
|
169 v8 = ((double)v5->vPosition.y - v7->flt_8) * 0.5 + v7->flt_8;
|
|
170 v9 = ((double)v5->vPosition.z - v7->flt_C) * 0.5 + v7->flt_C;
|
|
171 local_0.bFree = 1036;
|
|
172 local_0.uDiffuse = uDiffuse;
|
|
173 local_0.x = x + 4.0;
|
|
174 local_0.y = v8;
|
|
175 local_0.z = v9;
|
|
176 local_0.flt_10 = 0.0;
|
|
177 local_0.flt_14 = 0.0;
|
|
178 local_0.flt_18 = 0.0;
|
45
|
179 local_0.timeToLive = (rand() & 0x40) + 96;
|
0
|
180 local_0.uTextureID = uTextureID;
|
|
181 local_0.flt_28 = 1.0;
|
|
182 pGame->pParticleEngine->AddParticle(&local_0);
|
|
183 local_0.x = x - 4.0;
|
|
184 pGame->pParticleEngine->AddParticle(&local_0);
|
|
185 local_0.x = (double)v5->vPosition.x + 4.0;
|
|
186 local_0.y = (double)v5->vPosition.y;
|
|
187 local_0.z = (double)v5->vPosition.z;
|
|
188 pGame->pParticleEngine->AddParticle(&local_0);
|
|
189 local_0.x = (double)v5->vPosition.x - 4.0;
|
|
190 pGame->pParticleEngine->AddParticle(&local_0);
|
|
191 v4->array_0[v5->field_54 & 0x1F].flt_4 = (double)v5->vPosition.x;
|
|
192 v4->array_0[v5->field_54 & 0x1F].flt_8 = (double)v5->vPosition.y;
|
|
193 v4->array_0[v5->field_54 & 0x1F].flt_C = (double)v5->vPosition.z;
|
|
194 }
|
|
195 else
|
|
196 {
|
|
197 a2->field_54 = v4->array_0[0].uSpellAnimLength++;
|
|
198 v4->array_0[a2->field_54 & 0x1F].flt_4 = (double)a2->vPosition.x;
|
|
199 v4->array_0[a2->field_54 & 0x1F].flt_8 = (double)a2->vPosition.y;
|
|
200 v4->array_0[a2->field_54 & 0x1F].flt_C = (double)a2->vPosition.z;
|
|
201 v10 = (double)a2->vPosition.x;
|
|
202 local_0.bFree = 1036;
|
|
203 local_0.uDiffuse = uDiffuse;
|
|
204 local_0.x = v10 + 4.0;
|
|
205 local_0.y = (double)a2->vPosition.y;
|
|
206 local_0.z = (double)a2->vPosition.z;
|
|
207 local_0.flt_10 = 0.0;
|
|
208 local_0.flt_14 = 0.0;
|
|
209 local_0.flt_18 = 0.0;
|
|
210 local_0.flt_28 = 1.0;
|
45
|
211 local_0.timeToLive = (rand() & 0x7F) + 128;
|
0
|
212 local_0.uTextureID = uTextureID;
|
|
213 pGame->pParticleEngine->AddParticle(&local_0);
|
|
214 local_0.x = (double)a2->vPosition.x - 4.0;
|
|
215 pGame->pParticleEngine->AddParticle(&local_0);
|
|
216 }
|
|
217 }
|
|
218
|
|
219 //----- (004A75CC) --------------------------------------------------------
|
|
220 void stru6::_4A75CC_single_spell_collision_particle(LayingItem *a1, unsigned int uDiffuse, unsigned int uTextureID)
|
|
221 {
|
|
222 double v4; // st7@1
|
|
223 signed int v5; // edi@1
|
|
224 Particle_ local_0; // [sp+8h] [bp-68h]@1
|
|
225
|
|
226 memset(&local_0, 0, 0x68u);
|
|
227 local_0.bFree = 1029;
|
|
228 local_0.x = (double)a1->vPosition.x;
|
|
229 local_0.y = (double)a1->vPosition.y;
|
|
230 v4 = (double)a1->vPosition.z;
|
|
231 local_0.uDiffuse = uDiffuse;
|
|
232 local_0.z = v4;
|
|
233 v5 = 10;
|
45
|
234 local_0.timeToLive = (rand() & 0x7F) + 128;
|
0
|
235 local_0.uTextureID = uTextureID;
|
|
236 local_0.flt_28 = 1.0;
|
|
237 do
|
|
238 {
|
|
239 local_0.flt_10 = (double)(rand() & 0x1FF) - 255.0;
|
|
240 local_0.flt_14 = (double)(rand() & 0x1FF) - 255.0;
|
|
241 local_0.flt_18 = (double)(rand() & 0x1FF) - 255.0;
|
|
242 pGame->pParticleEngine->AddParticle(&local_0);
|
|
243 --v5;
|
|
244 }
|
|
245 while ( v5 );
|
|
246 }
|
|
247
|
|
248 //----- (004A7688) --------------------------------------------------------
|
|
249 void stru6::_4A7688_fireball_collision_particle(LayingItem *a2)
|
|
250 {
|
|
251 LayingItem *v2; // esi@1
|
|
252 double v3; // st7@1
|
|
253 double v4; // st7@2
|
|
254 double v5; // st7@4
|
|
255 int v6; // eax@6
|
|
256 float v7; // ST0C_4@6
|
|
257 float v8; // ST08_4@6
|
|
258 float v9; // ST04_4@6
|
|
259 float v10; // ST00_4@6
|
|
260 Particle_ local_0; // [sp+1Ch] [bp-7Ch]@1
|
|
261 stru6 *v12; // [sp+84h] [bp-14h]@1
|
|
262 float v13; // [sp+88h] [bp-10h]@1
|
|
263 double v14; // [sp+8Ch] [bp-Ch]@5
|
|
264 float v15; // [sp+94h] [bp-4h]@4
|
|
265 signed int i; // [sp+A0h] [bp+8h]@4
|
|
266 signed int a2b; // [sp+A0h] [bp+8h]@6
|
|
267
|
|
268 v12 = this;
|
|
269 memset(&local_0, 0, 0x68u);
|
|
270 v2 = a2;
|
|
271 v3 = (double)a2->uSpriteFrameID / (double)pObjectList->pObjects[a2->uObjectDescID].uLifetime;
|
|
272 v13 = 512.0 * v3;
|
|
273 if ( v3 >= 0.75 )
|
|
274 v4 = (1.0 - v3) * 4.0;
|
|
275 else
|
|
276 v4 = v3 * 1.333333333333333;
|
|
277 v15 = v4;
|
|
278 v5 = (double)a2->vPosition.x;
|
|
279 local_0.bFree = 1029;
|
|
280 local_0.uDiffuse = 0xFF3C1Eu;
|
|
281 local_0.x = v5;
|
|
282 local_0.y = (double)a2->vPosition.y;
|
|
283 local_0.z = (double)a2->vPosition.z;
|
45
|
284 local_0.timeToLive = (rand() & 0x7F) + 128;
|
0
|
285 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
|
|
286 i = 10;
|
|
287 local_0.flt_28 = 1.0;
|
|
288 do
|
|
289 {
|
|
290 HIDWORD(v14) = rand() & 0x1FF;
|
|
291 local_0.flt_10 = (double)SHIDWORD(v14) - 255.0;
|
|
292 HIDWORD(v14) = rand() & 0x1FF;
|
|
293 local_0.flt_14 = (double)SHIDWORD(v14) - 255.0;
|
|
294 WORD2(v14) = rand() & 0x1FF;
|
|
295 HIDWORD(v14) = WORD2(v14);
|
|
296 local_0.flt_18 = (double)WORD2(v14) - 255.0;
|
|
297 pGame->pParticleEngine->AddParticle(&local_0);
|
|
298 --i;
|
|
299 }
|
|
300 while ( i );
|
|
301 v14 = v13 + 6.7553994e15;
|
|
302 a2b = LODWORD(v14);
|
|
303 v6 = sub_4A7063(0xFF3C1Eu, v15);
|
|
304 v7 = (double)a2b;
|
|
305 v8 = (double)v2->vPosition.z;
|
|
306 v9 = (double)v2->vPosition.y;
|
|
307 v10 = (double)v2->vPosition.x;
|
|
308 v12->pStru1->_47829F_fireball_collision(v10, v9, v8, v7, v6);
|
|
309 }
|
|
310
|
|
311 //----- (004A77FD) --------------------------------------------------------
|
|
312 void stru6::_4A77FD_some_stuff_d3d(LayingItem *a1)
|
|
313 {
|
|
314 LayingItem *v2; // esi@1
|
|
315 stru6 *v3; // edi@1
|
|
316 double v4; // st7@1
|
|
317 double v5; // st7@2
|
|
318 double v6; // ST1C_8@4
|
|
319 int v7; // eax@4
|
|
320 float v8; // ST0C_4@4
|
|
321 float v9; // ST08_4@4
|
|
322 float v10; // ST04_4@4
|
|
323 float v11; // ST00_4@4
|
|
324 float v12; // [sp+28h] [bp-4h]@1
|
|
325 float a1a; // [sp+34h] [bp+8h]@4
|
|
326
|
|
327 v2 = a1;
|
|
328 v3 = this;
|
|
329 v4 = (double)a1->uSpriteFrameID / (double)pObjectList->pObjects[a1->uObjectDescID].uLifetime;
|
|
330 v12 = 512.0 - v4 * 512.0;
|
|
331 if ( v4 >= 0.75 )
|
|
332 v5 = v4 * 4.0;
|
|
333 else
|
|
334 v5 = v4 * 1.333333333333333;
|
|
335 a1a = v5;
|
|
336 v6 = v12 + 6.7553994e15;
|
|
337 v7 = sub_4A7063(0x7E7E7Eu, a1a);
|
|
338 v8 = (double)SLODWORD(v6);
|
|
339 v9 = (double)v2->vPosition.z;
|
|
340 v10 = (double)v2->vPosition.y;
|
|
341 v11 = (double)v2->vPosition.x;
|
|
342 v3->pStru1->_47829F_fireball_collision(v11, v10, v9, v8, v7);
|
|
343 }
|
|
344
|
|
345 //----- (004A78AE) --------------------------------------------------------
|
|
346 void stru6::_4A78AE_sparks_spell(LayingItem *a1)
|
|
347 {
|
|
348 ObjectDesc *v2; // esi@1
|
|
349 unsigned int v3; // eax@1
|
|
350 double v4; // st7@1
|
|
351 Particle_ local_0; // [sp+8h] [bp-68h]@1
|
|
352
|
|
353 v2 = &pObjectList->pObjects[a1->uObjectDescID];
|
|
354 memset(&local_0, 0, 0x68u);
|
|
355 v3 = a1->uSpriteFrameID;
|
|
356 local_0.x = (double)a1->vPosition.x;
|
|
357 v4 = (double)a1->vPosition.y;
|
|
358 local_0.bFree = 2048;
|
|
359 local_0.uDiffuse = 0x7F7F7Fu;
|
45
|
360 local_0.timeToLive = 1;
|
0
|
361 local_0.y = v4;
|
|
362 local_0.z = (double)a1->vPosition.z;
|
|
363 local_0.flt_10 = 0.0;
|
|
364 local_0.flt_14 = 0.0;
|
|
365 local_0.flt_18 = 0.0;
|
|
366 local_0.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0];
|
|
367 LODWORD(local_0.flt_28) = 0x40000000u;
|
|
368 pGame->pParticleEngine->AddParticle(&local_0);
|
|
369 }
|
|
370
|
|
371 //----- (004A7948) --------------------------------------------------------
|
|
372 void stru6::_4A7948_mind_blast_after_effect(LayingItem *a1)
|
|
373 {
|
|
374 ObjectDesc *v2; // esi@1
|
|
375 unsigned int v3; // eax@1
|
|
376 double v4; // st7@1
|
|
377 char v5; // al@1
|
|
378 signed int v6; // edi@1
|
|
379 Particle_ Dst; // [sp+8h] [bp-68h]@1
|
|
380
|
|
381 v2 = &pObjectList->pObjects[a1->uObjectDescID];
|
|
382 memset(&Dst, 0, 0x68u);
|
|
383 v3 = a1->uSpriteFrameID;
|
|
384 Dst.x = (double)a1->vPosition.x;
|
|
385 v4 = (double)a1->vPosition.y;
|
|
386 Dst.bFree = 2053;
|
|
387 Dst.uDiffuse = 0x7F7F7Fu;
|
|
388 Dst.y = v4;
|
|
389 Dst.z = (double)a1->vPosition.z;
|
|
390 Dst.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0];
|
|
391 v5 = rand();
|
|
392 v6 = 10;
|
|
393 Dst.flt_28 = 1.0;
|
45
|
394 Dst.timeToLive = (v5 & 0x7F) + 128;
|
0
|
395 do
|
|
396 {
|
|
397 Dst.flt_10 = (double)(rand() & 0x1FF) - 255.0;
|
|
398 Dst.flt_14 = (double)(rand() & 0x1FF) - 255.0;
|
|
399 Dst.flt_18 = (double)(rand() & 0x1FF) - 255.0;
|
|
400 pGame->pParticleEngine->AddParticle(&Dst);
|
|
401 --v6;
|
|
402 }
|
|
403 while ( v6 );
|
|
404 }
|
|
405
|
|
406 //----- (004A7A27) --------------------------------------------------------
|
|
407 bool stru6::AddMobileLight(LayingItem *a1, unsigned int uDiffuse, int uRadius)
|
|
408 {
|
|
409 return pMobileLightsStack->AddLight(
|
|
410 a1->vPosition.x,
|
|
411 a1->vPosition.y,
|
|
412 a1->vPosition.z,
|
|
413 a1->uSectorID,
|
|
414 uRadius,
|
59
|
415 (uDiffuse & 0x00FF0000) >> 16,
|
|
416 (uDiffuse & 0x0000FF00) >> 8,
|
|
417 uDiffuse & 0x000000FF,
|
|
418 byte_4E94D3);
|
0
|
419 }
|
|
420 // 4E94D3: using guessed type char byte_4E94D3;
|
|
421
|
|
422 //----- (004A7A66) --------------------------------------------------------
|
|
423 void stru6::_4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(LayingItem *a1, unsigned int uDiffuse, unsigned int uTextureID, float a4)
|
|
424 {
|
|
425 int v5; // eax@1
|
|
426 char v6; // al@1
|
|
427 double v7; // st6@1
|
|
428 double v8; // st6@1
|
|
429 double v9; // st7@1
|
|
430 double v10; // st6@1
|
|
431 Particle_ local_0; // [sp+0h] [bp-6Ch]@1
|
|
432 float v12; // [sp+68h] [bp-4h]@1
|
|
433 float a1a; // [sp+74h] [bp+8h]@1
|
|
434 float uDiffusea; // [sp+78h] [bp+Ch]@1
|
|
435 float uTextureIDa; // [sp+7Ch] [bp+10h]@1
|
|
436
|
|
437 memset(&local_0, 0, 0x68u);
|
|
438 local_0.bFree = 1029;
|
|
439 local_0.x = (double)a1->vPosition.x;
|
|
440 v5 = a1->vPosition.z;
|
|
441 local_0.y = (double)a1->vPosition.y;
|
|
442 local_0.uDiffuse = uDiffuse;
|
|
443 local_0.z = (double)(v5 + 32);
|
|
444 v6 = rand();
|
|
445 local_0.flt_28 = 1.0;
|
|
446 v7 = 0.0 * a4;
|
45
|
447 local_0.timeToLive = (v6 & 0x7F) + 128;
|
0
|
448 local_0.uTextureID = uTextureID;
|
|
449 a1a = v7;
|
|
450 local_0.flt_10 = v7;
|
|
451 local_0.flt_14 = a4;
|
|
452 local_0.flt_18 = a4;
|
|
453 pGame->pParticleEngine->AddParticle(&local_0);
|
|
454 v8 = 0.70710677 * a4;
|
|
455 uDiffusea = v8;
|
|
456 local_0.flt_10 = v8;
|
|
457 local_0.flt_14 = v8;
|
|
458 local_0.flt_18 = a4;
|
|
459 pGame->pParticleEngine->AddParticle(&local_0);
|
|
460 local_0.flt_14 = a1a;
|
|
461 local_0.flt_10 = a4;
|
|
462 local_0.flt_18 = a4;
|
|
463 pGame->pParticleEngine->AddParticle(&local_0);
|
|
464 local_0.flt_10 = uDiffusea;
|
|
465 local_0.flt_18 = a4;
|
|
466 v9 = -uDiffusea;
|
|
467 uTextureIDa = v9;
|
|
468 local_0.flt_14 = v9;
|
|
469 pGame->pParticleEngine->AddParticle(&local_0);
|
|
470 v10 = -1.0 * a4;
|
|
471 local_0.flt_10 = a1a;
|
|
472 v12 = v10;
|
|
473 local_0.flt_14 = v10;
|
|
474 local_0.flt_18 = a4;
|
|
475 pGame->pParticleEngine->AddParticle(&local_0);
|
|
476 local_0.flt_18 = a4;
|
|
477 local_0.flt_10 = uTextureIDa;
|
|
478 local_0.flt_14 = uTextureIDa;
|
|
479 pGame->pParticleEngine->AddParticle(&local_0);
|
|
480 local_0.flt_10 = v12;
|
|
481 local_0.flt_14 = a1a;
|
|
482 local_0.flt_18 = a4;
|
|
483 pGame->pParticleEngine->AddParticle(&local_0);
|
|
484 local_0.flt_10 = uTextureIDa;
|
|
485 local_0.flt_14 = uDiffusea;
|
|
486 local_0.flt_18 = a4;
|
|
487 pGame->pParticleEngine->AddParticle(&local_0);
|
|
488 }
|
|
489
|
|
490 //----- (004A7C07) --------------------------------------------------------
|
|
491 void stru6::_4A7C07(LayingItem *a2)
|
|
492 {
|
|
493 stru6 *v2; // edi@1
|
|
494 LayingItem *v3; // esi@1
|
|
495 int v4; // eax@1
|
|
496 ObjectDesc *v5; // ebx@1
|
|
497 stru6_stru2 *v6; // eax@2
|
|
498 double v7; // st6@2
|
|
499 double v8; // st5@2
|
|
500 double v9; // st4@2
|
|
501 char v10; // al@2
|
|
502 double v11; // st7@2
|
|
503 double v12; // st7@3
|
|
504 Particle_ local_0; // [sp+Ch] [bp-68h]@1
|
|
505 float a2a; // [sp+7Ch] [bp+8h]@2
|
|
506
|
|
507 v2 = this;
|
|
508 memset(&local_0, 0, 0x68u);
|
|
509 v3 = a2;
|
|
510 v4 = a2->field_54;
|
|
511 v5 = &pObjectList->pObjects[a2->uObjectDescID];
|
|
512 if ( v4 )
|
|
513 {
|
|
514 v6 = &v2->array_0[v4 & 0x1F];
|
|
515 v7 = ((double)a2->vPosition.x - v6->flt_4) * 0.5 + v6->flt_4;
|
|
516 v8 = ((double)a2->vPosition.y - v6->flt_8) * 0.5 + v6->flt_8;
|
|
517 v9 = ((double)a2->vPosition.z - v6->flt_C) * 0.5 + v6->flt_C;
|
|
518 local_0.bFree = 2048;
|
|
519 local_0.uDiffuse = 0xFFFFFFu;
|
|
520 a2a = v9;
|
|
521 local_0.x = v7;
|
|
522 local_0.z = a2a;
|
|
523 local_0.y = v8;
|
|
524 local_0.flt_10 = 0.0;
|
|
525 local_0.flt_14 = 0.0;
|
|
526 local_0.flt_18 = 0.0;
|
|
527 v10 = rand();
|
|
528 LODWORD(local_0.flt_28) = 0x40400000u;
|
45
|
529 local_0.timeToLive = (v10 & 0x3F) + 64;
|
0
|
530 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, v3->uSpriteFrameID)->pHwSpriteIDs[0];
|
|
531 pGame->pParticleEngine->AddParticle(&local_0);
|
|
532 v11 = (double)v3->vPosition.x;
|
|
533 LODWORD(local_0.flt_28) = 0x40800000u;
|
|
534 local_0.x = v11;
|
|
535 local_0.y = (double)v3->vPosition.y;
|
|
536 local_0.z = (double)v3->vPosition.z;
|
45
|
537 local_0.timeToLive = (rand() & 0x3F) + 64;
|
0
|
538 pGame->pParticleEngine->AddParticle(&local_0);
|
|
539 v2->array_0[v3->field_54 & 0x1F].flt_4 = (double)v3->vPosition.x;
|
|
540 v2->array_0[v3->field_54 & 0x1F].flt_8 = (double)v3->vPosition.y;
|
|
541 v2->array_0[v3->field_54 & 0x1F].flt_C = (double)v3->vPosition.z;
|
|
542 }
|
|
543 else
|
|
544 {
|
|
545 a2->field_54 = v2->array_0[0].uSpellAnimLength++;
|
|
546 v2->array_0[a2->field_54 & 0x1F].flt_4 = (double)a2->vPosition.x;
|
|
547 v2->array_0[a2->field_54 & 0x1F].flt_8 = (double)a2->vPosition.y;
|
|
548 v2->array_0[a2->field_54 & 0x1F].flt_C = (double)a2->vPosition.z;
|
|
549 v12 = (double)a2->vPosition.x;
|
|
550 local_0.bFree = 2048;
|
|
551 local_0.uDiffuse = 0xFFFFFFu;
|
|
552 LODWORD(local_0.flt_28) = 0x40000000u;
|
|
553 local_0.x = v12;
|
|
554 local_0.y = (double)a2->vPosition.y;
|
|
555 local_0.z = (double)a2->vPosition.z;
|
|
556 local_0.flt_10 = 0.0;
|
|
557 local_0.flt_14 = 0.0;
|
|
558 local_0.flt_18 = 0.0;
|
45
|
559 local_0.timeToLive = (rand() & 0x3F) + 64;
|
0
|
560 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0];
|
|
561 pGame->pParticleEngine->AddParticle(&local_0);
|
|
562 }
|
|
563 }
|
|
564
|
|
565 //----- (004A7E05) --------------------------------------------------------
|
|
566 void stru6::AddProjectile(LayingItem *a2, int a3, unsigned int uTextureID)
|
|
567 {
|
|
568 int v4; // edx@1
|
|
569 float v5; // ST14_4@2
|
|
570 float v6; // ST10_4@2
|
|
571 float v7; // ST0C_4@2
|
|
572
|
|
573 v4 = a2->field_54;
|
|
574 if ( v4 )
|
|
575 {
|
|
576 v5 = (double)a2->vPosition.z;
|
|
577 v6 = (double)a2->vPosition.y;
|
|
578 v7 = (double)a2->vPosition.x;
|
|
579 DoAddProjectile(
|
|
580 this->array_0[v4 & 0x1F].flt_4,
|
|
581 this->array_0[v4 & 0x1F].flt_8,
|
|
582 this->array_0[v4 & 0x1F].flt_C,
|
|
583 v7,
|
|
584 v6,
|
|
585 v5,
|
|
586 uTextureID);
|
|
587 }
|
|
588 else
|
|
589 {
|
|
590 a2->field_54 = this->array_0[0].uSpellAnimLength++;
|
|
591 this->array_0[a2->field_54 & 0x1F].flt_4 = (double)a2->vPosition.x;
|
|
592 this->array_0[a2->field_54 & 0x1F].flt_8 = (double)a2->vPosition.y;
|
|
593 this->array_0[a2->field_54 & 0x1F].flt_C = (double)a2->vPosition.z;
|
|
594 }
|
|
595 }
|
|
596
|
|
597 //----- (004A7E89) --------------------------------------------------------
|
|
598 int stru6::_4A7E89_sparkles_on_actor_after_it_casts_buff(Actor *pActor, unsigned int uDiffuse)
|
|
599 {
|
|
600 Actor *v3; // edi@1
|
|
601 int v4; // ebx@3
|
|
602 int result; // eax@5
|
|
603 Particle_ Dst; // [sp+Ch] [bp-6Ch]@1
|
|
604 int v7; // [sp+74h] [bp-4h]@2
|
|
605 signed int pActora; // [sp+80h] [bp+8h]@1
|
|
606
|
|
607 memset(&Dst, 0, 0x68u);
|
|
608 Dst.bFree = 1036;
|
45
|
609 Dst.timeToLive = (rand() & 0x7F) + 128;
|
0
|
610 v3 = pActor;
|
|
611 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT);
|
|
612 pActora = 50;
|
|
613 Dst.flt_28 = 1.0;
|
|
614 do
|
|
615 {
|
|
616 v7 = (unsigned __int8)rand() + v3->vPosition.x - 127;
|
|
617 Dst.x = (double)v7;
|
|
618 v7 = (unsigned __int8)rand() + v3->vPosition.y - 127;
|
|
619 Dst.y = (double)v7;
|
|
620 v7 = v3->vPosition.z + (unsigned __int8)rand();
|
|
621 Dst.z = (double)v7;
|
|
622 if ( uDiffuse )
|
|
623 {
|
|
624 Dst.uDiffuse = uDiffuse;
|
|
625 }
|
|
626 else
|
|
627 {
|
|
628 v4 = rand() << 16;
|
|
629 Dst.uDiffuse = rand() | v4;
|
|
630 }
|
|
631 pGame->pParticleEngine->AddParticle(&Dst);
|
|
632 --pActora;
|
|
633 }
|
|
634 while ( pActora );
|
|
635 return result;
|
|
636 }
|
|
637
|
|
638 //----- (004A7F74) --------------------------------------------------------
|
|
639 void stru6::_4A7F74(int x, int y, int z)
|
|
640 {
|
|
641 stru6 *v4; // esi@1
|
|
642 char v5; // al@1
|
|
643 signed int v6; // edi@1
|
|
644 unsigned int v7; // eax@1
|
|
645 double v8; // st7@2
|
|
646 double v9; // st7@2
|
|
647 Particle_ local_0; // [sp+8h] [bp-78h]@1
|
|
648 double v11; // [sp+70h] [bp-10h]@1
|
|
649 double v12; // [sp+78h] [bp-8h]@1
|
|
650 float z1; // [sp+88h] [bp+8h]@2
|
|
651
|
|
652 v4 = this;
|
|
653 memset(&local_0, 0, 0x68u);
|
|
654 local_0.bFree = 1029;
|
|
655 local_0.uDiffuse = 0x7E7E7Eu;
|
|
656 v5 = rand();
|
|
657 local_0.flt_28 = 1.0;
|
|
658 v6 = 8;
|
45
|
659 local_0.timeToLive = (v5 & 0x7F) + 128;
|
0
|
660 v7 = v4->uTextureID_effpar1;
|
|
661 v12 = (double)x;
|
|
662 local_0.uTextureID = v7;
|
|
663 v11 = (double)y;
|
|
664 do
|
|
665 {
|
|
666 v8 = pRnd->GetRandom();
|
|
667 local_0.x = v8 * 40.0 - 20.0 + v12;
|
|
668 v9 = pRnd->GetRandom();
|
|
669 z1 = (double)z;
|
|
670 local_0.z = z1;
|
|
671 local_0.y = v9 * 40.0 - 20.0 + v11;
|
|
672 local_0.flt_10 = pRnd->GetRandom() * 400.0 - 200.0;
|
|
673 local_0.flt_14 = pRnd->GetRandom() * 400.0 - 200.0;
|
|
674 local_0.flt_18 = pRnd->GetRandom() * 150.0 + 50.0;
|
|
675 pGame->pParticleEngine->AddParticle(&local_0);
|
|
676 --v6;
|
|
677 }
|
|
678 while ( v6 );
|
|
679 }
|
|
680
|
|
681 //----- (004A806F) --------------------------------------------------------
|
|
682 int stru6::_4A806F(Actor *pActor)
|
|
683 {
|
|
684 int v2; // ecx@1
|
|
685 unsigned int v3; // eax@1
|
|
686 double v4; // st7@2
|
|
687 float v5; // ST00_4@6
|
|
688
|
|
689 v2 = (int)pActor;
|
|
690 v3 = LODWORD(pActor->pActorBuffs[10].uExpireTime) - pMiscTimer->uTotalGameTimeElapsed;
|
|
691 if ( (signed int)v3 <= 64 )
|
|
692 {
|
|
693 if ( (v3 & 0x80000000u) != 0 )
|
|
694 {
|
|
695 pActor->pActorBuffs[10].uExpireTime = 0i64;
|
|
696 v4 = 1.0;
|
|
697 }
|
|
698 else
|
|
699 {
|
|
700 v2 = v3 * v3;
|
|
701 v4 = 1.0 - (double)(signed int)(v3 * v3) * 0.0001953125;
|
|
702 }
|
|
703 }
|
|
704 else
|
|
705 {
|
|
706 v2 = (v3 - 64) * (v3 - 64);
|
|
707 v4 = (double)v2 * 0.0001953125 + 0.2;
|
|
708 }
|
|
709 v5 = v4;
|
|
710 return _48B561_mess_with_scaling_along_z(/*v2, */v5);
|
|
711 }
|
|
712
|
|
713 //----- (004A80DC) --------------------------------------------------------
|
|
714 void stru6::_4A80DC_some_stuff_sw(LayingItem *a2)
|
|
715 {
|
|
716 stru6 *v2; // esi@1
|
|
717 signed int v3; // ebx@1
|
|
718 Particle_ local_0; // [sp+Ch] [bp-68h]@1
|
|
719
|
|
720 v2 = this;
|
|
721 memset(&local_0, 0, 0x68u);
|
|
722 local_0.bFree = 1029;
|
|
723 local_0.uDiffuse = 0x7E7E7Eu;
|
45
|
724 local_0.timeToLive = (rand() & 0x7F) + 128;
|
0
|
725 local_0.uTextureID = v2->uTextureID_effpar1;
|
|
726 v3 = 8;
|
|
727 local_0.flt_28 = 1.0;
|
|
728 do
|
|
729 {
|
|
730 local_0.x = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.x - 20.0;
|
|
731 local_0.y = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.y - 20.0;
|
|
732 local_0.z = (double)a2->vPosition.z;
|
|
733 local_0.flt_10 = pRnd->GetRandom() * 800.0 - 400.0;
|
|
734 local_0.flt_14 = pRnd->GetRandom() * 800.0 - 400.0;
|
|
735 local_0.flt_18 = pRnd->GetRandom() * 350.0 + 50.0;
|
|
736 pGame->pParticleEngine->AddParticle(&local_0);
|
|
737 --v3;
|
|
738 }
|
|
739 while ( v3 );
|
|
740 }
|
|
741
|
|
742 //----- (004A81CA) --------------------------------------------------------
|
|
743 bool stru6::_4A81CA(LayingItem *a2)
|
|
744 {
|
|
745 stru6 *v2; // ebx@1
|
|
746 int result; // eax@1
|
|
747 int v4; // eax@27
|
|
748 unsigned int diffuse; // esi@41
|
|
749 int v6; // ecx@49
|
|
750 int v7; // eax@54
|
|
751 int v8; // eax@55
|
|
752 char v9; // zf@56
|
|
753 int v10; // eax@59
|
|
754 int v11; // eax@61
|
|
755 int v12; // eax@85
|
|
756 int v13; // eax@86
|
|
757 int v14; // eax@96
|
|
758 int v15; // eax@111
|
|
759 int v16; // eax@118
|
|
760 int v17; // eax@139
|
|
761 int v18; // eax@140
|
|
762 int v19; // eax@141
|
|
763 int v20; // eax@151
|
|
764 unsigned int v21; // [sp-8h] [bp-20h]@66
|
|
765 LayingItem *v22; // [sp-8h] [bp-20h]@81
|
|
766 unsigned int v23; // [sp-4h] [bp-1Ch]@4
|
|
767 unsigned int v24; // [sp-4h] [bp-1Ch]@5
|
|
768 unsigned int v25; // [sp-4h] [bp-1Ch]@30
|
|
769 unsigned int v26; // [sp-4h] [bp-1Ch]@57
|
|
770 unsigned int v27; // [sp-4h] [bp-1Ch]@66
|
|
771 int v28; // [sp-4h] [bp-1Ch]@81
|
|
772 unsigned int v29; // [sp+0h] [bp-18h]@4
|
|
773 unsigned int v30; // [sp+0h] [bp-18h]@5
|
|
774 int v31; // [sp+0h] [bp-18h]@30
|
|
775 unsigned int v32; // [sp+0h] [bp-18h]@45
|
|
776 float v33; // [sp+0h] [bp-18h]@57
|
|
777 float v34; // [sp+0h] [bp-18h]@66
|
|
778 signed int v35; // [sp+0h] [bp-18h]@81
|
|
779 char pContainer[7]; // [sp+10h] [bp-8h]@81
|
|
780
|
|
781 v2 = this;
|
|
782 result = a2->uItemType;
|
|
783 if ( result <= 545 )
|
|
784 {
|
|
785 if ( result != 545 )
|
|
786 {
|
|
787 result -= 500;
|
|
788 switch ( result )
|
|
789 {
|
|
790 case 0:
|
|
791 case 30:
|
|
792 v29 = this->uTextureID_effpar1;
|
|
793 v23 = 0xAAAFFu;
|
|
794 goto LABEL_8;
|
|
795 case 1:
|
|
796 case 31:
|
|
797 v30 = this->uTextureID_effpar1;
|
|
798 v24 = 0xAAAFFu;
|
|
799 goto LABEL_32;
|
|
800 case 5:
|
|
801 v29 = this->uTextureID_effpar1;
|
|
802 v23 = 0x5C310Eu;
|
|
803 goto LABEL_8;
|
|
804 case 10:
|
|
805 v29 = this->uTextureID_effpar1;
|
|
806 v23 = 0xFF3C1Eu;
|
|
807 goto LABEL_8;
|
|
808 case 15:
|
|
809 v29 = this->uTextureID_effpar1;
|
|
810 v23 = 0x62D0u;
|
|
811 goto LABEL_8;
|
|
812 case 16:
|
|
813 v30 = this->uTextureID_effpar1;
|
|
814 v24 = 0x62D0u;
|
|
815 goto LABEL_32;
|
|
816 case 20:
|
|
817 v29 = this->uTextureID_effpar1;
|
|
818 v23 = 0xAB450u;
|
|
819 goto LABEL_8;
|
|
820 case 21:
|
|
821 v30 = this->uTextureID_effpar1;
|
|
822 v24 = 0xAB450u;
|
|
823 goto LABEL_32;
|
|
824 case 25:
|
|
825 v29 = this->uTextureID_effpar1;
|
|
826 v23 = 0xC8C805u;
|
|
827 goto LABEL_8;
|
|
828 case 26:
|
|
829 v30 = this->uTextureID_effpar1;
|
|
830 v24 = 0xC8C805u;
|
|
831 goto LABEL_32;
|
|
832 case 35:
|
|
833 v29 = this->uTextureID_effpar1;
|
|
834 v23 = 0xFFFFFFu;
|
|
835 goto LABEL_8;
|
|
836 case 36:
|
|
837 v30 = this->uTextureID_effpar1;
|
|
838 goto LABEL_154;
|
|
839 case 40:
|
|
840 goto LABEL_17;
|
|
841 case 11:
|
|
842 goto LABEL_31;
|
|
843 case 6:
|
|
844 goto LABEL_115;
|
|
845 case 41:
|
|
846 goto LABEL_164;
|
|
847 default:
|
|
848 goto LABEL_168;
|
|
849 }
|
|
850 goto LABEL_168;
|
|
851 }
|
|
852 goto LABEL_34;
|
|
853 }
|
|
854 if ( result <= 4051 )
|
|
855 {
|
|
856 if ( result != 4051 )
|
|
857 {
|
|
858 if ( result <= 2031 )
|
|
859 {
|
|
860 if ( result != 2031 )
|
|
861 {
|
|
862 if ( result <= 1051 )
|
|
863 {
|
|
864 if ( result == 1051 )
|
|
865 {
|
|
866 result = AddMobileLight(a2, 0xFF3C1Eu, 256);// fireball hit
|
|
867 if ( pRenderer->pRenderD3D )
|
|
868 {
|
|
869 result = a2->field_58 & 7;
|
|
870 if ( result != 3 )
|
|
871 {
|
|
872 if ( result != 2 )
|
|
873 {
|
|
874 result = (bool)&v2->field_204;
|
|
875 v6 = v2->field_204;
|
|
876 if ( v6 != 4 )
|
|
877 {
|
|
878 *(int *)result = v6 + 1;
|
|
879 _4A7688_fireball_collision_particle(a2);
|
|
880 }
|
|
881 goto LABEL_168;
|
|
882 }
|
|
883 }
|
|
884 }
|
|
885 goto LABEL_34;
|
|
886 }
|
|
887 if ( result <= 600 )
|
|
888 {
|
|
889 if ( result == 600 )
|
|
890 {
|
|
891 result = AddMobileLight(a2, 0xFF3C1Eu, 256);
|
|
892 goto LABEL_34;
|
|
893 }
|
|
894 result -= 550;
|
|
895 if ( !result )
|
|
896 {
|
|
897 LABEL_34:
|
|
898 LOBYTE(result) = 1;
|
|
899 return result;
|
|
900 }
|
|
901 v4 = result - 1;
|
|
902 if ( v4 )
|
|
903 {
|
|
904 result = v4 - 4;
|
|
905 if ( !result )
|
|
906 goto LABEL_34;
|
|
907 --result;
|
|
908 if ( !result )
|
|
909 {
|
|
910 v31 = 256;
|
|
911 v25 = 0xFF0000u;
|
|
912 LABEL_144:
|
|
913 result = AddMobileLight(a2, v25, v31);
|
|
914 goto LABEL_168;
|
|
915 }
|
|
916 goto LABEL_168;
|
|
917 }
|
|
918 goto LABEL_31;
|
|
919 }
|
|
920 if ( result < 811 )
|
|
921 goto LABEL_168;
|
|
922 if ( result <= 814 )
|
|
923 goto LABEL_34;
|
|
924 if ( result == 1010 )
|
|
925 goto LABEL_41; // fire strike
|
|
926 if ( result != 1011 )
|
|
927 {
|
|
928 if ( result != 1050 )
|
|
929 goto LABEL_168;
|
|
930 LABEL_41:
|
|
931 diffuse = 0xFF3C1Eu;
|
|
932 LABEL_42:
|
|
933 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(
|
|
934 a2,
|
|
935 diffuse,
|
|
936 this->uTextureID_effpar1);
|
|
937 LABEL_43:
|
|
938 v31 = 256;
|
|
939 LABEL_44:
|
|
940 v25 = diffuse;
|
|
941 goto LABEL_144;
|
|
942 }
|
|
943 v32 = this->uTextureID_effpar1;
|
|
944 diffuse = 0xFF3C1Eu;
|
|
945 LABEL_146:
|
|
946 _4A75CC_single_spell_collision_particle(a2, diffuse, v32);
|
|
947 goto LABEL_43;
|
|
948 }
|
|
949 if ( result <= 1081 )
|
|
950 {
|
|
951 if ( result == 1081 )
|
|
952 {
|
|
953 diffuse = 0xFF3C1Eu;
|
|
954 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(
|
|
955 a2,
|
|
956 0xFF3C1Eu,
|
|
957 this->uTextureID_effpar1,
|
|
958 300.0);
|
|
959 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(
|
|
960 a2,
|
|
961 0xFF3C1Eu,
|
|
962 v2->uTextureID_effpar1,
|
|
963 250.0);
|
|
964 v33 = 200.0;
|
|
965 v26 = v2->uTextureID_effpar1;
|
|
966 }
|
|
967 else
|
|
968 {
|
|
969 result -= 1060;
|
|
970 if ( !result )
|
|
971 goto LABEL_34;
|
|
972 v7 = result - 1;
|
|
973 if ( v7 )
|
|
974 {
|
|
975 v8 = v7 - 9;
|
|
976 if ( !v8 )
|
|
977 {
|
|
978 LABEL_31:
|
|
979 v30 = this->uTextureID_effpar1;
|
|
980 v24 = 0xFF3C1Eu;
|
|
981 goto LABEL_32;
|
|
982 }
|
|
983 result = v8 - 10;
|
|
984 v9 = result == 0;
|
|
985 LABEL_129:
|
|
986 if ( v9 )
|
|
987 goto LABEL_34;
|
|
988 goto LABEL_168;
|
|
989 }
|
|
990 diffuse = 0xFF3C1Eu;
|
|
991 v33 = 250.0;
|
|
992 v26 = this->uTextureID_effpar1;
|
|
993 }
|
|
994 LABEL_84:
|
|
995 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, diffuse, v26, v33);
|
|
996 goto LABEL_43;
|
|
997 }
|
|
998 v10 = result - 1090;
|
|
999 if ( v10 )
|
|
1000 {
|
|
1001 result = v10 - 10;
|
|
1002 if ( !result )
|
|
1003 goto LABEL_34;
|
|
1004 v11 = result - 1;
|
|
1005 if ( !v11 )
|
|
1006 {
|
|
1007 diffuse = 0xFF3C1Eu;
|
|
1008 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1Eu, this->uTextureID_effpar1);
|
|
1009 v32 = v2->uTextureID_effpar1;
|
|
1010 goto LABEL_146;
|
|
1011 }
|
|
1012 result = v11 - 929;
|
|
1013 if ( result )
|
|
1014 goto LABEL_168;
|
|
1015 LABEL_63:
|
|
1016 if ( !pRenderer->pRenderD3D )
|
|
1017 goto LABEL_34;
|
|
1018 _4A78AE_sparks_spell(a2);
|
|
1019 v31 = 128;
|
|
1020 v25 = 0x64640Fu;
|
|
1021 goto LABEL_144;
|
|
1022 }
|
|
1023 v34 = 250.0;
|
|
1024 v27 = this->uTextureID_effpar1;
|
|
1025 v21 = 0xFF3C1Eu;
|
|
1026 LABEL_117:
|
|
1027 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, v21, v27, v34);
|
|
1028 goto LABEL_168;
|
|
1029 }
|
|
1030 goto LABEL_67;
|
|
1031 }
|
|
1032 if ( result <= 3060 )
|
|
1033 {
|
|
1034 if ( result == 3060 )
|
|
1035 goto LABEL_171; // acid burst
|
|
1036 if ( result <= 2101 )
|
|
1037 {
|
|
1038 if ( result == 2101 )
|
|
1039 {
|
|
1040 v33 = 200.0;
|
|
1041 v26 = this->uTextureID_effpar1;
|
|
1042 goto LABEL_83;
|
|
1043 }
|
|
1044 if ( result != 2060 )
|
|
1045 {
|
|
1046 if ( result != 2061 )
|
|
1047 {
|
|
1048 if ( result <= 2079 )
|
|
1049 goto LABEL_168;
|
|
1050 if ( result <= 2081 )
|
|
1051 {
|
|
1052 if ( pRenderer->pRenderD3D )
|
|
1053 _4A77FD_some_stuff_d3d(a2);
|
|
1054 else
|
|
1055 _4A80DC_some_stuff_sw(a2);
|
|
1056 goto LABEL_168;
|
|
1057 }
|
|
1058 v9 = result == 2100;
|
|
1059 goto LABEL_129;
|
|
1060 }
|
|
1061 LABEL_67:
|
|
1062 v33 = 200.0;
|
|
1063 v26 = this->uTextureID_effpar2;
|
|
1064 LABEL_83:
|
|
1065 diffuse = (unsigned int)&pDecalBuilder->std__vector_pDecals[557].pVertices[57].vWorldViewPosition.y;
|
|
1066 goto LABEL_84;
|
|
1067 }
|
|
1068 if ( !pRenderer->pRenderD3D )
|
|
1069 goto LABEL_34;
|
102
|
1070 memcpy(pContainer, "sp18h1", 7);
|
0
|
1071 pRnd->SetRange(1, 6);
|
|
1072 pContainer[5] = pRnd->GetInRange() + '0';
|
|
1073 v35 = pBitmaps_LOD->LoadTexture(pContainer, TEXTURE_DEFAULT);
|
|
1074 v28 = 100;
|
|
1075 v22 = a2;
|
|
1076 LABEL_157:
|
|
1077 AddProjectile(v22, v28, v35);
|
|
1078 goto LABEL_168;
|
|
1079 }
|
|
1080 v12 = result - 3010;
|
|
1081 if ( !v12 )
|
|
1082 {
|
|
1083 LABEL_171:
|
|
1084 diffuse = 0xAB450u;
|
|
1085 goto LABEL_42;
|
|
1086 }
|
|
1087 v13 = v12 - 1;
|
|
1088 if ( !v13 )
|
|
1089 {
|
|
1090 v32 = this->uTextureID_effpar1;
|
|
1091 diffuse = 0xAB450u;
|
|
1092 goto LABEL_146;
|
|
1093 }
|
|
1094 result = v13 - 19;
|
|
1095 if ( !result )
|
|
1096 goto LABEL_34;
|
|
1097 --result;
|
|
1098 if ( result )
|
|
1099 goto LABEL_168;
|
|
1100 LABEL_89:
|
|
1101 v32 = this->uTextureID_effpar1;
|
|
1102 diffuse = 0x9EB9F1u;
|
|
1103 goto LABEL_146;
|
|
1104 }
|
|
1105 if ( result > 4000 )
|
|
1106 {
|
|
1107 result -= 4030;
|
|
1108 if ( !result || (--result, !result) )
|
|
1109 goto LABEL_34;
|
|
1110 result -= 19;
|
|
1111 v9 = result == 0;
|
|
1112 goto LABEL_129;
|
|
1113 }
|
|
1114 if ( result == 4000 )
|
|
1115 {
|
|
1116 if ( !pRenderer->pRenderD3D )
|
|
1117 goto LABEL_34;
|
|
1118 _4A7C07(a2);
|
|
1119 goto LABEL_168;
|
|
1120 }
|
|
1121 result -= 3061;
|
|
1122 if ( !result || (result -= 29) == 0 )
|
|
1123 goto LABEL_34;
|
|
1124 v14 = result - 1;
|
|
1125 if ( !v14 )
|
|
1126 goto LABEL_89;
|
|
1127 result = v14 - 1;
|
|
1128 if ( result )
|
|
1129 goto LABEL_168;
|
|
1130 v29 = this->uTextureID_effpar1;
|
|
1131 v23 = 0x9EB9F1u;
|
|
1132 LABEL_8:
|
|
1133 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, v23, v29);
|
|
1134 goto LABEL_168;
|
|
1135 }
|
|
1136 goto LABEL_122;
|
|
1137 }
|
|
1138 if ( result <= 7090 )
|
|
1139 {
|
|
1140 if ( result == 7090 )
|
|
1141 goto LABEL_34;
|
|
1142 if ( result > 6030 )
|
|
1143 {
|
|
1144 if ( result > 6091 )
|
|
1145 {
|
|
1146 result -= 6100;
|
|
1147 if ( !result )
|
|
1148 goto LABEL_34;
|
|
1149 result -= 930;
|
|
1150 if ( result )
|
|
1151 {
|
|
1152 --result;
|
|
1153 if ( result )
|
|
1154 goto LABEL_168;
|
|
1155 v30 = this->uTextureID_effpar1;
|
|
1156 v24 = 0xF00000u;
|
|
1157 goto LABEL_32;
|
|
1158 }
|
|
1159 goto LABEL_63;
|
|
1160 }
|
|
1161 if ( result != 6091 )
|
|
1162 {
|
|
1163 result -= 6040;
|
|
1164 if ( !result || (result -= 20) == 0 || (result -= 10) == 0 )
|
|
1165 goto LABEL_34;
|
|
1166 result -= 20;
|
|
1167 v9 = result == 0;
|
|
1168 goto LABEL_129;
|
|
1169 }
|
|
1170 }
|
|
1171 else
|
|
1172 {
|
|
1173 if ( result == 6030 )
|
|
1174 goto LABEL_34;
|
|
1175 if ( result <= 4091 )
|
|
1176 {
|
|
1177 if ( result != 4091 )
|
|
1178 {
|
|
1179 result -= 4070;
|
|
1180 if ( !result )
|
|
1181 goto LABEL_34;
|
|
1182 v15 = result - 1;
|
|
1183 if ( v15 )
|
|
1184 {
|
|
1185 result = v15 - 9;
|
|
1186 if ( !result )
|
|
1187 goto LABEL_34;
|
|
1188 result -= 10;
|
|
1189 if ( !result )
|
|
1190 {
|
|
1191 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(
|
|
1192 a2,
|
|
1193 0x7E7E7Eu,
|
|
1194 this->uTextureID_effpar1);
|
|
1195 goto LABEL_34;
|
|
1196 }
|
|
1197 goto LABEL_168;
|
|
1198 }
|
|
1199 LABEL_115:
|
|
1200 v30 = this->uTextureID_effpar1;
|
|
1201 v24 = 0x5C310Eu;
|
|
1202 LABEL_32:
|
|
1203 _4A75CC_single_spell_collision_particle(a2, v24, v30);
|
|
1204 goto LABEL_168;
|
|
1205 }
|
|
1206 v34 = 200.0;
|
|
1207 v27 = this->uTextureID_effpar1;
|
|
1208 v21 = 0x7E7E7Eu;
|
|
1209 goto LABEL_117;
|
|
1210 }
|
|
1211 v16 = result - 4092;
|
|
1212 if ( !v16 )
|
|
1213 {
|
|
1214 LABEL_17:
|
|
1215 v29 = this->uTextureID_effpar1;
|
|
1216 v23 = 0x7E7E7Eu;
|
|
1217 goto LABEL_8;
|
|
1218 }
|
|
1219 result = v16 - 8;
|
|
1220 if ( !result )
|
|
1221 goto LABEL_168;
|
|
1222 result -= 1910;
|
|
1223 if ( !result )
|
|
1224 goto LABEL_34;
|
|
1225 --result;
|
|
1226 if ( result )
|
|
1227 goto LABEL_168;
|
|
1228 }
|
|
1229 LABEL_122:
|
|
1230 _4A7948_mind_blast_after_effect(a2);
|
|
1231 goto LABEL_168;
|
|
1232 }
|
|
1233 if ( result <= 9000 )
|
|
1234 {
|
|
1235 if ( result == 9000 )
|
|
1236 goto LABEL_34;
|
|
1237 if ( result <= 8030 )
|
|
1238 {
|
|
1239 if ( result == 8030 )
|
|
1240 goto LABEL_34;
|
|
1241 v17 = result - 7091;
|
|
1242 if ( v17 )
|
|
1243 {
|
|
1244 v18 = v17 - 909;
|
|
1245 if ( !v18 )
|
|
1246 {
|
|
1247 diffuse = 0xFFFFFFu;
|
|
1248 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(
|
|
1249 a2,
|
|
1250 0xFFFFFFu,
|
|
1251 this->uTextureID_effpar3);
|
|
1252 v31 = 128;
|
|
1253 goto LABEL_44;
|
|
1254 }
|
|
1255 v19 = v18 - 1;
|
|
1256 if ( v19 )
|
|
1257 {
|
|
1258 result = v19 - 9;
|
|
1259 if ( !result )
|
|
1260 {
|
|
1261 v31 = 64;
|
|
1262 v25 = 0xFFFFFFu;
|
|
1263 goto LABEL_144;
|
|
1264 }
|
|
1265 goto LABEL_168;
|
|
1266 }
|
|
1267 v32 = this->uTextureID_effpar2;
|
|
1268 diffuse = 0xFFFFFFu;
|
|
1269 }
|
|
1270 else
|
|
1271 {
|
|
1272 v32 = this->uTextureID_effpar1;
|
|
1273 diffuse = 0xF00000u;
|
|
1274 }
|
|
1275 goto LABEL_146;
|
|
1276 }
|
|
1277 result -= 8040;
|
|
1278 if ( !result || (result -= 20) == 0 )
|
|
1279 goto LABEL_34;
|
|
1280 v20 = result - 30;
|
|
1281 if ( v20 )
|
|
1282 {
|
|
1283 result = v20 - 1;
|
|
1284 if ( result )
|
|
1285 goto LABEL_168;
|
|
1286 v30 = this->uTextureID_effpar3;
|
|
1287 LABEL_154:
|
|
1288 v24 = 16777215;
|
|
1289 goto LABEL_32;
|
|
1290 }
|
|
1291 result = AddMobileLight(a2, 0xFFFFFFu, 128);
|
|
1292 if ( !pRenderer->pRenderD3D )
|
|
1293 goto LABEL_34;
|
|
1294 v35 = -1;
|
|
1295 v28 = 100;
|
|
1296 v22 = a2;
|
|
1297 goto LABEL_157;
|
|
1298 }
|
|
1299 if ( result > 9050 )
|
|
1300 {
|
|
1301 result -= 9070;
|
|
1302 if ( !result || (result -= 10) == 0 || (--result, !result) )
|
|
1303 goto LABEL_34;
|
|
1304 goto LABEL_168;
|
|
1305 }
|
|
1306 if ( result == 9050 || (result -= 9010) == 0 || (result -= 20) == 0 || (result -= 10) == 0 )
|
|
1307 goto LABEL_34;
|
|
1308 --result;
|
|
1309 if ( !result )
|
|
1310 {
|
|
1311 LABEL_164:
|
|
1312 v30 = this->uTextureID_effpar1;
|
|
1313 v24 = 0x7E7E7Eu;
|
|
1314 goto LABEL_32;
|
|
1315 }
|
|
1316 LABEL_168:
|
|
1317 LOBYTE(result) = 0;
|
|
1318 return result;
|
|
1319 }
|
|
1320
|
|
1321 //----- (004A89BD) --------------------------------------------------------
|
|
1322 int stru6::SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID)
|
|
1323 {
|
|
1324 stru6 *v3; // edi@1
|
|
1325 PlayerBuffAnim *v4; // esi@1
|
|
1326 int result; // eax@1
|
|
1327 const char *v6; // [sp-4h] [bp-10h]@2
|
|
1328
|
|
1329 v3 = this;
|
|
1330 v4 = (PlayerBuffAnim *)((char *)this + 16 * (signed __int16)uPlayerID);
|
|
1331 v4[32].uSpellIconID_ = 0;
|
|
1332 v4[32].uSpellID = uSpellID;
|
|
1333 result = (signed __int16)uSpellID - 3;
|
|
1334 switch ( uSpellID )
|
|
1335 {
|
|
1336 case (SPELL_WATER_PROTECTION_FROM_WATER|0x80):
|
|
1337 v6 = "zapp";
|
|
1338 goto LABEL_24;
|
|
1339 case SPELL_AIR_FEATHER_FALL:
|
|
1340 case SPELL_SPIRIT_DETECT_LIFE:
|
|
1341 case SPELL_SPIRIT_DOOM:
|
|
1342 case 0x96u:
|
|
1343 v6 = "spboost1";
|
|
1344 goto LABEL_24;
|
|
1345 case SPELL_AIR_SHIELD|0x2:
|
|
1346 case SPELL_WATER_WATER_WALK:
|
|
1347 case SPELL_SPIRIT_PRESERVE:
|
|
1348 case 0x97u:
|
|
1349 v6 = "spboost2";
|
|
1350 goto LABEL_24;
|
|
1351 case SPELL_BODY_CURE_WEAKNESS|0x10:
|
|
1352 case SPELL_BODY_FIRST_AID|SPELL_AIR_SHIELD:
|
|
1353 case 0x56u:
|
|
1354 case SPELL_BODY_CURE_POISON|0x10:
|
|
1355 case 0x98u:
|
|
1356 v6 = "spboost3";
|
|
1357 goto LABEL_24;
|
|
1358 case (SPELL_AIR_SHIELD|0x20):
|
|
1359 case SPELL_MIND_REMOVE_FEAR:
|
|
1360 case SPELL_BODY_CURE_WEAKNESS:
|
|
1361 v6 = "spheal1";
|
|
1362 goto LABEL_24;
|
|
1363 case SPELL_SPIRIT_PRESERVE|0x4:
|
|
1364 case SPELL_MIND_CURE_PARALYSIS:
|
|
1365 case 0x40u:
|
|
1366 case SPELL_BODY_FIRST_AID:
|
|
1367 case SPELL_BODY_CURE_POISON:
|
|
1368 case SPELL_BODY_CURE_DISEASE:
|
|
1369 case 0x60u:
|
|
1370 v6 = "spheal2";
|
|
1371 goto LABEL_24;
|
|
1372 case SPELL_BODY_HAMMERHANDS|0x4:
|
|
1373 case SPELL_BODY_CURE_WEAKNESS|0x20:
|
|
1374 v6 = "spheal3";
|
|
1375 goto LABEL_24;
|
|
1376 case SPELL_FIRE_PROTECTION_FROM_FIRE:
|
|
1377 case SPELL_FIRE_FIRE_RING:
|
|
1378 v6 = "spell03";
|
|
1379 goto LABEL_24;
|
|
1380 case SPELL_FIRE_HASTE:
|
|
1381 v6 = "spell05";
|
|
1382 goto LABEL_24;
|
|
1383 case SPELL_AIR_PROTECTION_FROM_AIR:
|
|
1384 v6 = "spell14";
|
|
1385 goto LABEL_24;
|
|
1386 case SPELL_AIR_SHIELD:
|
|
1387 v6 = "spell17";
|
|
1388 goto LABEL_24;
|
|
1389 case SPELL_WATER_PROTECTION_FROM_WATER:
|
|
1390 v6 = "spell25";
|
|
1391 goto LABEL_24;
|
|
1392 case SPELL_EARTH_PROTECTION_FROM_EARTH:
|
|
1393 v6 = "spell36";
|
|
1394 goto LABEL_24;
|
|
1395 case SPELL_EARTH_STONESKIN:
|
|
1396 v6 = "spell38";
|
|
1397 goto LABEL_24;
|
|
1398 case SPELL_SPIRIT_BLESS:
|
|
1399 v6 = "spell46";
|
|
1400 goto LABEL_24;
|
|
1401 case SPELL_SPIRIT_HEROISM:
|
|
1402 v6 = "spell51";
|
|
1403 goto LABEL_24;
|
|
1404 case SPELL_SPIRIT_HEROISM|0x4:
|
|
1405 v6 = "spell55";
|
|
1406 goto LABEL_24;
|
|
1407 case SPELL_MIND_PROTECTION_FROM_MIND:
|
|
1408 v6 = "spell58";
|
|
1409 goto LABEL_24;
|
|
1410 case SPELL_BODY_FIRST_AID|0x1:
|
|
1411 v6 = "spell69";
|
|
1412 goto LABEL_24;
|
|
1413 case SPELL_BODY_FIRST_AID|SPELL_FIRE_PROTECTION_FROM_FIRE:
|
|
1414 v6 = "spell71";
|
|
1415 goto LABEL_24;
|
|
1416 case SPELL_BODY_HAMMERHANDS:
|
|
1417 v6 = "spell73";
|
|
1418 goto LABEL_24;
|
|
1419 case SPELL_BODY_PROTECTION_FROM_MAGIC:
|
|
1420 v6 = "spell75";
|
|
1421 LABEL_24:
|
|
1422 result = pIconsFrameTable->FindIcon(v6);
|
|
1423 v4[33].uSpellIconID = result;
|
|
1424 break;
|
|
1425 default:
|
|
1426 v4[32].uSpellID = 0;
|
|
1427 break;
|
|
1428 }
|
|
1429 if ( v4[32].uSpellID )
|
|
1430 {
|
|
1431 result = 8 * pIconsFrameTable->pIcons[v4[33].uSpellIconID].uAnimLength;
|
|
1432 v3->array_0[(signed __int16)uPlayerID + 33].uSpellAnimLength = result;
|
|
1433 }
|
|
1434 return result;
|
|
1435 }
|
|
1436
|
|
1437 //----- (004A8BDF) --------------------------------------------------------
|
|
1438 void stru6::FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime)
|
|
1439 {
|
|
1440 this->uFadeTime = uFadeTime;
|
|
1441 this->uFadeTime2 = uFadeTime;
|
|
1442 this->uFadeColor = uDiffuseColor;
|
|
1443 }
|
|
1444
|
|
1445 //----- (004A8BFC) --------------------------------------------------------
|
|
1446 int stru6::_4A8BFC()
|
|
1447 {
|
|
1448 stru6 *v1; // esi@1
|
|
1449 int result; // eax@1
|
|
1450
|
|
1451 v1 = this;
|
|
1452 result = 8
|
|
1453 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength;
|
|
1454 v1->uAnimLength = result;
|
|
1455 return result;
|
|
1456 }
|
|
1457
|
|
1458 //----- (004A8C27) --------------------------------------------------------
|
45
|
1459 void stru6::RenderSpecialEffects()
|
0
|
1460 {
|
|
1461 double v4; // st7@4
|
|
1462 double v5; // st6@4
|
|
1463 double v6; // st7@4
|
|
1464 float v7; // ST14_4@6
|
|
1465 unsigned int v8; // ST14_4@8
|
|
1466 unsigned int v9; // eax@8
|
|
1467 SpriteFrame *v10; // eax@8
|
|
1468 int v11; // edi@8
|
|
1469 double v12; // st7@9
|
|
1470 double v13; // st7@9
|
|
1471 double v14; // st7@9
|
|
1472 double v15; // st6@9
|
|
1473 HRESULT v16; // eax@9
|
|
1474 HRESULT v17; // eax@9
|
|
1475 signed __int64 v18; // qtt@10
|
|
1476 const char *v19; // [sp+4h] [bp-E8h]@0
|
|
1477 int v20; // [sp+8h] [bp-E4h]@0
|
|
1478 unsigned int v21; // [sp+Ch] [bp-E0h]@0
|
|
1479 RenderBillboardTransform_local0 vsr; // [sp+10h] [bp-DCh]@10
|
|
1480 RenderVertexD3D3 vd3d[4]; // [sp+60h] [bp-8Ch]@9
|
|
1481 int v24; // [sp+E0h] [bp-Ch]@10
|
|
1482 SpriteFrame *v70; // [sp+E4h] [bp-8h]@8
|
|
1483 unsigned int v26; // [sp+E8h] [bp-4h]@3
|
|
1484
|
45
|
1485 if (uNumProjectiles)
|
0
|
1486 {
|
|
1487 DrawProjectiles();
|
45
|
1488 uNumProjectiles = 0;
|
0
|
1489 }
|
45
|
1490
|
|
1491 field_204 = 0;
|
|
1492 v26 = uFadeTime;
|
|
1493 if ( v26 > 0 )
|
0
|
1494 {
|
45
|
1495 v4 = (double)(signed int)v26 / (double)uFadeTime2;
|
0
|
1496 v5 = 1.0 - v4 * v4;
|
|
1497 v6 = v5;
|
|
1498 if ( v5 > 0.9 )
|
|
1499 v6 = 1.0 - (v5 - 0.9) * 10.0;
|
|
1500 v7 = v6;
|
45
|
1501 pRenderer->_4A52F1(uFadeColor, v7);
|
|
1502 uFadeTime -= pEventTimer->uTimeElapsed;
|
0
|
1503 }
|
45
|
1504
|
|
1505 if (uAnimLength > 0)
|
0
|
1506 {
|
|
1507 v8 = 8
|
|
1508 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength
|
45
|
1509 - uAnimLength;
|
0
|
1510 v9 = pSpriteFrameTable->FastFindSprite("spell84");
|
|
1511 v10 = pSpriteFrameTable->GetFrame(v9, v8);
|
|
1512 v11 = v10->pHwSpriteIDs[0];
|
|
1513 v70 = v10;
|
45
|
1514 uAnimLength -= pEventTimer->uTimeElapsed;
|
0
|
1515 if ( pRenderer->pRenderD3D )
|
|
1516 {
|
|
1517 v12 = (double)(signed int)pViewport->uViewportX;
|
|
1518 vd3d[0].pos.x = v12;
|
|
1519 vd3d[1].pos.x = v12;
|
|
1520 v13 = (double)(signed int)pViewport->uViewportZ;
|
|
1521 v26 = pViewport->uViewportW + 1;
|
|
1522 vd3d[0].diffuse = 0x7F7F7Fu;
|
|
1523 vd3d[1].diffuse = 0x7F7F7Fu;
|
|
1524 vd3d[2].pos.x = v13;
|
|
1525 vd3d[3].pos.x = v13;
|
|
1526 v14 = (double)(signed int)pViewport->uViewportY;
|
|
1527 vd3d[2].diffuse = 0x7F7F7Fu;
|
|
1528 vd3d[3].diffuse = 0x7F7F7Fu;
|
|
1529 vd3d[0].specular = 0;
|
|
1530 vd3d[1].specular = 0;
|
|
1531 vd3d[0].pos.y = v14;
|
|
1532 v15 = (double)(pViewport->uViewportW + 1);
|
|
1533 vd3d[2].specular = 0;
|
|
1534 vd3d[3].specular = 0;
|
|
1535 vd3d[1].pos.y = v15;
|
|
1536 vd3d[2].pos.y = v15;
|
|
1537 vd3d[3].pos.y = v14;
|
|
1538 vd3d[0].pos.z = 0.0;
|
|
1539 vd3d[1].pos.z = 0.0;
|
|
1540 vd3d[2].pos.z = 0.0;
|
|
1541 vd3d[3].pos.z = 0.0;
|
|
1542 vd3d[0].rhw = 1.0;
|
|
1543 vd3d[1].rhw = 1.0;
|
|
1544 vd3d[2].rhw = 1.0;
|
|
1545 vd3d[3].rhw = 1.0;
|
|
1546 vd3d[0].texcoord.x = 0.0;
|
|
1547 vd3d[1].texcoord.x = 0.0;
|
|
1548 vd3d[2].texcoord.x = 1.0;
|
|
1549 vd3d[3].texcoord.x = 1.0;
|
|
1550 vd3d[0].texcoord.y = 0.0;
|
|
1551 vd3d[1].texcoord.y = 1.0;
|
|
1552 vd3d[2].texcoord.y = 1.0;
|
|
1553 vd3d[3].texcoord.y = 0.0;
|
|
1554 pRenderer->pRenderD3D->pDevice->SetTexture(
|
|
1555 0,
|
|
1556 pSprites_LOD->pHardwareSprites[v11].pTexture);
|
|
1557 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 0);
|
|
1558 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 1u);
|
|
1559 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0);
|
|
1560 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2u);
|
|
1561 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 2u);
|
|
1562 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, 0);
|
|
1563 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, 8u);
|
|
1564 pRenderer->pRenderD3D->pDevice->DrawPrimitive(
|
|
1565 D3DPT_TRIANGLEFAN,
|
68
|
1566 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
|
0
|
1567 vd3d,
|
|
1568 4,
|
|
1569 28);
|
|
1570 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2),
|
|
1571 "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\seffects.cpp:1348");
|
|
1572 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 1),
|
|
1573 "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\seffects.cpp:1349");
|
|
1574 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 0);
|
|
1575 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, true);
|
|
1576 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, true);
|
45
|
1577 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, 2);
|
0
|
1578 }
|
|
1579 else
|
|
1580 {
|
|
1581 vsr.pTarget = pRenderer->pTargetSurface;
|
|
1582 vsr.uParentBillboardID = -1;
|
|
1583 vsr.pTargetZ = pRenderer->pActiveZBuffer;
|
45
|
1584 vsr.uScreenSpaceX = (signed int)(pViewport->uViewportZ - pViewport->uViewportX) / 2;
|
|
1585 vsr.uScreenSpaceY = pViewport->uViewportW;
|
0
|
1586 v24 = 16777216;
|
|
1587 LODWORD(v18) = 0;
|
|
1588 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportZ) - LOWORD(pViewport->uViewportX));
|
|
1589 vsr.field_10 = v18 / 16777216;
|
|
1590 LODWORD(v18) = 0;
|
|
1591 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportW) - LOWORD(pViewport->uViewportY));
|
|
1592 v26 = v18 / 16777216;
|
|
1593 vsr.field_14 = v18 / 16777216;
|
|
1594 vsr.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v70->uPaletteIndex, 0, 1);
|
|
1595 vsr.uTargetPitch = pRenderer->uTargetSurfacePitch;
|
|
1596 vsr.uParentBillboardID = -1;
|
|
1597 vsr.uViewportX = pViewport->uViewportX;
|
|
1598 vsr.uViewportZ = pViewport->uViewportZ;
|
|
1599 vsr.uViewportY = pViewport->uViewportY;
|
45
|
1600 vsr.sZValue = 0;
|
0
|
1601 vsr.uViewportW = pViewport->uViewportW;
|
|
1602 vsr.uFlags = 0;
|
|
1603 if ( v11 >= 0 )
|
45
|
1604 pSprites_LOD->pSpriteHeaders[v11]._4ACC38(&vsr, 1);
|
0
|
1605 }
|
|
1606 }
|
|
1607 }
|
|
1608
|
|
1609 //----- (004A902A) --------------------------------------------------------
|
|
1610 void stru6::DrawPlayerBuffAnims()
|
|
1611 {
|
|
1612 __int16 *v1; // edi@1
|
|
1613 char *v2; // esi@1
|
|
1614 unsigned int v3; // eax@3
|
|
1615 unsigned __int8 v4; // zf@3
|
|
1616 char v5; // sf@3
|
|
1617 unsigned __int8 v6; // of@3
|
|
1618 IconFrame *v7; // eax@4
|
|
1619
|
23
|
1620 uint _it = 0;
|
0
|
1621 v1 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
|
|
1622 v2 = (char *)&this->pPlayerBuffs[0].uSpellIconID;
|
|
1623 do
|
|
1624 {
|
|
1625 if ( *((short *)v2 - 2) )
|
|
1626 {
|
|
1627 v3 = pEventTimer->uTimeElapsed + *(int *)v2;
|
|
1628 v6 = __OFSUB__(v3, *((int *)v2 + 1));
|
|
1629 v4 = v3 == *((int *)v2 + 1);
|
|
1630 v5 = ((v3 - *((int *)v2 + 1)) & 0x80000000u) != 0;
|
|
1631 *(int *)v2 = v3;
|
|
1632 if ( (unsigned __int8)(v5 ^ v6) | v4 )
|
|
1633 {
|
|
1634 v7 = pIconsFrameTable->GetFrame(*((int *)v2 + 2), v3);
|
|
1635 pRenderer->DrawTextureTransparent(*v1, 0x181u, &pIcons_LOD->pTextures[v7->uTextureID]);
|
|
1636 pOtherOverlayList->field_3EC = 1;
|
|
1637 }
|
|
1638 else
|
|
1639 {
|
|
1640 *((short *)v2 - 2) = 0;
|
|
1641 }
|
|
1642 }
|
|
1643 v2 += 16;
|
|
1644 ++v1;
|
|
1645 }
|
23
|
1646 //while ( (signed int)v1 < (signed int)pBaseHealthByClass );
|
|
1647 while (++_it != 4);
|
0
|
1648 }
|
|
1649
|
|
1650 //----- (004A90A0) --------------------------------------------------------
|
|
1651 void stru6::LoadAnimations()
|
|
1652 {
|
|
1653 stru6 *v1; // esi@1
|
|
1654 unsigned int v2; // eax@1
|
|
1655 unsigned int v3; // eax@1
|
|
1656 unsigned int v4; // eax@1
|
|
1657 unsigned int v5; // eax@1
|
|
1658 unsigned int v6; // eax@1
|
|
1659 unsigned int v7; // eax@1
|
|
1660 unsigned int v8; // eax@1
|
|
1661 unsigned int v9; // eax@1
|
|
1662 unsigned int v10; // eax@1
|
|
1663 unsigned int v11; // eax@1
|
|
1664 unsigned int v12; // eax@1
|
|
1665 unsigned int v13; // eax@1
|
|
1666 unsigned int v14; // eax@1
|
|
1667 unsigned int v15; // eax@1
|
|
1668 unsigned int v16; // eax@1
|
|
1669 unsigned int v17; // eax@1
|
|
1670 unsigned int v18; // eax@1
|
|
1671 unsigned int v19; // eax@1
|
|
1672 unsigned int v20; // eax@1
|
|
1673 unsigned int v21; // eax@1
|
|
1674 unsigned int v22; // eax@1
|
|
1675 unsigned int v23; // eax@1
|
|
1676 unsigned int v24; // eax@1
|
|
1677 unsigned int v25; // eax@1
|
|
1678 unsigned int v26; // eax@1
|
|
1679 unsigned int v27; // eax@1
|
|
1680 unsigned int v28; // eax@1
|
|
1681 unsigned int v29; // eax@1
|
|
1682 unsigned int v30; // eax@1
|
|
1683 unsigned int v31; // eax@1
|
|
1684 unsigned int v32; // eax@1
|
|
1685 unsigned int v33; // eax@1
|
|
1686 unsigned int v34; // eax@1
|
|
1687 unsigned int v35; // eax@1
|
|
1688 unsigned int v36; // eax@1
|
|
1689 unsigned int v37; // eax@1
|
|
1690 unsigned int v38; // eax@1
|
|
1691 unsigned int v39; // eax@1
|
|
1692 unsigned int v40; // eax@1
|
|
1693 unsigned int v41; // eax@1
|
|
1694 unsigned int v42; // eax@1
|
|
1695 unsigned int v43; // eax@1
|
|
1696 unsigned int v44; // eax@1
|
|
1697 unsigned int v45; // eax@1
|
|
1698 unsigned int v46; // eax@1
|
|
1699 unsigned int v47; // eax@1
|
|
1700 unsigned int v48; // eax@1
|
|
1701 unsigned int v49; // eax@1
|
|
1702 unsigned int v50; // eax@1
|
|
1703 unsigned int v51; // eax@1
|
|
1704
|
|
1705 v1 = this;
|
|
1706 uTextureID_effpar1 = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
|
|
1707 uTextureID_effpar2 = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT);
|
|
1708 uTextureID_effpar3 = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT);
|
|
1709 uSpriteID_sp57c = pSprites_LOD->LoadSprite("sp57c", 6);
|
|
1710 v2 = pIconsFrameTable->FindIcon("zapp");
|
|
1711 pIconsFrameTable->InitializeAnimation(v2);
|
|
1712 v3 = pIconsFrameTable->FindIcon("spheal1");
|
|
1713 pIconsFrameTable->InitializeAnimation(v3);
|
|
1714 v4 = pIconsFrameTable->FindIcon("spheal2");
|
|
1715 pIconsFrameTable->InitializeAnimation(v4);
|
|
1716 v5 = pIconsFrameTable->FindIcon("spheal3");
|
|
1717 pIconsFrameTable->InitializeAnimation(v5);
|
|
1718 v6 = pIconsFrameTable->FindIcon("spboost1");
|
|
1719 pIconsFrameTable->InitializeAnimation(v6);
|
|
1720 v7 = pIconsFrameTable->FindIcon("spboost2");
|
|
1721 pIconsFrameTable->InitializeAnimation(v7);
|
|
1722 v8 = pIconsFrameTable->FindIcon("spboost3");
|
|
1723 pIconsFrameTable->InitializeAnimation(v8);
|
|
1724 v9 = pIconsFrameTable->FindIcon("spell03");
|
|
1725 pIconsFrameTable->InitializeAnimation(v9);
|
|
1726 v10 = pIconsFrameTable->FindIcon("spell05");
|
|
1727 pIconsFrameTable->InitializeAnimation(v10);
|
|
1728 v11 = pIconsFrameTable->FindIcon("spell14");
|
|
1729 pIconsFrameTable->InitializeAnimation(v11);
|
|
1730 v12 = pIconsFrameTable->FindIcon("spell17");
|
|
1731 pIconsFrameTable->InitializeAnimation(v12);
|
|
1732 v13 = pIconsFrameTable->FindIcon("spell21");
|
|
1733 pIconsFrameTable->InitializeAnimation(v13);
|
|
1734 v14 = pIconsFrameTable->FindIcon("spell25");
|
|
1735 pIconsFrameTable->InitializeAnimation(v14);
|
|
1736 v15 = pIconsFrameTable->FindIcon("spell27");
|
|
1737 pIconsFrameTable->InitializeAnimation(v15);
|
|
1738 v16 = pIconsFrameTable->FindIcon("spell36");
|
|
1739 pIconsFrameTable->InitializeAnimation(v16);
|
|
1740 v17 = pIconsFrameTable->FindIcon("spell38");
|
|
1741 pIconsFrameTable->InitializeAnimation(v17);
|
|
1742 v18 = pIconsFrameTable->FindIcon("spell46");
|
|
1743 pIconsFrameTable->InitializeAnimation(v18);
|
|
1744 v19 = pIconsFrameTable->FindIcon("spell51");
|
|
1745 pIconsFrameTable->InitializeAnimation(v19);
|
|
1746 v20 = pIconsFrameTable->FindIcon("spell55");
|
|
1747 pIconsFrameTable->InitializeAnimation(v20);
|
|
1748 v21 = pIconsFrameTable->FindIcon("spell58");
|
|
1749 pIconsFrameTable->InitializeAnimation(v21);
|
|
1750 v22 = pIconsFrameTable->FindIcon("spell69");
|
|
1751 pIconsFrameTable->InitializeAnimation(v22);
|
|
1752 v23 = pIconsFrameTable->FindIcon("spell71");
|
|
1753 pIconsFrameTable->InitializeAnimation(v23);
|
|
1754 v24 = pIconsFrameTable->FindIcon("spell73");
|
|
1755 pIconsFrameTable->InitializeAnimation(v24);
|
|
1756 v25 = pIconsFrameTable->FindIcon("spell75");
|
|
1757 pIconsFrameTable->InitializeAnimation(v25);
|
|
1758 v26 = pIconsFrameTable->FindIcon("spell96");
|
|
1759 pIconsFrameTable->InitializeAnimation(v26);
|
|
1760
|
|
1761 v27 = pSpriteFrameTable->FastFindSprite("spell01");
|
|
1762 pSpriteFrameTable->InitializeSprite(v27);
|
|
1763 v28 = pSpriteFrameTable->FastFindSprite("spell02");
|
|
1764 pSpriteFrameTable->InitializeSprite(v28);
|
|
1765 v29 = pSpriteFrameTable->FastFindSprite("spell03");
|
|
1766 pSpriteFrameTable->InitializeSprite(v29);
|
|
1767 v30 = pSpriteFrameTable->FastFindSprite("spell09");
|
|
1768 pSpriteFrameTable->InitializeSprite(v30);
|
|
1769 v31 = pSpriteFrameTable->FastFindSprite("spell11");
|
|
1770 pSpriteFrameTable->InitializeSprite(v31);
|
|
1771 v32 = pSpriteFrameTable->FastFindSprite("spell18");
|
|
1772 pSpriteFrameTable->InitializeSprite(v32);
|
|
1773 v33 = pSpriteFrameTable->FastFindSprite("spell22");
|
|
1774 pSpriteFrameTable->InitializeSprite(v33);
|
|
1775 v34 = pSpriteFrameTable->FastFindSprite("spell26");
|
|
1776 pSpriteFrameTable->InitializeSprite(v34);
|
|
1777 v35 = pSpriteFrameTable->FastFindSprite("spell29");
|
|
1778 pSpriteFrameTable->InitializeSprite(v35);
|
|
1779 v36 = pSpriteFrameTable->FastFindSprite("spell39");
|
|
1780 pSpriteFrameTable->InitializeSprite(v36);
|
|
1781 v37 = pSpriteFrameTable->FastFindSprite("spell39c");
|
|
1782 pSpriteFrameTable->InitializeSprite(v37);
|
|
1783 v38 = pSpriteFrameTable->FastFindSprite("spell41");
|
|
1784 pSpriteFrameTable->InitializeSprite(v38);
|
|
1785 v39 = pSpriteFrameTable->FastFindSprite("spell57c");
|
|
1786 pSpriteFrameTable->InitializeSprite(v39);
|
|
1787 v40 = pSpriteFrameTable->FastFindSprite("spell62");
|
|
1788 pSpriteFrameTable->InitializeSprite(v40);
|
|
1789 v41 = pSpriteFrameTable->FastFindSprite("spell65");
|
|
1790 pSpriteFrameTable->InitializeSprite(v41);
|
|
1791 v42 = pSpriteFrameTable->FastFindSprite("spell66");
|
|
1792 pSpriteFrameTable->InitializeSprite(v42);
|
|
1793 v43 = pSpriteFrameTable->FastFindSprite("spell70");
|
|
1794 pSpriteFrameTable->InitializeSprite(v43);
|
|
1795 v44 = pSpriteFrameTable->FastFindSprite("spell76");
|
|
1796 pSpriteFrameTable->InitializeSprite(v44);
|
|
1797 v45 = pSpriteFrameTable->FastFindSprite("spell84");
|
|
1798 pSpriteFrameTable->InitializeSprite(v45);
|
|
1799 v46 = pSpriteFrameTable->FastFindSprite("spell90");
|
|
1800 pSpriteFrameTable->InitializeSprite(v46);
|
|
1801 v47 = pSpriteFrameTable->FastFindSprite("spell92");
|
|
1802 pSpriteFrameTable->InitializeSprite(v47);
|
|
1803 v48 = pSpriteFrameTable->FastFindSprite("spell93");
|
|
1804 pSpriteFrameTable->InitializeSprite(v48);
|
|
1805 v49 = pSpriteFrameTable->FastFindSprite("spell97");
|
|
1806 pSpriteFrameTable->InitializeSprite(v49);
|
|
1807 v50 = pSpriteFrameTable->FastFindSprite("spell97c");
|
|
1808 pSpriteFrameTable->InitializeSprite(v50);
|
|
1809 v51 = pSpriteFrameTable->FastFindSprite("spell97c");
|
|
1810 pSpriteFrameTable->InitializeSprite(v51);
|
|
1811 }
|