annotate ParticleEngine.cpp @ 2208:0b2eea6f80c9

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