annotate DecalBuilder.cpp @ 0:8b8875f5b359

Initial commit
author Nomad
date Fri, 05 Oct 2012 16:07:14 +0200
parents
children 2ca04ccb612a
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "DecalBuilder.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "Time.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "stru314.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "Outdoor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 //#include "MM7.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 struct DecalBuilder *pDecalBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 struct BloodsplatContainer *pBloodsplatContainer; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 //----- (0043B570) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 double DecalBuilder_stru0::_43B570()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 DecalBuilder_stru0 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 double result; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 if ( this->field_1C_flags & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 if ( (double)(signed __int64)(this->field_20_time - pEventTimer->Time() + 384) * 0.0026041667 >= 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 result = (double)(signed __int64)(v1->field_20_time - pEventTimer->Time() + 384) * 0.0026041667;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 result = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 result = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 //----- (0043B6EF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 bool BloodsplatContainer::AddBloodsplat(float x, float y, float z, float radius, char r, char g, char b)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 int *v8; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 int v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 Bloodsplat *v10; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 int *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 int v12; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 v8 = &this->uNumBloodsplats;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 if ( this->uNumBloodsplats == 64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 *v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 v9 = 5 * (*v8)++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 v10 = &this->std__vector_pBloodsplats[8 * v9 / 0x28u];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 v10->x = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 v10->y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 v10->z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 v10->radius = radius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 v10->r = r;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 v10->g = g;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 v10->b = b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 result = (int *)&this->std__vector_pBloodsplats_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 v12 = this->std__vector_pBloodsplats_size + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 if ( v12 > 64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 v12 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 *result = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 LOBYTE(result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 return (bool)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 //----- (0049B490) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 bool DecalBuilder::AddBloodsplat(float x, float y, float z, float r, float g, float b, float radius, int a8, int a9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 double v10; // ST1C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 char v11; // ST24_1@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 double v12; // ST1C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 double v13; // ST1C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 int a7a; // [sp+40h] [bp+18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 float arg14a; // [sp+44h] [bp+1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 float arg14b; // [sp+44h] [bp+1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 float arg14c; // [sp+44h] [bp+1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 arg14a = b * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 v10 = arg14a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 v11 = LOBYTE(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 arg14b = g * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 v12 = arg14b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 a7a = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 arg14c = r * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 v13 = arg14c + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 return pBloodsplatContainer->AddBloodsplat(x, y, z, radius, SLOBYTE(v13), a7a, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 //----- (0049B525) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 void DecalBuilder::Reset(unsigned int bPreserveBloodsplats)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 if ( !bPreserveBloodsplats )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 pBloodsplatContainer->std__vector_pBloodsplats_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 pBloodsplatContainer->uNumBloodsplats = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 this->std__vector_pDecals_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 //----- (0049B540) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 char DecalBuilder::ApplyDecals(int a2, char a3, stru154 *a4, int a5, RenderVertexSoft *a6, int a7, char a8, int a9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 char *v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 signed int v10; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 RenderVertexSoft *v11; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 unsigned int v12; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 RenderVertexSoft *v13; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 RenderVertexSoft *v14; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 char v15; // zf@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 stru154 *v16; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 double v18; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 double v19; // st6@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 float v20; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 Bloodsplat *v21; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 int v22; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 double v24; // st7@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 int v25; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 double v26; // st7@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 int v27; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 double v28; // st7@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 int v29; // ST10_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 int v30; // ST08_4@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 DecalBuilder *v31; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 int v32; // [sp+4h] [bp-44h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 RenderVertexSoft *v33; // [sp+8h] [bp-40h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 stru314 *v34; // [sp+Ch] [bp-3Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 float v35; // [sp+10h] [bp-38h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 float v36; // [sp+14h] [bp-34h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 int v37; // [sp+18h] [bp-30h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 int a5a; // [sp+28h] [bp-20h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 int v39; // [sp+2Ch] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 int v40; // [sp+30h] [bp-18h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 int v41; // [sp+34h] [bp-14h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 int v42; // [sp+38h] [bp-10h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 int v43; // [sp+3Ch] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 DecalBuilder *thisa; // [sp+40h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 RenderVertexSoft *a11; // [sp+44h] [bp-4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 thisa = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 if ( !a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 static RenderVertexSoft static_AE4F90[64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 static bool __init_flag1 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 if (!__init_flag1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 __init_flag1 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 for (uint i = 0; i < 64; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 static_AE4F90[i].flt_2C = 0.0f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 static stru314 static_AE4F60; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 /*static bool __init_flag2 = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 if (!__init_flag2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 __init_flag2 = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 stru314::stru314(&static_AE4F60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 a11 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 if ( a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 if ( a5 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 v11 = static_AE4F90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 v12 = (char *)a6 - (char *)static_AE4F90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 a6 = (RenderVertexSoft *)a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 v13 = (RenderVertexSoft *)((char *)v11 + v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 v14 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 v15 = a6 == (RenderVertexSoft *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 a6 = (RenderVertexSoft *)((char *)a6 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 memcpy(v14, v13, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 while ( !v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 v16 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 if ( pGame->pIndoorCameraD3D->_437376(a4, static_AE4F90, (unsigned int *)&a5) == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 if ( !a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 a11 = static_AE4F90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 v16 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 v18 = v16->vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 v19 = v16->vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 v20 = v16->vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 v37 = (int)&stru_AE4F7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 stru_AE4F64.y = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 stru_AE4F64.x = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 LODWORD(v36) = (DWORD)&stru_AE4F70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 stru_AE4F64.z = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 dword_AE4F88 = LODWORD(v16->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 if ( !pGame->pIndoorCameraD3D->GetFacetOrientation(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 v16->field_14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 &stru_AE4F64,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 &stru_AE4F70,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 &stru_AE4F7C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 MessageBoxW(nullptr, L"Error: Failed to get the facet orientation", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:101", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 if ( thisa->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 a6 = (RenderVertexSoft *)thisa->std__vector_30B00C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 v21 = &pBloodsplatContainer->std__vector_pBloodsplats[LODWORD(a6->vWorldPosition.x)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 *(float *)&v37 = v21->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 v36 = v21->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 v35 = v21->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 v22 = sub_43F5C8(a2, a9, v35, v36, *(float *)&v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 v23 = v21->b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 v24 = v21->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 v42 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 BYTE3(v22) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 *(short *)((char *)&v22 + 1) = v21->r;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 LOBYTE(v22) = v21->g;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 v43 = v23 | (v22 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 v25 = (signed __int64)v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 v26 = v21->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 v27 = (signed __int64)v21->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 v37 = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 v40 = (signed __int64)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 v28 = *(float *)&v21->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 LODWORD(v36) = (uint32)a11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 a5a = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 v39 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 LODWORD(v35) = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 v34 = &static_AE4F60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 *(float *)&v33 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 v32 = v23 | (v22 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 *(float *)&v29 = v21->radius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 v30 = (int)v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 v31 = thisa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 if ( !thisa->_49B790_build_decal_geometry(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 v42,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 v30,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 (int)&a5a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 v29,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 v43,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 v33,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 &static_AE4F60,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 a11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 a8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 MessageBoxW(nullptr, L"Error: Failed to build decal geometry", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:114", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 ++a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 a6 = (RenderVertexSoft *)((char *)a6 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 while ( a7 < v31->uNumDecals );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 // AE4F88: using guessed type int dword_AE4F88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 // AE5B90: using guessed type char static_init_flag__AE4F90_bit1__AE4F60_bit2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 //----- (0049B790) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 char DecalBuilder::_49B790_build_decal_geometry(int a2, char a3, int a4, int a5, int a6, int a7, RenderVertexSoft *a8, stru314 *a9, signed int a10, RenderVertexSoft *a11, char uClipFlags)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 DecalBuilder *v12; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 Decal *v13; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 char *v14; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 double v15; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 double v16; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 int v17; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 stru314 *v18; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 double v19; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 double v20; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 double v21; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 double v22; // st6@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 double v23; // st6@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 double v24; // st5@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 char *v25; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 signed int v26; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 double v27; // st5@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 double v28; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 double v29; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 char result; // al@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 unsigned int *v31; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 RenderVertexSoft *v32; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 std::string *v33; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 int v34; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 const char *v35; // [sp-Ch] [bp-2Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 int v36; // [sp-8h] [bp-28h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 std::string v37; // [sp-4h] [bp-24h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 float v38; // [sp+8h] [bp-18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 RenderVertexSoft *v39; // [sp+Ch] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 unsigned int *v40; // [sp+10h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 v12 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 if ( *(float *)&a6 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 v13 = &this->std__vector_pDecals[this->field_308008];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 v14 = (char *)&this->std__vector_pDecals[this->field_308008].field_C1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 this->std__vector_pDecals[this->field_308008].field_C18 = (DecalBuilder_stru0 *)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 *(int *)v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 if ( a3 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 *(int *)v14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 v15 = *(float *)&a6 - *(float *)&a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 *(float *)&this->field_30C028 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 v16 = sqrt((*(float *)&a6 + *(float *)&a6 - v15) * v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 *(float *)&v12->field_30C02C = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 v17 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 v18 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 v12->flt_30C030 = 1.0 - (*(float *)&a6 - v16) / *(float *)&a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 v13->field_C08 = (signed __int64)((double)*(signed int *)v17 - *(float *)&a8 * v18->field_4.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 v13->field_C0A = (signed __int64)((double)*(signed int *)(a5 + 4) - *(float *)&a8 * v18->field_4.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 v19 = *(float *)&a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 v13->field_C0C = (signed __int64)((double)*(signed int *)(a5 + 8) - *(float *)&a8 * v18->field_4.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 v20 = v19 * v12->flt_30C030;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 a8 = v13->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 v12->field_30C034 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 v12->field_30C010 = v20 * v18->field_10.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 v12->field_30C014 = v20 * v18->field_10.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 v12->field_30C018 = v20 * v18->field_10.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 v12->field_30C01C = v20 * v18->field_1C.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 v12->field_30C020 = v20 * v18->field_1C.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 v12->field_30C024 = v20 * v18->field_1C.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 a6 = v13->field_C08;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 v21 = (double)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 v22 = v21 - v12->field_30C01C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 a6 = v13->field_C0A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 v13->pVertices[0].vWorldPosition.x = v22 + v12->field_30C010;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 v23 = (double)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 v24 = v23 - v12->field_30C020 + v12->field_30C014;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 v25 = (char *)&v13->pVertices[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 a6 = v13->field_C0C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 v26 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 v13->pVertices[0].vWorldPosition.y = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 v27 = (double)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 *(float *)&a6 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 v13->pVertices[0].vWorldPosition.z = v27 - v12->field_30C024 + v12->field_30C018;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 v13->pVertices[0].u = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 v13->pVertices[0].v = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 v13->pVertices[1].vWorldPosition.x = v21 - v12->field_30C01C - v12->field_30C010;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 v13->pVertices[1].vWorldPosition.y = v23 - v12->field_30C020 - v12->field_30C014;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 v13->pVertices[1].vWorldPosition.z = v27 - v12->field_30C024 - v12->field_30C018;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 v13->pVertices[1].u = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 v13->pVertices[1].v = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 v13->pVertices[2].vWorldPosition.x = v21 + v12->field_30C01C - v12->field_30C010;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 v13->pVertices[2].vWorldPosition.y = v23 + v12->field_30C020 - v12->field_30C014;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 v13->pVertices[2].vWorldPosition.z = v27 + v12->field_30C024 - v12->field_30C018;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 v13->pVertices[2].u = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 v13->pVertices[2].v = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 v13->pVertices[3].vWorldPosition.x = v21 + v12->field_30C01C + v12->field_30C010;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 v13->pVertices[3].vWorldPosition.y = v23 + v12->field_30C020 + v12->field_30C014;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 v13->pVertices[3].vWorldPosition.z = *(float *)&a6 + v12->field_30C024 + v12->field_30C018;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 v13->pVertices[3].u = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 v13->pVertices[3].v = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 v28 = v18->field_4.y * *(float *)v25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 + *((float *)v25 - 1) * v18->field_4.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 + *((float *)v25 + 1) * v18->field_4.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 + *(float *)&v18->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 *((float *)v25 - 1) = *((float *)v25 - 1) - v28 * v18->field_4.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 *(float *)v25 = *(float *)v25 - v28 * v18->field_4.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 v25 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 --v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 *((float *)v25 - 11) = *((float *)v25 - 11) - v28 * v18->field_4.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 while ( v26 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 v13->field_C10 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 v40 = (unsigned int *)&v13->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 v39 = v13->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 v13->uNumVertices = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 v13->field_C14 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 v29 = v18->field_4.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 a6 = (int)&v13->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 v38 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 result = pGame->pStru9Instance->_4980B9(a11, a10, v18->field_4.x, v18->field_4.y, v38, v39, v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 v31 = (unsigned int *)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 if ( !*(int *)a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 v32 = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 v40 = *(unsigned int **)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 v39 = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 pGame->pIndoorCameraD3D->ViewTransform(a8, (unsigned int)v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 pGame->pIndoorCameraD3D->_436BB7_project_and_stuff(v32, *v31, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 if ( !(uClipFlags & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 ++v12->field_308008;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 v34 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 if ( v12->field_308008 == 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 v12->field_308008 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 if ( (signed int)(v12->std__vector_pDecals_size + 1) <= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 v34 = v12->std__vector_pDecals_size + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 v12->std__vector_pDecals_size = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 if ( uClipFlags & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 v40 = (unsigned int *)&a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 v39 = v12->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 pGame->pIndoorCameraD3D->_436CDC(v32, *v31, v12->pVertices, (unsigned int *)&a8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 v40 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 v39 = v12->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 pGame->pIndoorCameraD3D->_437143((unsigned int)a8, v32, v12->pVertices, v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 if ( uClipFlags & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 v40 = (unsigned int *)&a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 v39 = v12->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 pGame->pIndoorCameraD3D->_436F09(v32, *v31, v12->pVertices, (unsigned int *)&a8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 v39 = (RenderVertexSoft *)"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:258";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 v35 = "Undefined clip flag specified";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 v39 = (RenderVertexSoft *)"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:263";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 v35 = "Lightpoly builder native indoor clipping not implemented";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 MessageBoxA(nullptr, v35, (const char *)v39, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 if ( *(float *)&a8 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 //----- (0049BBBD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 char DecalBuilder::ApplyBloodsplatDecals_IndoorFace(unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 BLVFace *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 unsigned int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 char *v6; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 double v7; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 this->uNumDecals = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 v3 = pBloodsplatContainer->std__vector_pBloodsplats_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 if ( pBloodsplatContainer->std__vector_pBloodsplats_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 v4 = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 v5 = v4->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 if ( !(v5 & 0x400000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 if ( !(v5 & 0x10) && (signed int)pBloodsplatContainer->std__vector_pBloodsplats_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 v6 = (char *)&pBloodsplatContainer->std__vector_pBloodsplats[0].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 if ( (double)v4->pBounding.x1 - *((float *)v6 + 2) < *((float *)v6 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 if ( (double)v4->pBounding.x2 + *((float *)v6 + 2) > *((float *)v6 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 if ( (double)v4->pBounding.y1 - *((float *)v6 + 2) < *(float *)v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 if ( (double)v4->pBounding.y2 + *((float *)v6 + 2) > *(float *)v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 if ( (double)v4->pBounding.z1 - *((float *)v6 + 2) < *((float *)v6 + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 if ( (double)v4->pBounding.z2 + *((float *)v6 + 2) > *((float *)v6 + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 v7 = v4->pFacePlane.vNormal.z * *((float *)v6 + 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 + v4->pFacePlane.vNormal.y * *(float *)v6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 + v4->pFacePlane.vNormal.x * *((float *)v6 - 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 + v4->pFacePlane.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 if ( v7 <= *((float *)v6 + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 *((float *)v6 + 3) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 this->std__vector_30B00C[this->uNumDecals++] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 v6 += 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 while ( v2 < (signed int)v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 //----- (0049BCEB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 char DecalBuilder::ApplyDecals_OutdoorFace(ODMFace *pFace)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 char *v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 double v5; // ST1C_8@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 double v6; // ST14_8@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 double v7; // ST0C_8@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 double v8; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 unsigned int v10; // [sp+20h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 this->uNumDecals = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 v10 = pBloodsplatContainer->std__vector_pBloodsplats_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 if ( pBloodsplatContainer->std__vector_pBloodsplats_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 v3 = pFace->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 if ( !(v3 & 0x400000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 if ( !(v3 & 0x10) && (signed int)pBloodsplatContainer->std__vector_pBloodsplats_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 v4 = (char *)&pBloodsplatContainer->std__vector_pBloodsplats[0].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 if ( (double)pFace->pBoundingBox.x1 - *((float *)v4 + 2) < *((float *)v4 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 if ( (double)pFace->pBoundingBox.x2 + *((float *)v4 + 2) > *((float *)v4 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 if ( (double)pFace->pBoundingBox.y1 - *((float *)v4 + 2) < *(float *)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 if ( (double)pFace->pBoundingBox.y2 + *((float *)v4 + 2) > *(float *)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 if ( (double)pFace->pBoundingBox.z1 - *((float *)v4 + 2) < *((float *)v4 + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 if ( (double)pFace->pBoundingBox.z2 + *((float *)v4 + 2) > *((float *)v4 + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 v5 = *((float *)v4 - 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 v6 = *(float *)v4 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 v7 = *((float *)v4 + 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 v8 = (double)((pFace->pFacePlane.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 + LODWORD(v5) * pFace->pFacePlane.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 + LODWORD(v6) * pFace->pFacePlane.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 + LODWORD(v7) * pFace->pFacePlane.vNormal.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 if ( v8 <= *((float *)v4 + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 *((float *)v4 + 3) = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 this->std__vector_30B00C[this->uNumDecals++] = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 v4 += 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 while ( v2 < (signed int)v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 //----- (0049BE8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 bool DecalBuilder::_49BE8A(struct stru148 *a2, float a3, int a4, RenderVertexSoft *a5, unsigned int uStripType, char a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 bool result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 RenderVertexSoft *v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 float v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 char *v10; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 float v11; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 float v12; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 double v13; // st7@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 double v14; // st7@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 int v15; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 int v16; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 int v17; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 DecalBuilder *v18; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 std::string v19; // [sp-18h] [bp-54h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 const char *v20; // [sp-8h] [bp-44h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 int v21; // [sp-4h] [bp-40h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 double v22; // [sp+Ch] [bp-30h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 unsigned int v23; // [sp+14h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 DecalBuilder *v24; // [sp+18h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 int v25; // [sp+1Ch] [bp-20h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 float v26; // [sp+20h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 int v27; // [sp+24h] [bp-18h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 float v28; // [sp+28h] [bp-14h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 float v29; // [sp+2Ch] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 float v30; // [sp+30h] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 float v31; // [sp+34h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 bool v32; // [sp+38h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 this->uNumDecals = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 result = pBloodsplatContainer->std__vector_pBloodsplats_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 v24 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 v23 = pBloodsplatContainer->std__vector_pBloodsplats_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 if ( pBloodsplatContainer->std__vector_pBloodsplats_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 if ( (signed int)pBloodsplatContainer->std__vector_pBloodsplats_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 v8 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 v9 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 v10 = (char *)&pBloodsplatContainer->std__vector_pBloodsplats[0].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 while ( uStripType != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 if ( uStripType == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 if ( a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 a3 = v8->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 v31 = v8[2].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 v30 = v8[1].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 v12 = v8[2].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 a3 = v8[1].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 v11 = v8[2].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 v31 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 v30 = v8[1].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 v12 = v8->vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 v29 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 MessageBoxW(nullptr, L"Uknown strip type detected!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:434", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 v21 = uStripType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 v13 = pGame->pIndoorCameraD3D->GetPolygonMinZ(v8, uStripType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 v21 = uStripType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 v28 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 v26 = pGame->pIndoorCameraD3D->GetPolygonMaxZ(v8, uStripType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 if ( a3 - *((float *)v10 + 2) < *((float *)v10 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 if ( v31 + *((float *)v10 + 2) > *((float *)v10 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 if ( v30 - *((float *)v10 + 2) < *(float *)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 if ( v29 + *((float *)v10 + 2) > *(float *)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 if ( v28 - *((float *)v10 + 2) < *((float *)v10 + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 if ( v26 + *((float *)v10 + 2) > *((float *)v10 + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 Vec3_float_::NegDot(&v8->vWorldPosition, (Vec3_float_ *)LODWORD(v9), (float *)a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 v26 = *(float *)(LODWORD(v9) + 4) * *(float *)v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 + *(float *)(LODWORD(v9) + 8) * *((float *)v10 + 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 + *(unsigned int *)LODWORD(v9) * *((float *)v10 - 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 + *(float *)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 v22 = v26 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 v25 = LODWORD(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 v14 = (double)SLODWORD(v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 v28 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 if ( v14 <= *((float *)v10 + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 v15 = *(int *)&a2->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 if ( v15 & 2 || BYTE1(v15) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 v16 = *((int *)v10 + 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 if ( !(v16 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 LOBYTE(v16) = v16 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 *((int *)v10 + 5) = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 *((_QWORD *)v10 + 3) = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 v17 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 *((int *)v10 + 3) = LODWORD(v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 v18 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 v24->std__vector_30B00C[v24->uNumDecals] = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 ++v18->uNumDecals;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 ++v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 v10 += 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 result = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 if ( v32 >= (signed int)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 a3 = v8->vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 v11 = v8[3].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 LOBYTE(result) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 //----- (0049C095) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 void DecalBuilder::DrawDecal(Decal *pDecal, float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 Decal *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 double v4; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 double v5; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 unsigned __int8 v7; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 unsigned __int8 v8; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 char *v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 int v10; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 int v11; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 int v12; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 int v13; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 int v14; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 double v15; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 int v16; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 double v17; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 int v18; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 unsigned __int8 v19; // of@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 HRESULT v20; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 signed int v21; // [sp+Ch] [bp-864h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 const char *v22; // [sp+10h] [bp-860h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 int v23; // [sp+14h] [bp-85Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 unsigned int v24; // [sp+18h] [bp-858h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 RenderVertexD3D3 hr[64]; // [sp+20h] [bp-850h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 double v26; // [sp+820h] [bp-50h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 double v27; // [sp+828h] [bp-48h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 double v28; // [sp+830h] [bp-40h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 int v29; // [sp+838h] [bp-38h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 int v30; // [sp+83Ch] [bp-34h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 __int64 v31; // [sp+840h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 __int64 v32; // [sp+848h] [bp-28h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 __int64 v33; // [sp+850h] [bp-20h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 int v34; // [sp+858h] [bp-18h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 unsigned __int64 v35; // [sp+85Ch] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 float v36; // [sp+864h] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 int v37; // [sp+868h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 float v38; // [sp+86Ch] [bp-4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 float thisa; // [sp+878h] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 v3 = pDecal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 if ( pDecal->uNumVertices >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 if ( pDecal->field_C1C & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 v4 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 v4 = pDecal->field_C18->_43B570();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 thisa = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 v5 = get_shading_dist_mist();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 v7 = v3->uNumVertices == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 v8 = v3->uNumVertices < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 if ( !(v8 | v7) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 v9 = (char *)&hr[0].pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 v10 = (int)&v3->pVertices[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 v36 = 1.0 / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 v11 = pRenderer->GetActorTintColor(*(float *)v10, v3->field_C14, v6, v6, (RenderBillboard *)v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 LOBYTE(v12) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 v33 = ((unsigned int)v11 >> 16) & 0xFFi64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 LOBYTE(v38) = BYTE2(v3->field_C10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 v38 = (double)v33 * 0.0039215689 * thisa * (double)LOBYTE(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 v28 = v38 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 v31 = (unsigned __int16)v11 >> 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 LODWORD(v38) = BYTE1(v3->field_C10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 v38 = (double)v31 * 0.0039215689 * thisa * (double)SLODWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 v26 = v38 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 v35 = __PAIR__(LODWORD(v28), LODWORD(v26));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 v13 = v3->field_C10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 v32 = v12 & 0xFFi64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 v29 = (unsigned __int8)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 v38 = (double)v32 * 0.0039215689 * thisa * (double)(unsigned __int8)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 v27 = v38 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 v34 = LODWORD(v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 v14 = LODWORD(v27) | ((LODWORD(v26) | (LODWORD(v28) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 if ( a2 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 v15 = 1.0 - 1.0 / (v36 * *(float *)v10 * 1000.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 v15 = 1.0 - 1.0 / (v36 * *(float *)v10 * 1000.0) - a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 if ( v15 < 0.000099999997 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 v15 = 0.000099999997;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 *((float *)v9 + 1) = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 v16 = *(int *)(v10 + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 v17 = 1.0 / *(float *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 *((int *)v9 - 1) = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 *(int *)v9 = *(int *)(v10 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 *((int *)v9 + 5) = *(int *)(v10 + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 *((int *)v9 + 6) = *(int *)(v10 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 v18 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 *((int *)v9 + 3) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 *((int *)v9 + 4) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 v10 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 v9 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 v19 = __OFSUB__(v18, v3->uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 v8 = v18 - v3->uNumVertices < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 *((float *)v9 - 6) = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 if ( !(v8 ^ v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 v24 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 v21 = 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 v21 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 D3DPT_TRIANGLEFAN,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 452,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 hr,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 v3->uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 v21));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 //----- (0049C2CD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 void DecalBuilder::DrawDecals(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 DecalBuilder *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 signed int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 Decal *v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 if ( (signed int)this->std__vector_pDecals_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 v4 = this->std__vector_pDecals;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 DrawDecal(v4, a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 while ( v3 < (signed int)v2->std__vector_pDecals_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 //----- (0049C304) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 void DecalBuilder::DrawBloodsplats()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 unsigned int v1; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 int v2; // esi@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 char v3; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 HRESULT v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 HRESULT v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 HRESULT v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 HRESULT v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 HRESULT v8; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 HRESULT v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 HRESULT v10; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 char *v11; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 //IDirect3DDevice3Vtbl *v12; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 int v13; // ST6C_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 HRESULT v14; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 HRESULT v15; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 HRESULT v16; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 HRESULT v17; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 HRESULT v18; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 HRESULT v19; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 char thisa; // [sp+80h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 DecalBuilder *v21; // [sp+84h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 v3 = this->std__vector_pDecals_size == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 v21 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 if ( pRenderer->bUsingSpecular )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 ErrD3D(pRenderer->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 2u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 v11 = (char *)std__string_AE5B94.c_str();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 if ( !std__string_AE5B94.size() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 v11 = (char *)&dword_4D86F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 //v12 = pRenderer->pRenderD3D->pDevice->lpVtbl;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 v13 = (int)pGame->pIndoorCameraD3D->LoadTextureAndGetHardwarePtr(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(0, (IDirect3DTexture2 *)v13));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 v21->DrawDecals(0.00039999999);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, 2u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 if ( pRenderer->bUsingSpecular )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 //----- (0049C550) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 void DecalBuilder::DrawDecalDebugOutlines()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926 DecalBuilder *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 RenderVertexSoft *v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 if ( (signed int)this->std__vector_pDecals_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 v3 = this->std__vector_pDecals[0].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 pGame->pIndoorCameraD3D->debug_outline_sw(v3, *((int *)v3 - 1), 0xC86400u, 0.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 v3 = (RenderVertexSoft *)((char *)v3 + 3104);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 while ( v2 < (signed int)v1->std__vector_pDecals_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 //----- (0040E4C2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 void Decal::Decal_base_ctor()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 uNumVertices = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 for (uint i = 0; i < 64; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 pVertices[i].flt_2C = 0.0f;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 }