World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл Render.cpp

См. исходные тексты.

Определения типов

using EngineIoc = Engine_::IocContainer
 

Функции

void ErrHR (HRESULT hr, const char *pAPI, const char *pFunction, const char *pFile, int line)
 
unsigned int BlendColors (unsigned int a1, unsigned int a2)
 
void Present32 (uint32_t *src, unsigned int src_pitch, uint32_t *dst, unsigned int dst_pitch)
 
void Present_NoColorKey ()
 
uint32_t Color32_SwapRedBlue (uint16_t color16)
 
int ODM_NearClip (unsigned int num_vertices)
 
int ODM_FarClip (unsigned int uNumVertices)
 
unsigned int _452442_color_cvt (unsigned __int16 a1, unsigned __int16 a2, int a3, int a4)
 
int GetActorTintColor (int max_dimm, int min_dimm, float distance, int a4, RenderBillboard *a5)
 
int _43F55F_get_billboard_light_level (RenderBillboard *a1, int uBaseLightLevel)
 
int _43F5C8_get_point_light_level_with_respect_to_lights (unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z)
 
int _46E44E_collide_against_faces_and_portals (unsigned int b1)
 
void _46E889_collide_against_bmodels (unsigned int ecx0)
 
int collide_against_floor (int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID)
 
void _46ED8A_collide_against_sprite_objects (unsigned int _this)
 
int _46EF01_collision_chech_player (int a1)
 
void _46E0B2_collide_against_decorations ()
 
int _46F04E_collide_against_portals ()
 
unsigned int sub_46DEF2 (signed int a2, unsigned int uLayingItemID)
 
void UpdateObjects ()
 
bool sub_47531C (int a1, int *a2, int pos_x, int pos_y, int pos_z, int dir_x, int dir_y, int dir_z, BLVFace *face, int a10)
 
bool sub_4754BF (int a1, int *a2, int X, int Y, int Z, int dir_x, int dir_y, int dir_z, BLVFace *face, int a10, int a11)
 
int sub_475665 (BLVFace *face, int a2, __int16 a3)
 
bool sub_4759C9 (BLVFace *face, int a2, int a3, __int16 a4)
 
bool sub_475D85 (Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4)
 
bool sub_475F30 (int *a1, BLVFace *a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9)
 
bool IsBModelVisible (BSPModel *model, int *reachable)
 
void sr_485F53 (Vec2_int_ *v)
 

Переменные

struct IDirectDrawClipper * pDDrawClipper
 
struct RenderVertexD3D3 pVertices [50]
 
RenderVertexSoft VertexRenderList [50]
 
RenderVertexSoft array_73D150 [20]
 
RenderVertexD3D3 d3d_vertex_buffer [50]
 
DDPIXELFORMAT ddpfPrimarySuface
 

Типы

◆ EngineIoc

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

Функции

◆ ErrHR()

void ErrHR ( HRESULT  hr,
const char *  pAPI,
const char *  pFunction,
const char *  pFile,
int  line 
)

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

60  {
61  if (SUCCEEDED(hr)) {
62  return;
63  }
64 
65  char msg[4096];
66  sprintf(msg, "%s error (%08X) in\n\t%s\nin\n\t%s:%u", pAPI, hr, pFunction,
67  pFile, line);
68 
69  char caption[1024];
70  sprintf(caption, "%s error", pAPI);
71 
72  Error(msg);
73 }

◆ BlendColors()

unsigned int BlendColors ( unsigned int  a1,
unsigned int  a2 
)

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

265  {
266  uint alpha =
267  (uint)floorf(0.5f + (a1 >> 24) / 255.0f * (a2 >> 24) / 255.0f * 255.0f);
268  uint red = (uint)floorf(0.5f + ((a1 >> 16) & 0xFF) / 255.0f *
269  ((a2 >> 16) & 0xFF) / 255.0f * 255.0f);
270  uint green = (uint)floorf(0.5f + ((a1 >> 8) & 0xFF) / 255.0f *
271  ((a2 >> 8) & 0xFF) / 255.0f * 255.0f);
272  uint blue = (uint)floorf(0.5f + ((a1 >> 0) & 0xFF) / 255.0f *
273  ((a2 >> 0) & 0xFF) / 255.0f * 255.0f);
274  return (alpha << 24) | (red << 16) | (green << 8) | blue;
275 }

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

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

◆ Present32()

void Present32 ( uint32_t src,
unsigned int  src_pitch,
uint32_t dst,
unsigned int  dst_pitch 
)

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

1213  {
1214  // return;
1215 
1216  for (uint y = 0; y < 8; ++y) {
1217  memcpy(dst + y * dst_pitch, src + y * src_pitch,
1218  src_pitch * sizeof(uint32_t));
1219  }
1220 
1221  for (uint y = 8; y < 352; ++y) {
1222  memcpy(dst + y * dst_pitch, src + y * src_pitch, 8 * sizeof(uint32_t));
1223  memcpy(dst + 8 + game_viewport_width + y * dst_pitch,
1224  src + 8 + game_viewport_width + y * src_pitch,
1225  174 /*172*/ * sizeof(uint32_t));
1226  }
1227 
1228  for (uint y = 352; y < 480; ++y) {
1229  memcpy(dst + y * dst_pitch, src + y * src_pitch,
1230  src_pitch * sizeof(uint32_t));
1231  }
1232 
1233  for (uint y = pViewport->uViewportTL_Y; y < pViewport->uViewportBR_Y + 1;
1234  ++y) {
1235  for (uint x = pViewport->uViewportTL_X; x < pViewport->uViewportBR_X;
1236  ++x) {
1237  if (src[x + y * src_pitch] !=
1238  0xFF00FCF8) { // FFF8FCF8 = Color32(Color16(g_mask | b_mask))
1239  dst[x + y * dst_pitch] = src[x + y * src_pitch];
1240  }
1241  }
1242  }
1243 }

Перекрестные ссылки game_viewport_width, pViewport, Viewport::uViewportTL_X и Viewport::uViewportTL_Y.

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

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

◆ Present_NoColorKey()

void Present_NoColorKey ( )

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

1245  {
1246  Render *r = (Render *)render.get();
1247 
1248  DDSURFACEDESC2 Dst = {0};
1249  Dst.dwSize = sizeof(Dst);
1250  if (r->LockSurface_DDraw4(r->pBackBuffer4, &Dst, DDLOCK_WAIT)) {
1251  Gdiplus::Rect rect(0, 0, Dst.dwWidth, Dst.dwHeight);
1252  Gdiplus::BitmapData bitmapData;
1253  r->p2DSurface->LockBits(&rect, Gdiplus::ImageLockModeRead,
1254  PixelFormat32bppARGB, &bitmapData);
1255  Present32((uint32_t *)bitmapData.Scan0, bitmapData.Width,
1256  (uint32_t *)Dst.lpSurface, Dst.lPitch / 4);
1257  r->p2DSurface->UnlockBits(&bitmapData);
1258  ErrD3D(r->pBackBuffer4->Unlock(NULL));
1259  }
1260 }

Перекрестные ссылки Present32() и render.

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

◆ Color32_SwapRedBlue()

uint32_t Color32_SwapRedBlue ( uint16_t  color16)

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

2733  {
2734  uint32_t c = color16;
2735  unsigned int b = (c & 31) * 8;
2736  unsigned int g = ((c >> 5) & 63) * 4;
2737  unsigned int r = ((c >> 11) & 31) * 8;
2738 
2739  return (b << 16) | (g << 8) | r;
2740 }

◆ ODM_NearClip()

int ODM_NearClip ( unsigned int  num_vertices)

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

3296  {
3297  float nearclip = pIndoorCameraD3D->GetNearClip();
3298  bool current_vertices_flag; // edi@1
3299  bool next_vertices_flag; // [sp+Ch] [bp-24h]@6
3300  double t; // st6@10
3301  bool bFound = false;
3302 
3303  if (!num_vertices) return 0;
3304  for (uint i = 0; i < num_vertices; ++i) { // есть ли пограничные вершины
3305  if (VertexRenderList[i].vWorldViewPosition.x > nearclip) {
3306  bFound = true;
3307  break;
3308  }
3309  }
3310  if (!bFound) return 0;
3311 
3312  memcpy(&VertexRenderList[num_vertices], &VertexRenderList[0],
3313  sizeof(VertexRenderList[0]));
3314  next_vertices_flag = false;
3315  current_vertices_flag = false;
3316  if (VertexRenderList[0].vWorldViewPosition.x <= nearclip)
3317  current_vertices_flag = true;
3318  // check for near clip plane(проверка по ближней границе)
3319  //
3320  // v3.__________________. v0
3321  // | |
3322  // | |
3323  // | |
3324  // ----------------------- 8.0(near_clip - 8.0)
3325  // | |
3326  // .__________________.
3327  // v2 v1
3328 
3329  int out_num_vertices = 0;
3330  for (uint i = 0; i < num_vertices; ++i) {
3331  next_vertices_flag =
3332  VertexRenderList[i + 1].vWorldViewPosition.x <= nearclip; //
3333  if (current_vertices_flag ^ next_vertices_flag) {
3334  if (next_vertices_flag) { // следующая вершина за ближней границей
3335  // t = near_clip - v0.x / v1.x - v0.x (формула получения
3336  // точки пересечения отрезка с плоскостью)
3337  t = (nearclip - VertexRenderList[i].vWorldViewPosition.x) /
3338  (VertexRenderList[i + 1].vWorldViewPosition.x -
3340  array_507D30[out_num_vertices].vWorldViewPosition.x = nearclip;
3341  array_507D30[out_num_vertices].vWorldViewPosition.y =
3345  t;
3346  array_507D30[out_num_vertices].vWorldViewPosition.z =
3350  t;
3351  array_507D30[out_num_vertices].u =
3352  VertexRenderList[i].u +
3353  (VertexRenderList[i + 1].u - VertexRenderList[i].u) * t;
3354  array_507D30[out_num_vertices].v =
3355  VertexRenderList[i].v +
3356  (VertexRenderList[i + 1].v - VertexRenderList[i].v) * t;
3357  array_507D30[out_num_vertices]._rhw = 1.0 / nearclip;
3358  } else { // текущая вершина за ближней границей
3359  t = (nearclip - VertexRenderList[i].vWorldViewPosition.x) /
3360  (VertexRenderList[i].vWorldViewPosition.x -
3362  array_507D30[out_num_vertices].vWorldViewPosition.x = nearclip;
3363  array_507D30[out_num_vertices].vWorldViewPosition.y =
3367  t;
3368  array_507D30[out_num_vertices].vWorldViewPosition.z =
3372  t;
3373  array_507D30[out_num_vertices].u =
3374  VertexRenderList[i].u +
3375  (VertexRenderList[i].u - VertexRenderList[i + 1].u) * t;
3376  array_507D30[out_num_vertices].v =
3377  VertexRenderList[i].v +
3378  (VertexRenderList[i].v - VertexRenderList[i + 1].v) * t;
3379  array_507D30[out_num_vertices]._rhw = 1.0 / nearclip;
3380  }
3381  // array_507D30[out_num_vertices]._rhw = 0x3E000000u;
3382  ++out_num_vertices;
3383  }
3384  if (!next_vertices_flag) {
3385  memcpy(&array_507D30[out_num_vertices], &VertexRenderList[i + 1],
3386  sizeof(VertexRenderList[i + 1]));
3387  out_num_vertices++;
3388  }
3389  current_vertices_flag = next_vertices_flag;
3390  }
3391  return out_num_vertices >= 3 ? out_num_vertices : 0;
3392 }

Перекрестные ссылки RenderVertexSoft::_rhw, array_507D30, IndoorCameraD3D::GetNearClip(), pIndoorCameraD3D, RenderVertexSoft::u, RenderVertexSoft::v, VertexRenderList, RenderVertexSoft::vWorldViewPosition, Vec3_float_::x, Vec3_float_::y и Vec3_float_::z.

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

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

◆ ODM_FarClip()

int ODM_FarClip ( unsigned int  uNumVertices)

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

3394  {
3395  bool current_vertices_flag; // [sp+Ch] [bp-28h]@6
3396  bool next_vertices_flag; // edi@1
3397  double t; // st6@10
3398  signed int depth_num_vertices; // [sp+18h] [bp-1Ch]@1
3399  bool bFound;
3400  //Доп инфо "Программирование трёхмерных игр для windows" Ламот стр 910
3401 
3402  bFound = false;
3403 
3404  memcpy(&VertexRenderList[uNumVertices], &VertexRenderList[0],
3405  sizeof(VertexRenderList[uNumVertices]));
3406  depth_num_vertices = 0;
3407  current_vertices_flag = false;
3408  if (VertexRenderList[0].vWorldViewPosition.x >=
3410  current_vertices_flag =
3411  true; //настоящая вершина больше границы видимости
3412  if ((signed int)uNumVertices <= 0) return 0;
3413  for (uint i = 0; i < uNumVertices; ++i) { // есть ли пограничные вершины
3414  if (VertexRenderList[i].vWorldViewPosition.x <
3416  bFound = true;
3417  break;
3418  }
3419  }
3420  if (!bFound) return 0;
3421  // check for far clip plane(проверка по дальней границе)
3422  //
3423  // v3.__________________. v0
3424  // | |
3425  // | |
3426  // | |
3427  // ----------------------- 8192.0(far_clip - 0x2000)
3428  // | |
3429  // .__________________.
3430  // v2 v1
3431 
3432  for (uint i = 0; i < uNumVertices; ++i) {
3433  next_vertices_flag = VertexRenderList[i + 1].vWorldViewPosition.x >=
3435  if (current_vertices_flag ^
3436  next_vertices_flag) { // одна из граней за границей видимости
3437  if (next_vertices_flag) { // следующая вершина больше границы
3438  // видимости(настоящая вершина меньше
3439  // границы видимости) - v3
3440  // t = far_clip - v2.x / v3.x - v2.x (формула получения точки
3441  // пересечения отрезка с плоскостью)
3442  t = (pIndoorCameraD3D->GetFarClip() -
3444  (VertexRenderList[i].vWorldViewPosition.x -
3446  array_507D30[depth_num_vertices].vWorldViewPosition.x =
3448  // New_y = v2.y + (v3.y - v2.y)*t
3449  array_507D30[depth_num_vertices].vWorldViewPosition.y =
3453  t;
3454  // New_z = v2.z + (v3.z - v2.z)*t
3455  array_507D30[depth_num_vertices].vWorldViewPosition.z =
3459  t;
3460  array_507D30[depth_num_vertices].u =
3461  VertexRenderList[i].u +
3462  (VertexRenderList[i].u - VertexRenderList[i + 1].u) * t;
3463  array_507D30[depth_num_vertices].v =
3464  VertexRenderList[i].v +
3465  (VertexRenderList[i].v - VertexRenderList[i + 1].v) * t;
3466  array_507D30[depth_num_vertices]._rhw =
3467  1.0 / pIndoorCameraD3D->GetFarClip();
3468  } else { // настоящая вершина больше границы видимости(следующая
3469  // вершина меньше границы видимости) - v0
3470  // t = far_clip - v1.x / v0.x - v1.x
3471  t = (pIndoorCameraD3D->GetFarClip() -
3473  (VertexRenderList[i + 1].vWorldViewPosition.x -
3475  array_507D30[depth_num_vertices].vWorldViewPosition.x =
3477  // New_y = (v0.y - v1.y)*t + v1.y
3478  array_507D30[depth_num_vertices].vWorldViewPosition.y =
3482  t;
3483  // New_z = (v0.z - v1.z)*t + v1.z
3484  array_507D30[depth_num_vertices].vWorldViewPosition.z =
3488  t;
3489  array_507D30[depth_num_vertices].u =
3490  VertexRenderList[i].u +
3491  (VertexRenderList[i + 1].u - VertexRenderList[i].u) * t;
3492  array_507D30[depth_num_vertices].v =
3493  VertexRenderList[i].v +
3494  (VertexRenderList[i + 1].v - VertexRenderList[i].v) * t;
3495  array_507D30[depth_num_vertices]._rhw =
3496  1.0 / pIndoorCameraD3D->GetFarClip();
3497  }
3498  ++depth_num_vertices;
3499  }
3500  if (!next_vertices_flag) { //оба в границе видимости
3501  memcpy(&array_507D30[depth_num_vertices], &VertexRenderList[i + 1],
3502  sizeof(array_507D30[depth_num_vertices]));
3503  depth_num_vertices++;
3504  }
3505  current_vertices_flag = next_vertices_flag;
3506  }
3507  return depth_num_vertices >= 3 ? depth_num_vertices : 0;
3508 }

Перекрестные ссылки RenderVertexSoft::_rhw, array_507D30, IndoorCameraD3D::GetFarClip(), pIndoorCameraD3D, RenderVertexSoft::u, Polygon::uNumVertices, RenderVertexSoft::v, VertexRenderList, RenderVertexSoft::vWorldViewPosition, Vec3_float_::x, Vec3_float_::y и Vec3_float_::z.

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

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

◆ _452442_color_cvt()

unsigned int _452442_color_cvt ( unsigned __int16  a1,
unsigned __int16  a2,
int  a3,
int  a4 
)

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

4082  {
4083  int v4; // ebx@0
4084  __int16 v5; // ST14_2@1
4085  __int16 v6; // dx@1
4086  int v7; // ecx@1
4087  __int16 v8; // ST10_2@1
4088  int v9; // edi@1
4089  unsigned __int16 v10 = 0; // dh@1@1
4090  int v11; // ebx@1
4091  int v12; // ebx@1
4092  __int16 a3a; // [sp+1Ch] [bp+8h]@1
4093 
4094  v5 = a2 >> 2;
4095  v6 = (unsigned __int16)a4 >> 2;
4096  v8 = a1 >> 2;
4097  a3a = (unsigned __int16)a3 >> 2;
4098  HEXRAYS_LOWORD(v7) = a3a;
4099  v9 = v7;
4100  HEXRAYS_LOWORD(v4) = ((unsigned __int16)a4 >> 2) & 0xE0;
4101  HEXRAYS_LOWORD(v7) = a3a & 0xE0;
4102  HEXRAYS_LOWORD(v9) = v9 & 0x1C00;
4103  v11 = v7 + v4;
4104  HEXRAYS_LOWORD(v7) = v5 & 0xE0;
4105  v12 = v7 + v11;
4106  HEXRAYS_LOWORD(v7) = v8 & 0xE0;
4107  __debugbreak(); // warning C4700: uninitialized local variable 'v10' used
4108  return (PID_TYPE(v8) + PID_TYPE(v5) + PID_TYPE(a3a) + PID_TYPE(v6)) |
4109  (v7 + v12) |
4110  ((v8 & 0x1C00) + (v5 & 0x1C00) + v9 +
4111  (__PAIR__(v10, (unsigned __int16)a4 >> 2) & 0x1C00));
4112 }

Перекрестные ссылки __debugbreak() и __PAIR__().

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

◆ GetActorTintColor()

int GetActorTintColor ( int  max_dimm,
int  min_dimm,
float  distance,
int  a4,
RenderBillboard a5 
)

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

4114  {
4115  signed int v6; // edx@1
4116  int v8; // eax@3
4117  double v9; // st7@12
4118  int v11; // ecx@28
4119  double v15; // st7@44
4120  int v18; // ST14_4@44
4121  signed int v20; // [sp+10h] [bp-4h]@10
4122  float a3c; // [sp+1Ch] [bp+8h]@44
4123  int a5a; // [sp+24h] [bp+10h]@44
4124 
4125  // v5 = a2;
4126  v6 = 0;
4127 
4129  return 8 * (31 - max_dimm) | ((8 * (31 - max_dimm) | ((31 - max_dimm) << 11)) << 8);
4130 
4131  if (pParty->armageddon_timer) return 0xFFFF0000;
4132 
4133  v8 = pWeather->bNight;
4134  if (engine->IsUnderwater())
4135  v8 = 0;
4136  if (v8) {
4137  v20 = 1;
4138  if (pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Active())
4139  v20 = pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower;
4140  v9 = (double)v20 * 1024.0;
4141  if (a4) {
4142  v6 = 216;
4143  goto LABEL_20;
4144  }
4145  if (distance <= v9) {
4146  if (distance > 0.0) {
4147  // a4b = distance * 216.0 / device_caps;
4148  // v10 = a4b + 6.7553994e15;
4149  // v6 = LODWORD(v10);
4150  v6 = floorf(0.5f + distance * 216.0 / v9);
4151  if (v6 > 216) {
4152  v6 = 216;
4153  goto LABEL_20;
4154  }
4155  }
4156  } else {
4157  v6 = 216;
4158  }
4159  if (distance != 0.0) {
4160  LABEL_20:
4161  if (a5) v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3);
4162  if (v6 > 216) v6 = 216;
4163  return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
4164  }
4165  // LABEL_19:
4166  v6 = 216;
4167  goto LABEL_20;
4168  }
4169 
4170  if (fabsf(distance) < 1.0e-6f) return 0xFFF8F8F8;
4171 
4172  // dim in measured in 8-steps
4173  v11 = 8 * (max_dimm - min_dimm);
4174  // v12 = v11;
4175  if (v11 >= 0) {
4176  if (v11 > 216) v11 = 216;
4177  } else {
4178  v11 = 0;
4179  }
4180 
4181  float fog_density_mult = 216.0f;
4182  if (a4)
4183  fog_density_mult +=
4184  distance / (double)pODMRenderParams->shading_dist_shade * 32.0;
4185 
4186  v6 = v11 + floorf(pOutdoor->fFogDensity * fog_density_mult + 0.5f);
4187 
4188  if (a5) v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3);
4189  if (v6 > 216) v6 = 216;
4190  if (v6 < v11) v6 = v11;
4191  if (v6 > 8 * pOutdoor->max_terrain_dimming_level)
4193  if (!engine->IsUnderwater()) {
4194  return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
4195  } else {
4196  v15 = (double)(255 - v6) * 0.0039215689;
4197  a3c = v15;
4198  // a4c = v15 * 16.0;
4199  // v16 = a4c + 6.7553994e15;
4200  a5a = floorf(v15 * 16.0 + 0.5f); // LODWORD(v16);
4201  // a4d = a3c * 194.0;
4202  // v17 = a4d + 6.7553994e15;
4203  v18 = floorf(a3c * 194.0 + 0.5f); // LODWORD(v17);
4204  // a3d = a3c * 153.0;
4205  // v19 = a3d + 6.7553994e15;
4206  return (int)floorf(a3c * 153.0 + 0.5f) /*LODWORD(v19)*/ |
4207  ((v18 | (a5a << 8)) << 8);
4208  }
4209 }

Перекрестные ссылки _43F55F_get_billboard_light_level(), Party::armageddon_timer, Weather::bNight, engine, OutdoorLocation::fFogDensity, LEVEL_Indoor, OutdoorLocation::max_terrain_dimming_level, PARTY_BUFF_TORCHLIGHT, pODMRenderParams, pOutdoor, pParty, Party::pPartyBuffs, pWeather, ODMRenderParams::shading_dist_shade и uCurrentlyLoadedLevelType.

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

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

◆ _43F55F_get_billboard_light_level()

int _43F55F_get_billboard_light_level ( RenderBillboard a1,
int  uBaseLightLevel 
)

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

4212  {
4213  int v3 = 0;
4214 
4217  } else {
4218  if (uBaseLightLevel == -1) {
4219  v3 = a1->dimming_level;
4220  } else {
4221  v3 = uBaseLightLevel;
4222  }
4223  }
4224 
4226  v3, a1->uIndoorSectorID, a1->world_x, a1->world_y, a1->world_z);
4227 }

Перекрестные ссылки _43F5C8_get_point_light_level_with_respect_to_lights(), RenderBillboard::dimming_level, LEVEL_Indoor, pIndoor, IndoorLocation::pSectors, uCurrentlyLoadedLevelType, RenderBillboard::uIndoorSectorID, BLVSector::uMinAmbientLightLevel, RenderBillboard::world_x, RenderBillboard::world_y и RenderBillboard::world_z.

Используется в FindBillboardsLightLevels_BLV() и GetActorTintColor().

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

◆ _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 
)

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

4230  {
4231  signed int v6; // edi@1
4232  int v8; // eax@6
4233  int v9; // ebx@6
4234  unsigned int v10; // ecx@6
4235  unsigned int v11; // edx@9
4236  unsigned int v12; // edx@11
4237  signed int v13; // ecx@12
4238  BLVLightMM7 *v16; // esi@20
4239  int v17; // ebx@21
4240  signed int v24; // ecx@30
4241  int v26; // ebx@35
4242  int v37; // [sp+Ch] [bp-18h]@37
4243  int v39; // [sp+10h] [bp-14h]@23
4244  int v40; // [sp+10h] [bp-14h]@36
4245  int v42; // [sp+14h] [bp-10h]@22
4246  unsigned int v43; // [sp+18h] [bp-Ch]@12
4247  unsigned int v44; // [sp+18h] [bp-Ch]@30
4248  unsigned int v45; // [sp+18h] [bp-Ch]@44
4249 
4250  v6 = uBaseLightLevel;
4251  for (uint i = 0; i < pMobileLightsStack->uNumLightsActive; ++i) {
4253 
4254  float distX = abs(p->vPosition.x - x);
4255  if (distX <= p->uRadius) {
4256  float distY = abs(p->vPosition.y - y);
4257  if (distY <= p->uRadius) {
4258  float distZ = abs(p->vPosition.z - z);
4259  if (distZ <= p->uRadius) {
4260  v8 = distX;
4261  v9 = distY;
4262  v10 = distZ;
4263  if (distX < distY) {
4264  v8 = distY;
4265  v9 = distX;
4266  }
4267  if (v8 < distZ) {
4268  v11 = v8;
4269  v8 = distZ;
4270  v10 = v11;
4271  }
4272  if (v9 < (signed int)v10) {
4273  v12 = v10;
4274  v10 = v9;
4275  v9 = v12;
4276  }
4277  v43 = ((unsigned int)(11 * v9) / 32) + (v10 / 4) + v8;
4278  v13 = p->uRadius;
4279  if ((signed int)v43 < v13)
4280  v6 += ((unsigned __int64)(30i64 *
4281  (signed int)(v43 << 16) /
4282  v13) >>
4283  16) -
4284  30;
4285  }
4286  }
4287  }
4288  }
4289 
4291  BLVSector *pSector = &pIndoor->pSectors[uSectorID];
4292 
4293  for (uint i = 0; i < pSector->uNumLights; ++i) {
4294  v16 = pIndoor->pLights + pSector->pLights[i];
4295  if (~v16->uAtributes & 8) {
4296  v17 = abs(v16->vPosition.x - x);
4297  if (v17 <= v16->uRadius) {
4298  v42 = abs(v16->vPosition.y - y);
4299  if (v42 <= v16->uRadius) {
4300  v39 = abs(v16->vPosition.z - z);
4301  if (v39 <= v16->uRadius) {
4302  v44 = int_get_vector_length(v17, v42, v39);
4303  v24 = v16->uRadius;
4304  if ((signed int)v44 < v24)
4305  v6 += ((unsigned __int64)(30i64 *
4306  (signed int)(v44
4307  << 16) /
4308  v24) >>
4309  16) -
4310  30;
4311  }
4312  }
4313  }
4314  }
4315  }
4316  }
4317 
4318  for (uint i = 0; i < pStationaryLightsStack->uNumLightsActive; ++i) {
4319  // StationaryLight* p = &pStationaryLightsStack->pLights[i];
4320  v26 = abs(pStationaryLightsStack->pLights[i].vPosition.x - x);
4321  if (v26 <= pStationaryLightsStack->pLights[i].uRadius) {
4322  v40 = abs(pStationaryLightsStack->pLights[i].vPosition.y - y);
4323  if (v40 <= pStationaryLightsStack->pLights[i].uRadius) {
4324  v37 = abs(pStationaryLightsStack->pLights[i].vPosition.z - z);
4325  if (v37 <= pStationaryLightsStack->pLights[i].uRadius) {
4326  v45 = int_get_vector_length(v26, v40, v37);
4327  // v33 = pStationaryLightsStack->pLights[i].uRadius;
4328  if ((signed int)v45 <
4330  v6 += ((unsigned __int64)(30i64 *
4331  (signed int)(v45 << 16) /
4333  ->pLights[i]
4334  .uRadius) >>
4335  16) -
4336  30;
4337  }
4338  }
4339  }
4340  }
4341 
4342  if (v6 <= 31) {
4343  if (v6 < 0) v6 = 0;
4344  } else {
4345  v6 = 31;
4346  }
4347  return v6;
4348 }

Перекрестные ссылки int_get_vector_length(), LEVEL_Indoor, pIndoor, LightsStack_StationaryLight_::pLights, LightsStack_MobileLight_::pLights, BLVSector::pLights, IndoorLocation::pLights, pMobileLightsStack, IndoorLocation::pSectors, pStationaryLightsStack, BLVLightMM7::uAtributes, uCurrentlyLoadedLevelType, BLVSector::uNumLights, LightsStack_StationaryLight_::uNumLightsActive, LightsStack_MobileLight_::uNumLightsActive, StationaryLight::uRadius, BLVLightMM7::uRadius, StationaryLight::vPosition и BLVLightMM7::vPosition.

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

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

◆ _46E44E_collide_against_faces_and_portals()

int _46E44E_collide_against_faces_and_portals ( unsigned int  b1)

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

4350  {
4351  BLVSector *pSector; // edi@1
4352  int v2; // ebx@1
4353  BLVFace *pFace; // esi@2
4354  __int16 pNextSector; // si@10
4355  int pArrayNum; // ecx@12
4356  unsigned __int8 v6; // sf@12
4357  unsigned __int8 v7; // of@12
4358  int result; // eax@14
4359  // int v10; // ecx@15
4360  int pFloor; // eax@16
4361  int v15; // eax@24
4362  int v16; // edx@25
4363  int v17; // eax@29
4364  unsigned int v18; // eax@33
4365  int v21; // eax@35
4366  int v22; // ecx@36
4367  int v23; // eax@40
4368  unsigned int v24; // eax@44
4369  int a3; // [sp+10h] [bp-48h]@28
4370  int v26; // [sp+14h] [bp-44h]@15
4371  int i; // [sp+18h] [bp-40h]@1
4372  int a10; // [sp+1Ch] [bp-3Ch]@1
4373  int v29; // [sp+20h] [bp-38h]@14
4374  int v32; // [sp+2Ch] [bp-2Ch]@15
4375  int pSectorsArray[10]; // [sp+30h] [bp-28h]@1
4376 
4377  pSector = &pIndoor->pSectors[stru_721530.uSectorID];
4378  i = 1;
4379  a10 = b1;
4380  pSectorsArray[0] = stru_721530.uSectorID;
4381  for (v2 = 0; v2 < pSector->uNumPortals; ++v2) {
4382  pFace = &pIndoor->pFaces[pSector->pPortals[v2]];
4383  if (stru_721530.sMaxX <= pFace->pBounding.x2 &&
4384  stru_721530.sMinX >= pFace->pBounding.x1 &&
4385  stru_721530.sMaxY <= pFace->pBounding.y2 &&
4386  stru_721530.sMinY >= pFace->pBounding.y1 &&
4387  stru_721530.sMaxZ <= pFace->pBounding.z2 &&
4388  stru_721530.sMinZ >= pFace->pBounding.z1 &&
4389  abs((pFace->pFacePlane_old.dist +
4390  stru_721530.normal.x * pFace->pFacePlane_old.vNormal.x +
4391  stru_721530.normal.y * pFace->pFacePlane_old.vNormal.y +
4392  stru_721530.normal.z * pFace->pFacePlane_old.vNormal.z) >>
4393  16) <= stru_721530.field_6C + 16) {
4394  pNextSector = pFace->uSectorID == stru_721530.uSectorID
4395  ? pFace->uBackSectorID
4396  : pFace->uSectorID; // FrontSectorID
4397  pArrayNum = i++;
4398  v7 = i < 10;
4399  v6 = i - 10 < 0;
4400  pSectorsArray[pArrayNum] = pNextSector;
4401  if (!(v6 ^ v7)) break;
4402  }
4403  }
4404  result = 0;
4405  for (v29 = 0; v29 < i; v29++) {
4406  pSector = &pIndoor->pSectors[pSectorsArray[v29]];
4407  v32 = pSector->uNumFloors + pSector->uNumWalls + pSector->uNumCeilings;
4408  for (v26 = 0; v26 < v32; v26++) {
4409  pFloor = pSector->pFloors[v26];
4410  pFace = &pIndoor->pFaces[pSector->pFloors[v26]];
4411  if (!pFace->Portal() && stru_721530.sMaxX <= pFace->pBounding.x2 &&
4412  stru_721530.sMinX >= pFace->pBounding.x1 &&
4413  stru_721530.sMaxY <= pFace->pBounding.y2 &&
4414  stru_721530.sMinY >= pFace->pBounding.y1 &&
4415  stru_721530.sMaxZ <= pFace->pBounding.z2 &&
4416  stru_721530.sMinZ >= pFace->pBounding.z1 &&
4417  pFloor != stru_721530.field_84) {
4418  v15 =
4419  (pFace->pFacePlane_old.dist +
4420  stru_721530.normal.x * pFace->pFacePlane_old.vNormal.x +
4421  stru_721530.normal.y * pFace->pFacePlane_old.vNormal.y +
4422  stru_721530.normal.z * pFace->pFacePlane_old.vNormal.z) >>
4423  16;
4424  if (v15 > 0) {
4425  v16 = (pFace->pFacePlane_old.dist +
4426  stru_721530.normal2.x *
4427  pFace->pFacePlane_old.vNormal.x +
4428  stru_721530.normal2.y *
4429  pFace->pFacePlane_old.vNormal.y +
4430  stru_721530.normal2.z *
4431  pFace->pFacePlane_old.vNormal.z) >>
4432  16;
4433  if (v15 <= stru_721530.prolly_normal_d ||
4434  v16 <= stru_721530.prolly_normal_d) {
4435  if (v16 <= v15) {
4436  a3 = stru_721530.field_6C;
4437  if (sub_47531C(
4440  stru_721530.normal.z,
4443  stru_721530.direction.z, pFace, a10)) {
4444  v17 = a3;
4445  } else {
4446  a3 = stru_721530.field_6C +
4449  &stru_721530.direction, &a3,
4450  pFace))
4451  goto LABEL_34;
4452  v17 = a3 - stru_721530.prolly_normal_d;
4454  }
4455  if (v17 < stru_721530.field_7C) {
4456  stru_721530.field_7C = v17;
4457  v18 = 8 * pSector->pFloors[v26];
4458  v18 |= 6;
4459  stru_721530.pid = v18;
4460  }
4461  }
4462  }
4463  }
4464  LABEL_34:
4465  if (!(stru_721530.field_0 & 1) ||
4466  (v21 = (pFace->pFacePlane_old.dist +
4467  stru_721530.position.x *
4468  pFace->pFacePlane_old.vNormal.x +
4469  stru_721530.position.y *
4470  pFace->pFacePlane_old.vNormal.y +
4471  stru_721530.position.z *
4472  pFace->pFacePlane_old.vNormal.z) >>
4473  16,
4474  v21 <= 0) ||
4475  (v22 = (pFace->pFacePlane_old.dist +
4477  pFace->pFacePlane_old.vNormal.x +
4479  pFace->pFacePlane_old.vNormal.y +
4481  pFace->pFacePlane_old.vNormal.z) >>
4482  16,
4483  v21 > stru_721530.prolly_normal_d) &&
4484  v22 > stru_721530.prolly_normal_d ||
4485  v22 > v21)
4486  continue;
4487  a3 = stru_721530.field_6C;
4492  pFace, a10)) {
4493  v23 = a3;
4494  goto LABEL_43;
4495  }
4498  &a3, pFace)) {
4499  v23 = a3 - stru_721530.prolly_normal_d;
4501  LABEL_43:
4502  if (v23 < stru_721530.field_7C) {
4503  stru_721530.field_7C = v23;
4504  v24 = 8 * pSector->pFloors[v26];
4505  v24 |= 6;
4506  stru_721530.pid = v24;
4507  }
4508  }
4509  }
4510  }
4511  result = v29 + 1;
4512  }
4513  return result;
4514 }

Перекрестные ссылки stru141_actor_collision_object::direction, Plane_int_::dist, stru141_actor_collision_object::field_0, stru141_actor_collision_object::field_4C, stru141_actor_collision_object::field_50, stru141_actor_collision_object::field_54, stru141_actor_collision_object::field_6C, stru141_actor_collision_object::field_7C, stru141_actor_collision_object::field_84, stru141_actor_collision_object::field_8_radius, stru141_actor_collision_object::normal, stru141_actor_collision_object::normal2, BLVFace::pBounding, BLVFace::pFacePlane_old, IndoorLocation::pFaces, BLVSector::pFloors, stru141_actor_collision_object::pid, pIndoor, BLVFace::Portal(), stru141_actor_collision_object::position, BLVSector::pPortals, stru141_actor_collision_object::prolly_normal_d, IndoorLocation::pSectors, stru141_actor_collision_object::sMaxX, stru141_actor_collision_object::sMaxY, stru141_actor_collision_object::sMaxZ, stru141_actor_collision_object::sMinX, stru141_actor_collision_object::sMinY, stru141_actor_collision_object::sMinZ, stru_721530, sub_47531C(), sub_475D85(), BLVFace::uBackSectorID, BLVSector::uNumCeilings, BLVSector::uNumFloors, BLVSector::uNumPortals, BLVSector::uNumWalls, stru141_actor_collision_object::uSectorID, BLVFace::uSectorID, Plane_int_::vNormal, BBox_short_::x1, BBox_short_::x2, BBox_short_::y1, BBox_short_::y2, BBox_short_::z1 и BBox_short_::z2.

Используется в BLV_ProcessPartyActions(), UpdateActors_BLV() и SpriteObject::UpdateObject_fn0_BLV().

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

◆ _46E889_collide_against_bmodels()

void _46E889_collide_against_bmodels ( unsigned int  ecx0)

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

4516  {
4517  int v8; // eax@19
4518  int v9; // ecx@20
4519  int v10; // eax@24
4520  // unsigned int v14; // eax@28
4521  int v15; // eax@30
4522  int v16; // ecx@31
4523  // unsigned int v17; // eax@36
4524  int v21; // eax@42
4525  // unsigned int v22; // eax@43
4526  int a2; // [sp+84h] [bp-4h]@23
4527  BLVFace face; // [sp+Ch] [bp-7Ch]@1
4528 
4529  for (BSPModel &model : pOutdoor->pBModels) {
4530  if (stru_721530.sMaxX <= model.sMaxX &&
4531  stru_721530.sMinX >= model.sMinX &&
4532  stru_721530.sMaxY <= model.sMaxY &&
4533  stru_721530.sMinY >= model.sMinY &&
4534  stru_721530.sMaxZ <= model.sMaxZ &&
4535  stru_721530.sMinZ >= model.sMinZ) {
4536  for (ODMFace &mface : model.pFaces) {
4537  if (stru_721530.sMaxX <= mface.pBoundingBox.x2 &&
4538  stru_721530.sMinX >= mface.pBoundingBox.x1 &&
4539  stru_721530.sMaxY <= mface.pBoundingBox.y2 &&
4540  stru_721530.sMinY >= mface.pBoundingBox.y1 &&
4541  stru_721530.sMaxZ <= mface.pBoundingBox.z2 &&
4542  stru_721530.sMinZ >= mface.pBoundingBox.z1) {
4543  face.pFacePlane_old.vNormal.x = mface.pFacePlane.vNormal.x;
4544  face.pFacePlane_old.vNormal.y = mface.pFacePlane.vNormal.y;
4545  face.pFacePlane_old.vNormal.z = mface.pFacePlane.vNormal.z;
4546 
4547  face.pFacePlane_old.dist =
4548  mface.pFacePlane.dist; // incorrect
4549 
4550  face.uAttributes = mface.uAttributes;
4551 
4552  face.pBounding.x1 = mface.pBoundingBox.x1;
4553  face.pBounding.y1 = mface.pBoundingBox.y1;
4554  face.pBounding.z1 = mface.pBoundingBox.z1;
4555 
4556  face.pBounding.x2 = mface.pBoundingBox.x2;
4557  face.pBounding.y2 = mface.pBoundingBox.y2;
4558  face.pBounding.z2 = mface.pBoundingBox.z2;
4559 
4560  face.zCalc1 = mface.zCalc1;
4561  face.zCalc2 = mface.zCalc2;
4562  face.zCalc3 = mface.zCalc3;
4563 
4564  face.pXInterceptDisplacements =
4566  face.pYInterceptDisplacements =
4568  face.pZInterceptDisplacements =
4570 
4571  face.uPolygonType = (PolygonType)mface.uPolygonType;
4572 
4573  face.uNumVertices = mface.uNumVertices;
4574 
4575  // face.uBitmapID = model.pFaces[j].uTextureID;
4576  face.resource = mface.resource;
4577 
4578  face.pVertexIDs = mface.pVertexIDs;
4579 
4580  if (!face.Ethereal() && !face.Portal()) {
4581  v8 = (face.pFacePlane_old.dist +
4582  face.pFacePlane_old.vNormal.x *
4583  stru_721530.normal.x +
4584  face.pFacePlane_old.vNormal.y *
4585  stru_721530.normal.y +
4586  face.pFacePlane_old.vNormal.z *
4587  stru_721530.normal.z) >>
4588  16;
4589  if (v8 > 0) {
4590  v9 = (face.pFacePlane_old.dist +
4591  face.pFacePlane_old.vNormal.x *
4592  stru_721530.normal2.x +
4593  face.pFacePlane_old.vNormal.y *
4594  stru_721530.normal2.y +
4595  face.pFacePlane_old.vNormal.z *
4596  stru_721530.normal2.z) >>
4597  16;
4598  if (v8 <= stru_721530.prolly_normal_d ||
4599  v9 <= stru_721530.prolly_normal_d) {
4600  if (v9 <= v8) {
4601  a2 = stru_721530.field_6C;
4603  &a2, stru_721530.normal.x,
4604  stru_721530.normal.y,
4605  stru_721530.normal.z,
4609  &face, model.index, ecx0)) {
4610  v10 = a2;
4611  } else {
4614  if (!sub_475F30(&a2, &face,
4615  stru_721530.normal.x,
4616  stru_721530.normal.y,
4617  stru_721530.normal.z,
4621  model.index))
4622  goto LABEL_29;
4623  v10 = a2 - stru_721530.prolly_normal_d;
4625  }
4626  if (v10 < stru_721530.field_7C) {
4627  stru_721530.field_7C = v10;
4628  stru_721530.pid = PID(
4629  OBJECT_BModel,
4630  (mface.index | (model.index << 6)));
4631  }
4632  }
4633  }
4634  }
4635  LABEL_29:
4636  if (stru_721530.field_0 & 1) {
4637  v15 = (face.pFacePlane_old.dist +
4638  face.pFacePlane_old.vNormal.x *
4639  stru_721530.position.x +
4640  face.pFacePlane_old.vNormal.y *
4641  stru_721530.position.y +
4642  face.pFacePlane_old.vNormal.z *
4643  stru_721530.position.z) >>
4644  16;
4645  if (v15 > 0) {
4646  v16 = (face.pFacePlane_old.dist +
4647  face.pFacePlane_old.vNormal.x *
4649  face.pFacePlane_old.vNormal.y *
4651  face.pFacePlane_old.vNormal.z *
4652  stru_721530.field_54) >>
4653  16;
4654  if (v15 <= stru_721530.prolly_normal_d ||
4655  v16 <= stru_721530.prolly_normal_d) {
4656  if (v16 <= v15) {
4657  a2 = stru_721530.field_6C;
4658  if (sub_4754BF(
4666  model.index, ecx0)) {
4667  if (a2 < stru_721530.field_7C) {
4668  stru_721530.field_7C = a2;
4669  stru_721530.pid =
4670  PID(OBJECT_BModel,
4671  (mface.index |
4672  (model.index << 6)));
4673  }
4674  } else {
4675  a2 = stru_721530.field_6C +
4677  if (sub_475F30(
4678  &a2, &face,
4685  model.index)) {
4686  v21 =
4687  a2 -
4689  a2 -=
4691  if (a2 < stru_721530.field_7C) {
4692  stru_721530.field_7C = v21;
4693  stru_721530.pid = PID(
4694  OBJECT_BModel,
4695  (mface.index |
4696  (model.index << 6)));
4697  }
4698  }
4699  }
4700  }
4701  }
4702  }
4703  }
4704  }
4705  }
4706  }
4707  }
4708  }
4709 }

Перекрестные ссылки stru141_actor_collision_object::direction, Plane_int_::dist, stru141_actor_collision_object::field_0, stru141_actor_collision_object::field_4C, stru141_actor_collision_object::field_50, stru141_actor_collision_object::field_54, stru141_actor_collision_object::field_6C, stru141_actor_collision_object::field_7C, stru141_actor_collision_object::field_8_radius, ODMFace::index, BSPModel::index, stru141_actor_collision_object::normal, stru141_actor_collision_object::normal2, OBJECT_BModel, OutdoorLocation::pBModels, ODMFace::pBoundingBox, ODMFace::pFacePlane, BSPModel::pFaces, stru141_actor_collision_object::pid, stru141_actor_collision_object::position, pOutdoor, stru141_actor_collision_object::prolly_normal_d, ODMFace::pVertexIDs, ODMFace::pXInterceptDisplacements, ODMFace::pYInterceptDisplacements, ODMFace::pZInterceptDisplacements, ODMFace::resource, stru141_actor_collision_object::sMaxX, BSPModel::sMaxX, stru141_actor_collision_object::sMaxY, BSPModel::sMaxY, BSPModel::sMaxZ, stru141_actor_collision_object::sMaxZ, BSPModel::sMinX, stru141_actor_collision_object::sMinX, BSPModel::sMinY, stru141_actor_collision_object::sMinY, BSPModel::sMinZ, stru141_actor_collision_object::sMinZ, stru_721530, sub_4754BF(), sub_475F30(), ODMFace::uAttributes, ODMFace::uNumVertices, ODMFace::uPolygonType, Plane_int_::vNormal, BBox_short_::x1, BBox_short_::x2, BBox_short_::y1, BBox_short_::y2, BBox_short_::z1, BBox_short_::z2, ODMFace::zCalc1, ODMFace::zCalc2 и ODMFace::zCalc3.

Используется в ODM_ProcessPartyActions(), UpdateActors_ODM() и SpriteObject::UpdateObject_fn0_ODM().

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

◆ collide_against_floor()

int collide_against_floor ( int  x,
int  y,
int  z,
unsigned int *  pSectorID,
unsigned int *  pFaceID 
)

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

4712  {
4713  uint uFaceID = -1;
4714  int floor_level = BLV_GetFloorLevel(x, y, z, *pSectorID, &uFaceID);
4715 
4716  if (floor_level != -30000 && floor_level <= z + 50) {
4717  *pFaceID = uFaceID;
4718  return floor_level;
4719  }
4720 
4721  uint uSectorID = pIndoor->GetSector(x, y, z);
4722  *pSectorID = uSectorID;
4723 
4724  floor_level = BLV_GetFloorLevel(x, y, z, uSectorID, &uFaceID);
4725  if (uSectorID && floor_level != -30000)
4726  *pFaceID = uFaceID;
4727  else
4728  return -30000;
4729  return floor_level;
4730 }

Перекрестные ссылки BLV_GetFloorLevel(), IndoorLocation::GetSector() и pIndoor.

Используется в BLV_ProcessPartyActions(), collide_against_floor_approximate() и UpdateActors_BLV().

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

◆ _46ED8A_collide_against_sprite_objects()

void _46ED8A_collide_against_sprite_objects ( unsigned int  _this)

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

4732  {
4733  ObjectDesc *object; // edx@4
4734  int v10; // ecx@12
4735  int v11; // esi@13
4736 
4737  for (uint i = 0; i < uNumSpriteObjects; ++i) {
4738  if (pSpriteObjects[i].uObjectDescID) {
4739  object = &pObjectList->pObjects[pSpriteObjects[i].uObjectDescID];
4740  if (!(object->uFlags & OBJECT_DESC_NO_COLLISION)) {
4741  if (stru_721530.sMaxX <=
4742  pSpriteObjects[i].vPosition.x + object->uRadius &&
4743  stru_721530.sMinX >=
4744  pSpriteObjects[i].vPosition.x - object->uRadius &&
4745  stru_721530.sMaxY <=
4746  pSpriteObjects[i].vPosition.y + object->uRadius &&
4747  stru_721530.sMinY >=
4748  pSpriteObjects[i].vPosition.y - object->uRadius &&
4749  stru_721530.sMaxZ <=
4750  pSpriteObjects[i].vPosition.z + object->uHeight &&
4751  stru_721530.sMinZ >= pSpriteObjects[i].vPosition.z) {
4752  if (abs(((pSpriteObjects[i].vPosition.x -
4753  stru_721530.normal.x) *
4755  (pSpriteObjects[i].vPosition.y -
4756  stru_721530.normal.y) *
4757  stru_721530.direction.x) >>
4758  16) <=
4759  object->uHeight + stru_721530.prolly_normal_d) {
4760  v10 = ((pSpriteObjects[i].vPosition.x -
4761  stru_721530.normal.x) *
4763  (pSpriteObjects[i].vPosition.y -
4764  stru_721530.normal.y) *
4765  stru_721530.direction.y) >>
4766  16;
4767  if (v10 > 0) {
4768  v11 = stru_721530.normal.z +
4769  ((unsigned __int64)(stru_721530.direction.z *
4770  (signed __int64)v10) >>
4771  16);
4772  if (v11 >= pSpriteObjects[i].vPosition.z -
4774  if (v11 <= object->uHeight +
4776  pSpriteObjects[i].vPosition.z) {
4777  if (v10 < stru_721530.field_7C) {
4778  sub_46DEF2(_this, i);
4779  }
4780  }
4781  }
4782  }
4783  }
4784  }
4785  }
4786  }
4787  }
4788 }

Перекрестные ссылки stru141_actor_collision_object::direction, stru141_actor_collision_object::field_7C, stru141_actor_collision_object::normal, OBJECT_DESC_NO_COLLISION, pObjectList, ObjectList::pObjects, stru141_actor_collision_object::prolly_normal_d, pSpriteObjects, stru141_actor_collision_object::sMaxX, stru141_actor_collision_object::sMaxY, stru141_actor_collision_object::sMaxZ, stru141_actor_collision_object::sMinX, stru141_actor_collision_object::sMinY, stru141_actor_collision_object::sMinZ, stru_721530, sub_46DEF2() и uNumSpriteObjects.

Используется в ODM_ProcessPartyActions(), UpdateActors_BLV() и UpdateActors_ODM().

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

◆ _46EF01_collision_chech_player()

int _46EF01_collision_chech_player ( int  a1)

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

4790  {
4791  int result; // eax@1
4792  int v3; // ebx@7
4793  int v4; // esi@7
4794  int v5; // edi@8
4795  int v6; // ecx@9
4796  int v7; // edi@12
4797  int v10; // [sp+14h] [bp-8h]@7
4798  int v11; // [sp+18h] [bp-4h]@7
4799 
4800  result = pParty->vPosition.x;
4801  // device_caps = pParty->uPartyHeight;
4802  if (stru_721530.sMaxX <=
4803  pParty->vPosition.x + (2 * pParty->field_14_radius) &&
4804  stru_721530.sMinX >=
4805  pParty->vPosition.x - (2 * pParty->field_14_radius) &&
4806  stru_721530.sMaxY <=
4807  pParty->vPosition.y + (2 * pParty->field_14_radius) &&
4808  stru_721530.sMinY >=
4809  pParty->vPosition.y - (2 * pParty->field_14_radius) &&
4810  stru_721530.sMinZ/*sMaxZ*/ <= (pParty->vPosition.z + (int)pParty->uPartyHeight) &&
4811  stru_721530.sMaxZ/*sMinZ*/ >= pParty->vPosition.z) {
4813  v11 = pParty->vPosition.x - stru_721530.normal.x;
4814  v4 = ((pParty->vPosition.x - stru_721530.normal.x) *
4816  (pParty->vPosition.y - stru_721530.normal.y) *
4817  stru_721530.direction.x) >>
4818  16;
4819  v10 = pParty->vPosition.y - stru_721530.normal.y;
4820  result = abs(((pParty->vPosition.x - stru_721530.normal.x) *
4822  (pParty->vPosition.y - stru_721530.normal.y) *
4823  stru_721530.direction.x) >>
4824  16);
4825  if (result <=
4827  result = v10 * stru_721530.direction.y;
4828  v5 = (v10 * stru_721530.direction.y +
4829  v11 * stru_721530.direction.x) >>
4830  16;
4831  if (v5 > 0) {
4832  v6 = fixpoint_mul(stru_721530.direction.z, v5) +
4833  stru_721530.normal.z;
4834  result = pParty->vPosition.z;
4835  if (v6 >= pParty->vPosition.z) {
4837  if (v6 <= (signed int)(pParty->uPartyHeight +
4838  pParty->vPosition.z) ||
4839  a1) {
4840  result = integer_sqrt(v3 * v3 - v4 * v4);
4841  v7 = v5 - integer_sqrt(v3 * v3 - v4 * v4);
4842  if (v7 < 0) v7 = 0;
4843  if (v7 < stru_721530.field_7C) {
4844  stru_721530.field_7C = v7;
4845  stru_721530.pid = 4;
4846  }
4847  }
4848  }
4849  }
4850  }
4851  }
4852  return result;
4853 }

Перекрестные ссылки stru141_actor_collision_object::direction, Party::field_14_radius, stru141_actor_collision_object::field_7C, fixpoint_mul(), integer_sqrt(), stru141_actor_collision_object::normal, stru141_actor_collision_object::pid, pParty, stru141_actor_collision_object::prolly_normal_d, stru141_actor_collision_object::sMaxX, stru141_actor_collision_object::sMaxY, stru141_actor_collision_object::sMaxZ, stru141_actor_collision_object::sMinX, stru141_actor_collision_object::sMinY, stru141_actor_collision_object::sMinZ, stru_721530, Party::uPartyHeight и Party::vPosition.

Используется в UpdateActors_BLV(), UpdateActors_ODM(), SpriteObject::UpdateObject_fn0_BLV() и SpriteObject::UpdateObject_fn0_ODM().

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

◆ _46E0B2_collide_against_decorations()

void _46E0B2_collide_against_decorations ( )

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

4855  {
4857  for (unsigned int i = 0; i < sector->uNumDecorations; ++i) {
4858  LevelDecoration *decor = &pLevelDecorations[sector->pDecorationIDs[i]];
4859  if (!(decor->uFlags & LEVEL_DECORATION_INVISIBLE)) {
4861  if (!decor_desc->CanMoveThrough()) {
4862  if (stru_721530.sMaxX <= decor->vPosition.x + decor_desc->uRadius &&
4863  stru_721530.sMinX >= decor->vPosition.x - decor_desc->uRadius &&
4864  stru_721530.sMaxY <= decor->vPosition.y + decor_desc->uRadius &&
4865  stru_721530.sMinY >= decor->vPosition.y - decor_desc->uRadius &&
4866  stru_721530.sMaxZ <= decor->vPosition.z + decor_desc->uDecorationHeight &&
4867  stru_721530.sMinZ >= decor->vPosition.z) {
4868  int v16 = decor->vPosition.x - stru_721530.normal.x;
4869  int v15 = decor->vPosition.y - stru_721530.normal.y;
4870  int v8 = stru_721530.prolly_normal_d + decor_desc->uRadius;
4871  int v17 = ((decor->vPosition.x - stru_721530.normal.x) * stru_721530.direction.y -
4872  (decor->vPosition.y - stru_721530.normal.y) * stru_721530.direction.x) >> 16;
4873  if (abs(v17) <= stru_721530.prolly_normal_d + decor_desc->uRadius) {
4874  int v9 = (v16 * stru_721530.direction.x + v15 * stru_721530.direction.y) >> 16;
4875  if (v9 > 0) {
4876  int v11 = stru_721530.normal.z + fixpoint_mul(stru_721530.direction.z, v9);
4877  if (v11 >= decor->vPosition.z) {
4878  if (v11 <= decor_desc->uDecorationHeight + decor->vPosition.z) {
4879  int v12 = v9 - integer_sqrt(v8 * v8 - v17 * v17);
4880  if (v12 < 0) v12 = 0;
4881  if (v12 < stru_721530.field_7C) {
4882  stru_721530.field_7C = v12;
4883  stru_721530.pid = PID(OBJECT_Decoration, sector->pDecorationIDs[i]);
4884  }
4885  }
4886  }
4887  }
4888  }
4889  }
4890  }
4891  }
4892  }
4893 }

Перекрестные ссылки DecorationDesc_mm6::CanMoveThrough(), stru141_actor_collision_object::direction, stru141_actor_collision_object::field_7C, fixpoint_mul(), DecorationList::GetDecoration(), integer_sqrt(), LEVEL_DECORATION_INVISIBLE, stru141_actor_collision_object::normal, OBJECT_Decoration, BLVSector::pDecorationIDs, pDecorationList, stru141_actor_collision_object::pid, pIndoor, pLevelDecorations, stru141_actor_collision_object::prolly_normal_d, IndoorLocation::pSectors, stru141_actor_collision_object::sMaxX, stru141_actor_collision_object::sMaxY, stru141_actor_collision_object::sMaxZ, stru141_actor_collision_object::sMinX, stru141_actor_collision_object::sMinY, stru141_actor_collision_object::sMinZ, stru_721530, LevelDecoration::uDecorationDescID, DecorationDesc_mm6::uDecorationHeight, LevelDecoration::uFlags, BLVSector::uNumDecorations, DecorationDesc_mm6::uRadius, stru141_actor_collision_object::uSectorID и LevelDecoration::vPosition.

Используется в BLV_ProcessPartyActions(), UpdateActors_BLV() и SpriteObject::UpdateObject_fn0_BLV().

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

◆ _46F04E_collide_against_portals()

int _46F04E_collide_against_portals ( )

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

4895  {
4896  int a3; // [sp+Ch] [bp-8h]@13
4897  int v12 = 0; // [sp+10h] [bp-4h]@15
4898 
4899  unsigned int v1 = 0xFFFFFF;
4900  unsigned int v10 = 0xFFFFFF;
4901  for (unsigned int i = 0; i < pIndoor->pSectors[stru_721530.uSectorID].uNumPortals; ++i) {
4905  if (stru_721530.sMaxX <= face->pBounding.x2 &&
4906  stru_721530.sMinX >= face->pBounding.x1 &&
4907  stru_721530.sMaxY <= face->pBounding.y2 &&
4908  stru_721530.sMinY >= face->pBounding.y1 &&
4909  stru_721530.sMaxZ <= face->pBounding.z2 &&
4910  stru_721530.sMinZ >= face->pBounding.z1) {
4911  int v4 = (stru_721530.normal.x * face->pFacePlane_old.vNormal.x +
4912  face->pFacePlane_old.dist +
4913  stru_721530.normal.y * face->pFacePlane_old.vNormal.y +
4914  stru_721530.normal.z * face->pFacePlane_old.vNormal.z) >> 16;
4915  int v5 = (stru_721530.normal2.z * face->pFacePlane_old.vNormal.z +
4916  face->pFacePlane_old.dist +
4917  stru_721530.normal2.x * face->pFacePlane_old.vNormal.x +
4918  stru_721530.normal2.y * face->pFacePlane_old.vNormal.y) >> 16;
4921  (a3 = stru_721530.field_6C, sub_475D85(&stru_721530.normal, &stru_721530.direction, &a3, face)) && a3 < (int)v10) {
4922  v10 = a3;
4924  }
4925  }
4926  }
4927  }
4928 
4929  v1 = v10;
4930 
4931  int result = 1;
4932 
4933  if (stru_721530.field_7C >= (int)v1 && (int)v1 <= stru_721530.field_6C) {
4934  stru_721530.field_80 = v12;
4935  if (pIndoor->pFaces[v12].uSectorID == stru_721530.uSectorID) {
4937  } else {
4939  }
4940  stru_721530.field_7C = 268435455; // 0xFFFFFFF
4941  result = 0;
4942  }
4943 
4944  return result;
4945 }

Перекрестные ссылки stru141_actor_collision_object::direction, stru141_actor_collision_object::field_6C, stru141_actor_collision_object::field_7C, stru141_actor_collision_object::field_80, stru141_actor_collision_object::normal, stru141_actor_collision_object::normal2, IndoorLocation::pFaces, pIndoor, BLVSector::pPortals, stru141_actor_collision_object::prolly_normal_d, IndoorLocation::pSectors, stru141_actor_collision_object::sMaxX, stru141_actor_collision_object::sMaxY, stru141_actor_collision_object::sMaxZ, stru141_actor_collision_object::sMinX, stru141_actor_collision_object::sMinY, stru141_actor_collision_object::sMinZ, stru_721530, sub_475D85(), BLVFace::uBackSectorID, BLVSector::uNumPortals, stru141_actor_collision_object::uSectorID и BLVFace::uSectorID.

Используется в BLV_ProcessPartyActions(), UpdateActors_BLV() и SpriteObject::UpdateObject_fn0_BLV().

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

◆ sub_46DEF2()

unsigned int sub_46DEF2 ( signed int  a2,
unsigned int  uLayingItemID 
)

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

4947  {
4948  unsigned int result = uLayingItemID;
4949  if (pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID].uFlags & 0x10) {
4950  result = _46BFFA_update_spell_fx(uLayingItemID, a2);
4951  }
4952  return result;
4953 }

Перекрестные ссылки _46BFFA_update_spell_fx(), pObjectList, ObjectList::pObjects, pSpriteObjects и ObjectDesc::uFlags.

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

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

◆ UpdateObjects()

void UpdateObjects ( )

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

4955  {
4956  int v5; // ecx@6
4957  int v7; // eax@9
4958  int v11; // eax@17
4959  int v12; // edi@27
4960  int v18; // [sp+4h] [bp-10h]@27
4961  int v19; // [sp+8h] [bp-Ch]@27
4962 
4963  for (uint i = 0; i < uNumSpriteObjects; ++i) {
4964  if (pSpriteObjects[i].uAttributes & OBJECT_40) {
4965  pSpriteObjects[i].uAttributes &= ~OBJECT_40;
4966  } else {
4967  ObjectDesc *object =
4968  &pObjectList->pObjects[pSpriteObjects[i].uObjectDescID];
4969  if (pSpriteObjects[i].AttachedToActor()) {
4970  v5 = PID_ID(pSpriteObjects[i].spell_target_pid);
4971  pSpriteObjects[i].vPosition.x = pActors[v5].vPosition.x;
4972  pSpriteObjects[i].vPosition.y = pActors[v5].vPosition.y;
4973  pSpriteObjects[i].vPosition.z =
4974  pActors[v5].vPosition.z + pActors[v5].uActorHeight;
4975  if (!pSpriteObjects[i].uObjectDescID) continue;
4976  pSpriteObjects[i].uSpriteFrameID += pEventTimer->uTimeElapsed;
4977  if (!(object->uFlags & OBJECT_DESC_TEMPORARY)) continue;
4978  if (pSpriteObjects[i].uSpriteFrameID >= 0) {
4979  v7 = object->uLifetime;
4980  if (pSpriteObjects[i].uAttributes & ITEM_BROKEN)
4981  v7 = pSpriteObjects[i].field_20;
4982  if (pSpriteObjects[i].uSpriteFrameID < v7) continue;
4983  }
4985  continue;
4986  }
4987  if (pSpriteObjects[i].uObjectDescID) {
4988  pSpriteObjects[i].uSpriteFrameID += pEventTimer->uTimeElapsed;
4989  if (object->uFlags & OBJECT_DESC_TEMPORARY) {
4990  if (pSpriteObjects[i].uSpriteFrameID < 0) {
4992  continue;
4993  }
4994  v11 = object->uLifetime;
4995  if (pSpriteObjects[i].uAttributes & ITEM_BROKEN)
4996  v11 = pSpriteObjects[i].field_20;
4997  }
4998  if (!(object->uFlags & OBJECT_DESC_TEMPORARY) ||
4999  pSpriteObjects[i].uSpriteFrameID < v11) {
5002  else
5004  if (!pParty->bTurnBasedModeOn || !(pSpriteObjects[i].uSectorID & 4)) {
5005  continue;
5006  }
5007  v12 = abs(pParty->vPosition.x -
5008  pSpriteObjects[i].vPosition.x);
5009  v18 = abs(pParty->vPosition.y -
5010  pSpriteObjects[i].vPosition.y);
5011  v19 = abs(pParty->vPosition.z -
5012  pSpriteObjects[i].vPosition.z);
5013  if (int_get_vector_length(v12, v18, v19) <= 5120) continue;
5015  continue;
5016  }
5017  if (!(object->uFlags & OBJECT_DESC_INTERACTABLE)) {
5019  continue;
5020  }
5022  }
5023  }
5024  }
5025 }

Перекрестные ссылки _46BFFA_update_spell_fx(), Party::bTurnBasedModeOn, int_get_vector_length(), ITEM_BROKEN, LEVEL_Indoor, OBJECT_40, OBJECT_DESC_INTERACTABLE, OBJECT_DESC_TEMPORARY, OBJECT_Item, SpriteObject::OnInteraction(), pActors, pEventTimer, pObjectList, ObjectList::pObjects, pParty, pSpriteObjects, uCurrentlyLoadedLevelType, uNumSpriteObjects, SpriteObject::UpdateObject_fn0_BLV(), SpriteObject::UpdateObject_fn0_ODM(), Timer::uTimeElapsed и Party::vPosition.

Используется в BLV_UpdateUserInputAndOther() и ODM_UpdateUserInputAndOther().

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

◆ sub_47531C()

bool sub_47531C ( int  a1,
int *  a2,
int  pos_x,
int  pos_y,
int  pos_z,
int  dir_x,
int  dir_y,
int  dir_z,
BLVFace face,
int  a10 
)

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

5028  {
5029  int v11; // ST1C_4@3
5030  int v12; // edi@3
5031  int v13; // esi@3
5032  int v14; // edi@4
5033  __int64 v15; // qtt@6
5034  // __int16 v16; // si@7
5035  int a7a; // [sp+30h] [bp+18h]@7
5036  int a9b; // [sp+38h] [bp+20h]@3
5037  int a9a; // [sp+38h] [bp+20h]@3
5038  int a10b; // [sp+3Ch] [bp+24h]@3
5039  signed int a10a; // [sp+3Ch] [bp+24h]@4
5040  int a10c; // [sp+3Ch] [bp+24h]@5
5041 
5042  if (a10 && face->Ethereal()) return 0;
5043  v11 = fixpoint_mul(dir_x, face->pFacePlane_old.vNormal.x);
5044  a10b = fixpoint_mul(dir_y, face->pFacePlane_old.vNormal.y);
5045  a9b = fixpoint_mul(dir_z, face->pFacePlane_old.vNormal.z);
5046  v12 = v11 + a9b + a10b;
5047  a9a = v11 + a9b + a10b;
5048  v13 = (a1 << 16) - pos_x * face->pFacePlane_old.vNormal.x -
5049  pos_y * face->pFacePlane_old.vNormal.y -
5050  pos_z * face->pFacePlane_old.vNormal.z - face->pFacePlane_old.dist;
5051  if (abs((a1 << 16) - pos_x * face->pFacePlane_old.vNormal.x -
5052  pos_y * face->pFacePlane_old.vNormal.y -
5053  pos_z * face->pFacePlane_old.vNormal.z -
5054  face->pFacePlane_old.dist) >= a1 << 16) {
5055  a10c = abs(v13) >> 14;
5056  if (a10c > abs(v12)) return 0;
5057  HEXRAYS_LODWORD(v15) = v13 << 16;
5058  HEXRAYS_HIDWORD(v15) = v13 >> 16;
5059  v14 = a1;
5060  a10a = v15 / a9a;
5061  } else {
5062  a10a = 0;
5063  v14 = abs(v13) >> 16;
5064  }
5065  // v16 = pos_y + ((unsigned int)fixpoint_mul(a10a, dir_y) >> 16);
5066  HEXRAYS_LOWORD(a7a) = (short)pos_x +
5067  ((unsigned int)fixpoint_mul(a10a, dir_x) >> 16) -
5068  fixpoint_mul(v14, face->pFacePlane_old.vNormal.x);
5069  HEXRAYS_HIWORD(a7a) = pos_y +
5070  ((unsigned int)fixpoint_mul(a10a, dir_y) >> 16) -
5071  fixpoint_mul(v14, face->pFacePlane_old.vNormal.y);
5072  if (!sub_475665(face, a7a,
5073  (short)pos_z +
5074  ((unsigned int)fixpoint_mul(a10a, dir_z) >> 16) -
5075  fixpoint_mul(v14, face->pFacePlane_old.vNormal.z)))
5076  return 0;
5077  *a2 = a10a >> 16;
5078  if (a10a >> 16 < 0) *a2 = 0;
5079  return 1;
5080 }

Перекрестные ссылки fixpoint_mul() и sub_475665().

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

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

◆ sub_4754BF()

bool sub_4754BF ( int  a1,
int *  a2,
int  X,
int  Y,
int  Z,
int  dir_x,
int  dir_y,
int  dir_z,
BLVFace face,
int  a10,
int  a11 
)

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

5083  {
5084  int v12; // ST1C_4@3
5085  int v13; // edi@3
5086  int v14; // esi@3
5087  int v15; // edi@4
5088  int64_t v16; // qtt@6
5089  // __int16 v17; // si@7
5090  int a7a; // [sp+30h] [bp+18h]@7
5091  int a1b; // [sp+38h] [bp+20h]@3
5092  int a1a; // [sp+38h] [bp+20h]@3
5093  int a11b; // [sp+40h] [bp+28h]@3
5094  int a11a; // [sp+40h] [bp+28h]@4
5095  int a11c; // [sp+40h] [bp+28h]@5
5096 
5097  if (a11 && face->Ethereal()) return false;
5098  v12 = fixpoint_mul(dir_x, face->pFacePlane_old.vNormal.x);
5099  a11b = fixpoint_mul(dir_y, face->pFacePlane_old.vNormal.y);
5100  a1b = fixpoint_mul(dir_z, face->pFacePlane_old.vNormal.z);
5101  v13 = v12 + a1b + a11b;
5102  a1a = v12 + a1b + a11b;
5103  v14 = (a1 << 16) - X * face->pFacePlane_old.vNormal.x -
5104  Y * face->pFacePlane_old.vNormal.y -
5105  Z * face->pFacePlane_old.vNormal.z - face->pFacePlane_old.dist;
5106  if (abs((a1 << 16) - X * face->pFacePlane_old.vNormal.x -
5107  Y * face->pFacePlane_old.vNormal.y -
5108  Z * face->pFacePlane_old.vNormal.z - face->pFacePlane_old.dist) >=
5109  a1 << 16) {
5110  a11c = abs(v14) >> 14;
5111  if (a11c > abs(v13)) return false;
5112  HEXRAYS_LODWORD(v16) = v14 << 16;
5113  HEXRAYS_HIDWORD(v16) = v14 >> 16;
5114  v15 = a1;
5115  a11a = v16 / a1a;
5116  } else {
5117  a11a = 0;
5118  v15 = abs(v14) >> 16;
5119  }
5120  // v17 = Y + ((unsigned int)fixpoint_mul(a11a, dir_y) >> 16);
5121  HEXRAYS_LOWORD(a7a) = (short)X +
5122  ((unsigned int)fixpoint_mul(a11a, dir_x) >> 16) -
5123  fixpoint_mul(v15, face->pFacePlane_old.vNormal.x);
5124  HEXRAYS_HIWORD(a7a) = Y + ((unsigned int)fixpoint_mul(a11a, dir_y) >> 16) -
5125  fixpoint_mul(v15, face->pFacePlane_old.vNormal.y);
5126  if (!sub_4759C9(face, a10, a7a,
5127  (short)Z + ((unsigned int)fixpoint_mul(a11a, dir_z) >> 16) -
5128  fixpoint_mul(v15, face->pFacePlane_old.vNormal.z)))
5129  return false;
5130  *a2 = a11a >> 16;
5131  if (a11a >> 16 < 0) *a2 = 0;
5132  return true;
5133 }

Перекрестные ссылки fixpoint_mul() и sub_4759C9().

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

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

◆ sub_475665()

int sub_475665 ( BLVFace face,
int  a2,
__int16  a3 
)

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

5135  {
5136  bool v16; // edi@14
5137  int v20; // ebx@18
5138  int v21; // edi@20
5139  int v22; // ST14_4@22
5140  __int64 v23; // qtt@22
5141  int result; // eax@25
5142  int v25; // [sp+14h] [bp-10h]@14
5143  int v26; // [sp+1Ch] [bp-8h]@2
5144  int v27; // [sp+20h] [bp-4h]@2
5145  int v28; // [sp+30h] [bp+Ch]@2
5146  int v29; // [sp+30h] [bp+Ch]@7
5147  int v30; // [sp+30h] [bp+Ch]@11
5148  int v31; // [sp+30h] [bp+Ch]@14
5149 
5150  if (face->uAttributes & FACE_XY_PLANE) {
5151  v26 = (signed __int16)a2;
5152  v27 = HEXRAYS_SHIWORD(a2);
5153  if (face->uNumVertices) {
5154  for (v28 = 0; v28 < face->uNumVertices; v28++) {
5155  word_720C10_intercepts_xs[2 * v28] =
5156  face->pXInterceptDisplacements[v28] +
5157  pIndoor->pVertices[face->pVertexIDs[v28]].x;
5158  word_720B40_intercepts_zs[2 * v28] =
5159  face->pYInterceptDisplacements[v28] +
5160  pIndoor->pVertices[face->pVertexIDs[v28]].y;
5161  word_720C10_intercepts_xs[2 * v28 + 1] =
5162  face->pXInterceptDisplacements[v28 + 1] +
5163  pIndoor->pVertices[face->pVertexIDs[v28 + 1]].x;
5164  word_720B40_intercepts_zs[2 * v28 + 1] =
5165  face->pYInterceptDisplacements[v28 + 1] +
5166  pIndoor->pVertices[face->pVertexIDs[v28 + 1]].y;
5167  }
5168  }
5169  } else {
5170  if (face->uAttributes & FACE_XZ_PLANE) {
5171  v26 = (signed __int16)a2;
5172  v27 = a3;
5173  if (face->uNumVertices) {
5174  for (v29 = 0; v29 < face->uNumVertices; v29++) {
5175  word_720C10_intercepts_xs[2 * v29] =
5176  face->pXInterceptDisplacements[v29] +
5177  pIndoor->pVertices[face->pVertexIDs[v29]].x;
5178  word_720B40_intercepts_zs[2 * v29] =
5179  face->pZInterceptDisplacements[v29] +
5180  pIndoor->pVertices[face->pVertexIDs[v29]].z;
5181  word_720C10_intercepts_xs[2 * v29 + 1] =
5182  face->pXInterceptDisplacements[v29 + 1] +
5183  pIndoor->pVertices[face->pVertexIDs[v29 + 1]].x;
5184  word_720B40_intercepts_zs[2 * v29 + 1] =
5185  face->pZInterceptDisplacements[v29 + 1] +
5186  pIndoor->pVertices[face->pVertexIDs[v29 + 1]].z;
5187  }
5188  }
5189  } else {
5190  v26 = HEXRAYS_SHIWORD(a2);
5191  v27 = a3;
5192  if (face->uNumVertices) {
5193  for (v30 = 0; v30 < face->uNumVertices; v30++) {
5194  word_720C10_intercepts_xs[2 * v30] =
5195  face->pYInterceptDisplacements[v30] +
5196  pIndoor->pVertices[face->pVertexIDs[v30]].y;
5197  word_720B40_intercepts_zs[2 * v30] =
5198  face->pZInterceptDisplacements[v30] +
5199  pIndoor->pVertices[face->pVertexIDs[v30]].z;
5200  word_720C10_intercepts_xs[2 * v30 + 1] =
5201  face->pYInterceptDisplacements[v30 + 1] +
5202  pIndoor->pVertices[face->pVertexIDs[v30 + 1]].y;
5203  word_720B40_intercepts_zs[2 * v30 + 1] =
5204  face->pZInterceptDisplacements[v30 + 1] +
5205  pIndoor->pVertices[face->pVertexIDs[v30 + 1]].z;
5206  }
5207  }
5208  }
5209  }
5210  v31 = 0;
5211  word_720C10_intercepts_xs[2 * face->uNumVertices] =
5213  word_720B40_intercepts_zs[2 * face->uNumVertices] =
5215  v16 = word_720B40_intercepts_zs[0] >= v27;
5216  if (2 * face->uNumVertices <= 0) return 0;
5217  for (v25 = 0; v25 < 2 * face->uNumVertices; ++v25) {
5218  if (v31 >= 2) break;
5219  if (v16 ^ (word_720B40_intercepts_zs[v25 + 1] >= v27)) {
5220  if (word_720C10_intercepts_xs[v25 + 1] >= v26)
5221  v20 = 0;
5222  else
5223  v20 = 2;
5224  v21 = v20 | (word_720C10_intercepts_xs[v25] < v26);
5225  if (v21 != 3) {
5226  v22 = word_720C10_intercepts_xs[v25 + 1] -
5228  HEXRAYS_LODWORD(v23) = v22 << 16;
5229  HEXRAYS_HIDWORD(v23) = v22 >> 16;
5230  if (!v21 ||
5232  ((signed int)(((unsigned __int64)(v23 /
5234  [v25 + 1] -
5236  [v25]) *
5237  ((v27 -
5238  (signed int)
5240  [v25])
5241  << 16)) >>
5242  16) +
5243  32768) >>
5244  16) >=
5245  v26))
5246  ++v31;
5247  }
5248  }
5249  v16 = word_720B40_intercepts_zs[v25 + 1] >= v27;
5250  }
5251  result = 1;
5252  if (v31 != 1) result = 0;
5253  return result;
5254 }

Перекрестные ссылки pIndoor, IndoorLocation::pVertices, word_720B40_intercepts_zs и word_720C10_intercepts_xs.

Используется в sub_47531C() и sub_475D85().

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

◆ sub_4759C9()

bool sub_4759C9 ( BLVFace face,
int  a2,
int  a3,
__int16  a4 
)

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

5256  {
5257  bool v12; // edi@14
5258  signed int v16; // ebx@18
5259  int v17; // edi@20
5260  signed int v18; // ST14_4@22
5261  signed __int64 v19; // qtt@22
5262  bool result; // eax@25
5263  int v21; // [sp+14h] [bp-10h]@14
5264  signed int v22; // [sp+18h] [bp-Ch]@1
5265  int v23; // [sp+1Ch] [bp-8h]@2
5266  signed int v24; // [sp+20h] [bp-4h]@2
5267  signed int a4d; // [sp+30h] [bp+Ch]@14
5268 
5269  if (face->uAttributes & FACE_XY_PLANE) {
5270  v23 = (signed __int16)a3;
5271  v24 = HEXRAYS_SHIWORD(a3);
5272  if (face->uNumVertices) {
5273  for (v22 = 0; v22 < face->uNumVertices; ++v22) {
5275  face->pXInterceptDisplacements[v22] +
5276  LOWORD(pOutdoor->pBModels[a2]
5277  .pVertices.pVertices[face->pVertexIDs[v22]]
5278  .x);
5280  face->pYInterceptDisplacements[v22] +
5281  LOWORD(pOutdoor->pBModels[a2]
5282  .pVertices.pVertices[face->pVertexIDs[v22]]
5283  .y);
5284  word_720A70_intercepts_xs_plus_xs[2 * v22 + 1] =
5285  face->pXInterceptDisplacements[v22 + 1] +
5286  LOWORD(pOutdoor->pBModels[a2]
5287  .pVertices.pVertices[face->pVertexIDs[v22 + 1]]
5288  .x);
5289  word_7209A0_intercepts_ys_plus_ys[2 * v22 + 1] =
5290  face->pYInterceptDisplacements[v22 + 1] +
5291  LOWORD(pOutdoor->pBModels[a2]
5292  .pVertices.pVertices[face->pVertexIDs[v22 + 1]]
5293  .y);
5294  }
5295  }
5296  } else {
5297  if (face->uAttributes & FACE_XZ_PLANE) {
5298  v23 = (signed __int16)a3;
5299  v24 = a4;
5300  if (face->uNumVertices) {
5301  for (v22 = 0; v22 < face->uNumVertices; ++v22) {
5303  face->pXInterceptDisplacements[v22] +
5304  LOWORD(pOutdoor->pBModels[a2]
5305  .pVertices.pVertices[face->pVertexIDs[v22]]
5306  .x);
5308  face->pZInterceptDisplacements[v22] +
5309  LOWORD(pOutdoor->pBModels[a2]
5310  .pVertices.pVertices[face->pVertexIDs[v22]]
5311  .z);
5312  word_720A70_intercepts_xs_plus_xs[2 * v22 + 1] =
5313  face->pXInterceptDisplacements[v22 + 1] +
5314  LOWORD(
5315  pOutdoor->pBModels[a2]
5316  .pVertices.pVertices[face->pVertexIDs[v22 + 1]]
5317  .x);
5318  word_7209A0_intercepts_ys_plus_ys[2 * v22 + 1] =
5319  face->pZInterceptDisplacements[v22 + 1] +
5320  LOWORD(
5321  pOutdoor->pBModels[a2]
5322  .pVertices.pVertices[face->pVertexIDs[v22 + 1]]
5323  .z);
5324  }
5325  }
5326  } else {
5327  v23 = HEXRAYS_SHIWORD(a3);
5328  v24 = a4;
5329  if (face->uNumVertices) {
5330  for (v22 = 0; v22 < face->uNumVertices; ++v22) {
5332  face->pYInterceptDisplacements[v22] +
5333  LOWORD(pOutdoor->pBModels[a2]
5334  .pVertices.pVertices[face->pVertexIDs[v22]]
5335  .y);
5337  face->pZInterceptDisplacements[v22] +
5338  LOWORD(pOutdoor->pBModels[a2]
5339  .pVertices.pVertices[face->pVertexIDs[v22]]
5340  .z);
5341  word_720A70_intercepts_xs_plus_xs[2 * v22 + 1] =
5342  face->pYInterceptDisplacements[v22 + 1] +
5343  LOWORD(
5344  pOutdoor->pBModels[a2]
5345  .pVertices.pVertices[face->pVertexIDs[v22 + 1]]
5346  .y);
5347  word_7209A0_intercepts_ys_plus_ys[2 * v22 + 1] =
5348  face->pZInterceptDisplacements[v22 + 1] +
5349  LOWORD(
5350  pOutdoor->pBModels[a2]
5351  .pVertices.pVertices[face->pVertexIDs[v22 + 1]]
5352  .z);
5353  }
5354  }
5355  }
5356  }
5357  a4d = 0;
5358  word_720A70_intercepts_xs_plus_xs[2 * face->uNumVertices] =
5360  word_7209A0_intercepts_ys_plus_ys[2 * face->uNumVertices] =
5362  v12 = word_7209A0_intercepts_ys_plus_ys[0] >= v24;
5363  if (2 * face->uNumVertices <= 0) return 0;
5364  for (v21 = 0; v21 < 2 * face->uNumVertices; ++v21) {
5365  if (a4d >= 2) break;
5366  if (v12 ^ (word_7209A0_intercepts_ys_plus_ys[v21 + 1] >= v24)) {
5367  if (word_720A70_intercepts_xs_plus_xs[v21 + 1] >= v23)
5368  v16 = 0;
5369  else
5370  v16 = 2;
5371  v17 = v16 | (word_720A70_intercepts_xs_plus_xs[v21] < v23);
5372  if (v17 != 3) {
5373  v18 = word_720A70_intercepts_xs_plus_xs[v21 + 1] -
5375  HEXRAYS_LODWORD(v19) = v18 << 16;
5376  HEXRAYS_HIDWORD(v19) = v18 >> 16;
5377  if (!v17 ||
5379  ((signed int)(((unsigned __int64)(v19 /
5381  [v21 + 1] -
5383  [v21]) *
5384  ((v24 -
5385  (signed int)
5387  [v21])
5388  << 16)) >>
5389  16) +
5390  0x8000) >>
5391  16) >=
5392  v23))
5393  ++a4d;
5394  }
5395  }
5396  v12 = word_7209A0_intercepts_ys_plus_ys[v21 + 1] >= v24;
5397  }
5398  result = 1;
5399  if (a4d != 1) result = 0;
5400  return result;
5401 }

Перекрестные ссылки OutdoorLocation::pBModels, pOutdoor, word_7209A0_intercepts_ys_plus_ys и word_720A70_intercepts_xs_plus_xs.

Используется в sub_4754BF() и sub_475F30().

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

◆ sub_475D85()

bool sub_475D85 ( Vec3_int_ *  a1,
Vec3_int_ *  a2,
int *  a3,
BLVFace a4 
)

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

5403  {
5404  BLVFace *v4; // ebx@1
5405  int v5; // ST24_4@2
5406  int v6; // ST28_4@2
5407  int v7; // edi@2
5408  int v8; // eax@5
5409  signed int v9; // esi@5
5410  signed __int64 v10; // qtt@10
5411  Vec3_int_ *v11; // esi@11
5412  int v12; // ST14_4@11
5413  Vec3_int_ *v14; // [sp+Ch] [bp-18h]@1
5414  Vec3_int_ *v15; // [sp+14h] [bp-10h]@1
5415  int v17; // [sp+20h] [bp-4h]@10
5416  int a4b; // [sp+30h] [bp+Ch]@2
5417  int a4c; // [sp+30h] [bp+Ch]@9
5418  int a4a; // [sp+30h] [bp+Ch]@10
5419 
5420  v4 = a4;
5421  v15 = a2;
5422  v14 = a1;
5423  v5 = fixpoint_mul(a2->x, a4->pFacePlane_old.vNormal.x);
5424  a4b = fixpoint_mul(a2->y, a4->pFacePlane_old.vNormal.y);
5425  v6 = fixpoint_mul(a2->z, v4->pFacePlane_old.vNormal.z);
5426  v7 = v5 + v6 + a4b;
5427  // (v16 = v5 + v6 + a4b) == 0;
5428  if (a4->uAttributes & FACE_ETHEREAL || !v7 || v7 > 0 && !v4->Portal())
5429  return 0;
5430  v8 = v4->pFacePlane_old.vNormal.z * a1->z;
5431  v9 = -(v4->pFacePlane_old.dist + v8 + a1->y * v4->pFacePlane_old.vNormal.y +
5432  a1->x * v4->pFacePlane_old.vNormal.x);
5433  if (v7 <= 0) {
5434  if (v4->pFacePlane_old.dist + v8 +
5435  a1->y * v4->pFacePlane_old.vNormal.y +
5436  a1->x * v4->pFacePlane_old.vNormal.x <
5437  0)
5438  return 0;
5439  } else {
5440  if (v9 < 0) return 0;
5441  }
5442  a4c = abs(-(v4->pFacePlane_old.dist + v8 +
5443  a1->y * v4->pFacePlane_old.vNormal.y +
5444  a1->x * v4->pFacePlane_old.vNormal.x)) >>
5445  14;
5446  v11 = v14;
5447  HEXRAYS_LODWORD(v10) = v9 << 16;
5448  HEXRAYS_HIDWORD(v10) = v9 >> 16;
5449  a4a = v10 / v7;
5450  v17 = v10 / v7;
5451  HEXRAYS_LOWORD(v12) =
5452  HEXRAYS_LOWORD(v14->x) +
5453  (((unsigned int)fixpoint_mul(v17, v15->x) + 0x8000) >> 16);
5454  HEXRAYS_HIWORD(v12) =
5455  HEXRAYS_LOWORD(v11->y) +
5456  (((unsigned int)fixpoint_mul(v17, v15->y) + 0x8000) >> 16);
5457  if (a4c > abs(v7) || (v17 > *a3 << 16) ||
5458  !sub_475665(
5459  v4, v12,
5460  LOWORD(v11->z) +
5461  (((unsigned int)fixpoint_mul(v17, v15->z) + 0x8000) >> 16)))
5462  return 0;
5463  *a3 = a4a >> 16;
5464  return 1;
5465 }

Перекрестные ссылки Plane_int_::dist, fixpoint_mul(), BLVFace::pFacePlane_old, BLVFace::Portal(), sub_475665(), BLVFace::uAttributes и Plane_int_::vNormal.

Используется в _46E44E_collide_against_faces_and_portals() и _46F04E_collide_against_portals().

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

◆ sub_475F30()

bool sub_475F30 ( int *  a1,
BLVFace a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8,
int  a9 
)

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

5468  {
5469  int v10 = fixpoint_mul(a6, a2->pFacePlane_old.vNormal.x);
5470  int v11 = fixpoint_mul(a7, a2->pFacePlane_old.vNormal.y);
5471  int v12 = fixpoint_mul(a8, a2->pFacePlane_old.vNormal.z);
5472  int v13 = v10 + v12 + v11;
5473  int v14 = v10 + v12 + v11;
5474  int v22 = v10 + v12 + v11;
5475  if (a2->Ethereal() || !v13 || v14 > 0 && !a2->Portal()) {
5476  return false;
5477  }
5478  int v16 = -(a2->pFacePlane_old.dist + a4 * a2->pFacePlane_old.vNormal.y +
5479  a3 * a2->pFacePlane_old.vNormal.x +
5480  a5 * a2->pFacePlane_old.vNormal.z);
5481  if (v14 <= 0) {
5482  if (a2->pFacePlane_old.dist + a4 * a2->pFacePlane_old.vNormal.y +
5483  a3 * a2->pFacePlane_old.vNormal.x +
5484  a5 * a2->pFacePlane_old.vNormal.z <
5485  0)
5486  return 0;
5487  } else {
5488  if (v16 < 0) {
5489  return 0;
5490  }
5491  }
5492  int v17 =
5493  abs(-(a2->pFacePlane_old.dist + a4 * a2->pFacePlane_old.vNormal.y +
5494  a3 * a2->pFacePlane_old.vNormal.x +
5495  a5 * a2->pFacePlane_old.vNormal.z)) >>
5496  14;
5497  int64_t v18;
5498  HEXRAYS_LODWORD(v18) = v16 << 16;
5499  HEXRAYS_HIDWORD(v18) = v16 >> 16;
5500  int v24 = v18 / v22;
5501  int v23 = v18 / v22;
5502  int v19;
5503  HEXRAYS_LOWORD(v19) =
5504  a3 + (((unsigned int)fixpoint_mul(v23, a6) + 0x8000) >> 16);
5505  HEXRAYS_HIWORD(v19) =
5506  a4 + (((unsigned int)fixpoint_mul(v23, a7) + 0x8000) >> 16);
5507  if (v17 > abs(v14) || v23 > *a1 << 16 ||
5508  !sub_4759C9(
5509  a2, a9, v19,
5510  a5 + (((unsigned int)fixpoint_mul(v23, a8) + 0x8000) >> 16)))
5511  return 0;
5512  *a1 = v24 >> 16;
5513  return 1;
5514 }

Перекрестные ссылки Plane_int_::dist, BLVFace::Ethereal(), fixpoint_mul(), BLVFace::pFacePlane_old, BLVFace::Portal(), sub_4759C9() и Plane_int_::vNormal.

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

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

◆ IsBModelVisible()

bool IsBModelVisible ( BSPModel model,
int *  reachable 
)

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

5516  {
5517  int v11; // esi@6
5518  int v12; // esi@8
5519  bool result; // eax@9
5520 
5521  int angle = (int)(pODMRenderParams->uCameraFovInDegrees << 11) / 360 / 2;
5522  int v3 = model->vBoundingCenter.x - pIndoorCameraD3D->vPartyPos.x;
5523  int v4 = model->vBoundingCenter.y - pIndoorCameraD3D->vPartyPos.y;
5525  int v17 = v3 * stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY) +
5529  }
5530  int v19 = v4 * stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY) -
5532  int v9 = int_get_vector_length(abs(v3), abs(v4), 0);
5533  // v10 = v14 * 188;
5534  // v22 = device_caps;
5535  *reachable = false;
5536  if (v9 < model->sBoundingRadius + 256) *reachable = true;
5537  if (v19 >= 0)
5538  v11 = fixpoint_mul(stru_5C6E00->Sin(angle), v17) -
5540  else
5541  v11 = fixpoint_mul(stru_5C6E00->Cos(angle), v19) +
5543  v12 = v11 >> 16;
5544  if (v9 <= pIndoorCameraD3D->GetFarClip() + 2048) {
5545  // if ( abs(v12) > *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius
5546  // + v10) + 512 )
5547  if (abs(v12) > model->sBoundingRadius + 512) {
5548  result = v12 < 0;
5549  HEXRAYS_LOBYTE(result) = v12 >= 0;
5550  return result;
5551  } else {
5552  return true;
5553  }
5554  }
5555  return false;
5556 }

Перекрестные ссылки stru193_math::Cos(), fixpoint_mul(), int_get_vector_length(), pIndoorCameraD3D, pODMRenderParams, BSPModel::sBoundingRadius, stru193_math::Sin(), IndoorCameraD3D::sRotationX, IndoorCameraD3D::sRotationY, stru_5C6E00, ODMRenderParams::uCameraFovInDegrees, BSPModel::vBoundingCenter, IndoorCameraD3D::vPartyPos, Vec2< T >::x и Vec2< T >::y.

Используется в RenderOpenGL::DrawBuildingsD3D(), Render::DrawBuildingsD3D(), Vis::PickOutdoorFaces_Keyboard() и Vis::PickOutdoorFaces_Mouse().

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

◆ sr_485F53()

void sr_485F53 ( Vec2_int_ *  v)

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

5593  {
5594  ++v->y;
5595  if (v->y > 1000) v->y = 0;
5596 }

Переменные

◆ pDDrawClipper

struct IDirectDrawClipper* pDDrawClipper

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

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

◆ pVertices

◆ VertexRenderList

◆ array_73D150

RenderVertexSoft array_73D150[20]

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

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

◆ d3d_vertex_buffer

◆ ddpfPrimarySuface

DDPIXELFORMAT ddpfPrimarySuface

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

Используется в Render::InitializeFullscreen(), Render::ParseTargetPixelFormat() и Render::SwitchToWindow().

stru141_actor_collision_object::field_50
int field_50
Definition: Indoor.h:163
OBJECT_DESC_NO_COLLISION
@ OBJECT_DESC_NO_COLLISION
Definition: ObjectList.h:7
LightsStack_StationaryLight_::uNumLightsActive
unsigned int uNumLightsActive
Definition: Lights.h:65
sub_46DEF2
unsigned int sub_46DEF2(signed int a2, unsigned int uLayingItemID)
Definition: Render.cpp:4947
MobileLight
Definition: Lights.h:21
BLVFace::Portal
bool Portal() const
Definition: Indoor.h:448
Party::vPosition
Vec3_int_ vPosition
Definition: Party.h:250
face
GLenum GLuint GLint GLenum face
Definition: SDL_opengl_glext.h:3022
int_get_vector_length
uint32_t int_get_vector_length(int32_t x, int32_t y, int32_t z)
Definition: VectorTypes.cpp:8
array_507D30
RenderVertexSoft array_507D30[50]
Definition: RenderOpenGL.cpp:58
sub_47531C
bool sub_47531C(int a1, int *a2, int pos_x, int pos_y, int pos_z, int dir_x, int dir_y, int dir_z, BLVFace *face, int a10)
Definition: Render.cpp:5027
pLevelDecorations
std::array< LevelDecoration, 3000 > pLevelDecorations
Definition: Decoration.cpp:8
ODMFace::zCalc1
int zCalc1
Definition: BSPModel.h:132
Timer::uTimeElapsed
unsigned int uTimeElapsed
Definition: Time.h:133
IndoorCameraD3D::sRotationY
int sRotationY
Definition: IndoorCameraD3D.h:247
v
const GLdouble * v
Definition: SDL_opengl.h:2064
stru141_actor_collision_object::field_6C
int field_6C
Definition: Indoor.h:168
ODMFace::pYInterceptDisplacements
int16_t pYInterceptDisplacements[20]
Definition: BSPModel.h:140
DecorationList::GetDecoration
DecorationDesc * GetDecoration(unsigned int index)
Definition: DecorationList.h:65
BLVFace::pFacePlane_old
struct Plane_int_ pFacePlane_old
Definition: Indoor.h:471
Vec2::x
T x
Definition: VectorTypes.h:12
IndoorLocation::pSectors
struct BLVSector * pSectors
Definition: Indoor.h:634
OutdoorLocation::pBModels
BSPModelList pBModels
Definition: Outdoor.h:119
pSpriteObjects
std::array< SpriteObject, MAX_SPRITE_OBJECTS > pSpriteObjects
Definition: SpriteObject.cpp:34
stru141_actor_collision_object::sMaxZ
int sMaxZ
Definition: Indoor.h:180
Viewport::uViewportTL_Y
int uViewportTL_Y
Definition: Viewport.h:23
RenderBillboard::uIndoorSectorID
int16_t uIndoorSectorID
Definition: IRender.h:34
OBJECT_Item
@ OBJECT_Item
Definition: Actor.h:66
Vec3_float_::x
float x
Definition: VectorTypes.h:89
BSPModel::index
unsigned int index
Definition: BSPModel.h:167
stru141_actor_collision_object::uSectorID
unsigned int uSectorID
Definition: Indoor.h:170
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:407
_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
RenderVertexSoft::u
float u
Definition: IRender.h:121
BBox_short_::x1
int16_t x1
Definition: VectorTypes.h:114
engine
std::shared_ptr< Engine > engine
Definition: Engine.cpp:130
BSPModel::sMaxX
int32_t sMaxX
Definition: BSPModel.h:177
game_viewport_width
unsigned int game_viewport_width
Definition: mm7_data.cpp:194
RenderBillboard::dimming_level
uint16_t dimming_level
Definition: IRender.h:43
BSPModel::sBoundingRadius
int32_t sBoundingRadius
Definition: BSPModel.h:187
ObjectDesc
Definition: ObjectList.h:20
ODMFace::zCalc3
int zCalc3
Definition: BSPModel.h:134
Render
Definition: Render.h:20
sub_475F30
bool sub_475F30(int *a1, BLVFace *a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9)
Definition: Render.cpp:5467
IndoorCameraD3D::sRotationX
int sRotationX
Definition: IndoorCameraD3D.h:248
BBox_short_::y1
int16_t y1
Definition: VectorTypes.h:116
stru141_actor_collision_object::normal
Vec3_int_ normal
Definition: Indoor.h:159
int64_t
__int64 int64_t
Definition: alext.h:31
RenderBillboard::world_z
int16_t world_z
Definition: IRender.h:38
OutdoorLocation::fFogDensity
float fFogDensity
Definition: Outdoor.h:176
ODMFace::uPolygonType
uint8_t uPolygonType
Definition: BSPModel.h:156
sub_475665
int sub_475665(BLVFace *face, int a2, __int16 a3)
Definition: Render.cpp:5135
IndoorLocation::pLights
struct BLVLightMM7 * pLights
Definition: Indoor.h:636
OBJECT_Decoration
@ OBJECT_Decoration
Definition: Actor.h:69
Vec3_float_::y
float y
Definition: VectorTypes.h:90
BSPModel::sMinZ
int32_t sMinZ
Definition: BSPModel.h:176
Vec3_float_::z
float z
Definition: VectorTypes.h:91
DecorationDesc_mm6::uRadius
int16_t uRadius
Definition: DecorationList.h:41
BBox_short_::z2
int16_t z2
Definition: VectorTypes.h:119
pIndoor
IndoorLocation * pIndoor
Definition: Indoor.cpp:49
BLVSector::pLights
uint16_t * pLights
Definition: Indoor.h:556
PARTY_BUFF_TORCHLIGHT
@ PARTY_BUFF_TORCHLIGHT
Definition: Party.h:87
Plane_int_::vNormal
Vec3_int_ vNormal
Definition: VectorTypes.h:107
BLVSector::uNumWalls
uint16_t uNumWalls
Definition: Indoor.h:527
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
OBJECT_DESC_INTERACTABLE
@ OBJECT_DESC_INTERACTABLE
Definition: ObjectList.h:12
Party::pPartyBuffs
std::array< SpellBuff, 20 > pPartyBuffs
Definition: Party.h:309
BLVSector::uNumFloors
uint16_t uNumFloors
Definition: Indoor.h:524
Party::uPartyHeight
unsigned int uPartyHeight
Definition: Party.h:237
ODMFace::pBoundingBox
struct BBox_short_ pBoundingBox
Definition: BSPModel.h:145
RenderVertexSoft::vWorldViewPosition
Vec3_float_ vWorldViewPosition
Definition: IRender.h:117
alpha
GLfloat GLfloat GLfloat alpha
Definition: SDL_opengl_glext.h:415
pWeather
Weather * pWeather
Definition: Weather.cpp:8
y
EGLSurface EGLint EGLint y
Definition: SDL_egl.h:1596
LevelDecoration::vPosition
Vec3_int_ vPosition
Definition: Decoration.h:28
IndoorCameraD3D::vPartyPos
Vec3< int > vPartyPos
Definition: IndoorCameraD3D.h:253
BLVFace::Ethereal
bool Ethereal() const
Definition: Indoor.h:459
Vec2::y
T y
Definition: VectorTypes.h:13
BSPModel::sMinY
int32_t sMinY
Definition: BSPModel.h:175
stru141_actor_collision_object::field_0
int field_0
Definition: Indoor.h:151
pParty
Party * pParty
Definition: Party.cpp:30
ODMRenderParams::shading_dist_shade
int shading_dist_shade
Definition: IRender.h:74
object
GLuint object
Definition: SDL_opengl_glext.h:6060
ODMFace::pVertexIDs
uint16_t pVertexIDs[20]
Definition: BSPModel.h:136
stru141_actor_collision_object::field_8_radius
int field_8_radius
Definition: Indoor.h:153
stru141_actor_collision_object::sMinY
int sMinY
Definition: Indoor.h:179
LEVEL_DECORATION_INVISIBLE
@ LEVEL_DECORATION_INVISIBLE
Definition: Decoration.h:14
p
GLfloat GLfloat p
Definition: SDL_opengl_glext.h:11093
ODMFace::pXInterceptDisplacements
int16_t pXInterceptDisplacements[20]
Definition: BSPModel.h:139
stru141_actor_collision_object::normal2
Vec3_int_ normal2
Definition: Indoor.h:161
OBJECT_BModel
@ OBJECT_BModel
Definition: Actor.h:70
SpriteObject::UpdateObject_fn0_BLV
static void UpdateObject_fn0_BLV(unsigned int uLayingItemID)
Definition: SpriteObject.cpp:463
BLVSector::pPortals
uint16_t * pPortals
Definition: Indoor.h:538
x
EGLSurface EGLint x
Definition: SDL_egl.h:1596
sub_4759C9
bool sub_4759C9(BLVFace *face, int a2, int a3, __int16 a4)
Definition: Render.cpp:5256
BLVSector::uNumLights
uint16_t uNumLights
Definition: Indoor.h:554
_43F55F_get_billboard_light_level
int _43F55F_get_billboard_light_level(RenderBillboard *a1, int uBaseLightLevel)
Definition: Render.cpp:4211
stru141_actor_collision_object::field_7C
int field_7C
Definition: Indoor.h:172
src
GLenum src
Definition: SDL_opengl_glext.h:1740
DecorationDesc_mm6::CanMoveThrough
bool CanMoveThrough()
Definition: DecorationList.h:26
ODMRenderParams::uCameraFovInDegrees
unsigned int uCameraFovInDegrees
Definition: IRender.h:78
_46BFFA_update_spell_fx
bool _46BFFA_update_spell_fx(unsigned int uLayingItemID, int a2)
Definition: SpriteObject.cpp:1017
BBox_short_::y2
int16_t y2
Definition: VectorTypes.h:117
BLVFace::uSectorID
uint16_t uSectorID
Definition: Indoor.h:484
BLVLightMM7::uAtributes
int16_t uAtributes
Definition: Indoor.h:364
BLVFace
Definition: Indoor.h:424
OBJECT_DESC_TEMPORARY
@ OBJECT_DESC_TEMPORARY
Definition: ObjectList.h:8
v1
GLfloat GLfloat v1
Definition: SDL_opengl_glext.h:694
ObjectDesc::uFlags
int16_t uFlags
Definition: ObjectList.h:27
LevelDecoration::uFlags
uint16_t uFlags
Definition: Decoration.h:27
fixpoint_mul
__int64 fixpoint_mul(int a1, int a2)
Definition: OurMath.cpp:138
pActors
std::array< Actor, 500 > pActors
Definition: Actor.cpp:38
LightsStack_MobileLight_::pLights
MobileLight pLights[400]
Definition: Lights.h:87
BSPModel::sMinX
int32_t sMinX
Definition: BSPModel.h:174
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
BLVSector::uNumPortals
int16_t uNumPortals
Definition: Indoor.h:536
ODMFace::resource
void * resource
Definition: BSPModel.h:142
ODMFace::uNumVertices
uint8_t uNumVertices
Definition: BSPModel.h:155
blue
GLbyte GLbyte blue
Definition: SDL_opengl_glext.h:382
green
GLbyte green
Definition: SDL_opengl_glext.h:382
BLVSector::pFloors
uint16_t * pFloors
Definition: Indoor.h:526
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1740
LevelDecoration
Definition: Decoration.h:20
stru141_actor_collision_object::sMaxX
int sMaxX
Definition: Indoor.h:176
stru141_actor_collision_object::sMinX
int sMinX
Definition: Indoor.h:177
BLVLightMM7::vPosition
struct Vec3_short_ vPosition
Definition: Indoor.h:358
BLVFace::uBackSectorID
int16_t uBackSectorID
Definition: Indoor.h:485
BLVFace::pBounding
struct BBox_short_ pBounding
Definition: Indoor.h:486
stru141_actor_collision_object::sMaxY
int sMaxY
Definition: Indoor.h:178
t
GLdouble GLdouble t
Definition: SDL_opengl.h:2071
OutdoorLocation::max_terrain_dimming_level
int max_terrain_dimming_level
Definition: Outdoor.h:140
ODMFace::index
unsigned int index
Definition: BSPModel.h:130
word_720C10_intercepts_xs
std::array< __int16, 102 > word_720C10_intercepts_xs
Definition: mm7_data.cpp:726
LevelDecoration::uDecorationDescID
uint16_t uDecorationDescID
Definition: Decoration.h:26
LEVEL_Indoor
@ LEVEL_Indoor
Definition: Indoor.h:286
Plane_int_::dist
int dist
Definition: VectorTypes.h:108
distance
GLsizei GLsizei GLfloat distance
Definition: SDL_opengl_glext.h:9203
Party::bTurnBasedModeOn
bool bTurnBasedModeOn
Definition: Party.h:305
pViewport
struct Viewport * pViewport
Definition: mm7_data.cpp:21
Weather::bNight
bool bNight
Definition: Weather.h:17
BSPModel::sMaxY
int32_t sMaxY
Definition: BSPModel.h:178
Party::armageddon_timer
int armageddon_timer
Definition: Party.h:320
LightsStack_MobileLight_::uNumLightsActive
unsigned int uNumLightsActive
Definition: Lights.h:88
word_720A70_intercepts_xs_plus_xs
std::array< __int16, 104 > word_720A70_intercepts_xs_plus_xs
Definition: mm7_data.cpp:724
StationaryLight::vPosition
Vec3_short_ vPosition
Definition: Lights.h:11
pODMRenderParams
ODMRenderParams * pODMRenderParams
Definition: Outdoor.cpp:49
uNumSpriteObjects
size_t uNumSpriteObjects
Definition: SpriteObject.cpp:33
BLVLightMM7::uRadius
int16_t uRadius
Definition: Indoor.h:359
LightsStack_StationaryLight_::pLights
StationaryLight pLights[400]
Definition: Lights.h:64
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
VertexRenderList
RenderVertexSoft VertexRenderList[50]
Definition: Render.cpp:52
stru141_actor_collision_object::field_84
int field_84
Definition: Indoor.h:174
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
RenderBillboard::world_y
int16_t world_y
Definition: IRender.h:37
Party::field_14_radius
int field_14_radius
Definition: Party.h:241
sub_475D85
bool sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4)
Definition: Render.cpp:5403
stru141_actor_collision_object::prolly_normal_d
int prolly_normal_d
Definition: Indoor.h:152
BLVSector::pDecorationIDs
uint16_t * pDecorationIDs
Definition: Indoor.h:550
c
const GLubyte * c
Definition: SDL_opengl_glext.h:11096
v2
GLfloat GLfloat GLfloat v2
Definition: SDL_opengl_glext.h:695
RenderVertexSoft::v
float v
Definition: IRender.h:122
integer_sqrt
int integer_sqrt(int val)
Definition: OurMath.cpp:164
RenderVertexSoft::_rhw
float _rhw
Definition: IRender.h:120
uint
unsigned int uint
Definition: MM7.h:4
stru141_actor_collision_object::field_54
int field_54
Definition: Indoor.h:164
ITEM_BROKEN
@ ITEM_BROKEN
Definition: Items.h:27
v3
GLfloat GLfloat GLfloat GLfloat v3
Definition: SDL_opengl_glext.h:696
pStationaryLightsStack
LightsStack_StationaryLight_ * pStationaryLightsStack
Definition: LightmapBuilder.cpp:11
__debugbreak
void __cdecl __debugbreak(void)
stru141_actor_collision_object::field_80
int field_80
Definition: Indoor.h:173
DecorationDesc_mm6::uDecorationHeight
uint16_t uDecorationHeight
Definition: DecorationList.h:40
__PAIR__
int16 __PAIR__(int8 high, T low)
Definition: MM7.h:135
BSPModel::pFaces
std::vector< ODMFace > pFaces
Definition: BSPModel.h:190
ODMFace
Definition: BSPModel.h:93
stru141_actor_collision_object::direction
Vec3_int_ direction
Definition: Indoor.h:165
BSPModel::vBoundingCenter
Vec3_int_ vBoundingCenter
Definition: BSPModel.h:186
stru193_math::Cos
int Cos(int angle)
Definition: OurMath.cpp:28
ODMFace::uAttributes
uint32_t uAttributes
Definition: BSPModel.h:135
stru_5C6E00
struct stru193_math * stru_5C6E00
Definition: mm7_data.cpp:19
word_7209A0_intercepts_ys_plus_ys
std::array< __int16, 104 > word_7209A0_intercepts_ys_plus_ys
Definition: mm7_data.cpp:723
angle
GLfloat angle
Definition: SDL_opengl_glext.h:6100
BLVLightMM7
Definition: Indoor.h:357
ODMFace::pFacePlane
struct Plane_int_ pFacePlane
Definition: BSPModel.h:131
IndoorLocation::pVertices
struct Vec3_short_ * pVertices
Definition: Indoor.h:628
DecorationDesc
Definition: DecorationList.h:49
BLVSector::uNumCeilings
uint16_t uNumCeilings
Definition: Indoor.h:530
word_720B40_intercepts_zs
std::array< __int16, 104 > word_720B40_intercepts_zs
Definition: mm7_data.cpp:725
uCurrentlyLoadedLevelType
LEVEL_TYPE uCurrentlyLoadedLevelType
Definition: Indoor.cpp:52
Present32
void Present32(uint32_t *src, unsigned int src_pitch, uint32_t *dst, unsigned int dst_pitch)
Definition: Render.cpp:1212
stru_721530
stru141_actor_collision_object stru_721530
Definition: Indoor.cpp:58
StationaryLight::uRadius
int16_t uRadius
Definition: Lights.h:12
ODMFace::zCalc2
int zCalc2
Definition: BSPModel.h:133
IndoorLocation::GetSector
int GetSector(int sX, int sY, int sZ)
Definition: Indoor.cpp:1279
IndoorLocation::pFaces
struct BLVFace * pFaces
Definition: Indoor.h:630
IndoorCameraD3D::GetFarClip
float GetFarClip() const
Definition: IndoorCameraD3D.cpp:159
ObjectList::pObjects
struct ObjectDesc * pObjects
Definition: ObjectList.h:54
stru193_math::Sin
int Sin(int angle)
Definition: OurMath.cpp:133
BBox_short_::x2
int16_t x2
Definition: VectorTypes.h:115
SpriteObject::OnInteraction
static void OnInteraction(unsigned int uLayingItemID)
Definition: SpriteObject.cpp:872
BSPModel
Definition: BSPModel.h:163
BLVSector
Definition: Indoor.h:522
IndoorCameraD3D::GetNearClip
float GetNearClip() const
Definition: IndoorCameraD3D.cpp:146
sub_4754BF
bool sub_4754BF(int a1, int *a2, int X, int Y, int Z, int dir_x, int dir_y, int dir_z, BLVFace *face, int a10, int a11)
Definition: Render.cpp:5082
pMobileLightsStack
LightsStack_MobileLight_ * pMobileLightsStack
Definition: LightmapBuilder.cpp:14
stru141_actor_collision_object::field_4C
int field_4C
Definition: Indoor.h:162
pOutdoor
OutdoorLocation * pOutdoor
Definition: Outdoor.cpp:48
BBox_short_::z1
int16_t z1
Definition: VectorTypes.h:118
BLVSector::uNumDecorations
uint16_t uNumDecorations
Definition: Indoor.h:548
pIndoorCameraD3D
IndoorCameraD3D * pIndoorCameraD3D
Definition: IndoorCameraD3D.cpp:21
stru141_actor_collision_object::position
Vec3_int_ position
Definition: Indoor.h:160
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1112
Viewport::uViewportTL_X
int uViewportTL_X
Definition: Viewport.h:22
uint32_t
unsigned __int32 uint32_t
Definition: SDL_config.h:39
BLV_GetFloorLevel
int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID)
Definition: Indoor.cpp:2530
OBJECT_40
@ OBJECT_40
Definition: SpriteObject.h:182
ODMFace::pZInterceptDisplacements
int16_t pZInterceptDisplacements[20]
Definition: BSPModel.h:141
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
PolygonType
PolygonType
Definition: Indoor.h:216
BLVFace::uAttributes
unsigned int uAttributes
Definition: Indoor.h:475
RenderBillboard::world_x
int16_t world_x
Definition: IRender.h:36
BSPModel::sMaxZ
int32_t sMaxZ
Definition: BSPModel.h:179
pObjectList
struct ObjectList * pObjectList
Definition: ObjectList.cpp:5
pDecorationList
struct DecorationList * pDecorationList
Definition: DecorationList.cpp:11
BLVSector::uMinAmbientLightLevel
int16_t uMinAmbientLightLevel
Definition: Indoor.h:560
SpriteObject::UpdateObject_fn0_ODM
static void UpdateObject_fn0_ODM(unsigned int uLayingItemID)
Definition: SpriteObject.cpp:130
stru141_actor_collision_object::pid
unsigned int pid
Definition: Indoor.h:171
stru141_actor_collision_object::sMinZ
int sMinZ
Definition: Indoor.h:181
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52