World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Структура DecalBuilder

#include <DecalBuilder.h>

+ Граф связей класса DecalBuilder:

Открытые члены

 DecalBuilder ()
 
virtual ~DecalBuilder ()
 
void AddBloodsplat (float x, float y, float z, float r, float g, float b, float radius, int a8, int a9)
 
void Reset (bool bPreserveBloodsplats)
 
char ApplyDecals (int light_level, char a3, struct stru154 *a4, int a5, struct RenderVertexSoft *a6, struct IndoorCameraD3D_Vec4 *a7, char a8, unsigned int uSectorID)
 
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)
 
bool ApplyBloodsplatDecals_IndoorFace (unsigned int uFaceID)
 
char ApplyDecals_OutdoorFace (ODMFace *pFace)
 
bool ApplyBloodSplatToTerrain (struct Polygon *a2, Vec3_float_ *a3, float *a4, struct RenderVertexSoft *a5, unsigned int uStripType, char a7)
 
void DrawDecals (float z_bias)
 
void DrawBloodsplats ()
 
void DrawDecalDebugOutlines ()
 

Открытые атрибуты

Decal Decals [1024]
 
unsigned int DecalsCount
 
int curent_decal_id
 
RenderVertexSoft pVertices [256]
 
int std__vector_30B00C [1024]
 
int uNumDecals = 0
 
float field_30C010 = 0
 
float field_30C014 = 0
 
float field_30C018 = 0
 
float field_30C01C = 0
 
float field_30C020 = 0
 
float field_30C024 = 0
 
float field_30C028 = 0
 
float field_30C02C = 0
 
float flt_30C030 = 0
 
float field_30C034 = 0
 
Loglog
 
BloodsplatContainerbloodsplat_container
 

Подробное описание

См. определение в файле DecalBuilder.h строка 123

Конструктор(ы)

◆ DecalBuilder()

DecalBuilder::DecalBuilder ( )
inline

См. определение в файле DecalBuilder.h строка 124

124  {
125  this->log = EngineIoc::ResolveLogger();
127 
128  this->DecalsCount = 0;
129  this->curent_decal_id = 0;
130  for (unsigned int i = 0; i < 256; ++i) {
131  this->pVertices[i].flt_2C = 0.0f;
132  }
133  }

Перекрестные ссылки bloodsplat_container, curent_decal_id, DecalsCount, RenderVertexSoft::flt_2C, log, pVertices, Engine_::IocContainer::ResolveBloodsplatContainer() и Engine_::IocContainer::ResolveLogger().

+ Граф вызовов:

◆ ~DecalBuilder()

virtual DecalBuilder::~DecalBuilder ( )
inlinevirtual

См. определение в файле DecalBuilder.h строка 135

135 {}

Методы

◆ AddBloodsplat()

void DecalBuilder::AddBloodsplat ( float  x,
float  y,
float  z,
float  r,
float  g,
float  b,
float  radius,
int  a8,
int  a9 
)

См. определение в файле DecalBuilder.cpp строка 50

51  {
53  x, y, z, radius, bankersRounding(r * 255.0f),
54  bankersRounding(g * 255.0f), bankersRounding(b * 255.0f));
55 }

Перекрестные ссылки BloodsplatContainer::AddBloodsplat(), bankersRounding() и bloodsplat_container.

Используется в Actor::DamageMonsterFromParty() и DamagePlayerFromMonster().

+ Граф вызовов:
+ Граф вызова функции:

◆ Reset()

void DecalBuilder::Reset ( bool  bPreserveBloodsplats)

См. определение в файле DecalBuilder.cpp строка 58

58  {
59  if (!bPreserveBloodsplats) {
62  }
63  DecalsCount = 0;
64 }

Перекрестные ссылки bloodsplat_container, DecalsCount, BloodsplatContainer::std__vector_pBloodsplats_size и BloodsplatContainer::uNumBloodsplats.

Используется в Application::Game::EventLoop(), OutdoorLocation::Initialize() и IndoorLocation::Load().

+ Граф вызова функции:

◆ ApplyDecals()

char DecalBuilder::ApplyDecals ( int  light_level,
char  a3,
struct stru154 a4,
int  a5,
struct RenderVertexSoft a6,
struct IndoorCameraD3D_Vec4 a7,
char  a8,
unsigned int  uSectorID 
)

См. определение в файле DecalBuilder.cpp строка 67

69  {
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 }

Перекрестные ссылки IndoorCameraD3D::_437376(), _43F5C8_get_point_light_level_with_respect_to_lights(), _49B790_build_decal_geometry(), Bloodsplat::b, bloodsplat_container, stru314::dist, Plane_float_::dist, Bloodsplat::dot_dist, stru154::face_plane, stru314::field_10, stru314::field_1C, Bloodsplat::g, IndoorCameraD3D::GetFacetOrientation(), log, stru314::Normal, pIndoorCameraD3D, stru154::polygonType, Bloodsplat::r, Bloodsplat::radius, std__vector_30B00C, BloodsplatContainer::std__vector_pBloodsplats, uNumDecals, Plane_float_::vNormal, Log::Warning(), Bloodsplat::x, Vec3_float_::x, Bloodsplat::y, Vec3_float_::y, Bloodsplat::z и Vec3_float_::z.

Используется в Render::DrawBuildingsD3D(), IndoorLocation::ExecDraw_d3d() и Render::RenderTerrainD3D().

+ Граф вызовов:
+ Граф вызова функции:

◆ _49B790_build_decal_geometry()

char DecalBuilder::_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 
)

См. определение в файле DecalBuilder.cpp строка 165

168  {
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 }

Перекрестные ссылки IndoorCameraD3D::_437143(), curent_decal_id, Decals, DecalsCount, Decal::DecalXPos, Decal::DecalYPos, Decal::DecalZPos, stru314::dist, engine, stru314::field_10, stru314::field_1C, field_30C010, field_30C014, field_30C018, field_30C01C, field_30C020, field_30C024, field_30C028, field_30C02C, field_30C034, Decal::field_C14, Decal::field_C18, Decal::field_C1C, flt_30C030, LEVEL_Outdoor, IndoorCameraD3D::LightmapFarClip(), IndoorCameraD3D::LightmapNeerClip(), log, stru314::Normal, pIndoorCameraD3D, IndoorCameraD3D::Project(), Decal::pVertices, RenderVertexSoft::u, Decal::uColorMultiplier, uCurrentlyLoadedLevelType, Decal::uNumVertices, RenderVertexSoft::v, IndoorCameraD3D::ViewTransform(), RenderVertexSoft::vWorldPosition, Log::Warning(), Bloodsplat::x, Vec3_float_::x, Bloodsplat::y, Vec3_float_::y, Bloodsplat::z и Vec3_float_::z.

Используется в ApplyDecals().

+ Граф вызовов:
+ Граф вызова функции:

◆ ApplyBloodsplatDecals_IndoorFace()

bool DecalBuilder::ApplyBloodsplatDecals_IndoorFace ( unsigned int  uFaceID)

См. определение в файле DecalBuilder.cpp строка 325

325  {
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 }

Перекрестные ссылки bloodsplat_container, Plane_float_::dist, Bloodsplat::dot_dist, BLVFace::Fluid(), BLVFace::Indoor_sky(), BLVFace::pBounding, BLVFace::pFacePlane, IndoorLocation::pFaces, pIndoor, Bloodsplat::radius, std__vector_30B00C, BloodsplatContainer::std__vector_pBloodsplats, BloodsplatContainer::std__vector_pBloodsplats_size, uNumDecals, Plane_float_::vNormal, Bloodsplat::x, Vec3_float_::x, BBox_short_::x1, BBox_short_::x2, Bloodsplat::y, Vec3_float_::y, BBox_short_::y1, BBox_short_::y2, Bloodsplat::z, Vec3_float_::z, BBox_short_::z1 и BBox_short_::z2.

Используется в IndoorLocation::ExecDraw_d3d().

+ Граф вызовов:
+ Граф вызова функции:

◆ ApplyDecals_OutdoorFace()

char DecalBuilder::ApplyDecals_OutdoorFace ( ODMFace pFace)

См. определение в файле DecalBuilder.cpp строка 358

358  {
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 }

Перекрестные ссылки bloodsplat_container, Plane_int_::dist, Bloodsplat::dot_dist, ODMFace::Fluid(), ODMFace::Indoor_sky(), ODMFace::pBoundingBox, ODMFace::pFacePlane, Bloodsplat::radius, round_to_int(), std__vector_30B00C, BloodsplatContainer::std__vector_pBloodsplats, BloodsplatContainer::std__vector_pBloodsplats_size, uNumDecals, Plane_int_::vNormal, Bloodsplat::x, BBox_short_::x1, BBox_short_::x2, Bloodsplat::y, BBox_short_::y1, BBox_short_::y2, Bloodsplat::z, BBox_short_::z1 и BBox_short_::z2.

Используется в Render::DrawBuildingsD3D().

+ Граф вызовов:
+ Граф вызова функции:

◆ ApplyBloodSplatToTerrain()

bool DecalBuilder::ApplyBloodSplatToTerrain ( struct Polygon a2,
Vec3_float_ a3,
float *  a4,
struct RenderVertexSoft a5,
unsigned int  uStripType,
char  a7 
)

См. определение в файле DecalBuilder.cpp строка 392

393  {
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 }

Перекрестные ссылки bloodsplat_container, Bloodsplat::dot_dist, Bloodsplat::field_1C, Bloodsplat::field_20, Polygon::flags, IndoorCameraD3D::GetPolygonMaxZ(), IndoorCameraD3D::GetPolygonMinZ(), log, Vec3_float_::NegDot(), pEventTimer, pIndoorCameraD3D, Bloodsplat::radius, std__vector_30B00C, BloodsplatContainer::std__vector_pBloodsplats, BloodsplatContainer::std__vector_pBloodsplats_size, Timer::Time(), uNumDecals, RenderVertexSoft::vWorldPosition, Log::Warning(), Bloodsplat::x, Vec3_float_::x, Bloodsplat::y, Vec3_float_::y, Bloodsplat::z и Vec3_float_::z.

Используется в Render::RenderTerrainD3D().

+ Граф вызовов:
+ Граф вызова функции:

◆ DrawDecals()

void DecalBuilder::DrawDecals ( float  z_bias)

См. определение в файле DecalBuilder.cpp строка 511

511  {
512  for (uint i = 0; i < DecalsCount; ++i)
513  render->DrawDecal(&Decals[i], z_bias);
514 }

Перекрестные ссылки Decals, DecalsCount и render.

Используется в DrawBloodsplats().

+ Граф вызова функции:

◆ DrawBloodsplats()

void DecalBuilder::DrawBloodsplats ( )

См. определение в файле DecalBuilder.cpp строка 517

517  {
518  if (!DecalsCount) return;
519 
520  render->BeginDecals();
521 
522  DrawDecals(0.00039999999); // 0.00039999999
523 
524  render->EndDecals();
525 }

Перекрестные ссылки DecalsCount, DrawDecals() и render.

Используется в Engine::Draw().

+ Граф вызовов:
+ Граф вызова функции:

◆ DrawDecalDebugOutlines()

void DecalBuilder::DrawDecalDebugOutlines ( )

См. определение в файле DecalBuilder.cpp строка 528

528  {
529  for (int i = 0; i < DecalsCount; i++)
531  Decals[i].pVertices, Decals[i].uNumVertices, 0xC86400u, 0.0f);
532 }

Перекрестные ссылки IndoorCameraD3D::debug_outline_sw(), Decals, DecalsCount, pIndoorCameraD3D, Decal::pVertices и Decal::uNumVertices.

Используется в Engine::draw_debug_outlines().

+ Граф вызовов:
+ Граф вызова функции:

Данные класса

◆ Decals

Decal DecalBuilder::Decals[1024]

См. определение в файле DecalBuilder.h строка 159

Используется в _49B790_build_decal_geometry(), DrawDecalDebugOutlines() и DrawDecals().

◆ DecalsCount

unsigned int DecalBuilder::DecalsCount

См. определение в файле DecalBuilder.h строка 160

Используется в Engine::_44EEA7(), _49B790_build_decal_geometry(), DecalBuilder(), DrawBloodsplats(), DrawDecalDebugOutlines(), DrawDecals() и Reset().

◆ curent_decal_id

int DecalBuilder::curent_decal_id

См. определение в файле DecalBuilder.h строка 161

Используется в Engine::_44EEA7(), _49B790_build_decal_geometry() и DecalBuilder().

◆ pVertices

RenderVertexSoft DecalBuilder::pVertices[256]

См. определение в файле DecalBuilder.h строка 162

Используется в DecalBuilder().

◆ std__vector_30B00C

int DecalBuilder::std__vector_30B00C[1024]

См. определение в файле DecalBuilder.h строка 163

Используется в ApplyBloodsplatDecals_IndoorFace(), ApplyBloodSplatToTerrain(), ApplyDecals() и ApplyDecals_OutdoorFace().

◆ uNumDecals

int DecalBuilder::uNumDecals = 0

◆ field_30C010

float DecalBuilder::field_30C010 = 0

См. определение в файле DecalBuilder.h строка 165

Используется в _49B790_build_decal_geometry().

◆ field_30C014

float DecalBuilder::field_30C014 = 0

См. определение в файле DecalBuilder.h строка 166

Используется в _49B790_build_decal_geometry().

◆ field_30C018

float DecalBuilder::field_30C018 = 0

См. определение в файле DecalBuilder.h строка 167

Используется в _49B790_build_decal_geometry().

◆ field_30C01C

float DecalBuilder::field_30C01C = 0

См. определение в файле DecalBuilder.h строка 168

Используется в _49B790_build_decal_geometry().

◆ field_30C020

float DecalBuilder::field_30C020 = 0

См. определение в файле DecalBuilder.h строка 169

Используется в _49B790_build_decal_geometry().

◆ field_30C024

float DecalBuilder::field_30C024 = 0

См. определение в файле DecalBuilder.h строка 170

Используется в _49B790_build_decal_geometry().

◆ field_30C028

float DecalBuilder::field_30C028 = 0

См. определение в файле DecalBuilder.h строка 171

Используется в _49B790_build_decal_geometry().

◆ field_30C02C

float DecalBuilder::field_30C02C = 0

См. определение в файле DecalBuilder.h строка 172

Используется в _49B790_build_decal_geometry().

◆ flt_30C030

float DecalBuilder::flt_30C030 = 0

См. определение в файле DecalBuilder.h строка 173

Используется в _49B790_build_decal_geometry().

◆ field_30C034

float DecalBuilder::field_30C034 = 0

См. определение в файле DecalBuilder.h строка 174

Используется в _49B790_build_decal_geometry().

◆ log

Log* DecalBuilder::log

См. определение в файле DecalBuilder.h строка 176

Используется в _49B790_build_decal_geometry(), ApplyBloodSplatToTerrain(), ApplyDecals() и DecalBuilder().

◆ bloodsplat_container

BloodsplatContainer* DecalBuilder::bloodsplat_container

См. определение в файле DecalBuilder.h строка 177

Используется в AddBloodsplat(), ApplyBloodsplatDecals_IndoorFace(), ApplyBloodSplatToTerrain(), ApplyDecals(), ApplyDecals_OutdoorFace(), DecalBuilder() и Reset().


Объявления и описания членов структур находятся в файлах:
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
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
Timer::Time
uint64_t Time()
Definition: Time.cpp:11
DecalBuilder::field_30C010
float field_30C010
Definition: DecalBuilder.h:165
Decal::DecalYPos
int16_t DecalYPos
Definition: DecalBuilder.h:111
Vec3_float_::x
float x
Definition: VectorTypes.h:89
Bloodsplat::b
unsigned char b
Definition: DecalBuilder.h:40
Engine_::IocContainer::ResolveBloodsplatContainer
static BloodsplatContainer * ResolveBloodsplatContainer()
Definition: IocContainer.cpp:67
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:407
Engine_::IocContainer::ResolveLogger
static Log * ResolveLogger()
Definition: IocContainer.cpp:51
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
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
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::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
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
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::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
RenderVertexSoft::flt_2C
float flt_2C
Definition: IRender.h:123
BLVFace::pBounding
struct BBox_short_ pBounding
Definition: Indoor.h:486
stru154::face_plane
Plane_float_ face_plane
Definition: Indoor.h:243
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
DecalBuilder::pVertices
RenderVertexSoft pVertices[256]
Definition: DecalBuilder.h:162
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
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
stru314
Definition: stru314.h:5
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
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
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
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