annotate stru6.cpp @ 1160:502b8b2e36b4

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