World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
DecalBuilder.cpp
См. документацию.
2 
3 #include <cstdlib>
4 #include <algorithm>
5 #include <string>
6 
7 #include "Engine/Engine.h"
8 #include "Engine/OurMath.h"
9 #include "Engine/Time.h"
10 #include "Engine/stru314.h"
11 
12 #include "Outdoor.h"
13 
14 #include "Engine/Graphics/stru9.h"
15 
16 //----- (0043B570) --------------------------------------------------------
18  double result = (field_20_time - pEventTimer->Time() + 384) / 384.0;
19  if (field_1C_flags & 1) {
20  if (result < 0)
21  result = 0.0;
22  } else {
23  result = 1.0;
24  }
25  return result;
26 }
27 
28 //----- (0043B6EF) --------------------------------------------------------
29 void BloodsplatContainer::AddBloodsplat(float x, float y, float z, float radius,
30  unsigned char r, unsigned char g,
31  unsigned char b) {
32  if (this->uNumBloodsplats == 64)
33  this->uNumBloodsplats = 0;
34  int i = this->uNumBloodsplats;
35  if (this->uNumBloodsplats == 64)
36  i = 0;
37 
38  this->std__vector_pBloodsplats[i].x = x;
39  this->std__vector_pBloodsplats[i].y = y;
40  this->std__vector_pBloodsplats[i].z = z;
41  this->std__vector_pBloodsplats[i].radius = radius;
42  this->std__vector_pBloodsplats[i].r = r;
43  this->std__vector_pBloodsplats[i].g = g;
44  this->std__vector_pBloodsplats[i].b = b;
45  this->std__vector_pBloodsplats_size = std::min(this->std__vector_pBloodsplats_size + 1, 64u);
46  this->uNumBloodsplats++;
47 }
48 
49 //----- (0049B490) --------------------------------------------------------
50 void DecalBuilder::AddBloodsplat(float x, float y, float z, float r, float g,
51  float b, float radius, int a8, int a9) {
53  x, y, z, radius, bankersRounding(r * 255.0f),
54  bankersRounding(g * 255.0f), bankersRounding(b * 255.0f));
55 }
56 
57 //----- (0049B525) --------------------------------------------------------
58 void DecalBuilder::Reset(bool bPreserveBloodsplats) {
59  if (!bPreserveBloodsplats) {
62  }
63  DecalsCount = 0;
64 }
65 
66 //----- (0049B540) --------------------------------------------------------
67 char DecalBuilder::ApplyDecals(int light_level, char LocationFlags, stru154 *a4, int a5,
69  char ClipFlags, unsigned int uSectorID) {
70  // LocationFlags 1 indoors 2 buildings 4 terrain
71 
72  stru154 *v16; // esi@12
73  int BloodSplatX; // ebx@21
74  int ColourMult; // [sp+3Ch] [bp-Ch]@21
75  // DecalBuilder *thisa; // [sp+40h] [bp-8h]@1
76  // RenderVertexSoft *a11; // [sp+44h] [bp-4h]@8
77  // int a6a;
78  // int *a6b;
79 
80  // __debugbreak();
81 
82  // auto a2 = light_level;
83  // auto a9 = uSectorID;
84 
85  // thisa = this;
86  if (!a5) return 0;
87 
88  static RenderVertexSoft static_AE4F90[64];
89  static bool __init_flag1 = false;
90  if (!__init_flag1) {
91  __init_flag1 = true;
92 
93  for (uint i = 0; i < 64; ++i) static_AE4F90[i].flt_2C = 0.0f;
94  }
95 
96  static stru314 static_AE4F60; // idb
97  /*static bool __init_flag2 = false;
98  if (!__init_flag2)
99  {
100  __init_flag2 = true;
101 
102  stru314::stru314(&static_AE4F60);
103  }*/
104 
105  // a11 = a6;
106  if (a7) {
107  for (int i = 0; i < a5; i++) {
108  memcpy(&static_AE4F90[i], a6, 0x30u);
109  ++a6;
110  }
111  v16 = a4;
112  if (pIndoorCameraD3D->_437376(a4, static_AE4F90, (unsigned int *)&a5) ==
113  1) {
114  if (!a5) return 0;
115  a6 = static_AE4F90;
116  }
117  } else {
118  v16 = a4;
119  }
120  // v18 = v16->face_plane.vNormal.z;
121  // v19 = v16->face_plane.vNormal.y;
122  // v20 = v16->face_plane.vNormal.x;
123  // v37 = (int)&static_AE4F60.field_1C;
124  static_AE4F60.Normal.y = v16->face_plane.vNormal.y;
125  static_AE4F60.Normal.x = v16->face_plane.vNormal.x;
126  // LODWORD(v36) = (DWORD)&static_AE4F60.field_10;
127  static_AE4F60.Normal.z = v16->face_plane.vNormal.z;
128  static_AE4F60.dist = v16->face_plane.dist;
130  v16->polygonType, &static_AE4F60.Normal, &static_AE4F60.field_10,
131  &static_AE4F60.field_1C))
132  log->Warning(L"Error: Failed to get the facet orientation");
133 
134  if (this->uNumDecals > 0) {
135  // a6b = this->std__vector_30B00C;
136  for (int i = 0; i < this->uNumDecals; ++i) {
137  // v21 = &pBloodsplatContainer->std__vector_pBloodsplats[*a6b];
138  int point_light_level =
140  light_level, uSectorID,
141  bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]].x,
142  bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]].y,
143  bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]].z);
144 
146  ((unsigned int)bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]].g << 8) |
147  ((unsigned int)bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]].r << 16);
148  BloodSplatX = (signed __int64)bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]].x;
149 
150  if (!this->_49B790_build_decal_geometry(
151  point_light_level, LocationFlags,
152  &bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]],
153  (int)&BloodSplatX,
155  ColourMult,
157  &static_AE4F60, a5, a6, ClipFlags))
158  log->Warning(L"Error: Failed to build decal geometry");
159  }
160  }
161  return 1;
162 }
163 
164 //----- (0049B790) --------------------------------------------------------
166  int LightLevel, char LocationFlags, Bloodsplat *blood, int DecalXPos, float DecalRadius,
167  unsigned int uColorMultiplier, float DecalDotDist, stru314 *FacetNormals, signed int a10,
168  RenderVertexSoft *a11, char uClipFlags) {
169 
170  // LocationFlags 1 indoors 2 buildings 4 terrain
171 
172  /*this->_49B790_build_decal_geometry(
173  point_light_level, LocationFlags,
174  &bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]],
175  (int)&BloodSplatX,
176  bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]].radius,
177  ColourMult,
178  bloodsplat_container->std__vector_pBloodsplats[this->std__vector_30B00C[i]].dot_dist,
179  &static_AE4F60, a5, a6, a8))*/
180 
181  Decal *decal; // edi@2
182  double v28; // st7@5
183  char result; // al@6
184  int v34; // eax@19
185  // std::string v37; // [sp-4h] [bp-24h]@15
186 
187  unsigned int a8b = 0;
188 
189  if (DecalRadius == 0.0f) return 1;
190  decal = &this->Decals[this->curent_decal_id];
191  this->Decals[this->curent_decal_id].field_C18 = (DecalBuilder_stru0 *)blood;
192  this->Decals[this->curent_decal_id].field_C1C = 0;
193  if (LocationFlags & 2) this->Decals[this->curent_decal_id].field_C1C = 1;
194 
195  this->field_30C028 = DecalRadius - DecalDotDist;
196  this->field_30C02C =
197  sqrt((DecalRadius + DecalRadius - this->field_30C028) * this->field_30C028);
198 
199  this->flt_30C030 = 1.0 - (DecalRadius - this->field_30C02C) / DecalRadius;
200  decal->DecalXPos = (signed __int64)(blood->x - DecalDotDist * FacetNormals->Normal.x);
201  decal->DecalYPos = (signed __int64)(blood->y - DecalDotDist * FacetNormals->Normal.y);
202  decal->DecalZPos = (signed __int64)(blood->z - DecalDotDist * FacetNormals->Normal.z);
203 
204  // for decal size
205  this->field_30C034 = DecalRadius * this->flt_30C030;
206  this->field_30C010 = this->field_30C034 * FacetNormals->field_10.x;
207  this->field_30C014 = this->field_30C034 * FacetNormals->field_10.y;
208  this->field_30C018 = this->field_30C034 * FacetNormals->field_10.z;
209 
210  this->field_30C01C = this->field_30C034 * FacetNormals->field_1C.x;
211  this->field_30C020 = this->field_30C034 * FacetNormals->field_1C.y;
212  this->field_30C024 = this->field_30C034 * FacetNormals->field_1C.z;
213 
214  // vertex position sizing
215  decal->pVertices[0].vWorldPosition.x =
216  (double)decal->DecalXPos - this->field_30C01C + this->field_30C010;
217  decal->pVertices[0].vWorldPosition.y =
218  (double)decal->DecalYPos - this->field_30C020 + this->field_30C014;
219  decal->pVertices[0].vWorldPosition.z =
220  (double)decal->DecalZPos - this->field_30C024 + this->field_30C018;
221  decal->pVertices[0].u = 0.0;
222  decal->pVertices[0].v = 0.0;
223 
224  decal->pVertices[1].vWorldPosition.x =
225  (double)decal->DecalXPos - this->field_30C01C - this->field_30C010;
226  decal->pVertices[1].vWorldPosition.y =
227  (double)decal->DecalYPos - this->field_30C020 - this->field_30C014;
228  decal->pVertices[1].vWorldPosition.z =
229  (double)decal->DecalZPos - this->field_30C024 - this->field_30C018;
230  decal->pVertices[1].u = 0.0;
231  decal->pVertices[1].v = 1.0;
232 
233  decal->pVertices[2].vWorldPosition.x =
234  (double)decal->DecalXPos + this->field_30C01C - this->field_30C010;
235  decal->pVertices[2].vWorldPosition.y =
236  (double)decal->DecalYPos + this->field_30C020 - this->field_30C014;
237  decal->pVertices[2].vWorldPosition.z =
238  (double)decal->DecalZPos + this->field_30C024 - this->field_30C018;
239  decal->pVertices[2].u = 1.0;
240  decal->pVertices[2].v = 1.0;
241 
242  decal->pVertices[3].vWorldPosition.x =
243  (double)decal->DecalXPos + this->field_30C01C + this->field_30C010;
244  decal->pVertices[3].vWorldPosition.y =
245  (double)decal->DecalYPos + this->field_30C020 + this->field_30C014;
246  decal->pVertices[3].vWorldPosition.z =
247  (double)decal->DecalZPos + this->field_30C024 + this->field_30C018;
248  decal->pVertices[3].u = 1.0;
249  decal->pVertices[3].v = 0.0;
250 
251 
252  //
253  for (uint i = 0; i < 4; ++i) {
254  v28 = FacetNormals->Normal.x * decal->pVertices[i].vWorldPosition.x +
255  FacetNormals->Normal.y * decal->pVertices[i].vWorldPosition.y +
256  FacetNormals->Normal.z * decal->pVertices[i].vWorldPosition.z + FacetNormals->dist;
257  decal->pVertices[i].vWorldPosition.x =
258  decal->pVertices[i].vWorldPosition.x - v28 * FacetNormals->Normal.x;
259  decal->pVertices[i].vWorldPosition.y =
260  decal->pVertices[i].vWorldPosition.y - v28 * FacetNormals->Normal.y;
261  decal->pVertices[i].vWorldPosition.z =
262  decal->pVertices[i].vWorldPosition.z - v28 * FacetNormals->Normal.z;
263  }
264 
265  decal->uColorMultiplier = uColorMultiplier;
266  decal->uNumVertices = 4;
267  decal->field_C14 = LightLevel;
268 
269  result = engine->pStru9Instance->_4980B9(
270  a11, a10, FacetNormals->Normal.x, FacetNormals->Normal.y, FacetNormals->Normal.z, decal->pVertices,
271  (signed int *)&decal->uNumVertices);
272 
273  if (result) {
274  if (!decal->uNumVertices) return 1;
275 
277  (unsigned int)decal->uNumVertices);
278  pIndoorCameraD3D->Project(decal->pVertices, decal->uNumVertices, 0);
279  if (!(uClipFlags & 1)) {
280  ++this->curent_decal_id;
281  v34 = 1024;
282  if (this->curent_decal_id == 1024) this->curent_decal_id = 0;
283  if ((signed int)(this->DecalsCount + 1) <= 1024)
284  v34 = this->DecalsCount + 1;
285  this->DecalsCount = v34;
286  return 1;
287  }
289  if (uClipFlags & 2) {
291  decal->uNumVertices,
292  this->pVertices, &a8b);
293  pIndoorCameraD3D->_437143(a8b, decal->pVertices,
294  this->pVertices,
295  (signed int *)&decal->uNumVertices);
296  } else if (uClipFlags & 4) {
298  decal->uNumVertices,
299  this->pVertices, &a8b);
300  pIndoorCameraD3D->_437143(a8b, decal->pVertices,
301  this->pVertices,
302  (signed int *)&decal->uNumVertices);
303  } else {
304  log->Warning(L"Undefined clip flag specified");
305  }
306  } else {
307  log->Warning(
308  L"Lightpoly builder native indoor clipping not implemented");
309  }
310  if (a8b != 0) {
311  ++this->curent_decal_id;
312  v34 = 1024;
313  if (this->curent_decal_id == 1024) this->curent_decal_id = 0;
314  if ((signed int)(this->DecalsCount + 1) <= 1024)
315  v34 = this->DecalsCount + 1;
316  this->DecalsCount = v34;
317  return 1;
318  }
319  result = 1;
320  }
321  return result;
322 }
323 
324 //----- (0049BBBD) --------------------------------------------------------
326  double v7; // st7@12
327 
328  uNumDecals = 0;
330  return true;
331 
332  BLVFace *pFace = &pIndoor->pFaces[uFaceID];
333 
334  if (pFace->Indoor_sky() || pFace->Fluid()) return true;
337  if (pFace->pBounding.x1 - pBloodsplat->radius < pBloodsplat->x &&
338  pFace->pBounding.x2 + pBloodsplat->radius > pBloodsplat->x &&
339  pFace->pBounding.y1 - pBloodsplat->radius < pBloodsplat->y &&
340  pFace->pBounding.y2 + pBloodsplat->radius > pBloodsplat->y &&
341  pFace->pBounding.z1 - pBloodsplat->radius < pBloodsplat->z &&
342  pFace->pBounding.z2 + pBloodsplat->radius > pBloodsplat->z) {
343  v7 = pFace->pFacePlane.vNormal.z * pBloodsplat->z +
344  pFace->pFacePlane.vNormal.y * pBloodsplat->y +
345  pFace->pFacePlane.vNormal.x * pBloodsplat->x +
346  pFace->pFacePlane.dist;
347  if (v7 <= pBloodsplat->radius) {
348  pBloodsplat->dot_dist = v7;
350  }
351  }
352  }
353 
354  return true;
355 }
356 
357 //----- (0049BCEB) --------------------------------------------------------
359  double v8; // st7@12
360  // unsigned int v10; // [sp+20h] [bp-1Ch]@1
361 
362  Bloodsplat *pBloodsplat;
363 
364  this->uNumDecals = 0;
365  // v10 = pBloodsplatContainer->std__vector_pBloodsplats_size;
366  if (!pFace->Indoor_sky() && !pFace->Fluid()) {
368  i++) {
370  if ((double)pFace->pBoundingBox.x1 - pBloodsplat->radius < pBloodsplat->x &&
371  (double)pFace->pBoundingBox.x2 + pBloodsplat->radius > pBloodsplat->x &&
372  (double)pFace->pBoundingBox.y1 - pBloodsplat->radius < pBloodsplat->y &&
373  (double)pFace->pBoundingBox.y2 + pBloodsplat->radius > pBloodsplat->y &&
374  (double)pFace->pBoundingBox.z1 - pBloodsplat->radius < pBloodsplat->z &&
375  (double)pFace->pBoundingBox.z2 + pBloodsplat->radius > pBloodsplat->z) {
376  v8 = (double)((pFace->pFacePlane.dist +
377  round_to_int(pBloodsplat->x) * pFace->pFacePlane.vNormal.x +
378  round_to_int(pBloodsplat->y) * pFace->pFacePlane.vNormal.y +
379  round_to_int(pBloodsplat->z) * pFace->pFacePlane.vNormal.z) >> 16);
380  if (v8 <= pBloodsplat->radius) {
381  pBloodsplat->dot_dist = v8;
382  this->std__vector_30B00C[this->uNumDecals++] = i;
383  }
384  }
385  }
386  }
387  return 1;
388 }
389 
390 //----- (0049BE8A) --------------------------------------------------------
391 // apply outdoor blodsplats
393  RenderVertexSoft *a5, unsigned int uStripType, char a7) {
394  bool result; // eax@1
395  // RenderVertexSoft *v8; // edi@3
396  // Vec3_float_ *v9; // ebx@3
397  // Bloodsplat *v10; // esi@3
398  // float v11; // eax@5
399  float WorldYPosD; // eax@6
400  // double v13; // st7@13
401  double v14; // st7@19
402  // short v15; // eax@20
403  int v16; // eax@22
404  // int v17; // edx@24
405  // DecalBuilder *v18; // eax@24
406  // std::string v19; // [sp-18h] [bp-54h]@12
407  // const char *v20; // [sp-8h] [bp-44h]@12
408  // int v21; // [sp-4h] [bp-40h]@12
409  double v22; // [sp+Ch] [bp-30h]@19
410  unsigned int NumBloodsplats; // [sp+14h] [bp-28h]@1
411  // DecalBuilder *v24; // [sp+18h] [bp-24h]@1
412  // int v25; // [sp+1Ch] [bp-20h]@19
413  float WorldMaxZ; // [sp+20h] [bp-1Ch]@12
414  // int v27; // [sp+24h] [bp-18h]@12
415  float WorldMinZ; // [sp+28h] [bp-14h]@13
416  // float v29; // [sp+2Ch] [bp-10h]@7
417  float WorldYPosU; // [sp+30h] [bp-Ch]@6
418  float WorldXPosL; // [sp+34h] [bp-8h]@6
419  // bool v32; // [sp+38h] [bp-4h]@2
420  float WorldXPosR;
421 
422  this->uNumDecals = 0;
423 
425  // v24 = this;
429  // v8 = a5;
430  // v9 = _WorldXPosR;
431  for (uint i = 0; i < (signed int)NumBloodsplats; ++i) {
432  if (uStripType == 4) {
433  WorldXPosR = a5[0].vWorldPosition.x; // left
434  // v11 = v8[3].vWorldPosition.x;
435  WorldXPosL = a5[3].vWorldPosition.x; // right
436  WorldYPosU = a5[1].vWorldPosition.y; // bott
437  WorldYPosD = a5[0].vWorldPosition.y; // top
438  // v29 = WorldYPosD;
439  } else if (uStripType == 3) {
440  if (a7) {
441  WorldXPosR = a5->vWorldPosition.x;
442  WorldXPosL = a5[2].vWorldPosition.x;
443  WorldYPosU = a5[1].vWorldPosition.y;
444  WorldYPosD = a5[2].vWorldPosition.y;
445  // v29 = WorldYPosD;
446  } else {
447  WorldXPosR = a5[1].vWorldPosition.x;
448  // v11 = v8[2].vWorldPosition.x;
449  WorldXPosL = a5[2].vWorldPosition.x;
450  WorldYPosU = a5[1].vWorldPosition.y;
451  WorldYPosD = a5->vWorldPosition.y;
452  // v29 = WorldYPosD;
453  }
454  } else {
455  log->Warning(L"Uknown strip type detected!");
456  }
457  // v21 = uStripType;
458  // v13 = pIndoorCameraD3D->GetPolygonMinZ(v8, uStripType);
459  // v21 = uStripType;
460  WorldMinZ = pIndoorCameraD3D->GetPolygonMinZ(a5, uStripType);
461  WorldMaxZ = pIndoorCameraD3D->GetPolygonMaxZ(a5, uStripType);
474  Vec3_float_::NegDot(&a5->vWorldPosition, _a3, a4);
475  WorldMaxZ = _a3->y * bloodsplat_container->std__vector_pBloodsplats[i].y +
478  v22 = WorldMaxZ + 0.5f;
479  // v25 = LODWORD(v22);
480  v14 = (double)HEXRAYS_SLODWORD(v22);
481  WorldMinZ = v14;
482  if (v14 <= bloodsplat_container->std__vector_pBloodsplats[i].radius) {
483  // v15 = a2->flags;
484  if (a2->flags & 2 || a2->flags & 0x100) {
487  v16 |= 1;
490  }
491  }
492  // v17 = v32;
493  bloodsplat_container->std__vector_pBloodsplats[i].dot_dist = HEXRAYS_LODWORD(WorldMinZ);
494  // v18 = this;
495  this->std__vector_30B00C[this->uNumDecals] = i;
496  ++this->uNumDecals;
497  }
498  }
499  }
500  // ++v32;
501  // ++v10;
502  result = i;
503  }
504  }
505  }
506 
507  return true;
508 }
509 
510 //----- (0049C2CD) --------------------------------------------------------
511 void DecalBuilder::DrawDecals(float z_bias) {
512  for (uint i = 0; i < DecalsCount; ++i)
513  render->DrawDecal(&Decals[i], z_bias);
514 }
515 
516 //----- (0049C304) --------------------------------------------------------
518  if (!DecalsCount) return;
519 
520  render->BeginDecals();
521 
522  DrawDecals(0.00039999999); // 0.00039999999
523 
524  render->EndDecals();
525 }
526 
527 //----- (0049C550) --------------------------------------------------------
529  for (int i = 0; i < DecalsCount; i++)
531  Decals[i].pVertices, Decals[i].uNumVertices, 0xC86400u, 0.0f);
532 }
533 
534 //----- (0040E4C2) --------------------------------------------------------
536  uNumVertices = -1;
537  for (uint i = 0; i < 64; ++i) pVertices[i].flt_2C = 0.0f;
538 }
DecalBuilder::log
Log * log
Definition: DecalBuilder.h:176
Bloodsplat::field_1C
int field_1C
Definition: DecalBuilder.h:42
DecalBuilder::field_30C020
float field_30C020
Definition: DecalBuilder.h:169
stru314::Normal
Vec3_float_ Normal
Definition: stru314.h:26
Vec3_float_
Definition: VectorTypes.h:74
stru314::field_1C
Vec3_float_ field_1C
Definition: stru314.h:28
stru154
Definition: Indoor.h:229
Decal::uNumVertices
int uNumVertices
Definition: DecalBuilder.h:108
Bloodsplat::dot_dist
float dot_dist
Definition: DecalBuilder.h:37
Decal::Decal_base_ctor
void Decal_base_ctor()
Definition: DecalBuilder.cpp:535
Timer::Time
uint64_t Time()
Definition: Time.cpp:11
DecalBuilder::ApplyBloodSplatToTerrain
bool ApplyBloodSplatToTerrain(struct Polygon *a2, Vec3_float_ *a3, float *a4, struct RenderVertexSoft *a5, unsigned int uStripType, char a7)
Definition: DecalBuilder.cpp:392
DecalBuilder::field_30C010
float field_30C010
Definition: DecalBuilder.h:165
Decal::DecalYPos
int16_t DecalYPos
Definition: DecalBuilder.h:111
Polygon
Definition: Polygon.h:14
Vec3_float_::x
float x
Definition: VectorTypes.h:89
Bloodsplat::b
unsigned char b
Definition: DecalBuilder.h:40
DecalBuilder::ApplyBloodsplatDecals_IndoorFace
bool ApplyBloodsplatDecals_IndoorFace(unsigned int uFaceID)
Definition: DecalBuilder.cpp:325
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:407
DecalBuilder::AddBloodsplat
void AddBloodsplat(float x, float y, float z, float r, float g, float b, float radius, int a8, int a9)
Definition: DecalBuilder.cpp:50
RenderVertexSoft::u
float u
Definition: IRender.h:121
_43F5C8_get_point_light_level_with_respect_to_lights
int _43F5C8_get_point_light_level_with_respect_to_lights(unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z)
Definition: Render.cpp:4229
Decal
Definition: DecalBuilder.h:98
BBox_short_::x1
int16_t x1
Definition: VectorTypes.h:114
engine
std::shared_ptr< Engine > engine
Definition: Engine.cpp:130
round_to_int
int round_to_int(float x)
Definition: OurMath.h:18
Bloodsplat::x
float x
Definition: DecalBuilder.h:33
Decal::pVertices
RenderVertexSoft pVertices[64]
Definition: DecalBuilder.h:109
stru314::field_10
Vec3_float_ field_10
Definition: stru314.h:27
BBox_short_::y1
int16_t y1
Definition: VectorTypes.h:116
Bloodsplat::g
unsigned char g
Definition: DecalBuilder.h:39
stru9.h
IndoorCameraD3D_Vec4
Definition: IndoorCameraD3D.h:32
Vec3_float_::y
float y
Definition: VectorTypes.h:90
Vec3_float_::z
float z
Definition: VectorTypes.h:91
stru314::dist
float dist
Definition: stru314.h:29
BLVFace::Indoor_sky
bool Indoor_sky() const
Definition: Indoor.h:450
BBox_short_::z2
int16_t z2
Definition: VectorTypes.h:119
pIndoor
IndoorLocation * pIndoor
Definition: Indoor.cpp:49
Engine.h
Plane_float_::vNormal
struct Vec3_float_ vNormal
Definition: VectorTypes.h:136
Plane_int_::vNormal
Vec3_int_ vNormal
Definition: VectorTypes.h:107
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
DecalBuilder::field_30C02C
float field_30C02C
Definition: DecalBuilder.h:172
Bloodsplat::z
float z
Definition: DecalBuilder.h:35
ODMFace::pBoundingBox
struct BBox_short_ pBoundingBox
Definition: BSPModel.h:145
BloodsplatContainer::uNumBloodsplats
int uNumBloodsplats
Definition: DecalBuilder.h:76
y
EGLSurface EGLint EGLint y
Definition: SDL_egl.h:1596
DecalBuilder::Reset
void Reset(bool bPreserveBloodsplats)
Definition: DecalBuilder.cpp:58
DecalBuilder::DrawDecalDebugOutlines
void DrawDecalDebugOutlines()
Definition: DecalBuilder.cpp:528
DecalBuilder::field_30C014
float field_30C014
Definition: DecalBuilder.h:166
Plane_float_::dist
float dist
Definition: VectorTypes.h:137
DecalBuilder::field_30C018
float field_30C018
Definition: DecalBuilder.h:167
Decal::field_C18
DecalBuilder_stru0 * field_C18
Definition: DecalBuilder.h:116
bankersRounding
int bankersRounding(const FloatType &value)
Definition: OurMath.h:98
Bloodsplat::radius
float radius
Definition: DecalBuilder.h:36
DecalBuilder_stru0::field_20_time
int64_t field_20_time
Definition: DecalBuilder.h:92
IndoorCameraD3D::LightmapNeerClip
void LightmapNeerClip(struct RenderVertexSoft *pInVertices, int uNumInVertices, struct RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices)
Definition: IndoorCameraD3D.cpp:958
DecalBuilder::Decals
Decal Decals[1024]
Definition: DecalBuilder.h:159
Bloodsplat::r
unsigned char r
Definition: DecalBuilder.h:38
x
EGLSurface EGLint x
Definition: SDL_egl.h:1596
DecalBuilder_stru0::_43B570_get_color_mult_by_time
double _43B570_get_color_mult_by_time()
Definition: DecalBuilder.cpp:17
IndoorCameraD3D::debug_outline_sw
void debug_outline_sw(struct RenderVertexSoft *a2, unsigned int uNumVertices, unsigned int uDiffuse, float a5)
Definition: IndoorCameraD3D.cpp:402
BloodsplatContainer::std__vector_pBloodsplats
Bloodsplat std__vector_pBloodsplats[64]
Definition: DecalBuilder.h:74
BloodsplatContainer::AddBloodsplat
void AddBloodsplat(float x, float y, float z, float r, float g, float b, float radius, int a8, int a9)
BBox_short_::y2
int16_t y2
Definition: VectorTypes.h:117
BLVFace
Definition: Indoor.h:424
Vec3_float_::NegDot
static float NegDot(Vec3_float_ *a1, Vec3_float_ *a2, float *a3)
Definition: VectorTypes.h:85
BLVFace::pFacePlane
struct Plane_float_ pFacePlane
Definition: Indoor.h:470
Log::Warning
void Warning(const wchar_t *pFormat,...)
Definition: Log.cpp:28
IndoorCameraD3D::Project
void Project(int x, int y, int z, int *screenspace_x, int *screenspace_y)
Definition: IndoorCameraD3D.cpp:1137
DecalBuilder::ApplyDecals
char ApplyDecals(int light_level, char a3, struct stru154 *a4, int a5, struct RenderVertexSoft *a6, struct IndoorCameraD3D_Vec4 *a7, char a8, unsigned int uSectorID)
Definition: DecalBuilder.cpp:67
DecalBuilder::ApplyDecals_OutdoorFace
char ApplyDecals_OutdoorFace(ODMFace *pFace)
Definition: DecalBuilder.cpp:358
DecalBuilder::field_30C028
float field_30C028
Definition: DecalBuilder.h:171
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
Decal::field_C1C
int field_C1C
Definition: DecalBuilder.h:117
Bloodsplat
Definition: DecalBuilder.h:13
LEVEL_Outdoor
@ LEVEL_Outdoor
Definition: Indoor.h:287
IndoorCameraD3D::_437143
void _437143(unsigned int uNumInVertices, struct RenderVertexSoft *pOutVertices, struct RenderVertexSoft *pInVertices, signed int *pOutNumVertices)
Definition: IndoorCameraD3D.cpp:823
DecalBuilder::flt_30C030
float flt_30C030
Definition: DecalBuilder.h:173
ODMFace::Indoor_sky
bool Indoor_sky() const
Definition: BSPModel.h:105
DecalBuilder::curent_decal_id
int curent_decal_id
Definition: DecalBuilder.h:161
DecalBuilder::field_30C024
float field_30C024
Definition: DecalBuilder.h:170
DecalBuilder::uNumDecals
int uNumDecals
Definition: DecalBuilder.h:164
IndoorCameraD3D::GetPolygonMinZ
double GetPolygonMinZ(struct RenderVertexSoft *pVertices, unsigned int uStripType)
Definition: IndoorCameraD3D.cpp:1156
Decal::uColorMultiplier
uint32_t uColorMultiplier
Definition: DecalBuilder.h:114
Decal::DecalZPos
int16_t DecalZPos
Definition: DecalBuilder.h:112
BLVFace::pBounding
struct BBox_short_ pBounding
Definition: Indoor.h:486
stru154::face_plane
Plane_float_ face_plane
Definition: Indoor.h:243
Outdoor.h
DecalBuilder::_49B790_build_decal_geometry
char _49B790_build_decal_geometry(int a2, char a3, Bloodsplat *a4, int a5, float a6, unsigned int uColorMultiplier, float a8, struct stru314 *a9, signed int a10, struct RenderVertexSoft *a11, char uClipFlags)
Definition: DecalBuilder.cpp:165
Plane_int_::dist
int dist
Definition: VectorTypes.h:108
IndoorCameraD3D::GetFacetOrientation
bool GetFacetOrientation(char polyType, struct Vec3_float_ *a2, struct Vec3_float_ *a3, struct Vec3_float_ *a4)
Definition: IndoorCameraD3D.cpp:237
DecalBuilder::bloodsplat_container
BloodsplatContainer * bloodsplat_container
Definition: DecalBuilder.h:177
Polygon::flags
__int16 flags
Definition: Polygon.h:35
Bloodsplat::field_20
unsigned long long field_20
Definition: DecalBuilder.h:43
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
RenderVertexSoft::v
float v
Definition: IRender.h:122
IndoorCameraD3D::_437376
char _437376(struct stru154 *thisa, struct RenderVertexSoft *a2, unsigned int *pOutNumVertices)
Definition: IndoorCameraD3D.cpp:629
uint
unsigned int uint
Definition: MM7.h:4
BLVFace::Fluid
bool Fluid() const
Definition: Indoor.h:449
RenderVertexSoft::vWorldPosition
Vec3_float_ vWorldPosition
Definition: IRender.h:116
ODMFace
Definition: BSPModel.h:93
stru154::polygonType
PolygonType polygonType
Definition: Indoor.h:244
DecalBuilder::field_30C034
float field_30C034
Definition: DecalBuilder.h:174
ODMFace::pFacePlane
struct Plane_int_ pFacePlane
Definition: BSPModel.h:131
DecalBuilder::DecalsCount
unsigned int DecalsCount
Definition: DecalBuilder.h:160
DecalBuilder_stru0::field_1C_flags
int field_1C_flags
Definition: DecalBuilder.h:91
stru314
Definition: stru314.h:5
OurMath.h
Decal::field_C14
int field_C14
Definition: DecalBuilder.h:115
Bloodsplat::y
float y
Definition: DecalBuilder.h:34
uCurrentlyLoadedLevelType
LEVEL_TYPE uCurrentlyLoadedLevelType
Definition: Indoor.cpp:52
IndoorLocation::pFaces
struct BLVFace * pFaces
Definition: Indoor.h:630
ODMFace::Fluid
bool Fluid() const
Definition: BSPModel.h:104
DecalBuilder_stru0
Definition: DecalBuilder.h:81
IndoorCameraD3D::ViewTransform
void ViewTransform(int x, int y, int z, int *transformed_x, int *transformed_y, int *transformed_z)
Definition: IndoorCameraD3D.cpp:184
BBox_short_::x2
int16_t x2
Definition: VectorTypes.h:115
DecalBuilder::DrawDecals
void DrawDecals(float z_bias)
Definition: DecalBuilder.cpp:511
RenderVertexSoft
Definition: IRender.h:113
BloodsplatContainer::std__vector_pBloodsplats_size
unsigned int std__vector_pBloodsplats_size
Definition: DecalBuilder.h:75
BBox_short_::z1
int16_t z1
Definition: VectorTypes.h:118
stru314.h
DecalBuilder::DrawBloodsplats
void DrawBloodsplats()
Definition: DecalBuilder.cpp:517
pIndoorCameraD3D
IndoorCameraD3D * pIndoorCameraD3D
Definition: IndoorCameraD3D.cpp:21
IndoorCameraD3D::LightmapFarClip
void LightmapFarClip(struct RenderVertexSoft *pInVertices, int uNumInVertices, struct RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices)
Definition: IndoorCameraD3D.cpp:848
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1112
DecalBuilder.h
Decal::DecalXPos
int16_t DecalXPos
Definition: DecalBuilder.h:110
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
DecalBuilder::field_30C01C
float field_30C01C
Definition: DecalBuilder.h:168
Time.h
IndoorCameraD3D::GetPolygonMaxZ
double GetPolygonMaxZ(struct RenderVertexSoft *pVertex, unsigned int uStripType)
Definition: IndoorCameraD3D.cpp:1168
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52
DecalBuilder::std__vector_30B00C
int std__vector_30B00C[1024]
Definition: DecalBuilder.h:163