annotate ParticleEngine.cpp @ 145:dac041fc74e8

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