annotate Engine/Graphics/ParticleEngine.cpp @ 2542:bacf9809126a

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