annotate DecalBuilder.cpp @ 1439:468f434a8d8a

Слияние
author Ritor1
date Mon, 22 Jul 2013 18:00:58 +0600
parents cc9a3a24d61d
children c9e3b93ec570
rev   line source
0
Ritor1
parents:
diff changeset
1 #include "DecalBuilder.h"
Ritor1
parents:
diff changeset
2 #include "Game.h"
Ritor1
parents:
diff changeset
3 #include "Time.h"
Ritor1
parents:
diff changeset
4 #include "stru314.h"
Ritor1
parents:
diff changeset
5 #include "Outdoor.h"
Ritor1
parents:
diff changeset
6 #include "Log.h"
Ritor1
parents:
diff changeset
7
Ritor1
parents:
diff changeset
8 #include "mm7_data.h"
Ritor1
parents:
diff changeset
9
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 920
diff changeset
10 #include "stru9.h"
0
Ritor1
parents:
diff changeset
11
1277
1803172dffd9 header stuff
Grumpy7
parents: 1122
diff changeset
12 #include "Outdoor_stuff.h"
0
Ritor1
parents:
diff changeset
13
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15 struct DecalBuilder *pDecalBuilder = new DecalBuilder;
Ritor1
parents:
diff changeset
16 struct BloodsplatContainer *pBloodsplatContainer = new BloodsplatContainer;
Ritor1
parents:
diff changeset
17
Ritor1
parents:
diff changeset
18
Ritor1
parents:
diff changeset
19 //----- (0043B570) --------------------------------------------------------
Ritor1
parents:
diff changeset
20 double DecalBuilder_stru0::_43B570_get_color_mult_by_time()
Ritor1
parents:
diff changeset
21 {
Ritor1
parents:
diff changeset
22 double result; // st7@3
Ritor1
parents:
diff changeset
23
Ritor1
parents:
diff changeset
24 if (field_1C_flags & 1)
Ritor1
parents:
diff changeset
25 {
Ritor1
parents:
diff changeset
26 if ((field_20_time - pEventTimer->Time() + 384) / 384.0 >= 0.0)
Ritor1
parents:
diff changeset
27 result = (field_20_time - pEventTimer->Time() + 384) / 384.0;
Ritor1
parents:
diff changeset
28 else
Ritor1
parents:
diff changeset
29 result = 0.0;
Ritor1
parents:
diff changeset
30 }
Ritor1
parents:
diff changeset
31 else
Ritor1
parents:
diff changeset
32 {
Ritor1
parents:
diff changeset
33 result = 1.0;
Ritor1
parents:
diff changeset
34 }
Ritor1
parents:
diff changeset
35 return result;
Ritor1
parents:
diff changeset
36 }
Ritor1
parents:
diff changeset
37
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39
Ritor1
parents:
diff changeset
40
Ritor1
parents:
diff changeset
41
Ritor1
parents:
diff changeset
42 //----- (0043B6EF) --------------------------------------------------------
Ritor1
parents:
diff changeset
43 bool BloodsplatContainer::AddBloodsplat(float x, float y, float z, float radius, char r, char g, char b)
Ritor1
parents:
diff changeset
44 {
Ritor1
parents:
diff changeset
45 int *v8; // esi@1
Ritor1
parents:
diff changeset
46 int v9; // eax@3
Ritor1
parents:
diff changeset
47 Bloodsplat *v10; // eax@3
Ritor1
parents:
diff changeset
48 int *result; // eax@3
Ritor1
parents:
diff changeset
49 int v12; // ecx@3
Ritor1
parents:
diff changeset
50
Ritor1
parents:
diff changeset
51 v8 = &this->uNumBloodsplats;
Ritor1
parents:
diff changeset
52 if ( this->uNumBloodsplats == 64 )
Ritor1
parents:
diff changeset
53 *v8 = 0;
Ritor1
parents:
diff changeset
54 v9 = 5 * (*v8)++;
Ritor1
parents:
diff changeset
55 v10 = &this->std__vector_pBloodsplats[8 * v9 / 0x28u];
Ritor1
parents:
diff changeset
56 v10->x = x;
Ritor1
parents:
diff changeset
57 v10->y = y;
Ritor1
parents:
diff changeset
58 v10->z = z;
Ritor1
parents:
diff changeset
59 v10->radius = radius;
Ritor1
parents:
diff changeset
60 v10->r = r;
Ritor1
parents:
diff changeset
61 v10->g = g;
Ritor1
parents:
diff changeset
62 v10->b = b;
Ritor1
parents:
diff changeset
63 result = (int *)&this->std__vector_pBloodsplats_size;
Ritor1
parents:
diff changeset
64 v12 = this->std__vector_pBloodsplats_size + 1;
Ritor1
parents:
diff changeset
65 if ( v12 > 64 )
Ritor1
parents:
diff changeset
66 v12 = 64;
Ritor1
parents:
diff changeset
67 *result = v12;
Ritor1
parents:
diff changeset
68 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
69 return (bool)result;
Ritor1
parents:
diff changeset
70 }
Ritor1
parents:
diff changeset
71
Ritor1
parents:
diff changeset
72 //----- (0049B490) --------------------------------------------------------
Ritor1
parents:
diff changeset
73 bool DecalBuilder::AddBloodsplat(float x, float y, float z, float r, float g, float b, float radius, int a8, int a9)
Ritor1
parents:
diff changeset
74 {
Ritor1
parents:
diff changeset
75 //double v10; // ST1C_8@1
Ritor1
parents:
diff changeset
76 char v11; // ST24_1@1
Ritor1
parents:
diff changeset
77 //double v12; // ST1C_8@1
Ritor1
parents:
diff changeset
78 //double v13; // ST1C_8@1
Ritor1
parents:
diff changeset
79 int a7a; // [sp+40h] [bp+18h]@1
Ritor1
parents:
diff changeset
80 //float arg14a; // [sp+44h] [bp+1Ch]@1
Ritor1
parents:
diff changeset
81 //float arg14b; // [sp+44h] [bp+1Ch]@1
Ritor1
parents:
diff changeset
82 //float arg14c; // [sp+44h] [bp+1Ch]@1
Ritor1
parents:
diff changeset
83
Ritor1
parents:
diff changeset
84 /*arg14a = b * 255.0;
Ritor1
parents:
diff changeset
85 v10 = arg14a + 6.7553994e15;
Ritor1
parents:
diff changeset
86 v11 = LOBYTE(v10);
Ritor1
parents:
diff changeset
87 arg14b = g * 255.0;
Ritor1
parents:
diff changeset
88 v12 = arg14b + 6.7553994e15;
Ritor1
parents:
diff changeset
89 a7a = LODWORD(v12);
Ritor1
parents:
diff changeset
90 arg14c = r * 255.0;
Ritor1
parents:
diff changeset
91 v13 = arg14c + 6.7553994e15;*/
Ritor1
parents:
diff changeset
92 return pBloodsplatContainer->AddBloodsplat(x, y, z, radius,
Ritor1
parents:
diff changeset
93 //SLOBYTE(v13), a7a, v11);
Ritor1
parents:
diff changeset
94 r * 255.0f,
Ritor1
parents:
diff changeset
95 g * 255.0f,
Ritor1
parents:
diff changeset
96 b * 255.0f);
Ritor1
parents:
diff changeset
97 }
Ritor1
parents:
diff changeset
98
Ritor1
parents:
diff changeset
99 //----- (0049B525) --------------------------------------------------------
Ritor1
parents:
diff changeset
100 void DecalBuilder::Reset(unsigned int bPreserveBloodsplats)
Ritor1
parents:
diff changeset
101 {
Ritor1
parents:
diff changeset
102 if ( !bPreserveBloodsplats )
Ritor1
parents:
diff changeset
103 {
Ritor1
parents:
diff changeset
104 pBloodsplatContainer->std__vector_pBloodsplats_size = 0;
Ritor1
parents:
diff changeset
105 pBloodsplatContainer->uNumBloodsplats = 0;
Ritor1
parents:
diff changeset
106 }
Ritor1
parents:
diff changeset
107 std__vector_pDecals_size = 0;
Ritor1
parents:
diff changeset
108 }
Ritor1
parents:
diff changeset
109
Ritor1
parents:
diff changeset
110 //----- (0049B540) --------------------------------------------------------
638
ccf8b4815a1f GetActorTintColor fixed
Nomad
parents: 186
diff changeset
111 char DecalBuilder::ApplyDecals(int light_level, char a3, stru154 *a4, int a5, RenderVertexSoft *a6, IndoorCameraD3D_Vec4 *a7, char a8, unsigned int uSectorID)
0
Ritor1
parents:
diff changeset
112 {
Ritor1
parents:
diff changeset
113 char *v9; // eax@3
Ritor1
parents:
diff changeset
114 signed int v10; // ecx@3
Ritor1
parents:
diff changeset
115 RenderVertexSoft *v11; // eax@10
Ritor1
parents:
diff changeset
116 unsigned int v12; // edx@10
Ritor1
parents:
diff changeset
117 RenderVertexSoft *v13; // esi@11
Ritor1
parents:
diff changeset
118 RenderVertexSoft *v14; // edi@11
Ritor1
parents:
diff changeset
119 char v15; // zf@11
Ritor1
parents:
diff changeset
120 stru154 *v16; // esi@12
Ritor1
parents:
diff changeset
121 double v18; // st7@17
Ritor1
parents:
diff changeset
122 double v19; // st6@17
Ritor1
parents:
diff changeset
123 float v20; // eax@17
Ritor1
parents:
diff changeset
124 Bloodsplat *v21; // esi@21
Ritor1
parents:
diff changeset
125 int v22; // eax@21
Ritor1
parents:
diff changeset
126 int v23; // ecx@21
Ritor1
parents:
diff changeset
127 double v24; // st7@21
Ritor1
parents:
diff changeset
128 int v25; // ebx@21
Ritor1
parents:
diff changeset
129 double v26; // st7@21
Ritor1
parents:
diff changeset
130 int v27; // edi@21
Ritor1
parents:
diff changeset
131 double v28; // st7@21
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
132 float v29; // ST10_4@21
0
Ritor1
parents:
diff changeset
133 int v30; // ST08_4@21
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
134 //DecalBuilder *v31; // esi@21
0
Ritor1
parents:
diff changeset
135 int v32; // [sp+4h] [bp-44h]@18
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
136 float v33; // [sp+8h] [bp-40h]@21
0
Ritor1
parents:
diff changeset
137 stru314 *v34; // [sp+Ch] [bp-3Ch]@21
Ritor1
parents:
diff changeset
138 float v35; // [sp+10h] [bp-38h]@21
Ritor1
parents:
diff changeset
139 float v36; // [sp+14h] [bp-34h]@17
Ritor1
parents:
diff changeset
140 int v37; // [sp+18h] [bp-30h]@17
Ritor1
parents:
diff changeset
141 int a5a; // [sp+28h] [bp-20h]@21
Ritor1
parents:
diff changeset
142 int v39; // [sp+2Ch] [bp-1Ch]@21
Ritor1
parents:
diff changeset
143 int v40; // [sp+30h] [bp-18h]@21
Ritor1
parents:
diff changeset
144 int v41; // [sp+34h] [bp-14h]@22
Ritor1
parents:
diff changeset
145 int v42; // [sp+38h] [bp-10h]@21
Ritor1
parents:
diff changeset
146 int v43; // [sp+3Ch] [bp-Ch]@21
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
147 //DecalBuilder *thisa; // [sp+40h] [bp-8h]@1
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
148 //RenderVertexSoft *a11; // [sp+44h] [bp-4h]@8
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
149 int a6a;
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
150 int *a6b;
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
151
0
Ritor1
parents:
diff changeset
152
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
153 // __debugbreak();
0
Ritor1
parents:
diff changeset
154
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
155 //auto a2 = light_level;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
156 //auto a9 = uSectorID;
0
Ritor1
parents:
diff changeset
157
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
158 //thisa = this;
0
Ritor1
parents:
diff changeset
159 if ( !a5 )
Ritor1
parents:
diff changeset
160 return 0;
Ritor1
parents:
diff changeset
161
Ritor1
parents:
diff changeset
162 static RenderVertexSoft static_AE4F90[64];
Ritor1
parents:
diff changeset
163 static bool __init_flag1 = false;
Ritor1
parents:
diff changeset
164 if (!__init_flag1)
Ritor1
parents:
diff changeset
165 {
Ritor1
parents:
diff changeset
166 __init_flag1 = true;
Ritor1
parents:
diff changeset
167
Ritor1
parents:
diff changeset
168 for (uint i = 0; i < 64; ++i)
Ritor1
parents:
diff changeset
169 static_AE4F90[i].flt_2C = 0.0f;
Ritor1
parents:
diff changeset
170 }
Ritor1
parents:
diff changeset
171
Ritor1
parents:
diff changeset
172 static stru314 static_AE4F60; // idb
Ritor1
parents:
diff changeset
173 /*static bool __init_flag2 = false;
Ritor1
parents:
diff changeset
174 if (!__init_flag2)
Ritor1
parents:
diff changeset
175 {
Ritor1
parents:
diff changeset
176 __init_flag2 = true;
Ritor1
parents:
diff changeset
177
Ritor1
parents:
diff changeset
178 stru314::stru314(&static_AE4F60);
Ritor1
parents:
diff changeset
179 }*/
Ritor1
parents:
diff changeset
180
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
181 //a11 = a6;
0
Ritor1
parents:
diff changeset
182 if ( a7 )
Ritor1
parents:
diff changeset
183 {
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
184 for(int i=0; i < a5;i++)
0
Ritor1
parents:
diff changeset
185 {
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
186 memcpy(&static_AE4F90[i], a6, 0x30u);
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
187 ++a6;
0
Ritor1
parents:
diff changeset
188 }
Ritor1
parents:
diff changeset
189 v16 = a4;
Ritor1
parents:
diff changeset
190 if ( pGame->pIndoorCameraD3D->_437376(a4, static_AE4F90, (unsigned int *)&a5) == 1 )
Ritor1
parents:
diff changeset
191 {
Ritor1
parents:
diff changeset
192 if ( !a5 )
Ritor1
parents:
diff changeset
193 return 0;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
194 a6 = static_AE4F90;
0
Ritor1
parents:
diff changeset
195 }
Ritor1
parents:
diff changeset
196 }
Ritor1
parents:
diff changeset
197 else
Ritor1
parents:
diff changeset
198 {
Ritor1
parents:
diff changeset
199 v16 = a4;
Ritor1
parents:
diff changeset
200 }
Ritor1
parents:
diff changeset
201 v18 = v16->face_plane.vNormal.z;
Ritor1
parents:
diff changeset
202 v19 = v16->face_plane.vNormal.y;
Ritor1
parents:
diff changeset
203 v20 = v16->face_plane.vNormal.x;
Ritor1
parents:
diff changeset
204 v37 = (int)&static_AE4F60.field_1C;
Ritor1
parents:
diff changeset
205 static_AE4F60.field_4.y = v19;
Ritor1
parents:
diff changeset
206 static_AE4F60.field_4.x = v20;
Ritor1
parents:
diff changeset
207 LODWORD(v36) = (DWORD)&static_AE4F60.field_10;
Ritor1
parents:
diff changeset
208 static_AE4F60.field_4.z = v18;
Ritor1
parents:
diff changeset
209 static_AE4F60.dist = v16->face_plane.dist;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
210 if ( !pGame->pIndoorCameraD3D->GetFacetOrientation(v16->polygonType, &static_AE4F60.field_4, &static_AE4F60.field_10, &static_AE4F60.field_1C) )
0
Ritor1
parents:
diff changeset
211 {
Ritor1
parents:
diff changeset
212 MessageBoxW(nullptr, L"Error: Failed to get the facet orientation", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:101", 0);
Ritor1
parents:
diff changeset
213 }
Ritor1
parents:
diff changeset
214 int _a7 = 0;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
215 if ( this->uNumDecals > 0 )
0
Ritor1
parents:
diff changeset
216 {
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
217 a6b = this->std__vector_30B00C;
0
Ritor1
parents:
diff changeset
218 do
Ritor1
parents:
diff changeset
219 {
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
220 v21 = &pBloodsplatContainer->std__vector_pBloodsplats[*a6b];
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
221 v22 = _43F5C8_get_point_light_level_with_respect_to_lights(light_level, uSectorID, v21->x, v21->y, v21->z);
0
Ritor1
parents:
diff changeset
222 v23 = v21->b;
Ritor1
parents:
diff changeset
223 v24 = v21->x;
Ritor1
parents:
diff changeset
224 v42 = v22;
Ritor1
parents:
diff changeset
225 BYTE3(v22) = 0;
Ritor1
parents:
diff changeset
226 *(short *)((char *)&v22 + 1) = v21->r;
Ritor1
parents:
diff changeset
227 LOBYTE(v22) = v21->g;
Ritor1
parents:
diff changeset
228 v43 = v23 | (v22 << 8);
Ritor1
parents:
diff changeset
229 v25 = (signed __int64)v24;
Ritor1
parents:
diff changeset
230 v26 = v21->z;
Ritor1
parents:
diff changeset
231 v27 = (signed __int64)v21->y;
Ritor1
parents:
diff changeset
232 v37 = a8;
Ritor1
parents:
diff changeset
233 v40 = (signed __int64)v26;
Ritor1
parents:
diff changeset
234 v28 = v21->dot_dist;
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
235 //LODWORD(v36) = (uint32)a6;
0
Ritor1
parents:
diff changeset
236 a5a = v25;
Ritor1
parents:
diff changeset
237 v39 = v27;
Ritor1
parents:
diff changeset
238 LODWORD(v35) = a5;
Ritor1
parents:
diff changeset
239 v34 = &static_AE4F60;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
240 v33 = v28;
0
Ritor1
parents:
diff changeset
241 v32 = v23 | (v22 << 8);
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
242 v29 = v21->radius;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
243 //v30 = (int)v21;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
244 //v31 = thisa;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
245 if ( !this->_49B790_build_decal_geometry(v42, a3, (DecalBuilder_stru0 *)v21, (int)&a5a, SLODWORD(v29), v43, v33, &static_AE4F60, a5, a6, a8) )
0
Ritor1
parents:
diff changeset
246 {
Ritor1
parents:
diff changeset
247 MessageBoxW(nullptr, L"Error: Failed to build decal geometry", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:114", 0);
Ritor1
parents:
diff changeset
248 }
Ritor1
parents:
diff changeset
249 ++_a7;
1076
9b6e252658e8 more DecalBuilder
zipi
parents: 1075
diff changeset
250 ++a6b;
0
Ritor1
parents:
diff changeset
251 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 791
diff changeset
252 while ( _a7 < this->uNumDecals );
0
Ritor1
parents:
diff changeset
253 }
Ritor1
parents:
diff changeset
254 return 1;
Ritor1
parents:
diff changeset
255 }
Ritor1
parents:
diff changeset
256
Ritor1
parents:
diff changeset
257 //----- (0049B790) --------------------------------------------------------
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
258 char DecalBuilder::_49B790_build_decal_geometry(int a2, char a3, DecalBuilder_stru0 *a4, int a5, float a6, unsigned int uColorMultiplier, float a8, stru314 *a9, signed int a10, RenderVertexSoft *a11, char uClipFlags)
0
Ritor1
parents:
diff changeset
259 {
Ritor1
parents:
diff changeset
260 DecalBuilder *v12; // esi@1
Ritor1
parents:
diff changeset
261 Decal *v13; // edi@2
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
262 int *v14; // eax@2
0
Ritor1
parents:
diff changeset
263 double v15; // st7@4
Ritor1
parents:
diff changeset
264 double v16; // st7@4
Ritor1
parents:
diff changeset
265 int v17; // eax@4
Ritor1
parents:
diff changeset
266 stru314 *v18; // ebx@4
Ritor1
parents:
diff changeset
267 double v19; // st7@4
Ritor1
parents:
diff changeset
268 double v20; // st7@4
Ritor1
parents:
diff changeset
269 double v21; // st7@4
Ritor1
parents:
diff changeset
270 double v22; // st6@4
Ritor1
parents:
diff changeset
271 double v23; // st6@4
Ritor1
parents:
diff changeset
272 double v24; // st5@4
Ritor1
parents:
diff changeset
273 char *v25; // eax@4
Ritor1
parents:
diff changeset
274 signed int v26; // ecx@4
Ritor1
parents:
diff changeset
275 double v27; // st5@4
Ritor1
parents:
diff changeset
276 double v28; // st7@5
Ritor1
parents:
diff changeset
277 double v29; // st7@6
Ritor1
parents:
diff changeset
278 char result; // al@6
Ritor1
parents:
diff changeset
279 unsigned int *v31; // edi@7
Ritor1
parents:
diff changeset
280 RenderVertexSoft *v32; // ebx@8
Ritor1
parents:
diff changeset
281 std::string *v33; // ecx@15
Ritor1
parents:
diff changeset
282 int v34; // eax@19
Ritor1
parents:
diff changeset
283 const char *v35; // [sp-Ch] [bp-2Ch]@15
Ritor1
parents:
diff changeset
284 int v36; // [sp-8h] [bp-28h]@15
Ritor1
parents:
diff changeset
285 std::string v37; // [sp-4h] [bp-24h]@15
Ritor1
parents:
diff changeset
286 float v38; // [sp+8h] [bp-18h]@6
Ritor1
parents:
diff changeset
287 RenderVertexSoft *v39; // [sp+Ch] [bp-14h]@6
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
288 unsigned int v40; // [sp+10h] [bp-10h]@6
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
289
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
290 int a6a;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
291 RenderVertexSoft *a8a;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
292 unsigned int a8b = 0;
0
Ritor1
parents:
diff changeset
293
Ritor1
parents:
diff changeset
294 v12 = this;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
295 if ( a6 == 0.0 )
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
296 return 1;
0
Ritor1
parents:
diff changeset
297 v13 = &this->std__vector_pDecals[this->field_308008];
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
298 v14 = &this->std__vector_pDecals[this->field_308008].field_C1C;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
299 this->std__vector_pDecals[this->field_308008].field_C18 = a4;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
300 *v14 = 0;
0
Ritor1
parents:
diff changeset
301 if ( a3 & 2 )
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
302 *v14 = 1;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
303 v15 = a6 - a8;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
304 this->field_30C028 = v15;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
305 v16 = sqrt((a6 + a6 - v15) * v15);
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
306 v12->field_30C02C = v16;
0
Ritor1
parents:
diff changeset
307 v17 = a5;
Ritor1
parents:
diff changeset
308 v18 = a9;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
309 v12->flt_30C030 = 1.0 - (a6 - v16) / a6;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
310 v13->field_C08 = (signed __int64)((double)*(signed int *)v17 - a8 * v18->field_4.x);
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
311 v13->field_C0A = (signed __int64)((double)*(signed int *)(a5 + 4) - a8 * v18->field_4.y);
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
312 v19 = a6;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
313 v13->field_C0C = (signed __int64)((double)*(signed int *)(a5 + 8) - a8 * v18->field_4.z);
0
Ritor1
parents:
diff changeset
314 v20 = v19 * v12->flt_30C030;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
315 a8a = v13->pVertices;
0
Ritor1
parents:
diff changeset
316 v12->field_30C034 = v20;
Ritor1
parents:
diff changeset
317 v12->field_30C010 = v20 * v18->field_10.x;
Ritor1
parents:
diff changeset
318 v12->field_30C014 = v20 * v18->field_10.y;
Ritor1
parents:
diff changeset
319 v12->field_30C018 = v20 * v18->field_10.z;
Ritor1
parents:
diff changeset
320 v12->field_30C01C = v20 * v18->field_1C.x;
Ritor1
parents:
diff changeset
321 v12->field_30C020 = v20 * v18->field_1C.y;
Ritor1
parents:
diff changeset
322 v12->field_30C024 = v20 * v18->field_1C.z;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
323 a6a = v13->field_C08;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
324 v21 = (double)a6a;
0
Ritor1
parents:
diff changeset
325 v22 = v21 - v12->field_30C01C;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
326 a6a = v13->field_C0A;
0
Ritor1
parents:
diff changeset
327 v13->pVertices[0].vWorldPosition.x = v22 + v12->field_30C010;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
328 v23 = (double)a6a;
0
Ritor1
parents:
diff changeset
329 v24 = v23 - v12->field_30C020 + v12->field_30C014;
Ritor1
parents:
diff changeset
330 v25 = (char *)&v13->pVertices[0].vWorldPosition.y;
Ritor1
parents:
diff changeset
331 a6 = v13->field_C0C;
Ritor1
parents:
diff changeset
332 v26 = 4;
Ritor1
parents:
diff changeset
333 v13->pVertices[0].vWorldPosition.y = v24;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
334 v27 = (double)a6a;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
335 a6 = v27;
0
Ritor1
parents:
diff changeset
336 v13->pVertices[0].vWorldPosition.z = v27 - v12->field_30C024 + v12->field_30C018;
Ritor1
parents:
diff changeset
337 v13->pVertices[0].u = 0.0;
Ritor1
parents:
diff changeset
338 v13->pVertices[0].v = 0.0;
Ritor1
parents:
diff changeset
339 v13->pVertices[1].vWorldPosition.x = v21 - v12->field_30C01C - v12->field_30C010;
Ritor1
parents:
diff changeset
340 v13->pVertices[1].vWorldPosition.y = v23 - v12->field_30C020 - v12->field_30C014;
Ritor1
parents:
diff changeset
341 v13->pVertices[1].vWorldPosition.z = v27 - v12->field_30C024 - v12->field_30C018;
Ritor1
parents:
diff changeset
342 v13->pVertices[1].u = 0.0;
Ritor1
parents:
diff changeset
343 v13->pVertices[1].v = 1.0;
Ritor1
parents:
diff changeset
344 v13->pVertices[2].vWorldPosition.x = v21 + v12->field_30C01C - v12->field_30C010;
Ritor1
parents:
diff changeset
345 v13->pVertices[2].vWorldPosition.y = v23 + v12->field_30C020 - v12->field_30C014;
Ritor1
parents:
diff changeset
346 v13->pVertices[2].vWorldPosition.z = v27 + v12->field_30C024 - v12->field_30C018;
Ritor1
parents:
diff changeset
347 v13->pVertices[2].u = 1.0;
Ritor1
parents:
diff changeset
348 v13->pVertices[2].v = 1.0;
Ritor1
parents:
diff changeset
349 v13->pVertices[3].vWorldPosition.x = v21 + v12->field_30C01C + v12->field_30C010;
Ritor1
parents:
diff changeset
350 v13->pVertices[3].vWorldPosition.y = v23 + v12->field_30C020 + v12->field_30C014;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
351 v13->pVertices[3].vWorldPosition.z = a6 + v12->field_30C024 + v12->field_30C018;
0
Ritor1
parents:
diff changeset
352 v13->pVertices[3].u = 1.0;
Ritor1
parents:
diff changeset
353 v13->pVertices[3].v = 0.0;
Ritor1
parents:
diff changeset
354 do
Ritor1
parents:
diff changeset
355 {
Ritor1
parents:
diff changeset
356 v28 = v18->field_4.y * *(float *)v25
Ritor1
parents:
diff changeset
357 + *((float *)v25 - 1) * v18->field_4.x
Ritor1
parents:
diff changeset
358 + *((float *)v25 + 1) * v18->field_4.z
Ritor1
parents:
diff changeset
359 + v18->dist;
Ritor1
parents:
diff changeset
360 *((float *)v25 - 1) = *((float *)v25 - 1) - v28 * v18->field_4.x;
Ritor1
parents:
diff changeset
361 *(float *)v25 = *(float *)v25 - v28 * v18->field_4.y;
Ritor1
parents:
diff changeset
362 v25 += 48;
Ritor1
parents:
diff changeset
363 --v26;
Ritor1
parents:
diff changeset
364 *((float *)v25 - 11) = *((float *)v25 - 11) - v28 * v18->field_4.z;
Ritor1
parents:
diff changeset
365 }
Ritor1
parents:
diff changeset
366 while ( v26 );
Ritor1
parents:
diff changeset
367 v13->uColorMultiplier = uColorMultiplier;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
368 //v40 = (unsigned int *)&v13->uNumVertices;
0
Ritor1
parents:
diff changeset
369 v39 = v13->pVertices;
Ritor1
parents:
diff changeset
370 v13->uNumVertices = 4;
Ritor1
parents:
diff changeset
371 v13->field_C14 = a2;
Ritor1
parents:
diff changeset
372 v29 = v18->field_4.z;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
373 //a6a = (unsigned int *)&v13->uNumVertices;
0
Ritor1
parents:
diff changeset
374 v38 = v29;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
375 result = pGame->pStru9Instance->_4980B9(a11, a10, v18->field_4.x, v18->field_4.y, v38, v39, (unsigned int*)&v13->uNumVertices);
0
Ritor1
parents:
diff changeset
376 if ( result )
Ritor1
parents:
diff changeset
377 {
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
378 //v31 = a6a;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
379 if ( !v13->uNumVertices )
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
380 return 1;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
381 v32 = a8a;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
382 //v40 = *a6a;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
383 v39 = a8a;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
384 pGame->pIndoorCameraD3D->ViewTransform(a8a, (unsigned int)v13->uNumVertices);
0
Ritor1
parents:
diff changeset
385 v40 = 0;
1086
74ab0ed7e308 arrows working
zipi
parents: 1079
diff changeset
386 pGame->pIndoorCameraD3D->Project(v32, v13->uNumVertices, 0);
0
Ritor1
parents:
diff changeset
387 if ( !(uClipFlags & 1) )
Ritor1
parents:
diff changeset
388 {
Ritor1
parents:
diff changeset
389 ++v12->field_308008;
Ritor1
parents:
diff changeset
390 v34 = 1024;
Ritor1
parents:
diff changeset
391 if ( v12->field_308008 == 1024 )
Ritor1
parents:
diff changeset
392 v12->field_308008 = 0;
Ritor1
parents:
diff changeset
393 if ( (signed int)(v12->std__vector_pDecals_size + 1) <= 1024 )
Ritor1
parents:
diff changeset
394 v34 = v12->std__vector_pDecals_size + 1;
Ritor1
parents:
diff changeset
395 v12->std__vector_pDecals_size = v34;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
396 return 1;
0
Ritor1
parents:
diff changeset
397 }
Ritor1
parents:
diff changeset
398 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
Ritor1
parents:
diff changeset
399 {
Ritor1
parents:
diff changeset
400 if ( uClipFlags & 2 )
Ritor1
parents:
diff changeset
401 {
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
402 v40 = (int)&a8;
0
Ritor1
parents:
diff changeset
403 v39 = v12->pVertices;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
404 pGame->pIndoorCameraD3D->_436CDC_mess_with_lightmap__clipflag_2(v32, *v31, v12->pVertices, &a8b);
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
405 v40 = (int)v31;
0
Ritor1
parents:
diff changeset
406 v39 = v12->pVertices;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
407 pGame->pIndoorCameraD3D->_437143(a8b, v32, v12->pVertices, v31);
0
Ritor1
parents:
diff changeset
408 }
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
409 else if ( uClipFlags & 4 )
0
Ritor1
parents:
diff changeset
410 {
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
411 v40 = (int)&a8;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
412 v39 = v12->pVertices;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
413 pGame->pIndoorCameraD3D->_436F09_mess_with_lightmap__clipflag_4(v32, *v31, v12->pVertices, &a8b);
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
414 v40 = (int)v31;
0
Ritor1
parents:
diff changeset
415 v39 = v12->pVertices;
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
416 pGame->pIndoorCameraD3D->_437143(a8b, v32, v12->pVertices, v31);
0
Ritor1
parents:
diff changeset
417 }
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
418 else
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
419 {
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
420 v39 = (RenderVertexSoft *)"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:258";
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
421 v35 = "Undefined clip flag specified";
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
422 MessageBoxA(nullptr, v35, (const char *)v39, 0);
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
423 }
0
Ritor1
parents:
diff changeset
424 }
Ritor1
parents:
diff changeset
425 else
Ritor1
parents:
diff changeset
426 {
Ritor1
parents:
diff changeset
427 v39 = (RenderVertexSoft *)"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:263";
Ritor1
parents:
diff changeset
428 v35 = "Lightpoly builder native indoor clipping not implemented";
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
429 MessageBoxA(nullptr, v35, (const char *)v39, 0);
0
Ritor1
parents:
diff changeset
430 }
1077
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
431 if ( a8b != 0 )
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
432 {
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
433 ++v12->field_308008;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
434 v34 = 1024;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
435 if ( v12->field_308008 == 1024 )
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
436 v12->field_308008 = 0;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
437 if ( (signed int)(v12->std__vector_pDecals_size + 1) <= 1024 )
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
438 v34 = v12->std__vector_pDecals_size + 1;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
439 v12->std__vector_pDecals_size = v34;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
440 return 1;
2210109f280d DecalBuilder, AI_SpellAttack sparkles
zipi
parents: 1076
diff changeset
441 }
0
Ritor1
parents:
diff changeset
442 result = 1;
Ritor1
parents:
diff changeset
443 }
Ritor1
parents:
diff changeset
444 return result;
Ritor1
parents:
diff changeset
445 }
Ritor1
parents:
diff changeset
446
Ritor1
parents:
diff changeset
447 //----- (0049BBBD) --------------------------------------------------------
Ritor1
parents:
diff changeset
448 bool DecalBuilder::ApplyBloodsplatDecals_IndoorFace(unsigned int uFaceID)
Ritor1
parents:
diff changeset
449 {
Ritor1
parents:
diff changeset
450 double v7; // st7@12
Ritor1
parents:
diff changeset
451
1079
81a30c2e3e0a DecalBuilder small error
zipi
parents: 1077
diff changeset
452 uNumDecals = 0;
0
Ritor1
parents:
diff changeset
453 if (!pBloodsplatContainer->std__vector_pBloodsplats_size)
Ritor1
parents:
diff changeset
454 return true;
Ritor1
parents:
diff changeset
455
Ritor1
parents:
diff changeset
456 auto pFace = &pIndoor->pFaces[uFaceID];
Ritor1
parents:
diff changeset
457
Ritor1
parents:
diff changeset
458 if (pFace->uAttributes & 0x400000)
Ritor1
parents:
diff changeset
459 return true;
791
346f7069676a Indoor::GetSector and various stuff
Nomad
parents: 638
diff changeset
460 if (pFace->Fluid())
0
Ritor1
parents:
diff changeset
461 return true;
Ritor1
parents:
diff changeset
462 for (uint i = 0; i < pBloodsplatContainer->std__vector_pBloodsplats_size; ++i)
Ritor1
parents:
diff changeset
463 {
Ritor1
parents:
diff changeset
464 auto pBloodsplat = pBloodsplatContainer->std__vector_pBloodsplats + i;
Ritor1
parents:
diff changeset
465 if (pFace->pBounding.x1 - pBloodsplat->radius < pBloodsplat->x &&
Ritor1
parents:
diff changeset
466 pFace->pBounding.x2 + pBloodsplat->radius > pBloodsplat->x &&
Ritor1
parents:
diff changeset
467 pFace->pBounding.y1 - pBloodsplat->radius < pBloodsplat->y &&
Ritor1
parents:
diff changeset
468 pFace->pBounding.y2 + pBloodsplat->radius > pBloodsplat->y &&
Ritor1
parents:
diff changeset
469 pFace->pBounding.z1 - pBloodsplat->radius < pBloodsplat->z &&
Ritor1
parents:
diff changeset
470 pFace->pBounding.z2 + pBloodsplat->radius > pBloodsplat->z)
Ritor1
parents:
diff changeset
471 {
Ritor1
parents:
diff changeset
472 v7 = pFace->pFacePlane.vNormal.z * pBloodsplat->z +
Ritor1
parents:
diff changeset
473 pFace->pFacePlane.vNormal.y * pBloodsplat->y +
Ritor1
parents:
diff changeset
474 pFace->pFacePlane.vNormal.x * pBloodsplat->x +
Ritor1
parents:
diff changeset
475 pFace->pFacePlane.dist;
Ritor1
parents:
diff changeset
476 if (v7 <= pBloodsplat->radius)
Ritor1
parents:
diff changeset
477 {
Ritor1
parents:
diff changeset
478 pBloodsplat->dot_dist = v7;
Ritor1
parents:
diff changeset
479 std__vector_30B00C[uNumDecals++] = i;
Ritor1
parents:
diff changeset
480 }
Ritor1
parents:
diff changeset
481 }
Ritor1
parents:
diff changeset
482 }
Ritor1
parents:
diff changeset
483
Ritor1
parents:
diff changeset
484 return true;
Ritor1
parents:
diff changeset
485 }
Ritor1
parents:
diff changeset
486
Ritor1
parents:
diff changeset
487 //----- (0049BCEB) --------------------------------------------------------
Ritor1
parents:
diff changeset
488 char DecalBuilder::ApplyDecals_OutdoorFace(ODMFace *pFace)
Ritor1
parents:
diff changeset
489 {
1119
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
490 double v8; // st7@12
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
491 unsigned int v10; // [sp+20h] [bp-1Ch]@1
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
492
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
493 Bloodsplat *pBloodsplat;
0
Ritor1
parents:
diff changeset
494
1119
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
495 this->uNumDecals = 0;
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
496 v10 = pBloodsplatContainer->std__vector_pBloodsplats_size;
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
497 if ( !(pFace->uAttributes & 0x400000) && !(pFace->uAttributes & 0x10) )
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
498 {
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
499 for(int i = 0; i < pBloodsplatContainer->std__vector_pBloodsplats_size; i++ )
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
500 {
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
501 pBloodsplat = &pBloodsplatContainer->std__vector_pBloodsplats[i];
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
502 if ( (double)pFace->pBoundingBox.x1 - pBloodsplat->radius < pBloodsplat->x &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
503 (double)pFace->pBoundingBox.x2 + pBloodsplat->radius > pBloodsplat->x &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
504 (double)pFace->pBoundingBox.y1 - pBloodsplat->radius < pBloodsplat->y &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
505 (double)pFace->pBoundingBox.y2 + pBloodsplat->radius > pBloodsplat->y &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
506 (double)pFace->pBoundingBox.z1 - pBloodsplat->radius < pBloodsplat->z &&
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
507 (double)pFace->pBoundingBox.z2 + pBloodsplat->radius > pBloodsplat->z )
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
508 {
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
509 v8 = (double)((pFace->pFacePlane.dist
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
510 + round(pBloodsplat->x) * pFace->pFacePlane.vNormal.x
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
511 + round(pBloodsplat->y) * pFace->pFacePlane.vNormal.y
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
512 + round(pBloodsplat->z) * pFace->pFacePlane.vNormal.z) >> 16);
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
513 if ( v8 <= pBloodsplat->radius )
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
514 {
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
515 pBloodsplat->dot_dist = v8;
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
516 this->std__vector_30B00C[this->uNumDecals++] = i;
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
517 }
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
518 }
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
519 }
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
520 }
aa706cde7fda * dark spells working
zipi
parents: 1113
diff changeset
521 return 1;
0
Ritor1
parents:
diff changeset
522 }
Ritor1
parents:
diff changeset
523
Ritor1
parents:
diff changeset
524 //----- (0049BE8A) --------------------------------------------------------
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1277
diff changeset
525 bool DecalBuilder::_49BE8A(struct Polygon *a2, Vec3_float_ *_a3, float *a4, RenderVertexSoft *a5, unsigned int uStripType, char a7)
0
Ritor1
parents:
diff changeset
526 {
Ritor1
parents:
diff changeset
527 bool result; // eax@1
Ritor1
parents:
diff changeset
528 RenderVertexSoft *v8; // edi@3
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
529 Vec3_float_ *v9; // ebx@3
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
530 Bloodsplat *v10; // esi@3
0
Ritor1
parents:
diff changeset
531 float v11; // eax@5
Ritor1
parents:
diff changeset
532 float v12; // eax@6
Ritor1
parents:
diff changeset
533 double v13; // st7@13
Ritor1
parents:
diff changeset
534 double v14; // st7@19
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
535 short v15; // eax@20
0
Ritor1
parents:
diff changeset
536 int v16; // eax@22
Ritor1
parents:
diff changeset
537 int v17; // edx@24
Ritor1
parents:
diff changeset
538 DecalBuilder *v18; // eax@24
Ritor1
parents:
diff changeset
539 std::string v19; // [sp-18h] [bp-54h]@12
Ritor1
parents:
diff changeset
540 const char *v20; // [sp-8h] [bp-44h]@12
Ritor1
parents:
diff changeset
541 int v21; // [sp-4h] [bp-40h]@12
Ritor1
parents:
diff changeset
542 double v22; // [sp+Ch] [bp-30h]@19
Ritor1
parents:
diff changeset
543 unsigned int v23; // [sp+14h] [bp-28h]@1
Ritor1
parents:
diff changeset
544 DecalBuilder *v24; // [sp+18h] [bp-24h]@1
Ritor1
parents:
diff changeset
545 int v25; // [sp+1Ch] [bp-20h]@19
Ritor1
parents:
diff changeset
546 float v26; // [sp+20h] [bp-1Ch]@12
Ritor1
parents:
diff changeset
547 int v27; // [sp+24h] [bp-18h]@12
Ritor1
parents:
diff changeset
548 float v28; // [sp+28h] [bp-14h]@13
Ritor1
parents:
diff changeset
549 float v29; // [sp+2Ch] [bp-10h]@7
Ritor1
parents:
diff changeset
550 float v30; // [sp+30h] [bp-Ch]@6
Ritor1
parents:
diff changeset
551 float v31; // [sp+34h] [bp-8h]@6
Ritor1
parents:
diff changeset
552 bool v32; // [sp+38h] [bp-4h]@2
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
553 float a3;
0
Ritor1
parents:
diff changeset
554
Ritor1
parents:
diff changeset
555 this->uNumDecals = 0;
1113
39eaa6b00141 something to bool cast (performance warning) mostly fixed
Grumpy7
parents: 1086
diff changeset
556 result = pBloodsplatContainer->std__vector_pBloodsplats_size != 0;
0
Ritor1
parents:
diff changeset
557 v24 = this;
Ritor1
parents:
diff changeset
558 v23 = pBloodsplatContainer->std__vector_pBloodsplats_size;
Ritor1
parents:
diff changeset
559 if ( pBloodsplatContainer->std__vector_pBloodsplats_size )
Ritor1
parents:
diff changeset
560 {
Ritor1
parents:
diff changeset
561 v32 = 0;
Ritor1
parents:
diff changeset
562 if ( (signed int)pBloodsplatContainer->std__vector_pBloodsplats_size > 0 )
Ritor1
parents:
diff changeset
563 {
Ritor1
parents:
diff changeset
564 v8 = a5;
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
565 v9 = _a3;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
566 v10 = pBloodsplatContainer->std__vector_pBloodsplats;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
567 while ( v32 < (signed int)v23)
0
Ritor1
parents:
diff changeset
568 {
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
569 if ( uStripType == 4 )
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
570 {
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
571 a3 = v8->vWorldPosition.x;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
572 v11 = v8[3].vWorldPosition.x;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
573 v31 = v11;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
574 v30 = v8[1].vWorldPosition.y;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
575 v12 = v8->vWorldPosition.y;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
576 v29 = v12;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
577 }
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
578 else if ( uStripType == 3 )
0
Ritor1
parents:
diff changeset
579 {
Ritor1
parents:
diff changeset
580 if ( a7 )
Ritor1
parents:
diff changeset
581 {
Ritor1
parents:
diff changeset
582 a3 = v8->vWorldPosition.x;
Ritor1
parents:
diff changeset
583 v31 = v8[2].vWorldPosition.x;
Ritor1
parents:
diff changeset
584 v30 = v8[1].vWorldPosition.y;
Ritor1
parents:
diff changeset
585 v12 = v8[2].vWorldPosition.y;
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
586 v29 = v12;
0
Ritor1
parents:
diff changeset
587 }
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
588 else
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
589 {
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
590 a3 = v8[1].vWorldPosition.x;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
591 v11 = v8[2].vWorldPosition.x;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
592 v31 = v11;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
593 v30 = v8[1].vWorldPosition.y;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
594 v12 = v8->vWorldPosition.y;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
595 v29 = v12;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
596 }
0
Ritor1
parents:
diff changeset
597 }
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
598 else
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
599 MessageBoxW(nullptr, L"Uknown strip type detected!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\PolyProjector.cpp:434", 0);
0
Ritor1
parents:
diff changeset
600 v21 = uStripType;
Ritor1
parents:
diff changeset
601 v13 = pGame->pIndoorCameraD3D->GetPolygonMinZ(v8, uStripType);
Ritor1
parents:
diff changeset
602 v21 = uStripType;
Ritor1
parents:
diff changeset
603 v28 = v13;
Ritor1
parents:
diff changeset
604 v26 = pGame->pIndoorCameraD3D->GetPolygonMaxZ(v8, uStripType);
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
605 if ( a3 - v10->radius < v10->x &&
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
606 v31 + v10->radius > v10->x &&
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
607 v30 - v10->radius < v10->y &&
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
608 v29 + v10->radius > v10->y &&
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
609 v28 - v10->radius < v10->z &&
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
610 v26 + v10->radius > v10->z )
0
Ritor1
parents:
diff changeset
611 {
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
612 Vec3_float_::NegDot(&v8->vWorldPosition, v9, a4);
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
613 v26 = v9->y * v10->y
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
614 + v9->z * v10->z
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
615 + v9->x * v10->x
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
616 + *a4;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
617 v22 = v26 + 6.7553994e15;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
618 v25 = LODWORD(v22);
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
619 v14 = (double)SLODWORD(v22);
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
620 v28 = v14;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
621 if ( v14 <= v10->radius )
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
622 {
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
623 v15 = a2->flags;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
624 if ( v15 & 2 || BYTE1(v15) & 1 )
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
625 {
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
626 v16 = v10->field_1C;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
627 if ( !(v16 & 1) )
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
628 {
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
629 LOBYTE(v16) = v16 | 1;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
630 v10->field_1C = v16;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
631 v10->field_20 = pEventTimer->Time();
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
632 }
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
633 }
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
634 v17 = v32;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
635 v10->dot_dist = LODWORD(v28);
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
636 v18 = v24;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
637 v24->std__vector_30B00C[v24->uNumDecals] = v17;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
638 ++v18->uNumDecals;
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
639 }
0
Ritor1
parents:
diff changeset
640 }
Ritor1
parents:
diff changeset
641 ++v32;
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
642 ++v10;
0
Ritor1
parents:
diff changeset
643 result = v32;
Ritor1
parents:
diff changeset
644 }
Ritor1
parents:
diff changeset
645 }
Ritor1
parents:
diff changeset
646 }
Ritor1
parents:
diff changeset
647 LOBYTE(result) = 1;
Ritor1
parents:
diff changeset
648 return result;
Ritor1
parents:
diff changeset
649 }
Ritor1
parents:
diff changeset
650
Ritor1
parents:
diff changeset
651 //----- (0049C095) --------------------------------------------------------
Ritor1
parents:
diff changeset
652 void DecalBuilder::DrawDecal(Decal *pDecal, float z_bias)
Ritor1
parents:
diff changeset
653 {
Ritor1
parents:
diff changeset
654 signed int v21; // [sp+Ch] [bp-864h]@15
Ritor1
parents:
diff changeset
655 RenderVertexD3D3 pVerticesD3D[64]; // [sp+20h] [bp-850h]@6
Ritor1
parents:
diff changeset
656
Ritor1
parents:
diff changeset
657 if (pDecal->uNumVertices < 3)
Ritor1
parents:
diff changeset
658 {
Ritor1
parents:
diff changeset
659 Log::Warning(L"Decal has < 3 vertices");
Ritor1
parents:
diff changeset
660 return;
Ritor1
parents:
diff changeset
661 }
Ritor1
parents:
diff changeset
662
Ritor1
parents:
diff changeset
663 float color_mult;
Ritor1
parents:
diff changeset
664 if ( pDecal->field_C1C & 1 )
Ritor1
parents:
diff changeset
665 color_mult = 1.0;
Ritor1
parents:
diff changeset
666 else
Ritor1
parents:
diff changeset
667 color_mult = pDecal->field_C18->_43B570_get_color_mult_by_time();
Ritor1
parents:
diff changeset
668
Ritor1
parents:
diff changeset
669 for (uint i = 0; i < pDecal->uNumVertices; ++i)
Ritor1
parents:
diff changeset
670 {
Ritor1
parents:
diff changeset
671 uint uTint = pRenderer->GetActorTintColor(pDecal->pVertices[i].vWorldViewPosition.x, pDecal->field_C14, 0, 0, nullptr);
Ritor1
parents:
diff changeset
672
Ritor1
parents:
diff changeset
673 uint uTintR = (uTint >> 16) & 0xFF,
Ritor1
parents:
diff changeset
674 uTintG = (uTint >> 8) & 0xFF,
Ritor1
parents:
diff changeset
675 uTintB = uTint & 0xFF;
Ritor1
parents:
diff changeset
676
Ritor1
parents:
diff changeset
677 uint uDecalColorMultR = (pDecal->uColorMultiplier >> 16) & 0xFF,
Ritor1
parents:
diff changeset
678 uDecalColorMultG = (pDecal->uColorMultiplier >> 8) & 0xFF,
Ritor1
parents:
diff changeset
679 uDecalColorMultB = pDecal->uColorMultiplier & 0xFF;
Ritor1
parents:
diff changeset
680
Ritor1
parents:
diff changeset
681 uint uFinalR = floorf(uTintR / 255.0 * color_mult * uDecalColorMultR + 0.0f),
Ritor1
parents:
diff changeset
682 uFinalG = floorf(uTintG / 255.0 * color_mult * uDecalColorMultG + 0.0f),
Ritor1
parents:
diff changeset
683 uFinalB = floorf(uTintB / 255.0 * color_mult * uDecalColorMultB + 0.0f);
Ritor1
parents:
diff changeset
684
Ritor1
parents:
diff changeset
685
Ritor1
parents:
diff changeset
686 float v15;
Ritor1
parents:
diff changeset
687 if (fabs(z_bias) < 1e-5)
Ritor1
parents:
diff changeset
688 v15 = 1.0 - 1.0 / ((1.0f / get_shading_dist_mist()) * pDecal->pVertices[i].vWorldViewPosition.x * 1000.0);
Ritor1
parents:
diff changeset
689 else
Ritor1
parents:
diff changeset
690 {
Ritor1
parents:
diff changeset
691 v15 = 1.0 - 1.0 / ((1.0f / get_shading_dist_mist()) * pDecal->pVertices[i].vWorldViewPosition.x * 1000.0) - z_bias;
Ritor1
parents:
diff changeset
692 if (v15 < 0.000099999997)
Ritor1
parents:
diff changeset
693 v15 = 0.000099999997;
Ritor1
parents:
diff changeset
694 }
Ritor1
parents:
diff changeset
695
Ritor1
parents:
diff changeset
696 pVerticesD3D[i].pos.z = v15;
Ritor1
parents:
diff changeset
697
Ritor1
parents:
diff changeset
698 pVerticesD3D[i].pos.x = pDecal->pVertices[i].vWorldViewProjX;
Ritor1
parents:
diff changeset
699 pVerticesD3D[i].pos.y = pDecal->pVertices[i].vWorldViewProjY;
Ritor1
parents:
diff changeset
700 pVerticesD3D[i].texcoord.x = pDecal->pVertices[i].u;
Ritor1
parents:
diff changeset
701 pVerticesD3D[i].texcoord.y = pDecal->pVertices[i].v;
Ritor1
parents:
diff changeset
702 pVerticesD3D[i].diffuse = (uFinalR << 16) | (uFinalG << 8) | uFinalB;
Ritor1
parents:
diff changeset
703 pVerticesD3D[i].specular = 0;
Ritor1
parents:
diff changeset
704 pVerticesD3D[i].rhw = 1.0 / pDecal->pVertices[i].vWorldViewPosition.x;
Ritor1
parents:
diff changeset
705 }
Ritor1
parents:
diff changeset
706
Ritor1
parents:
diff changeset
707 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
708 v21 = D3DDP_DONOTLIGHT | D3DDP_DONOTCLIP | D3DDP_DONOTUPDATEEXTENTS;
Ritor1
parents:
diff changeset
709 else
Ritor1
parents:
diff changeset
710 v21 = D3DDP_DONOTLIGHT;
Ritor1
parents:
diff changeset
711
Ritor1
parents:
diff changeset
712 ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN,
Ritor1
parents:
diff changeset
713 D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
Ritor1
parents:
diff changeset
714 pVerticesD3D,
Ritor1
parents:
diff changeset
715 pDecal->uNumVertices,
Ritor1
parents:
diff changeset
716 v21));
Ritor1
parents:
diff changeset
717 }
Ritor1
parents:
diff changeset
718
Ritor1
parents:
diff changeset
719 //----- (0049C2CD) --------------------------------------------------------
Ritor1
parents:
diff changeset
720 void DecalBuilder::DrawDecals(float z_bias)
Ritor1
parents:
diff changeset
721 {
Ritor1
parents:
diff changeset
722 for (uint i = 0; i < std__vector_pDecals_size; ++i)
Ritor1
parents:
diff changeset
723 DrawDecal(std__vector_pDecals + i, z_bias);
Ritor1
parents:
diff changeset
724 }
Ritor1
parents:
diff changeset
725
Ritor1
parents:
diff changeset
726 //----- (0049C304) --------------------------------------------------------
Ritor1
parents:
diff changeset
727 void DecalBuilder::DrawBloodsplats()
Ritor1
parents:
diff changeset
728 {
Ritor1
parents:
diff changeset
729 if (!std__vector_pDecals_size)
Ritor1
parents:
diff changeset
730 return;
Ritor1
parents:
diff changeset
731
Ritor1
parents:
diff changeset
732 if (pRenderer->bUsingSpecular)
186
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
733 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, FALSE));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
734 ErrD3D(pRenderer->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_CLAMP));
0
Ritor1
parents:
diff changeset
735
186
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
736 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
737 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, FALSE));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
738 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
739 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
740 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
741 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE));
0
Ritor1
parents:
diff changeset
742
Ritor1
parents:
diff changeset
743 auto pTex = pGame->pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("hwsplat04");
Ritor1
parents:
diff changeset
744 ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(0, pTex));
Ritor1
parents:
diff changeset
745
Ritor1
parents:
diff changeset
746 DrawDecals(0.00039999999);
186
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
747 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_CW));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
748 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, TRUE));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
749 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
750 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE));
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
751 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ZERO));
0
Ritor1
parents:
diff changeset
752
Ritor1
parents:
diff changeset
753 if (pRenderer->bUsingSpecular)
186
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
754 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, TRUE));
0
Ritor1
parents:
diff changeset
755 }
Ritor1
parents:
diff changeset
756
Ritor1
parents:
diff changeset
757 //----- (0049C550) --------------------------------------------------------
Ritor1
parents:
diff changeset
758 void DecalBuilder::DrawDecalDebugOutlines()
Ritor1
parents:
diff changeset
759 {
1075
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
760 for(int i = 0; i < std__vector_pDecals_size; i++)
1e38e5c049f3 DecalBuilder cleaning and some type changes
zipi
parents: 1016
diff changeset
761 pGame->pIndoorCameraD3D->debug_outline_sw(std__vector_pDecals[i].pVertices, std__vector_pDecals[i].uNumVertices, 0xC86400u, 0.0);
0
Ritor1
parents:
diff changeset
762 }
Ritor1
parents:
diff changeset
763
Ritor1
parents:
diff changeset
764 //----- (0040E4C2) --------------------------------------------------------
Ritor1
parents:
diff changeset
765 void Decal::Decal_base_ctor()
Ritor1
parents:
diff changeset
766 {
Ritor1
parents:
diff changeset
767 uNumVertices = -1;
Ritor1
parents:
diff changeset
768 for (uint i = 0; i < 64; ++i)
Ritor1
parents:
diff changeset
769 pVertices[i].flt_2C = 0.0f;
Ritor1
parents:
diff changeset
770 }