annotate ParticleEngine.cpp @ 1:ac0fb48cd27a

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