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

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

Функции

void PrepareDrawLists_BLV ()
 
unsigned int FaceFlowTextureOffset (unsigned int uFaceID)
 
void BLV_UpdateDoors ()
 
void UpdateActors_BLV ()
 
void PrepareToLoadBLV (unsigned int bLoading)
 
int BLV_GetFloorLevel (int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID)
 
void AddBspNodeToRenderList (unsigned int node_id)
 
void sub_4406BC (unsigned int node_id, unsigned int uFirstNode)
 
void PrepareBspRenderList_BLV ()
 
bool sub_407A1C (int x, int y, int z, Vec3_int_ v)
 
char DoInteractionWithTopmostZObject (int a1, int a2)
 
void BLV_UpdateUserInputAndOther ()
 
bool PortalFrustrum (int pNumVertices, BspRenderer_PortalViewportData *far_portal, BspRenderer_PortalViewportData *near_portal, int uFaceID)
 
int GetPortalScreenCoord (unsigned int uFaceID)
 
void BLV_ProcessPartyActions ()
 
void Door_switch_animation (unsigned int uDoorID, int a2)
 
int sub_4088E9 (int x1, int y1, int x2, int y2, int x3, int y3)
 
int GetAlertStatus ()
 
int _45063B_spawn_some_monster (MapInfo *a1, int a2)
 
int sub_450521_ProllyDropItemAt (int ecx0, int a2, int a3, int a4, int a5, uint16_t a6)
 
bool sub_4075DB (int x, int y, int z, BLVFace *face)
 
bool sub_4077F1 (int a1, int a2, int a3, ODMFace *face, BSPVertexBuffer *a5)
 
void FindBillboardsLightLevels_BLV ()
 
int collide_against_floor_approximate (int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID)
 

Переменные

IndoorLocationpIndoor = new IndoorLocation
 
BLVRenderParamspBLVRenderParams = new BLVRenderParams
 
LEVEL_TYPE uCurrentlyLoadedLevelType = LEVEL_null
 
LightsData Lights
 
stru337 stru_F81018
 
BspRenderer_PortalViewportData stru_F8A590
 
BspRendererpBspRenderer = new BspRenderer
 
stru141_actor_collision_object stru_721530
 
std::array< stru352, 480 > stru_F83B80
 
unsigned __int16 pDoorSoundIDsByLocationID [78]
 
std::array< const char *, 11 > _4E6BDC_loc_names
 

Функции

◆ PrepareDrawLists_BLV()

void PrepareDrawLists_BLV ( )

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

102  {
103  int TorchLightPower; // eax@4
104  unsigned int v7; // ebx@8
105  BLVSector *v8; // esi@8
106 
109  // uNumMobileLightsApplied = 0;
113 
114  if (!_4D864C_force_sw_render_rules || !engine->config->TorchlightEffect()) { // lightspot around party
115  TorchLightPower = 800;
116  if (pParty->TorchlightActive()) {
117  // max is 800 * torchlight
118  // min is 800
119  int MinTorch = TorchLightPower;
120  int MaxTorch = TorchLightPower * pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower;
121 
122  // TorchLightPower *= pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower; // 2,3,4
123  int ran = rand();
124  int mod = ((ran - (RAND_MAX * .4)) / 200);
125  TorchLightPower = (pParty->TorchLightLastIntensity + mod);
126 
127  // clamp
128  if (TorchLightPower < MinTorch)
129  TorchLightPower = MinTorch;
130  if (TorchLightPower > MaxTorch)
131  TorchLightPower = MaxTorch;
132  }
133 
134  pParty->TorchLightLastIntensity = TorchLightPower;
135 
136  // double nexLightIntensity(lastIntensity)
137  // return clamp(0, 1, lastIntensity + (rand() - .3) / 100)
138 
142  floorf(pParty->flt_TorchlightColorR + 0.5f),
143  floorf(pParty->flt_TorchlightColorG + 0.5f),
145  }
146 
150 
151  for (uint i = 0; i < pBspRenderer->uNumVisibleNotEmptySectors; ++i) {
154 
155  for (uint j = 0; j < v8->uNumDecorations; ++j)
157  }
159  // engine->PrepareBloodsplats();
160 }

Перекрестные ссылки _4D864C_force_sw_render_rules, _4E94D0_light_type, LightsStack_MobileLight_::AddLight(), engine, FindBillboardsLightLevels_BLV(), Party::flt_TorchlightColorB, Party::flt_TorchlightColorG, Party::flt_TorchlightColorR, PARTY_BUFF_TORCHLIGHT, pBLVRenderParams, pBspRenderer, BLVSector::pDecorationIDs, pIndoor, pIndoorCameraD3D, pMobileLightsStack, pParty, Party::pPartyBuffs, IndoorLocation::PrepareActorRenderList_BLV(), PrepareBspRenderList_BLV(), IndoorLocation::PrepareDecorationsRenderList_BLV(), IndoorLocation::PrepareItemsRenderList_BLV(), IndoorLocation::pSectors, BspRenderer::pVisibleSectorIDs_toDrawDecorsActorsEtcFrom, BLVRenderParams::Reset(), Party::TorchlightActive(), Party::TorchLightLastIntensity, uNumBillboardsToDraw, BLVSector::uNumDecorations, uNumDecorationsDrawnThisFrame, LightsStack_MobileLight_::uNumLightsActive, uNumSpritesDrawnThisFrame, BspRenderer::uNumVisibleNotEmptySectors, BLVRenderParams::uPartySectorID, IndoorCameraD3D::vPartyPos, Vec2< T >::x, Vec2< T >::y и Vec3< T >::z.

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

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

◆ FaceFlowTextureOffset()

unsigned int FaceFlowTextureOffset ( unsigned int  uFaceID)

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

562  { // time texture offset
565 
566  unsigned int offset = OS_GetTime() >> 3;
567 
568  if (pIndoor->pFaces[uFaceID].uAttributes & FACE_FLOW_DIAGONAL) {
569  Lights.pDeltaUV[1] -= offset & (((Texture *)pIndoor->pFaces[uFaceID].resource)->GetHeight() - 1); // pBitmaps_LOD->GetTexture(pIndoor->pFaces[uFaceID].uBitmapID)->uHeightMinus1;
570  } else if (pIndoor->pFaces[uFaceID].uAttributes & FACE_FLOW_VERTICAL) {
571  Lights.pDeltaUV[1] += offset & (((Texture *)pIndoor->pFaces[uFaceID].resource)->GetHeight() - 1); // pBitmaps_LOD->GetTexture(pIndoor->pFaces[uFaceID].uBitmapID)->uHeightMinus1;
572  }
573 
574  if (pIndoor->pFaces[uFaceID].uAttributes & FACE_FLOW_HORIZONTAL) {
575  Lights.pDeltaUV[0] -= offset & (((Texture *)pIndoor->pFaces[uFaceID].resource)->GetWidth() - 1); // pBitmaps_LOD->GetTexture(pIndoor->pFaces[uFaceID].uBitmapID)->uWidthMinus1;
576  } else if (pIndoor->pFaces[uFaceID].uAttributes & FACE_DONT_CACHE_TEXTURE) {
577  Lights.pDeltaUV[0] += offset & (((Texture *)pIndoor->pFaces[uFaceID].resource)->GetWidth() - 1); // pBitmaps_LOD->GetTexture(pIndoor->pFaces[uFaceID].uBitmapID)->uWidthMinus1;
578  }
579 
580  return offset;
581 }

Перекрестные ссылки Lights, OS_GetTime(), LightsData::pDeltaUV, IndoorLocation::pFaceExtras, IndoorLocation::pFaces, pIndoor, BLVFace::resource, BLVFaceExtra::sTextureDeltaU, BLVFaceExtra::sTextureDeltaV, BLVFace::uAttributes и BLVFace::uFaceExtraID.

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

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

◆ BLV_UpdateDoors()

void BLV_UpdateDoors ( )

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

1506  {
1507  BLVFace *face; // ebx@24
1508  Vec3_short_ *v17; // esi@24
1509  int v18; // eax@24
1510  int v19; // edx@24
1511  signed int v20; // eax@24
1512  int v24; // esi@25
1513  int v25; // eax@25
1514  signed __int64 v27; // qtt@27
1515  BLVFaceExtra *v28; // esi@32
1516  int v32; // eax@34
1517  Vec3_short_ *v34; // eax@35
1518  int v35; // ecx@35
1519  int v36; // edx@35
1520  signed int v37; // eax@35
1521  signed int v38; // edx@35
1522  int v39; // eax@35
1523  int v40; // edx@35
1524  Vec3_short_ *v43; // edi@36
1525  int v57; // eax@58
1526  Vec3_int_ v67;
1527  Vec3_int_ v70;
1528  int v73; // [sp+20h] [bp-44h]@24
1529  int v75; // [sp+28h] [bp-3Ch]@36
1530  int v76; // [sp+2Ch] [bp-38h]@36
1531  int v77; // [sp+30h] [bp-34h]@36
1532  int v82; // [sp+44h] [bp-20h]@35
1533  int v83; // [sp+48h] [bp-1Ch]@34
1534  int v84; // [sp+4Ch] [bp-18h]@34
1535  SoundID eDoorSoundID; // [sp+54h] [bp-10h]@1
1536  int v88; // [sp+5Ch] [bp-8h]@18
1537  int v89; // [sp+60h] [bp-4h]@6
1538 
1539  eDoorSoundID = (SoundID)
1541  for (uint i = 0; i < pIndoor->uNumDoors; ++i) {
1542  BLVDoor *door = &pIndoor->pDoors[i];
1543  if (door->uState == BLVDoor::Closed || door->uState == BLVDoor::Open) {
1544  door->uAttributes &= 0xFFFFFFFDu; // ~0x2
1545  continue;
1546  }
1548  if (door->uState == BLVDoor::Opening) {
1549  v89 = (signed int)(door->uTimeSinceTriggered * door->uCloseSpeed) /
1550  128;
1551  if (v89 >= door->uMoveLength) {
1552  v89 = door->uMoveLength;
1553  door->uState = BLVDoor::Open;
1554  if (!(door->uAttributes & FACE_UNKNOW5) &&
1555  door->uNumVertices != 0)
1556  pAudioPlayer->PlaySound((SoundID)((int)eDoorSoundID + 1), PID(OBJECT_BLVDoor, i), 0, -1, 0, 0);
1557  // goto LABEL_18;
1558  } else if (!(door->uAttributes & FACE_UNKNOW5) &&
1559  door->uNumVertices) {
1560  pAudioPlayer->PlaySound(eDoorSoundID, PID(OBJECT_BLVDoor, i), 1,
1561  -1, 0, 0);
1562  }
1563  } else {
1564  signed int v5 =
1565  (signed int)(door->uTimeSinceTriggered * door->uOpenSpeed) /
1566  128;
1567  if (v5 >= door->uMoveLength) {
1568  v89 = 0;
1569  door->uState = BLVDoor::Closed;
1570  if (!(door->uAttributes & FACE_UNKNOW5) &&
1571  door->uNumVertices != 0)
1572  pAudioPlayer->PlaySound((SoundID)((int)eDoorSoundID + 1),
1573  PID(OBJECT_BLVDoor, i), 0, -1, 0, 0);
1574  // goto LABEL_18;
1575  } else {
1576  v89 = door->uMoveLength - v5;
1577  if (!(door->uAttributes & FACE_UNKNOW5) && door->uNumVertices)
1578  pAudioPlayer->PlaySound(eDoorSoundID,
1579  PID(OBJECT_BLVDoor, i), 1, -1, 0, 0);
1580  }
1581  }
1582 
1583  // LABEL_18:
1584  for (uint j = 0; j < door->uNumVertices; ++j) {
1585  pIndoor->pVertices[door->pVertexIDs[j]].x =
1586  fixpoint_mul(door->vDirection.x, v89) + door->pXOffsets[j];
1587  pIndoor->pVertices[door->pVertexIDs[j]].y =
1588  fixpoint_mul(door->vDirection.y, v89) + door->pYOffsets[j];
1589  pIndoor->pVertices[door->pVertexIDs[j]].z =
1590  fixpoint_mul(door->vDirection.z, v89) + door->pZOffsets[j];
1591  }
1592  for (v88 = 0; v88 < door->uNumFaces; ++v88) {
1593  face = &pIndoor->pFaces[door->pFaceIDs[v88]];
1594  v17 = &pIndoor->pVertices[face->pVertexIDs[0]];
1595  v18 = face->pFacePlane_old.vNormal.y;
1596  v73 = *(int *)&v17->x;
1597  v19 = face->pFacePlane_old.vNormal.z;
1598  v20 = -(v19 * (int)v17->z +
1599  (signed __int16)v73 * face->pFacePlane_old.vNormal.x +
1600  HEXRAYS_SHIWORD(v73) * v18);
1601  face->pFacePlane_old.dist = v20;
1602  face->pFacePlane.dist =
1603  -((double)v17->z * face->pFacePlane.vNormal.z +
1604  (double)v17->y * face->pFacePlane.vNormal.y +
1605  (double)v17->x * face->pFacePlane.vNormal.x);
1606  if (v19) {
1607  v24 = abs(v20 >> 15);
1608  v25 = abs(face->pFacePlane_old.vNormal.z);
1609  if (v24 > v25)
1610  Error(
1611  "Door Error\ndoor id: %i\nfacet no: %i\n\nOverflow "
1612  "dividing facet->d [%i] by facet->nz [%i]",
1613  door->uDoorID, door->pFaceIDs[v88],
1614  face->pFacePlane_old.dist,
1615  face->pFacePlane_old.vNormal.z);
1616  HEXRAYS_LODWORD(v27) = face->pFacePlane_old.dist << 16;
1617  HEXRAYS_HIDWORD(v27) = face->pFacePlane_old.dist >> 16;
1618  face->zCalc3 = -v27 / face->pFacePlane_old.vNormal.z;
1619  }
1620  // if ( face->uAttributes & FACE_TEXTURE_FLOW || render->pRenderD3D
1621  // )
1622  face->_get_normals(&v70, &v67);
1623  v28 = &pIndoor->pFaceExtras[face->uFaceExtraID];
1624  /*if ( !render->pRenderD3D )
1625  {
1626  if ( !(face->uAttributes & FACE_TEXTURE_FLOW) )
1627  continue;
1628  v83 = (unsigned __int64)(door->vDirection.x * (signed __int64)v70.x)
1629  >> 16; v85 = (unsigned __int64)(door->vDirection.y * (signed
1630  __int64)v70.y) >> 16; v84 = (unsigned __int64)(door->vDirection.z *
1631  (signed __int64)v70.z) >> 16; v29 = v89; v28->sTextureDeltaU =
1632  -((v83 + v85 + v84) * (signed __int64)v89) >> 16; v85 = (unsigned
1633  __int64)(door->vDirection.x * (signed __int64)v67.x) >> 16; v83 =
1634  (unsigned __int64)(door->vDirection.y * (signed __int64)v67.y) >>
1635  16; v84 = (unsigned __int64)(door->vDirection.z * (signed
1636  __int64)v67.z) >> 16; v31 = (v85 + v83 + v84) * (signed __int64)v29;
1637  v32 = v31 >> 16;
1638  v57 = -v32;
1639  v28->sTextureDeltaV = v57;
1640  v28->sTextureDeltaU += door->pDeltaUs[v88];
1641  v28->sTextureDeltaV = v57 + door->pDeltaVs[v88];
1642  continue;
1643  }*/
1644  v28->sTextureDeltaU = 0;
1645  v28->sTextureDeltaV = 0;
1646  v34 = &pIndoor->pVertices[face->pVertexIDs[0]];
1647  v35 = v34->z;
1648  v36 = v34->y;
1649  v82 = v34->x;
1650  v37 = v70.x * v82 + v70.y * v36 + v70.z * v35;
1651  v38 = v67.x * v82 + v67.y * v36 + v67.z * v35;
1652  v39 = v37 >> 16;
1653  *face->pVertexUIDs = v39;
1654  v40 = v38 >> 16;
1655  *face->pVertexVIDs = v40;
1656  v84 = v39;
1657  v82 = v40;
1658  for (uint j = 1; j < face->uNumVertices; ++j) {
1659  v43 = &pIndoor->pVertices[face->pVertexIDs[j]];
1660  v76 = ((__int64)v70.z * v43->z + (__int64)v70.x * v43->x +
1661  (__int64)v70.y * v43->y) >>
1662  16;
1663  v77 = ((__int64)v67.x * v43->x + (__int64)v67.y * v43->y +
1664  (__int64)v43->z * v67.z) >>
1665  16;
1666  if (v76 < v39) v39 = v76;
1667  if (v77 < v40) v40 = v77;
1668  if (v76 > v84) v84 = v76;
1669  if (v77 > v82) v82 = v77;
1670  face->pVertexUIDs[j] = v76;
1671  face->pVertexVIDs[j] = v77;
1672  }
1673  if (face->uAttributes & 0x00001000) {
1674  v28->sTextureDeltaU -= v39;
1675  } else {
1676  if (face->uAttributes & 0x8000) {
1677  if (face->resource) {
1678  // v28->sTextureDeltaU -= v84 +
1679  // pBitmaps_LOD->pTextures[face->uBitmapID].uTextureWidth;
1680  v28->sTextureDeltaU -=
1681  v84 + ((Texture *)face->resource)->GetWidth();
1682  }
1683  }
1684  }
1685  if (face->uAttributes & FACE_UNKNOW6) {
1686  v28->sTextureDeltaV -= v40;
1687  } else {
1688  if (face->uAttributes & FACE_INDOOR_DOOR) {
1689  v28->sTextureDeltaV -=
1690  v84 + ((Texture *)face->resource)->GetHeight();
1691  // if (face->uBitmapID != -1)
1692  // v28->sTextureDeltaV -= v82 +
1693  // pBitmaps_LOD->GetTexture(face->uBitmapID)->uTextureHeight;
1694  }
1695  }
1696  if (face->uAttributes & FACE_TEXTURE_FLOW) {
1697  v84 = fixpoint_mul(door->vDirection.x, v70.x);
1698  v82 = fixpoint_mul(door->vDirection.y, v70.y);
1699  v83 = fixpoint_mul(door->vDirection.z, v70.z);
1700  v75 = v84 + v82 + v83;
1701  v82 = fixpoint_mul(v75, v89);
1702  v28->sTextureDeltaU = -v82;
1703  v84 = fixpoint_mul(door->vDirection.x, v67.x);
1704  v82 = fixpoint_mul(door->vDirection.y, v67.y);
1705  v83 = fixpoint_mul(door->vDirection.z, v67.z);
1706  v75 = v84 + v82 + v83;
1707  v32 = fixpoint_mul(v75, v89);
1708  v57 = -v32;
1709  v28->sTextureDeltaV = v57;
1710  v28->sTextureDeltaU += door->pDeltaUs[v88];
1711  v28->sTextureDeltaV = v57 + door->pDeltaVs[v88];
1712  }
1713  }
1714  }
1715 }

Перекрестные ссылки BLVDoor::Closed, dword_6BE13C_uCurrentlyLoadedLocationID, fixpoint_mul(), OBJECT_BLVDoor, BLVDoor::Open, BLVDoor::Opening, pAudioPlayer, BLVDoor::pDeltaUs, BLVDoor::pDeltaVs, IndoorLocation::pDoors, pDoorSoundIDsByLocationID, pEventTimer, IndoorLocation::pFaceExtras, BLVDoor::pFaceIDs, IndoorLocation::pFaces, pIndoor, AudioPlayer::PlaySound(), BLVDoor::pVertexIDs, IndoorLocation::pVertices, BLVDoor::pXOffsets, BLVDoor::pYOffsets, BLVDoor::pZOffsets, BLVFaceExtra::sTextureDeltaU, BLVFaceExtra::sTextureDeltaV, BLVDoor::uAttributes, BLVDoor::uCloseSpeed, BLVDoor::uDoorID, BLVDoor::uMoveLength, IndoorLocation::uNumDoors, BLVDoor::uNumFaces, BLVDoor::uNumVertices, BLVDoor::uOpenSpeed, BLVDoor::uState, Timer::uTimeElapsed, BLVDoor::uTimeSinceTriggered и BLVDoor::vDirection.

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

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

◆ UpdateActors_BLV()

void UpdateActors_BLV ( )

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

1718  {
1719  int v2; // edi@6
1720  int v3; // eax@6
1721  int v4; // eax@8
1722  __int16 v5; // ax@11
1723  signed int v6; // ebx@14
1724  signed __int64 v10; // qax@18
1725  int v22; // edi@46
1726  unsigned int v24; // eax@51
1727  int v27; // ST08_4@54
1728  int v28; // edi@54
1729  int v29; // eax@54
1730  int v30; // ecx@62
1731  int v31; // ebx@62
1732  int v32; // eax@62
1733  int v33; // eax@64
1734  int v37; // ebx@85
1735  int v44; // ecx@96
1736  int v45; // edi@101
1737  AIDirection v52; // [sp+0h] [bp-60h]@75
1738  AIDirection v53; // [sp+1Ch] [bp-44h]@116
1739  unsigned int uSectorID; // [sp+3Ch] [bp-24h]@6
1740  int v56; // [sp+40h] [bp-20h]@6
1741  unsigned int _this; // [sp+44h] [bp-1Ch]@51
1742  int v58; // [sp+48h] [bp-18h]@51
1743  int v59; // [sp+4Ch] [bp-14h]@8
1744  unsigned int uFaceID; // [sp+50h] [bp-10h]@6
1745  int v61; // [sp+54h] [bp-Ch]@14
1746  int v62; // [sp+58h] [bp-8h]@6
1747  unsigned int actor_id; // [sp+5Ch] [bp-4h]@1
1748 
1749  if (engine->config->no_actors)
1750  return; // uNumActors = 0;
1751 
1752  for (actor_id = 0; actor_id < uNumActors; actor_id++) {
1753  if (pActors[actor_id].uAIState == Removed ||
1754  pActors[actor_id].uAIState == Disabled ||
1755  pActors[actor_id].uAIState == Summoned ||
1756  !pActors[actor_id].uMovementSpeed)
1757  continue;
1758  uSectorID = pActors[actor_id].uSectorID;
1760  pActors[actor_id].vPosition.x, pActors[actor_id].vPosition.y,
1761  pActors[actor_id].vPosition.z, &uSectorID, &uFaceID);
1762  pActors[actor_id].uSectorID = uSectorID;
1763  v3 = pActors[actor_id].pMonsterInfo.uFlying;
1764  v56 = v2;
1765  v62 = v3;
1766  if (!pActors[actor_id].CanAct()) v62 = 0;
1767  v4 = pActors[actor_id].vPosition.z;
1768  v59 = 0;
1769  if (pActors[actor_id].vPosition.z > v2 + 1) v59 = 1;
1770  if (v2 <= -30000) {
1771  v5 = pIndoor->GetSector(pActors[actor_id].vPosition.x,
1772  pActors[actor_id].vPosition.y, v4);
1773  pActors[actor_id].uSectorID = v5;
1774  v56 = BLV_GetFloorLevel(
1775  pActors[actor_id].vPosition.x, pActors[actor_id].vPosition.y,
1776  pActors[actor_id].vPosition.z, v5, &uFaceID);
1777  if (!v5 || v56 == -30000) continue;
1778  }
1779  if (pActors[actor_id].uCurrentActionAnimation ==
1780  ANIM_Walking) { //монстр двигается
1781  v6 = pActors[actor_id].uMovementSpeed;
1782  if (pActors[actor_id].pActorBuffs[ACTOR_BUFF_SLOWED].Active()) {
1783  if (pActors[actor_id].pActorBuffs[ACTOR_BUFF_SLOWED].uPower)
1784  HEXRAYS_LODWORD(v10) = pActors[actor_id].uMovementSpeed /
1785  (unsigned __int16)pActors[actor_id]
1786  .pActorBuffs[ACTOR_BUFF_SLOWED]
1787  .uPower;
1788  else
1789  v10 = (signed __int64)((double)pActors[actor_id]
1790  .uMovementSpeed *
1791  0.5);
1792  v6 = v10;
1793  }
1794  if (pActors[actor_id].uAIState == Pursuing ||
1795  pActors[actor_id].uAIState == Fleeing)
1796  v6 *= 2;
1798  v6 = (signed __int64)((double)v6 *
1800  if (v6 > 1000) v6 = 1000;
1801  pActors[actor_id].vVelocity.x =
1802  fixpoint_mul(stru_5C6E00->Cos(pActors[actor_id].uYawAngle), v6);
1803  pActors[actor_id].vVelocity.y =
1804  fixpoint_mul(stru_5C6E00->Sin(pActors[actor_id].uYawAngle), v6);
1805  if (v62)
1806  pActors[actor_id].vVelocity.z = fixpoint_mul(
1807  stru_5C6E00->Sin(pActors[actor_id].uPitchAngle), v6);
1808  } else { // actor is not moving(актор не двигается)
1809  pActors[actor_id].vVelocity.x =
1810  fixpoint_mul(55000, pActors[actor_id].vVelocity.x);
1811  pActors[actor_id].vVelocity.y =
1812  fixpoint_mul(55000, pActors[actor_id].vVelocity.y);
1813  if (v62)
1814  pActors[actor_id].vVelocity.z =
1815  fixpoint_mul(55000, pActors[actor_id].vVelocity.z);
1816  }
1817  if (pActors[actor_id].vPosition.z <= v56) {
1818  pActors[actor_id].vPosition.z = v56 + 1;
1819  if (pIndoor->pFaces[uFaceID].uPolygonType == 3) {
1820  if (pActors[actor_id].vVelocity.z < 0)
1821  pActors[actor_id].vVelocity.z = 0;
1822  } else {
1823  if (pIndoor->pFaces[uFaceID].pFacePlane_old.vNormal.z < 45000)
1824  pActors[actor_id].vVelocity.z -=
1826  }
1827  } else {
1828  if (v59 && !v62)
1829  pActors[actor_id].vVelocity.z +=
1830  -8 * (short)pEventTimer->uTimeElapsed *
1832  }
1833  if (pActors[actor_id].vVelocity.x * pActors[actor_id].vVelocity.x +
1834  pActors[actor_id].vVelocity.y * pActors[actor_id].vVelocity.y +
1835  pActors[actor_id].vVelocity.z * pActors[actor_id].vVelocity.z >=
1836  400) {
1837  stru_721530.field_84 = -1;
1838  stru_721530.field_70 = 0;
1839  stru_721530.field_0 = 1;
1840  stru_721530.field_8_radius = pActors[actor_id].uActorRadius;
1841  stru_721530.prolly_normal_d = pActors[actor_id].uActorRadius;
1842  stru_721530.height = pActors[actor_id].uActorHeight;
1843  v22 = 0;
1844  for (uSectorID = 0; uSectorID < 100; uSectorID++) {
1845  stru_721530.position.x = pActors[actor_id].vPosition.x;
1847  stru_721530.position.y = pActors[actor_id].vPosition.y;
1849  stru_721530.normal.z = pActors[actor_id].vPosition.z +
1850  pActors[actor_id].uActorRadius + 1;
1851  stru_721530.position.z = pActors[actor_id].vPosition.z -
1852  pActors[actor_id].uActorRadius +
1853  stru_721530.height - 1;
1855  stru_721530.position.z = pActors[actor_id].vPosition.z +
1856  pActors[actor_id].uActorRadius + 1;
1857  stru_721530.velocity.x = pActors[actor_id].vVelocity.x;
1858  stru_721530.velocity.y = pActors[actor_id].vVelocity.y;
1859  stru_721530.velocity.z = pActors[actor_id].vVelocity.z;
1860  stru_721530.uSectorID = pActors[actor_id].uSectorID;
1861  if (!stru_721530.CalcMovementExtents(v22)) {
1862  v58 = 0;
1863  v24 = 8 * actor_id;
1864  HEXRAYS_LOBYTE(v24) = PID(OBJECT_Actor, actor_id);
1865  for (v61 = 0; v61 < 100; ++v61) {
1870  for (uint j = 0; j < ai_arrays_size; j++) {
1871  if (ai_near_actors_ids[j] != actor_id) {
1872  v27 = abs(
1873  pActors[ai_near_actors_ids[j]].vPosition.z -
1874  pActors[actor_id].vPosition.z);
1875  v28 = abs(
1876  pActors[ai_near_actors_ids[j]].vPosition.y -
1877  pActors[actor_id].vPosition.y);
1878  v29 = abs(
1879  pActors[ai_near_actors_ids[j]].vPosition.x -
1880  pActors[actor_id].vPosition.x);
1881  if (int_get_vector_length(v29, v28, v27) >=
1882  pActors[actor_id].uActorRadius +
1883  (signed int)
1885  .uActorRadius &&
1887  ai_near_actors_ids[j], 40))
1888  ++v58;
1889  }
1890  }
1891  if (_46F04E_collide_against_portals()) break;
1892  }
1893  v56 = v58 > 1;
1895  v30 = stru_721530.normal2.x;
1896  v31 = stru_721530.normal2.y;
1897  v32 = stru_721530.normal2.z -
1899  } else {
1900  v30 = pActors[actor_id].vPosition.x +
1903  v31 = pActors[actor_id].vPosition.y +
1906  v32 = pActors[actor_id].vPosition.z +
1909  }
1910  v33 = collide_against_floor(
1911  v30, v31, v32, &stru_721530.uSectorID, &uFaceID);
1912  if (pIndoor->pFaces[uFaceID].uAttributes &
1913  FACE_INDOOR_SKY &&
1914  pActors[actor_id].uAIState == Dead) {
1915  pActors[actor_id].uAIState = Removed;
1916  continue;
1917  }
1918  if (v59 || v62 ||
1919  !(pIndoor->pFaces[uFaceID].uAttributes &
1920  FACE_INDOOR_SKY)) {
1921  if (v33 == -30000) continue;
1922  if (pActors[actor_id].uCurrentActionAnimation != 1 ||
1923  v33 >= pActors[actor_id].vPosition.z - 100 || v59 ||
1924  v62) {
1926  pActors[actor_id].vPosition.x +=
1929  pActors[actor_id].vPosition.y +=
1932  pActors[actor_id].vPosition.z +=
1935  pActors[actor_id].uSectorID =
1936  (short)stru_721530.uSectorID;
1938  v37 = PID_ID(stru_721530.pid);
1939  if (PID_TYPE(stru_721530.pid) == OBJECT_Actor) {
1940  if (pParty->bTurnBasedModeOn &&
1943  pActors[actor_id].vVelocity.x =
1944  fixpoint_mul(58500, pActors[actor_id].vVelocity.x);
1945  pActors[actor_id].vVelocity.y =
1946  fixpoint_mul(58500, pActors[actor_id].vVelocity.y);
1947  pActors[actor_id].vVelocity.z =
1948  fixpoint_mul(
1949  58500,
1950  pActors[actor_id].vVelocity.z);
1951  v22 = 0;
1952  continue;
1953  }
1954  if (pActors[actor_id]
1955  .pMonsterInfo.uHostilityType) {
1956  if (!v56) {
1957  Actor::AI_Flee(actor_id,
1958  stru_721530.pid, v22,
1959  (AIDirection *)v22);
1960  pActors[actor_id]
1961  .vVelocity.x = fixpoint_mul(
1962  58500,
1963  pActors[actor_id].vVelocity.x);
1964  pActors[actor_id]
1965  .vVelocity.y = fixpoint_mul(
1966  58500,
1967  pActors[actor_id].vVelocity.y);
1968  pActors[actor_id]
1969  .vVelocity.z = fixpoint_mul(
1970  58500,
1971  pActors[actor_id].vVelocity.z);
1972  v22 = 0;
1973  continue;
1974  }
1975  } else {
1976  if (!v56) {
1977  if (!pActors[v37]
1978  .pMonsterInfo
1979  .uHostilityType) {
1981  actor_id, stru_721530.pid,
1982  v22, (AIDirection *)v22);
1983  pActors[actor_id].vVelocity.x =
1984  fixpoint_mul(
1985  58500,
1986  pActors[actor_id]
1987  .vVelocity.x);
1988  pActors[actor_id].vVelocity.y =
1989  fixpoint_mul(
1990  58500,
1991  pActors[actor_id]
1992  .vVelocity.y);
1993  pActors[actor_id].vVelocity.z =
1994  fixpoint_mul(
1995  58500,
1996  pActors[actor_id]
1997  .vVelocity.z);
1998  v22 = 0;
1999  continue;
2000  }
2001  Actor::AI_Flee(actor_id,
2002  stru_721530.pid, v22,
2003  (AIDirection *)v22);
2004  pActors[actor_id]
2005  .vVelocity.x = fixpoint_mul(
2006  58500,
2007  pActors[actor_id].vVelocity.x);
2008  pActors[actor_id]
2009  .vVelocity.y = fixpoint_mul(
2010  58500,
2011  pActors[actor_id].vVelocity.y);
2012  pActors[actor_id]
2013  .vVelocity.z = fixpoint_mul(
2014  58500,
2015  pActors[actor_id].vVelocity.z);
2016  v22 = 0;
2017  continue;
2018  }
2019  }
2020  Actor::AI_StandOrBored(actor_id, 4, v22,
2021  &v53);
2022  pActors[actor_id].vVelocity.x =
2023  fixpoint_mul(
2024  58500,
2025  pActors[actor_id].vVelocity.x);
2026  pActors[actor_id].vVelocity.y =
2027  fixpoint_mul(
2028  58500,
2029  pActors[actor_id].vVelocity.y);
2030  pActors[actor_id].vVelocity.z =
2031  fixpoint_mul(
2032  58500,
2033  pActors[actor_id].vVelocity.z);
2034  v22 = 0;
2035  continue;
2036  }
2037  if (PID_TYPE(stru_721530.pid) ==
2038  OBJECT_Player) {
2039  if (pActors[actor_id].GetActorsRelation(
2040  0)) {
2041  // v51 =
2042  // __OFSUB__(HIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime),
2043  // v22); v49 =
2044  // HIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime)
2045  // == v22; v50 =
2046  // HIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime)
2047  // - v22 < 0;
2048  pActors[actor_id].vVelocity.y = 0;
2049  pActors[actor_id].vVelocity.x = 0;
2050  if (pParty
2051  ->pPartyBuffs
2053  .Active()) {
2054  pParty
2055  ->pPartyBuffs
2057  .Reset();
2058  }
2059 
2061  pActors[actor_id].vVelocity.x =
2062  fixpoint_mul(
2063  58500,
2064  pActors[actor_id].vVelocity.x);
2065  pActors[actor_id].vVelocity.y =
2066  fixpoint_mul(
2067  58500,
2068  pActors[actor_id].vVelocity.y);
2069  pActors[actor_id].vVelocity.z =
2070  fixpoint_mul(
2071  58500,
2072  pActors[actor_id].vVelocity.z);
2073  continue;
2074  }
2075  Actor::AI_FaceObject(actor_id,
2076  stru_721530.pid, v22,
2077  (AIDirection *)v22);
2078  pActors[actor_id].vVelocity.x =
2079  fixpoint_mul(
2080  58500,
2081  pActors[actor_id].vVelocity.x);
2082  pActors[actor_id].vVelocity.y =
2083  fixpoint_mul(
2084  58500,
2085  pActors[actor_id].vVelocity.y);
2086  pActors[actor_id].vVelocity.z =
2087  fixpoint_mul(
2088  58500,
2089  pActors[actor_id].vVelocity.z);
2090  v22 = 0;
2091  continue;
2092  }
2093  if (PID_TYPE(stru_721530.pid) ==
2095  _this = integer_sqrt(
2096  pActors[actor_id].vVelocity.x *
2097  pActors[actor_id].vVelocity.x +
2098  pActors[actor_id].vVelocity.y *
2099  pActors[actor_id].vVelocity.y);
2100  v45 = stru_5C6E00->Atan2(
2101  pActors[actor_id].vPosition.x -
2102  pLevelDecorations[v37].vPosition.x,
2103  pActors[actor_id].vPosition.y -
2104  pLevelDecorations[v37].vPosition.y);
2105  pActors[actor_id].vVelocity.x =
2107  _this);
2108  pActors[actor_id].vVelocity.y =
2110  _this);
2111  pActors[actor_id].vVelocity.x =
2112  fixpoint_mul(
2113  58500,
2114  pActors[actor_id].vVelocity.x);
2115  pActors[actor_id].vVelocity.y =
2116  fixpoint_mul(
2117  58500,
2118  pActors[actor_id].vVelocity.y);
2119  pActors[actor_id].vVelocity.z =
2120  fixpoint_mul(
2121  58500,
2122  pActors[actor_id].vVelocity.z);
2123  v22 = 0;
2124  continue;
2125  }
2126  if (PID_TYPE(stru_721530.pid) ==
2127  OBJECT_BModel) {
2129  if (pIndoor->pFaces[v37].uPolygonType ==
2130  3) {
2131  pActors[actor_id].vVelocity.z = 0;
2132  pActors[actor_id].vPosition.z =
2133  pIndoor
2134  ->pVertices[*pIndoor
2135  ->pFaces[v37]
2136  .pVertexIDs]
2137  .z +
2138  1;
2139  if (pActors[actor_id].vVelocity.x *
2140  pActors[actor_id]
2141  .vVelocity.x +
2142  pActors[actor_id].vVelocity.y *
2143  pActors[actor_id]
2144  .vVelocity.y <
2145  400) {
2146  pActors[actor_id].vVelocity.y = 0;
2147  pActors[actor_id].vVelocity.x = 0;
2148  pActors[actor_id]
2149  .vVelocity.x = fixpoint_mul(
2150  58500,
2151  pActors[actor_id].vVelocity.x);
2152  pActors[actor_id]
2153  .vVelocity.y = fixpoint_mul(
2154  58500,
2155  pActors[actor_id].vVelocity.y);
2156  pActors[actor_id]
2157  .vVelocity.z = fixpoint_mul(
2158  58500,
2159  pActors[actor_id].vVelocity.z);
2160  v22 = 0;
2161  continue;
2162  }
2163  } else {
2164  v61 = abs(pIndoor->pFaces[v37]
2166  .vNormal.x *
2167  pActors[actor_id]
2168  .vVelocity.x +
2169  pIndoor->pFaces[v37]
2171  .vNormal.y *
2172  pActors[actor_id]
2173  .vVelocity.y +
2174  pIndoor->pFaces[v37]
2176  .vNormal.z *
2177  pActors[actor_id]
2178  .vVelocity.z) >>
2179  16;
2180  if ((stru_721530.speed >> 3) > v61)
2181  v61 = stru_721530.speed >> 3;
2182  pActors[actor_id].vVelocity.x +=
2183  fixpoint_mul(
2184  v61,
2185  pIndoor->pFaces[v37]
2186  .pFacePlane_old.vNormal.x);
2187  pActors[actor_id].vVelocity.y +=
2188  fixpoint_mul(
2189  v61,
2190  pIndoor->pFaces[v37]
2191  .pFacePlane_old.vNormal.y);
2192  pActors[actor_id].vVelocity.z +=
2193  fixpoint_mul(
2194  v61,
2195  pIndoor->pFaces[v37]
2196  .pFacePlane_old.vNormal.z);
2197  if (pIndoor->pFaces[v37].uPolygonType !=
2198  4 &&
2199  pIndoor->pFaces[v37].uPolygonType !=
2200  3) {
2202  ((pIndoor->pFaces[v37]
2203  .pFacePlane_old.dist +
2204  pIndoor->pFaces[v37]
2206  .vNormal.z *
2207  pActors[actor_id]
2208  .vPosition.z +
2209  pIndoor->pFaces[v37]
2211  .vNormal.y *
2212  pActors[actor_id]
2213  .vPosition.y +
2214  pIndoor->pFaces[v37]
2216  .vNormal.x *
2217  pActors[actor_id]
2218  .vPosition.x) >>
2219  16);
2220  if (v44 > 0) {
2221  pActors[actor_id].vPosition.x +=
2222  fixpoint_mul(
2223  v44,
2224  pIndoor->pFaces[v37]
2226  .vNormal.x);
2227  pActors[actor_id].vPosition.y +=
2228  fixpoint_mul(
2229  v44,
2230  pIndoor->pFaces[v37]
2232  .vNormal.y);
2233  pActors[actor_id].vPosition.z +=
2234  fixpoint_mul(
2235  v44,
2236  pIndoor->pFaces[v37]
2238  .vNormal.z);
2239  }
2240  pActors[actor_id]
2241  .uYawAngle = stru_5C6E00->Atan2(
2242  pActors[actor_id].vVelocity.x,
2243  pActors[actor_id].vVelocity.y);
2244  }
2245  }
2246  if (pIndoor->pFaces[v37].uAttributes &
2247  FACE_UNKNOW1)
2249  pIndoor
2250  ->pFaceExtras[pIndoor
2251  ->pFaces[v37]
2252  .uFaceExtraID]
2253  .uEventID,
2254  0, 1);
2255  }
2256  pActors[actor_id].vVelocity.x = fixpoint_mul(
2257  58500, pActors[actor_id].vVelocity.x);
2258  pActors[actor_id].vVelocity.y = fixpoint_mul(
2259  58500, pActors[actor_id].vVelocity.y);
2260  pActors[actor_id].vVelocity.z = fixpoint_mul(
2261  58500, pActors[actor_id].vVelocity.z);
2262  v22 = 0;
2263  continue;
2264  } else {
2265  pActors[actor_id].vPosition.x =
2266  (short)stru_721530.normal2.x;
2267  pActors[actor_id].vPosition.y =
2268  (short)stru_721530.normal2.y;
2269  pActors[actor_id].vPosition.z =
2270  (short)stru_721530.normal2.z -
2271  (short)stru_721530.prolly_normal_d - 1;
2272  pActors[actor_id].uSectorID =
2273  (short)stru_721530.uSectorID;
2274  // goto LABEL_123;
2275  break;
2276  }
2277 
2278  } else if (pActors[actor_id].vPosition.x & 1) {
2279  pActors[actor_id].uYawAngle += 100;
2280  } else {
2281  pActors[actor_id].uYawAngle -= 100;
2282  }
2283  } else {
2284  if (pParty->bTurnBasedModeOn &&
2287  continue;
2288  if (!pActors[actor_id].pMonsterInfo.uHostilityType ||
2289  v56 != v22) {
2290  Actor::AI_StandOrBored(actor_id, 4, v22, &v52);
2291  continue;
2292  }
2293  }
2294  }
2295  }
2296  } else {
2297  pActors[actor_id].vVelocity.z = 0;
2298  pActors[actor_id].vVelocity.y = 0;
2299  pActors[actor_id].vVelocity.x = 0;
2300  if (pIndoor->pFaces[uFaceID].uAttributes & FACE_INDOOR_SKY) {
2301  if (pActors[actor_id].uAIState == Dead)
2302  pActors[actor_id].uAIState = Removed;
2303  }
2304  }
2305  // LABEL_123:
2306  }
2307 }

Перекрестные ссылки Actor::_46DF1A_collide_against_actor(), _46E0B2_collide_against_decorations(), _46E44E_collide_against_faces_and_portals(), _46ED8A_collide_against_sprite_objects(), _46EF01_collision_chech_player(), _46F04E_collide_against_portals(), ACTOR_BUFF_SLOWED, ai_arrays_size, Actor::AI_FaceObject(), Actor::AI_Flee(), ai_near_actors_ids, Actor::AI_StandOrBored(), ANIM_Walking, stru193_math::Atan2(), BLV_GetFloorLevel(), ViewingParams::bRedrawGameUI, Party::bTurnBasedModeOn, stru141_actor_collision_object::CalcMovementExtents(), collide_against_floor(), stru193_math::Cos(), Dead, stru141_actor_collision_object::direction, Disabled, Plane_int_::dist, engine, EventProcessor(), stru141_actor_collision_object::field_0, stru141_actor_collision_object::field_6C, stru141_actor_collision_object::field_70, stru141_actor_collision_object::field_7C, stru141_actor_collision_object::field_84, stru141_actor_collision_object::field_8_radius, fixpoint_mul(), Fleeing, flt_6BE3AC_debug_recmod1_x_1_6, GetGravityStrength(), IndoorLocation::GetSector(), stru141_actor_collision_object::height, int_get_vector_length(), integer_sqrt(), stru141_actor_collision_object::normal, stru141_actor_collision_object::normal2, OBJECT_Actor, OBJECT_BModel, OBJECT_Decoration, OBJECT_Player, pActors, PARTY_BUFF_INVISIBILITY, pEventTimer, BLVFace::pFacePlane_old, IndoorLocation::pFaces, stru141_actor_collision_object::pid, pIndoor, pLevelDecorations, stru141_actor_collision_object::position, pParty, Party::pPartyBuffs, stru141_actor_collision_object::prolly_normal_d, pTurnEngine, Pursuing, BLVFace::pVertexIDs, IndoorLocation::pVertices, Removed, stru193_math::Sin(), stru141_actor_collision_object::speed, stru_5C6E00, stru_721530, Summoned, TE_ATTACK, TE_MOVEMENT, TE_WAIT, stru262_TurnBased::turn_stage, BLVFace::uAttributes, uNumActors, BLVFace::uPolygonType, stru141_actor_collision_object::uSectorID, Timer::uTimeElapsed, stru141_actor_collision_object::velocity, viewparams и Plane_int_::vNormal.

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

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

◆ PrepareToLoadBLV()

void PrepareToLoadBLV ( unsigned int  bLoading)

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

2310  {
2311  unsigned int respawn_interval; // ebx@1
2312  unsigned int map_id; // eax@8
2313  MapInfo *map_info; // edi@9
2314  int v4; // eax@11
2315  char v28; // zf@81
2316  signed int v30; // edi@94
2317  int v34[4]; // [sp+3E8h] [bp-2Ch]@96
2318  int v35; // [sp+3F8h] [bp-1Ch]@1
2319  int v38; // [sp+404h] [bp-10h]@1
2320  int pDest; // [sp+40Ch] [bp-8h]@1
2321 
2322  respawn_interval = 0;
2324  bNoNPCHiring = false;
2325  pDest = 1;
2327 
2328  engine->SetUnderwater(
2330 
2331  if ((pCurrentMapName == "out15.odm") || (pCurrentMapName == "d23.blv")) {
2332  bNoNPCHiring = true;
2333  }
2340  if (map_id) {
2341  map_info = &pMapStats->pInfos[map_id];
2342  respawn_interval = pMapStats->pInfos[map_id].uRespawnIntervalDays;
2343  v38 = GetAlertStatus();
2344  } else {
2345  map_info = (MapInfo *)bLoading;
2346  }
2348 
2351  respawn_interval, (char *)&pDest) -
2352  1;
2353  if (!v4) Error("Unable to open %s", pCurrentMapName.c_str());
2354 
2355  if (v4 == 1) Error("File %s is not a BLV File", pCurrentMapName.c_str());
2356 
2357  if (v4 == 2) Error("Attempt to open new level before clearing old");
2358  if (v4 == 3) Error("Out of memory loading indoor level");
2359  if (!(dword_6BE364_game_settings_1 & GAME_SETTINGS_2000)) {
2362  }
2363  dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_2000;
2364  if (!map_id) pDest = 0;
2365  if (pDest == 1) {
2366  for (uint i = 0; i < pIndoor->uNumSpawnPoints; ++i) {
2367  auto spawn = pIndoor->pSpawnPoints + i;
2368  if (spawn->IsMonsterSpawn())
2369  SpawnEncounter(map_info, spawn, 0, 0, 0);
2370  else
2371  map_info->SpawnRandomTreasure(spawn);
2372  }
2374  }
2375 
2376  for (uint i = 0; i < pIndoor->uNumDoors; ++i) {
2377  if (pIndoor->pDoors[i].uAttributes & 0x01) {
2379  pIndoor->pDoors[i].uTimeSinceTriggered = 15360;
2380  pIndoor->pDoors[i].uAttributes = 2;
2381  }
2382 
2383  if (pIndoor->pDoors[i].uState == BLVDoor::Closed) {
2385  pIndoor->pDoors[i].uTimeSinceTriggered = 15360;
2386  pIndoor->pDoors[i].uAttributes = 2;
2387  } else if (pIndoor->pDoors[i].uState == BLVDoor::Open) {
2389  pIndoor->pDoors[i].uTimeSinceTriggered = 15360;
2390  pIndoor->pDoors[i].uAttributes = 2;
2391  }
2392  }
2393 
2394  /*for (uint i = 0; i < pIndoor->uNumFaces; ++i)
2395  {
2396  if (pIndoor->pFaces[i].uBitmapID != -1)
2397  pBitmaps_LOD->pTextures[pIndoor->pFaces[i].uBitmapID].palette_id2 =
2398  pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[pIndoor->pFaces[i].uBitmapID].palette_id1);
2399  }*/
2400 
2402 
2403  v35 = 0;
2404  for (uint i = 0; i < uNumLevelDecorations; ++i) {
2406 
2407  DecorationDesc *decoration = pDecorationList->GetDecoration(pLevelDecorations[i].uDecorationDescID);
2408 
2409  if (decoration->uSoundID && _6807E0_num_decorations_with_sounds_6807B8 < 9) {
2410  // pSoundList->LoadSound(decoration->uSoundID, 0);
2412  }
2413 
2414  if (!(pLevelDecorations[i].uFlags & LEVEL_DECORATION_INVISIBLE)) {
2415  if (!decoration->DontDraw()) {
2416  if (decoration->uLightRadius) {
2417  unsigned char r = 255, g = 255, b = 255;
2418  if (/*render->pRenderD3D*/ true &&
2419  render->config->is_using_colored_lights) {
2420  r = decoration->uColoredLightRed;
2421  g = decoration->uColoredLightGreen;
2422  b = decoration->uColoredLightBlue;
2423  }
2425  pLevelDecorations[i].vPosition.x,
2426  pLevelDecorations[i].vPosition.y,
2427  pLevelDecorations[i].vPosition.z +
2428  decoration->uDecorationHeight,
2429  decoration->uLightRadius, r, g, b, _4E94D0_light_type);
2430  }
2431  }
2432  }
2433 
2434  if (!pLevelDecorations[i].uEventID) {
2435  if (pLevelDecorations[i].IsInteractive()) {
2436  if (v35 < 124) {
2437  pLevelDecorations[i]._idx_in_stru123 = v35 + 75;
2439  pLevelDecorations[i].uFlags |=
2441  v35++;
2442  }
2443  }
2444  }
2445  }
2446 
2448 
2449  for (uint i = 0; i < uNumSpriteObjects; ++i) {
2450  if (pSpriteObjects[i].uObjectDescID) {
2451  if (pSpriteObjects[i].containing_item.uItemID) {
2452  if (pSpriteObjects[i].containing_item.uItemID != 220 &&
2453  pItemsTable
2454  ->pItems[pSpriteObjects[i].containing_item.uItemID]
2455  .uEquipType == EQUIP_POTION &&
2456  !pSpriteObjects[i].containing_item.uEnchantmentType)
2457  pSpriteObjects[i].containing_item.uEnchantmentType =
2458  rand() % 15 + 5;
2460  &pSpriteObjects[i].containing_item);
2461  }
2462  }
2463  }
2464 
2465  // INDOOR initialize actors
2466  v38 = 0;
2467 
2468  for (uint i = 0; i < uNumActors; ++i) {
2469  if (pActors[i].uAttributes & ACTOR_UNKNOW7) {
2470  if (!map_id) {
2471  pActors[i].pMonsterInfo.field_3E = 19;
2472  pActors[i].uAttributes |= ACTOR_UNKNOW11;
2473  continue;
2474  }
2475  v28 = v38 == 0;
2476  } else {
2477  v28 = v38 == 1;
2478  }
2479 
2480  if (!v28) {
2481  pActors[i].PrepareSprites(0);
2482  pActors[i].pMonsterInfo.uHostilityType =
2484  if (pActors[i].pMonsterInfo.field_3E != 11 &&
2485  pActors[i].pMonsterInfo.field_3E != 19 &&
2486  (!pActors[i].sCurrentHP || !pActors[i].pMonsterInfo.uHP)) {
2487  pActors[i].pMonsterInfo.field_3E = 5;
2488  pActors[i].UpdateAnimation();
2489  }
2490  } else {
2491  pActors[i].pMonsterInfo.field_3E = 19;
2492  pActors[i].uAttributes |= ACTOR_UNKNOW11;
2493  }
2494  }
2495 
2497 
2498  // Party to start position
2499  Actor this_;
2500  this_.pMonsterInfo.uID = 45;
2501  this_.PrepareSprites(0);
2502  if (!bLoading) {
2503  pParty->sRotationX = 0;
2504  pParty->sRotationY = 0;
2505  pParty->vPosition.z = 0;
2506  pParty->vPosition.y = 0;
2507  pParty->vPosition.x = 0;
2508  pParty->uFallStartY = 0;
2509  pParty->uFallSpeed = 0;
2511  }
2512  viewparams->_443365();
2513  PlayLevelMusic();
2514  if (!bLoading) {
2515  v30 = 0;
2516  for (uint pl_id = 1; pl_id <= 4; ++pl_id) {
2517  if (pPlayers[pl_id]->CanAct()) v34[v30++] = pl_id;
2518  }
2519  if (v30) {
2520  if (pDest) {
2523  uSpeakingCharacter = v34[rand() % v30];
2524  }
2525  }
2526  }
2527 }

Перекрестные ссылки ViewingParams::_443365(), _4E94D0_light_type, _6807B8_level_decorations_ids, _6807E0_num_decorations_with_sounds_6807B8, _A750D8_player_speech_timer, stru123::_decor_events, LightsStack_StationaryLight_::AddLight(), bNoNPCHiring, BLVDoor::Closed, BLVDoor::Closing, DecorationDesc_mm6::DontDraw(), dword_6BE13C_uCurrentlyLoadedLocationID, dword_6BE364_game_settings_1, engine, EQUIP_POTION, GetAlertStatus(), GameTime::GetDays(), DecorationList::GetDecoration(), MapStats::GetMapInfo(), Party::GetPlayingTime(), MonsterInfo::Hostility_Friendly, Actor::InitializeActors(), DecorationList::InitializeDecorationSprite(), SpriteObject::InitializeSpriteObjects(), Is_out15odm_underwater(), LEVEL_DECORATION_INVISIBLE, LEVEL_Indoor, IndoorLocation::Load(), BLVDoor::Open, BLVDoor::Opening, pActors, pCurrentMapName, pDecorationList, IndoorLocation::pDoors, pGameLoadingUI_ProgressBar, pIndoor, MapStats::pInfos, ItemsTable::pItems, pItemsTable, PlayerSpeechID, PlayLevelMusic(), pLevelDecorations, pMapStats, Actor::pMonsterInfo, PaletteManager::pPalette_tintColor, pPaletteManager, pParty, pPlayers, Actor::PrepareSprites(), GUIProgressBar::Progress(), IndoorLocation::pSpawnPoints, pSpriteObjects, pStationaryLightsStack, PaletteManager::RecalculateAll(), render, GUIProgressBar::Reset(), RespawnGlobalDecorations(), ItemsTable::SetSpecialBonus(), SpawnEncounter(), MapInfo::SpawnRandomTreasure(), SPEECH_46, Party::sRotationX, Party::sRotationY, stru_5E4C90_MapPersistVars, TeleportToStartingPoint(), BLVDoor::uAttributes, DecorationDesc::uColoredLightBlue, DecorationDesc::uColoredLightGreen, DecorationDesc::uColoredLightRed, uCurrentlyLoadedLevelType, DecorationDesc_mm6::uDecorationHeight, Party::uFallSpeed, Party::uFallStartY, MonsterInfo::uID, uLevel_StartingPointType, DecorationDesc_mm6::uLightRadius, uNumActors, IndoorLocation::uNumDoors, uNumLevelDecorations, LightsStack_StationaryLight_::uNumLightsActive, IndoorLocation::uNumSpawnPoints, uNumSpriteObjects, MapInfo::uRespawnIntervalDays, DecorationDesc_mm6::uSoundID, uSpeakingCharacter, BLVDoor::uState, BLVDoor::uTimeSinceTriggered, viewparams и Party::vPosition.

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

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

◆ BLV_GetFloorLevel()

int BLV_GetFloorLevel ( int  x,
int  y,
int  z,
unsigned int  uSectorID,
unsigned int *  pFaceID 
)

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

2531  {
2532  int v13; // ecx@13
2533  signed int v14; // ebx@14
2534  int v15; // eax@16
2535  int v21; // eax@27
2536  signed int v28; // eax@45
2537  int v29; // ebx@47
2538  int v38; // edx@62
2539  bool v47; // [sp+24h] [bp-1Ch]@43
2540  bool current_vertices_Y; // [sp+28h] [bp-18h]@10
2541  bool v49; // [sp+28h] [bp-18h]@41
2542  bool next_vertices_Y; // [sp+2Ch] [bp-14h]@12
2543  int number_hits; // [sp+30h] [bp-10h]@10
2544  int v54; // [sp+30h] [bp-10h]@41
2545  int v55; // [sp+34h] [bp-Ch]@1
2546 
2547  static int blv_floor_id[50]; // 00721200
2548  static int blv_floor_level[50]; // 007212C8
2549 
2550  static __int16 blv_floor_face_vert_coord_Y[104]; // word_721390_ys
2551  static __int16 blv_floor_face_vert_coord_X[104]; // word_721460_xs
2552 
2553  BLVSector *pSector = &pIndoor->pSectors[uSectorID];
2554  v55 = 0;
2555  for (uint i = 0; i < pSector->uNumFloors; ++i) {
2556  BLVFace *pFloor = &pIndoor->pFaces[pSector->pFloors[i]];
2557  if (pFloor->Ethereal()) continue;
2558 
2559  assert(pFloor->uNumVertices);
2560  if (x <= pFloor->pBounding.x2 && x >= pFloor->pBounding.x1 &&
2561  y <= pFloor->pBounding.y2 && y >= pFloor->pBounding.y1) {
2562  for (uint j = 0; j < pFloor->uNumVertices; ++j) {
2563  blv_floor_face_vert_coord_X[2 * j] =
2564  pFloor->pXInterceptDisplacements[j] +
2565  pIndoor->pVertices[pFloor->pVertexIDs[j]].x;
2566  blv_floor_face_vert_coord_X[2 * j + 1] =
2567  pFloor->pXInterceptDisplacements[j] +
2568  pIndoor->pVertices[pFloor->pVertexIDs[j + 1]].x;
2569  blv_floor_face_vert_coord_Y[2 * j] =
2570  pFloor->pYInterceptDisplacements[j] +
2571  pIndoor->pVertices[pFloor->pVertexIDs[j]].y;
2572  blv_floor_face_vert_coord_Y[2 * j + 1] =
2573  pFloor->pYInterceptDisplacements[j] +
2574  pIndoor->pVertices[pFloor->pVertexIDs[j + 1]].y;
2575  }
2576  blv_floor_face_vert_coord_X[2 * pFloor->uNumVertices] =
2577  blv_floor_face_vert_coord_X[0];
2578  blv_floor_face_vert_coord_Y[2 * pFloor->uNumVertices] =
2579  blv_floor_face_vert_coord_Y[0];
2580 
2581  next_vertices_Y = blv_floor_face_vert_coord_Y[0] >= y;
2582  number_hits = 0;
2583 
2584  for (uint j = 0; j < 2 * pFloor->uNumVertices; ++j) {
2585  if (number_hits >= 2) break;
2586 
2587  current_vertices_Y = next_vertices_Y;
2588  next_vertices_Y = blv_floor_face_vert_coord_Y[j + 1] >= y;
2589 
2590  v13 = i;
2591  if (current_vertices_Y == next_vertices_Y) continue;
2592 
2593  v14 = blv_floor_face_vert_coord_X[j + 1] >= x ? 0 : 2;
2594  v15 = v14 | (blv_floor_face_vert_coord_X[j] < x);
2595 
2596  if (v15 == 3) {
2597  continue;
2598  } else if (!v15) {
2599  ++number_hits;
2600  } else {
2601  long long a_div_b =
2602  fixpoint_div(y - blv_floor_face_vert_coord_Y[j],
2603  blv_floor_face_vert_coord_Y[j + 1] -
2604  blv_floor_face_vert_coord_Y[j]);
2605  long long res = fixpoint_mul(
2606  (signed int)blv_floor_face_vert_coord_X[j + 1] -
2607  (signed int)blv_floor_face_vert_coord_X[j],
2608  a_div_b);
2609 
2610  if (res + blv_floor_face_vert_coord_X[j] >= x)
2611  ++number_hits;
2612  }
2613  }
2614 
2615  if (number_hits == 1) {
2616  if (v55 >= 50) break;
2617  if (pFloor->uPolygonType == POLYGON_Floor ||
2618  pFloor->uPolygonType == POLYGON_Ceiling)
2619  v21 = pIndoor->pVertices[pFloor->pVertexIDs[0]].z;
2620  else
2621  v21 = fixpoint_mul(pFloor->zCalc1, x) +
2622  fixpoint_mul(pFloor->zCalc2, y) +
2623  (short)(pFloor->zCalc3 >> 16);
2624  blv_floor_level[v55] = v21;
2625  blv_floor_id[v55] = pSector->pFloors[i];
2626  v55++;
2627  }
2628  }
2629  }
2630 
2631  if (pSector->field_0 & 8) {
2632  for (uint i = 0; i < pSector->uNumPortals; ++i) {
2633  BLVFace *portal = &pIndoor->pFaces[pSector->pPortals[i]];
2634  if (portal->uPolygonType != POLYGON_Floor) continue;
2635 
2636  if (!portal->uNumVertices) continue;
2637 
2638  if (x <= portal->pBounding.x2 && x >= portal->pBounding.x1 &&
2639  y <= portal->pBounding.y2 && y >= portal->pBounding.y1) {
2640  for (uint j = 0; j < portal->uNumVertices; ++j) {
2641  blv_floor_face_vert_coord_X[2 * j] =
2642  portal->pXInterceptDisplacements[j] +
2643  pIndoor->pVertices[portal->pVertexIDs[j]].x;
2644  blv_floor_face_vert_coord_X[2 * j + 1] =
2645  portal->pXInterceptDisplacements[j + 1] +
2646  pIndoor->pVertices[portal->pVertexIDs[j + 1]].x;
2647  blv_floor_face_vert_coord_Y[2 * j] =
2648  portal->pYInterceptDisplacements[j] +
2649  pIndoor->pVertices[portal->pVertexIDs[j]].y;
2650  blv_floor_face_vert_coord_Y[2 * j + 1] =
2651  portal->pYInterceptDisplacements[j + 1] +
2652  pIndoor->pVertices[portal->pVertexIDs[j + 1]].y;
2653  }
2654  blv_floor_face_vert_coord_X[2 * portal->uNumVertices] =
2655  blv_floor_face_vert_coord_X[0];
2656  blv_floor_face_vert_coord_Y[2 * portal->uNumVertices] =
2657  blv_floor_face_vert_coord_Y[0];
2658  v54 = 0;
2659  v47 = blv_floor_face_vert_coord_Y[0] >= y;
2660 
2661  for (uint j = 0; j < 2 * portal->uNumVertices; ++j) {
2662  v49 = v47;
2663  if (v54 >= 2) break;
2664  v47 = blv_floor_face_vert_coord_Y[j + 1] >= y;
2665  if (v49 != v47) {
2666  v28 = blv_floor_face_vert_coord_X[j + 1] >= x ? 0 : 2;
2667  v29 = v28 | (blv_floor_face_vert_coord_X[j] < x);
2668  if (v29 != 3) {
2669  if (!v29) {
2670  ++v54;
2671  } else {
2672  long long a_div_b = fixpoint_div(
2673  y - blv_floor_face_vert_coord_Y[j],
2674  blv_floor_face_vert_coord_Y[j + 1] -
2675  blv_floor_face_vert_coord_Y[j]);
2676  long long res = fixpoint_mul(
2677  blv_floor_face_vert_coord_X[j + 1] -
2678  blv_floor_face_vert_coord_X[j],
2679  a_div_b);
2680  if (res + blv_floor_face_vert_coord_X[j] >= x)
2681  ++v54;
2682  }
2683  }
2684  }
2685  }
2686  if (v54 == 1) {
2687  if (v55 >= 50) break;
2688  blv_floor_level[v55] = -29000;
2689  blv_floor_id[v55] = pSector->pPortals[i];
2690  v55++;
2691  }
2692  }
2693  }
2694  }
2695  if (v55 == 1) {
2696  *pFaceID = blv_floor_id[0];
2697  if (blv_floor_level[0] <= -29000) __debugbreak();
2698  return blv_floor_level[0];
2699  }
2700  if (!v55) return -30000;
2701  *pFaceID = blv_floor_id[0];
2702  // result = blv_floor_level[0];
2703 
2704  /*for ( v35 = 1; v35 < v55; ++v35 )
2705  {
2706  if ( blv_floor_level[0] <= z + 5 )
2707  {
2708  if ( blv_floor_level[v35] >= blv_floor_level[0] || blv_floor_level[v35]
2709  > z + 5 ) continue; blv_floor_level[0] = blv_floor_level[v35]; *pFaceID =
2710  blv_floor_id[v35]; continue;
2711  }
2712  if ( blv_floor_level[v35] < blv_floor_level[0] )
2713  {
2714  blv_floor_level[0] = blv_floor_level[v35];
2715  *pFaceID = blv_floor_id[v35];
2716  }
2717  }*/
2718 
2719  int result = blv_floor_level[0];
2720  for (uint i = 1; i < v55; ++i) {
2721  v38 = blv_floor_level[i];
2722  if (result <= z + 5) {
2723  if (v38 > result && v38 <= z + 5) {
2724  result = blv_floor_level[i];
2725  if (blv_floor_level[i] <= -29000) __debugbreak();
2726  *pFaceID = blv_floor_id[i];
2727  }
2728  } else if (v38 < result) {
2729  result = blv_floor_level[i];
2730  if (blv_floor_level[i] < -29000) __debugbreak(); // crashes here when <=
2731  *pFaceID = blv_floor_id[i];
2732  }
2733  }
2734 
2735  return result;
2736 }

Перекрестные ссылки __debugbreak(), BLVFace::Ethereal(), BLVSector::field_0, fixpoint_div(), fixpoint_mul(), BLVFace::pBounding, IndoorLocation::pFaces, BLVSector::pFloors, pIndoor, POLYGON_Ceiling, POLYGON_Floor, BLVSector::pPortals, IndoorLocation::pSectors, BLVFace::pVertexIDs, IndoorLocation::pVertices, BLVFace::pXInterceptDisplacements, BLVFace::pYInterceptDisplacements, BLVSector::uNumFloors, BLVSector::uNumPortals, BLVFace::uNumVertices, BLVFace::uPolygonType, BBox_short_::x1, BBox_short_::y1, BLVFace::zCalc1, BLVFace::zCalc2 и BLVFace::zCalc3.

Используется в _45063B_spawn_some_monster(), collide_against_floor(), Engine::DrawGUI(), SpawnEncounter(), sub_44FA4C_spawn_light_elemental(), Actor::SummonMinion(), UpdateActors_BLV() и SpriteObject::UpdateObject_fn0_BLV().

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

◆ AddBspNodeToRenderList()

void AddBspNodeToRenderList ( unsigned int  node_id)

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

2970  {
2971  BLVSector *pSector = &pIndoor->pSectors[pBspRenderer->nodes[node_id].uSectorID];
2972  // if ( render->pRenderD3D )
2973  {
2974  for (uint i = 0; i < pSector->uNumNonBSPFaces; ++i)
2975  // logger->Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]);
2976  pBspRenderer->AddFaceToRenderList_d3d(node_id, pSector->pFaceIDs[i]); // рекурсия\recursion
2977  }
2978  /*else
2979  {
2980  for (uint i = 0; i < pSector->uNumNonBSPFaces; ++i)
2981  pBspRenderer->AddFaceToRenderList_sw(node_id, pSector->pFaceIDs[i]);
2982  }*/
2983  if (pSector->field_0 & 0x10) sub_4406BC(node_id, pSector->uFirstBSPNode);
2984 }

Перекрестные ссылки BspRenderer::AddFaceToRenderList_d3d(), BLVSector::field_0, BspRenderer::nodes, pBspRenderer, BLVSector::pFaceIDs, pIndoor, IndoorLocation::pSectors, sub_4406BC(), BLVSector::uFirstBSPNode, BLVSector::uNumNonBSPFaces и BspRenderer_stru0::uSectorID.

Используется в BspRenderer::AddFaceToRenderList_d3d() и PrepareBspRenderList_BLV().

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

◆ sub_4406BC()

void sub_4406BC ( unsigned int  node_id,
unsigned int  uFirstNode 
)

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

2987  {
2988  BLVSector *pSector; // esi@2
2989  BSPNode *pNode; // edi@2
2990  BLVFace *pFace; // eax@2
2991  int v5; // ecx@2
2992  __int16 v6; // ax@6
2993  int v7; // ebp@10
2994  int v8; // ebx@10
2995  __int16 v9; // di@18
2996  BspRenderer_stru0 *node; // [sp+18h] [bp-4h]@1
2997 
2998  // logger->Warning(L"sub_4406BC(%u, %u)", a1, uFirstNode);
2999 
3000  // v10 = a1;
3001  node = &pBspRenderer->nodes[node_id];
3002  while (1) {
3003  pSector = &pIndoor->pSectors[node->uSectorID];
3004  pNode = &pIndoor->pNodes[uFirstNode];
3005  pFace = &pIndoor->pFaces[pSector->pFaceIDs[pNode->uCoplanarOffset]];
3006  v5 = pFace->pFacePlane_old.dist +
3010  pFace->pFacePlane_old.vNormal.z; // plane equation
3011  if (pFace->Portal() && pFace->uSectorID != node->uSectorID) v5 = -v5;
3012  // v11 = v5 > 0;
3013  if (v5 <= 0)
3014  v6 = pNode->uFront;
3015  else
3016  v6 = pNode->uBack;
3017  if (v6 != -1) sub_4406BC(node_id, v6);
3018  v7 = pNode->uCoplanarOffset;
3019  v8 = v7 + pNode->uCoplanarSize;
3020 
3021  // logger->Warning(L"Node %u: %X to %X (%hX)", uFirstNode, v7, v8,
3022  // v2->pFaceIDs[v7]);
3023 
3024  // if ( render->pRenderD3D )
3025  {
3026  while (v7 < v8)
3028  pSector->pFaceIDs[v7++]);
3029  }
3030  /*else
3031  {
3032  while ( v7 < v8 )
3033  pBspRenderer->AddFaceToRenderList_sw(node_id,
3034  pSector->pFaceIDs[v7++]);
3035  }*/
3036  v9 = v5 > 0 ? pNode->uFront : pNode->uBack;
3037  if (v9 == -1) break;
3038  uFirstNode = v9;
3039  }
3040 }

Перекрестные ссылки BspRenderer::AddFaceToRenderList_d3d(), Plane_int_::dist, BspRenderer::nodes, pBspRenderer, BLVSector::pFaceIDs, BLVFace::pFacePlane_old, IndoorLocation::pFaces, pIndoor, pIndoorCameraD3D, IndoorLocation::pNodes, BLVFace::Portal(), IndoorLocation::pSectors, sub_4406BC(), BSPNode::uBack, BSPNode::uCoplanarOffset, BSPNode::uCoplanarSize, BSPNode::uFront, BLVFace::uSectorID, BspRenderer_stru0::uSectorID, Plane_int_::vNormal, IndoorCameraD3D::vPartyPos, Vec2< T >::x, Vec2< T >::y и Vec3< T >::z.

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

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

◆ PrepareBspRenderList_BLV()

void PrepareBspRenderList_BLV ( )

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

Перекрестные ссылки AddBspNodeToRenderList(), BspRenderer_PortalViewportData::GetViewportData(), BspRenderer::MakeVisibleSectorList(), BspRenderer::nodes, BspRenderer::num_faces, BspRenderer::num_nodes, pBLVRenderParams, pBspRenderer, BspRenderer_stru0::PortalScreenData, BspRenderer_stru0::uFaceID, BLVRenderParams::uPartySectorID, BspRenderer_stru0::uSectorID, BLVRenderParams::uViewportW, BspRenderer_stru0::uViewportW, BLVRenderParams::uViewportX, BspRenderer_stru0::uViewportX, BLVRenderParams::uViewportY, BspRenderer_stru0::uViewportY, BLVRenderParams::uViewportZ, BspRenderer_stru0::uViewportZ и BspRenderer_stru0::viewing_portal_id.

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

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

◆ sub_407A1C()

bool sub_407A1C ( int  x,
int  y,
int  z,
Vec3_int_  v 
)

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

3199  {
3200  unsigned int v4; // esi@1
3201  int dist_y; // edi@2
3202  int dist_z; // ebx@2
3203  int dist_x; // esi@2
3204  int v9; // ecx@2
3205  int v10; // eax@2
3206  int v12; // eax@4
3207  int v17; // ST34_4@25
3208  int v18; // ST38_4@25
3209  int v19; // eax@25
3210  char v20; // zf@25
3211  int v21; // ebx@25
3212  int v23; // edi@26
3213  int v24; // ST34_4@30
3214  int v32; // ecx@37
3215  int v33; // eax@37
3216  int v35; // eax@39
3217  int v40; // ebx@60
3218  int v42; // edi@61
3219  int v49; // ecx@73
3220  int v50; // eax@73
3221  int v51; // edx@75
3222  int v52; // ecx@75
3223  int v53; // eax@75
3224  int v59; // eax@90
3225  BLVFace *face; // esi@91
3226  int v63; // ST34_4@98
3227  int v64; // ST30_4@98
3228  int v65; // eax@98
3229  int v66; // ebx@98
3230  int v68; // edi@99
3231  int v69; // ST2C_4@103
3232  int v77; // ecx@111
3233  int v78; // eax@111
3234  int v79; // edx@113
3235  int v80; // ecx@113
3236  int v81; // eax@113
3237  int v87; // ecx@128
3238  int v91; // ebx@136
3239  int v93; // edi@137
3240  Vec3_int_ v97; // [sp-18h] [bp-94h]@1
3241  int v107; // [sp+10h] [bp-6Ch]@98
3242  int v108; // [sp+10h] [bp-6Ch]@104
3243  int v109; // [sp+18h] [bp-64h]@25
3244  int v110; // [sp+18h] [bp-64h]@31
3245  int v113; // [sp+20h] [bp-5Ch]@1
3246  int v114; // [sp+24h] [bp-58h]@1
3247  int v119; // [sp+34h] [bp-48h]@75
3248  int v120; // [sp+34h] [bp-48h]@113
3249  int v121; // [sp+38h] [bp-44h]@4
3250  int v122; // [sp+38h] [bp-44h]@39
3251  int v123; // [sp+38h] [bp-44h]@76
3252  int v124; // [sp+38h] [bp-44h]@114
3253  int v125; // [sp+3Ch] [bp-40h]@4
3254  int v126; // [sp+3Ch] [bp-40h]@39
3255  int v127; // [sp+3Ch] [bp-40h]@77
3256  int v128; // [sp+3Ch] [bp-40h]@115
3257  int v129; // [sp+40h] [bp-3Ch]@11
3258  int v130; // [sp+40h] [bp-3Ch]@46
3259  int v131; // [sp+40h] [bp-3Ch]@78
3260  int v132; // [sp+40h] [bp-3Ch]@116
3261  int v133; // [sp+44h] [bp-38h]@10
3262  int v134; // [sp+44h] [bp-38h]@45
3263  int v135; // [sp+44h] [bp-38h]@81
3264  int v136; // [sp+44h] [bp-38h]@119
3265  int v137; // [sp+48h] [bp-34h]@7
3266  int v138; // [sp+48h] [bp-34h]@42
3267  int v139; // [sp+48h] [bp-34h]@82
3268  int v140; // [sp+48h] [bp-34h]@120
3269  int v141; // [sp+4Ch] [bp-30h]@6
3270  int v142; // [sp+4Ch] [bp-30h]@41
3271  int v143; // [sp+4Ch] [bp-30h]@75
3272  int v144; // [sp+4Ch] [bp-30h]@113
3273  int v145; // [sp+50h] [bp-2Ch]@5
3274  int v146; // [sp+50h] [bp-2Ch]@40
3275  int v149; // [sp+54h] [bp-28h]@4
3276  int v150; // [sp+54h] [bp-28h]@39
3277  int sDepthb; // [sp+58h] [bp-24h]@90
3278  int a5b; // [sp+5Ch] [bp-20h]@83
3279  int a5c; // [sp+5Ch] [bp-20h]@121
3280  int v162; // [sp+60h] [bp-1Ch]@128
3281  int outz; // [sp+64h] [bp-18h]@2
3282  int outx; // [sp+68h] [bp-14h]@2
3283  int outy; // [sp+6Ch] [bp-10h]@2
3284  int sZ; // [sp+70h] [bp-Ch]@2
3285  int sX; // [sp+74h] [bp-8h]@2
3286  int sY; // [sp+78h] [bp-4h]@2
3287  // 8bytes unused
3288  int ya; // [sp+84h] [bp+8h]@60
3289  int yb; // [sp+84h] [bp+8h]@136
3290  int ve; // [sp+88h] [bp+Ch]@60
3291  int va; // [sp+88h] [bp+Ch]@60
3292  int vb; // [sp+88h] [bp+Ch]@66
3293  int vf; // [sp+88h] [bp+Ch]@136
3294  int vc; // [sp+88h] [bp+Ch]@136
3295  int vd; // [sp+88h] [bp+Ch]@142
3296  int v_4; // [sp+8Ch] [bp+10h]@60
3297  int v_4a; // [sp+8Ch] [bp+10h]@65
3298  int v_4b; // [sp+8Ch] [bp+10h]@136
3299  int v_4c; // [sp+8Ch] [bp+10h]@141
3300 
3301  // __debugbreak();срабатывает при стрельбе огненным шаром
3302  // triggered by fireball
3303 
3304  v4 = stru_5C6E00->Atan2(v.x - x, v.y - y);
3305 
3306  v113 = 0;
3307  v114 = 0;
3308 
3309  v97.z = z;
3310  v97.x = x;
3311  v97.y = y;
3312 
3314  Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v97, &sX,
3315  &sY, &sZ);
3316  Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v, &outx,
3317  &outy, &outz);
3318  dist_y = outy - sY;
3319  dist_z = outz - sZ;
3320  dist_x = outx - sX;
3321  v49 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z);
3322  v50 = 65536;
3323  if (v49) v50 = 65536 / v49;
3324  v51 = outx;
3325  v143 = dist_x * v50;
3326  v52 = dist_y * v50;
3327  v53 = dist_z * v50;
3328 
3329  v123 = std::max(outx, sX);
3330  v119 = std::min(outx, sX);
3331 
3332  v131 = std::max(outy, sY);
3333  v127 = std::min(outy, sY);
3334 
3335  v139 = std::max(outz, sZ);
3336  v135 = std::min(outz, sZ);
3337 
3338  for (a5b = 0; a5b < 2; a5b++) {
3339  if (a5b)
3340  v59 = pIndoor->GetSector(sX, sY, sZ);
3341  else
3342  v59 = pIndoor->GetSector(outx, outy, outz);
3343  // v60 = pIndoor->pSectors;
3344  // v61 = 116 * v59;
3345  // i = 116 * v59;
3346  // for (sDepthb = 0; *(__int16 *)((char
3347  // *)&pIndoor->pSectors->uNumWalls + v61)
3348  // + 2 * *(__int16 *)((char *)&pIndoor->pSectors->uNumFloors + v61);
3349  // ++sDepthb)
3350  for (sDepthb = 0; sDepthb < pIndoor->pSectors[v59].uNumFaces;
3351  ++sDepthb) {
3352  face =
3353  &pIndoor
3354  ->pFaces[pIndoor->pSectors[v59]
3355  .pFaceIDs[sDepthb]]; // face =
3356  // &pIndoor->pFaces[*(__int16
3357  // *)((char
3358  // *)&pIndoor->pSectors->pWalls
3359  // + v61)[sDepthb]]
3360  v63 = fixpoint_mul(v143, face->pFacePlane_old.vNormal.x);
3361  v64 = fixpoint_mul(v53, face->pFacePlane_old.vNormal.z);
3362  v65 = fixpoint_mul(v52, face->pFacePlane_old.vNormal.y);
3363  v20 = v63 + v64 + v65 == 0;
3364  v66 = v63 + v64 + v65;
3365  v107 = v63 + v64 + v65;
3366  if (face->Portal() || v119 > face->pBounding.x2 ||
3367  v123 < face->pBounding.x1 || v127 > face->pBounding.y2 ||
3368  v131 < face->pBounding.y1 || v135 > face->pBounding.z2 ||
3369  v139 < face->pBounding.z1 || v20)
3370  continue;
3371  v68 = -(face->pFacePlane_old.dist +
3372  sX * face->pFacePlane_old.vNormal.x +
3373  sY * face->pFacePlane_old.vNormal.y +
3374  sZ * face->pFacePlane_old.vNormal.z);
3375  if (v66 <= 0) {
3376  if (face->pFacePlane_old.dist +
3377  sX * face->pFacePlane_old.vNormal.x +
3378  sY * face->pFacePlane_old.vNormal.y +
3379  sZ * face->pFacePlane_old.vNormal.z <
3380  0)
3381  continue;
3382  } else {
3383  if (face->pFacePlane_old.dist +
3384  sX * face->pFacePlane_old.vNormal.x +
3385  sY * face->pFacePlane_old.vNormal.y +
3386  sZ * face->pFacePlane_old.vNormal.z >
3387  0)
3388  continue;
3389  }
3390  v69 = abs(-(face->pFacePlane_old.dist +
3391  sX * face->pFacePlane_old.vNormal.x +
3392  sY * face->pFacePlane_old.vNormal.y +
3393  sZ * face->pFacePlane_old.vNormal.z)) >>
3394  14;
3395  if (v69 <= abs(v66)) {
3396  // LODWORD(v70) = v68 << 16;
3397  // HIDWORD(v70) = v68 >> 16;
3398  // v71 = v70 / v107;
3399  // v108 = v70 / v107;
3400  v108 = fixpoint_div(v68, v107);
3401  if (v108 >= 0) {
3402  if (sub_4075DB(
3403  sX + ((signed int)(fixpoint_mul(v108, v143) +
3404  0x8000) >>
3405  16),
3406  sY + ((signed int)(fixpoint_mul(v108, v52) +
3407  0x8000) >>
3408  16),
3409  sZ + ((signed int)(fixpoint_mul(v108, v53) +
3410  0x8000) >>
3411  16),
3412  face)) {
3413  v114 = 1;
3414  break;
3415  }
3416  }
3417  }
3418  }
3419  }
3420 
3421  Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v97, &sX,
3422  &sY, &sZ);
3423  Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v, &outx,
3424  &outy, &outz);
3425  dist_y = outy - sY;
3426  dist_z = outz - sZ;
3427  dist_x = outx - sX;
3428  v77 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z);
3429  v78 = 65536;
3430  if (v77) v78 = 65536 / v77;
3431  v79 = outx;
3432  v144 = dist_x * v78;
3433  v80 = dist_y * v78;
3434  v81 = dist_z * v78;
3435 
3436  v120 = std::max(outx, sX);
3437  v124 = std::min(outx, sX);
3438 
3439  v132 = std::max(outy, sY);
3440  v128 = std::min(outy, sY);
3441 
3442  v140 = std::max(outz, sZ);
3443  v136 = std::min(outz, sZ);
3444 
3445  for (a5c = 0; a5c < 2; a5c++) {
3446  if (v113) return !v114 || !v113;
3447  if (a5c) {
3448  v87 = pIndoor->GetSector(sX, sY, sZ);
3449  } else {
3450  v87 = pIndoor->GetSector(outx, outy, outz);
3451  }
3452  for (v162 = 0; v162 < pIndoor->pSectors[v87].uNumFaces; v162++) {
3453  face = &pIndoor->pFaces[pIndoor->pSectors[v87].pFaceIDs[v162]];
3454  yb = fixpoint_mul(v144, face->pFacePlane_old.vNormal.x);
3455  v_4b = fixpoint_mul(v80, face->pFacePlane_old.vNormal.y);
3456  vf = fixpoint_mul(v81, face->pFacePlane_old.vNormal.z);
3457  v20 = yb + vf + v_4b == 0;
3458  v91 = yb + vf + v_4b;
3459  vc = yb + vf + v_4b;
3460  if (face->Portal() || v120 > face->pBounding.x2 ||
3461  v124 < face->pBounding.x1 || v128 > face->pBounding.y2 ||
3462  v132 < face->pBounding.y1 || v136 > face->pBounding.z2 ||
3463  v140 < face->pBounding.z1 || v20)
3464  continue;
3465  v93 = -(face->pFacePlane_old.dist +
3466  sX * face->pFacePlane_old.vNormal.x +
3467  sY * face->pFacePlane_old.vNormal.y +
3468  sZ * face->pFacePlane_old.vNormal.z);
3469  if (v91 <= 0) {
3470  if (face->pFacePlane_old.dist +
3471  sX * face->pFacePlane_old.vNormal.x +
3472  sY * face->pFacePlane_old.vNormal.y +
3473  sZ * face->pFacePlane_old.vNormal.z <
3474  0)
3475  continue;
3476  } else {
3477  if (face->pFacePlane_old.dist +
3478  sX * face->pFacePlane_old.vNormal.x +
3479  sY * face->pFacePlane_old.vNormal.y +
3480  sZ * face->pFacePlane_old.vNormal.z >
3481  0)
3482  continue;
3483  }
3484  v_4c = abs(-(face->pFacePlane_old.dist +
3485  sX * face->pFacePlane_old.vNormal.x +
3486  sY * face->pFacePlane_old.vNormal.y +
3487  sZ * face->pFacePlane_old.vNormal.z)) >>
3488  14;
3489  if (v_4c <= abs(v91)) {
3490  vd = fixpoint_div(v93, vc);
3491  if (vd >= 0) {
3492  if (sub_4075DB(
3493  sX + ((signed int)(fixpoint_mul(vd, v144) +
3494  0x8000) >>
3495  16),
3496  sY + ((signed int)(fixpoint_mul(vd, v80) +
3497  0x8000) >>
3498  16),
3499  sZ + ((signed int)(fixpoint_mul(vd, v81) +
3500  0x8000) >>
3501  16),
3502  face)) {
3503  v113 = 1;
3504  break;
3505  }
3506  }
3507  }
3508  }
3509  }
3510  } else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) {
3511  Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v97, &sX,
3512  &sY, &sZ);
3513  Vec3_int_::Rotate(32, stru_5C6E00->uIntegerHalfPi + v4, 0, v, &outx,
3514  &outy, &outz);
3515  dist_y = outy - sY;
3516  dist_z = outz - sZ;
3517  dist_x = outx - sX;
3518  v9 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z);
3519  v10 = 65536;
3520  if (v9) v10 = 65536 / v9;
3521  v125 = dist_x * v10;
3522  v12 = dist_z * v10;
3523  v121 = dist_y * v10;
3524 
3525  v145 = std::max(outx, sX);
3526  v149 = std::min(outx, sX);
3527 
3528  v137 = std::max(outy, sY);
3529  v141 = std::min(outy, sY);
3530 
3531  v129 = std::max(outz, sZ);
3532  v133 = std::min(outz, sZ);
3533 
3534  for (BSPModel &model : pOutdoor->pBModels) {
3535  if (sub_4088E9(sX, sY, outx, outy, model.vPosition.x,
3536  model.vPosition.y) <= model.sBoundingRadius + 128) {
3537  for (ODMFace &face : model.pFaces) {
3538  v17 = fixpoint_mul(v125, face.pFacePlane.vNormal.x);
3539  v18 = fixpoint_mul(v121, face.pFacePlane.vNormal.y);
3540  v19 = fixpoint_mul(v12, face.pFacePlane.vNormal.z);
3541  v20 = v17 + v18 + v19 == 0;
3542  v21 = v17 + v18 + v19;
3543  v109 = v17 + v18 + v19;
3544  if (v149 > face.pBoundingBox.x2 ||
3545  v145 < face.pBoundingBox.x1 ||
3546  v141 > face.pBoundingBox.y2 ||
3547  v137 < face.pBoundingBox.y1 ||
3548  v133 > face.pBoundingBox.z2 ||
3549  v129 < face.pBoundingBox.z1 || v20)
3550  continue;
3551  v23 = -(face.pFacePlane.dist +
3552  sX * face.pFacePlane.vNormal.x +
3553  sY * face.pFacePlane.vNormal.y +
3554  sZ * face.pFacePlane.vNormal.z);
3555  if (v21 <= 0) {
3556  if (face.pFacePlane.dist +
3557  sX * face.pFacePlane.vNormal.x +
3558  sY * face.pFacePlane.vNormal.y +
3559  sZ * face.pFacePlane.vNormal.z <
3560  0)
3561  continue;
3562  } else {
3563  if (face.pFacePlane.dist +
3564  sX * face.pFacePlane.vNormal.x +
3565  sY * face.pFacePlane.vNormal.y +
3566  sZ * face.pFacePlane.vNormal.z >
3567  0)
3568  continue;
3569  }
3570  v24 = abs(-(face.pFacePlane.dist +
3571  sX * face.pFacePlane.vNormal.x +
3572  sY * face.pFacePlane.vNormal.y +
3573  sZ * face.pFacePlane.vNormal.z)) >>
3574  14;
3575  if (v24 <= abs(v21)) {
3576  v110 = fixpoint_div(v23, v109);
3577  if (v110 >= 0) {
3578  if (sub_4077F1(
3579  sX +
3580  ((signed int)(fixpoint_mul(v110, v125) +
3581  0x8000) >>
3582  16),
3583  sY +
3584  ((signed int)(fixpoint_mul(v110, v121) +
3585  0x8000) >>
3586  16),
3587  sZ + ((signed int)(fixpoint_mul(v110, v12) +
3588  0x8000) >>
3589  16),
3590  &face, &model.pVertices)) {
3591  v114 = 1;
3592  break;
3593  }
3594  }
3595  }
3596  }
3597  }
3598  }
3599 
3600  Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v97, &sX,
3601  &sY, &sZ);
3602  Vec3_int_::Rotate(32, v4 - stru_5C6E00->uIntegerHalfPi, 0, v, &outx,
3603  &outy, &outz);
3604  dist_y = outy - sY;
3605  dist_z = outz - sZ;
3606  dist_x = outx - sX;
3607  v32 = integer_sqrt(dist_x * dist_x + dist_y * dist_y + dist_z * dist_z);
3608  v33 = 65536;
3609  if (v32) v33 = 65536 / v32;
3610  v126 = dist_x * v33;
3611  v35 = dist_z * v33;
3612  v122 = dist_y * v33;
3613 
3614  v146 = std::max(outx, sX);
3615  v150 = std::min(outx, sX);
3616 
3617  v138 = std::max(outy, sY);
3618  v142 = std::min(outy, sY);
3619 
3620  v130 = std::max(outz, sZ);
3621  v134 = std::min(outz, sZ);
3622 
3623  for (BSPModel &model : pOutdoor->pBModels) {
3624  if (sub_4088E9(sX, sY, outx, outy, model.vPosition.x,
3625  model.vPosition.y) <= model.sBoundingRadius + 128) {
3626  for (ODMFace &face : model.pFaces) {
3627  ya = fixpoint_mul(v126, face.pFacePlane.vNormal.x);
3628  ve = fixpoint_mul(v122, face.pFacePlane.vNormal.y);
3629  v_4 = fixpoint_mul(v35, face.pFacePlane.vNormal.z);
3630  v20 = ya + ve + v_4 == 0;
3631  v40 = ya + ve + v_4;
3632  va = ya + ve + v_4;
3633  if (v150 > face.pBoundingBox.x2 ||
3634  v146 < face.pBoundingBox.x1 ||
3635  v142 > face.pBoundingBox.y2 ||
3636  v138 < face.pBoundingBox.y1 ||
3637  v134 > face.pBoundingBox.z2 ||
3638  v130 < face.pBoundingBox.z1 || v20)
3639  continue;
3640  v42 = -(face.pFacePlane.dist +
3641  sX * face.pFacePlane.vNormal.x +
3642  sY * face.pFacePlane.vNormal.y +
3643  sZ * face.pFacePlane.vNormal.z);
3644  if (v40 <= 0) {
3645  if (face.pFacePlane.dist +
3646  sX * face.pFacePlane.vNormal.x +
3647  sY * face.pFacePlane.vNormal.y +
3648  sZ * face.pFacePlane.vNormal.z <
3649  0)
3650  continue;
3651  } else {
3652  if (face.pFacePlane.dist +
3653  sX * face.pFacePlane.vNormal.x +
3654  sY * face.pFacePlane.vNormal.y +
3655  sZ * face.pFacePlane.vNormal.z >
3656  0)
3657  continue;
3658  }
3659  v_4a = abs(-(face.pFacePlane.dist +
3660  sX * face.pFacePlane.vNormal.x +
3661  sY * face.pFacePlane.vNormal.y +
3662  sZ * face.pFacePlane.vNormal.z)) >>
3663  14;
3664  if (v_4a <= abs(v40)) {
3665  // LODWORD(v43) = v42 << 16;
3666  // HIDWORD(v43) = v42 >> 16;
3667  // vb = v43 / va;
3668  vb = fixpoint_div(v42, va);
3669  if (vb >= 0) {
3670  if (sub_4077F1(sX + ((int)(fixpoint_mul(vb, v126) +
3671  0x8000) >>
3672  16),
3673  sY + ((int)(fixpoint_mul(vb, v122) +
3674  0x8000) >>
3675  16),
3676  sZ + ((int)(fixpoint_mul(vb, v35) +
3677  0x8000) >>
3678  16),
3679  &face, &model.pVertices)) {
3680  v113 = 1;
3681  break;
3682  }
3683  }
3684  }
3685  }
3686  }
3687  }
3688  }
3689  return !v114 || !v113;
3690 }

Перекрестные ссылки stru193_math::Atan2(), fixpoint_div(), fixpoint_mul(), IndoorLocation::GetSector(), integer_sqrt(), LEVEL_Indoor, LEVEL_Outdoor, OutdoorLocation::pBModels, BLVSector::pFaceIDs, BSPModel::pFaces, IndoorLocation::pFaces, pIndoor, pOutdoor, IndoorLocation::pSectors, BSPModel::pVertices, BSPModel::sBoundingRadius, stru_5C6E00, sub_4075DB(), sub_4077F1(), sub_4088E9(), uCurrentlyLoadedLevelType, stru193_math::uIntegerHalfPi, BLVSector::uNumFaces и BSPModel::vPosition.

Используется в Actor::AI_MeleeAttack(), Actor::AI_MissileAttack1(), Actor::AI_MissileAttack2(), Actor::AI_SpellAttack1(), Actor::AI_SpellAttack2() и area_of_effect__damage_evaluate().

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

◆ DoInteractionWithTopmostZObject()

char DoInteractionWithTopmostZObject ( int  a1,
int  a2 
)

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

3716  {
3717  uint32_t v17 = PID_ID(a1);
3718  switch (PID_TYPE(a1)) {
3719  case OBJECT_Item: { // take the item
3720  if (pSpriteObjects[v17].IsUnpickable() || v17 >= 1000 || !pSpriteObjects[v17].uObjectDescID) {
3721  return 1;
3722  }
3723 
3724  extern void ItemInteraction(unsigned int item_id);
3725  ItemInteraction(v17);
3726  break;
3727  }
3728 
3729  case OBJECT_Actor:
3730  if (pActors[v17].uAIState == Dying || pActors[v17].uAIState == Summoned)
3731  return 1;
3732  if (pActors[v17].uAIState == Dead) {
3733  pActors[v17].LootActor();
3734  } else {
3735  extern bool ActorInteraction(unsigned int id);
3736  ActorInteraction(v17);
3737  }
3738  break;
3739 
3740  case OBJECT_Decoration:
3741  extern void DecorationInteraction(unsigned int id, unsigned int pid);
3742  DecorationInteraction(v17, a1);
3743  break;
3744 
3745  default:
3746  logger->Warning(L"Warning: Invalid ID reached!");
3747  return 1;
3748 
3749  case OBJECT_BModel:
3751  int bmodel_id = a1 >> 9;
3752  int face_id = v17 & 0x3F;
3753  if (bmodel_id >= pOutdoor->pBModels.size()) {
3754  return 1;
3755  }
3756  if (pOutdoor->pBModels[bmodel_id].pFaces[face_id].uAttributes & FACE_HAS_EVENT ||
3757  pOutdoor->pBModels[bmodel_id].pFaces[face_id].sCogTriggeredID == 0)
3758  return 1;
3759  EventProcessor((int16_t)pOutdoor->pBModels[bmodel_id].pFaces[face_id].sCogTriggeredID,
3760  a1, 1);
3761  } else {
3762  if (!(pIndoor->pFaces[v17].uAttributes & FACE_CLICKABLE)) {
3764  return 1;
3765  }
3766  if (pIndoor->pFaces[v17].uAttributes & FACE_HAS_EVENT ||
3768  return 1;
3771  a1, 1);
3772  }
3773  return 0;
3774  break;
3775  }
3776  return 0;
3777 }

Перекрестные ссылки ActorInteraction(), current_screen_type, Dead, DecorationInteraction(), Dying, EventProcessor(), GameUI_StatusBar_NothingHere(), ItemInteraction(), LEVEL_Outdoor, logger, OBJECT_Actor, OBJECT_BModel, OBJECT_Decoration, OBJECT_Item, pActors, OutdoorLocation::pBModels, IndoorLocation::pFaceExtras, IndoorLocation::pFaces, pIndoor, pOutdoor, pSpriteObjects, SCREEN_BRANCHLESS_NPC_DIALOG, Summoned, BLVFace::uAttributes, uCurrentlyLoadedLevelType, BLVFaceExtra::uEventID, BLVFace::uFaceExtraID и Log::Warning().

Используется в Application::Game::OnPressSpace().

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

◆ BLV_UpdateUserInputAndOther()

void BLV_UpdateUserInputAndOther ( )

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

3779  {
3780  UpdateObjects();
3782  UpdateActors_BLV();
3783  BLV_UpdateDoors();
3785 }

Перекрестные ссылки BLV_ProcessPartyActions(), BLV_UpdateDoors(), check_event_triggers(), UpdateActors_BLV() и UpdateObjects().

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

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

◆ PortalFrustrum()

bool PortalFrustrum ( int  pNumVertices,
BspRenderer_PortalViewportData far_portal,
BspRenderer_PortalViewportData near_portal,
int  uFaceID 
)

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

3790  {
3791  int min_y; // esi@5
3792  int max_y; // edx@5
3793  int current_ID; // eax@12
3794  int v13; // eax@22
3795  int v15; // ecx@29
3796  int v18; // eax@39
3797  int v19; // eax@44
3798  int v20; // ecx@44
3799  int v22; // edi@46
3800  int v24; // edx@48
3801  int v26; // eax@55
3802  int v29; // edx@57
3803  int v31; // eax@64
3804  __int16 v36; // dx@67
3805  __int16 v38; // dx@67
3806  int v46; // edx@87
3807  int v49; // esi@93
3808  int v53 = 0; // [sp+Ch] [bp-34h]@44
3809  int v54 = 0; // [sp+10h] [bp-30h]@0
3810  int min_y_ID2; // [sp+14h] [bp-2Ch]@12
3811  int v59; // [sp+14h] [bp-2Ch]@87
3812  int v61; // [sp+1Ch] [bp-24h]@29
3813  int v62; // [sp+20h] [bp-20h]@0
3814  signed int direction1; // [sp+24h] [bp-1Ch]@3
3815  signed int direction2; // [sp+28h] [bp-18h]@3
3816  int min_y_ID; // [sp+2Ch] [bp-14h]@5
3817  int v69; // [sp+34h] [bp-Ch]@29
3818  int v70; // [sp+34h] [bp-Ch]@46
3819 
3820  if (pNumVertices <= 1) return false;
3821  min_y = PortalFace._screen_space_y[0];
3822  min_y_ID = 0;
3823  max_y = PortalFace._screen_space_y[0];
3824  // face direction(направление фейса)
3825  if (!PortalFace.direction) {
3826  direction1 = 1;
3827  direction2 = -1;
3828  } else {
3829  direction1 = -1;
3830  direction2 = 1;
3831  }
3832 
3833  // get min and max y for portal(дать минимальное и максимальное значение y
3834  // для портала)
3835  for (uint i = 1; i < pNumVertices; ++i) {
3836  if (PortalFace._screen_space_y[i] < min_y) {
3837  min_y_ID = i;
3838  min_y = PortalFace._screen_space_y[i];
3839  } else if (PortalFace._screen_space_y[i] > max_y) {
3840  max_y = PortalFace._screen_space_y[i];
3841  }
3842  }
3843  if (max_y == min_y) return false;
3844 
3845  //*****************************************************************************************************************************
3846  far_portal->_viewport_space_y = min_y;
3847  far_portal->_viewport_space_w = max_y;
3848  current_ID = min_y_ID;
3849  min_y_ID2 = min_y_ID;
3850 
3851  for (uint i = 0; i < pNumVertices; ++i) {
3852  current_ID += direction2;
3853  if (current_ID < pNumVertices) {
3854  if (current_ID < 0) current_ID += pNumVertices;
3855  } else {
3856  current_ID -= pNumVertices;
3857  }
3858  if (PortalFace._screen_space_y[current_ID] <=
3859  PortalFace._screen_space_y[min_y_ID]) { // определение минимальной у
3860  min_y_ID2 = current_ID;
3861  min_y_ID = current_ID;
3862  }
3863  if (PortalFace._screen_space_y[current_ID] == max_y) break;
3864  }
3865 
3866  v13 = min_y_ID2 + direction2;
3867  if (v13 < pNumVertices) {
3868  if (v13 < 0) v13 += pNumVertices;
3869  } else {
3870  v13 -= pNumVertices;
3871  }
3872  if (PortalFace._screen_space_y[v13] !=
3873  PortalFace._screen_space_y[min_y_ID2]) {
3874  v62 = PortalFace._screen_space_x[min_y_ID2] << 16;
3875  v54 = ((PortalFace._screen_space_x[v13] -
3876  PortalFace._screen_space_x[min_y_ID2])
3877  << 16) /
3878  (PortalFace._screen_space_y[v13] -
3879  PortalFace._screen_space_y[min_y_ID2]);
3880  far_portal->viewport_left_side[min_y] =
3881  (short)PortalFace._screen_space_x[min_y_ID2];
3882  }
3883  //****************************************************************************************************************************************
3884  //
3885  v15 = min_y_ID;
3886  v61 = min_y_ID;
3887  for (v69 = 0; v69 < pNumVertices; ++v69) {
3888  v15 += direction1;
3889  if (v15 < pNumVertices) {
3890  if (v15 < 0) v15 += pNumVertices;
3891  } else {
3892  v15 -= pNumVertices;
3893  }
3894  if (PortalFace._screen_space_y[v15] <=
3895  PortalFace._screen_space_y[min_y_ID]) {
3896  v61 = v15;
3897  min_y_ID = v15;
3898  }
3899  if (PortalFace._screen_space_y[v15] == max_y) break;
3900  }
3901  v18 = direction1 + v61;
3902  if (v18 < pNumVertices) {
3903  if (v18 < 0) v18 += pNumVertices;
3904  } else {
3905  v18 -= pNumVertices;
3906  }
3907  v19 = v18;
3908  v20 = v61;
3910  v61 = PortalFace._screen_space_x[v20] << 16;
3911  v53 =
3913  << 16) /
3915  far_portal->viewport_right_side[max_y] =
3916  (short)PortalFace._screen_space_x[v20];
3917  }
3918  //****************************************************************************************************************************************
3919  v22 = min_y;
3920  if (min_y <= max_y) {
3921  for (v70 = min_y; v70 <= max_y; ++v70) {
3922  v24 = v13;
3923  if (v22 >= PortalFace._screen_space_y[v13] && v22 != max_y) {
3924  v13 = direction2 + v13;
3925  if (v13 < pNumVertices) {
3926  if (v13 < 0) v13 += pNumVertices;
3927  } else {
3928  v13 -= pNumVertices;
3929  }
3930  v26 = v13;
3931  if (PortalFace._screen_space_y[v26] -
3933  0) {
3934  v54 = ((PortalFace._screen_space_x[v26] -
3936  << 16) /
3937  (PortalFace._screen_space_y[v26] -
3939  v62 = PortalFace._screen_space_x[v24] << 16;
3940  }
3941  }
3942  v29 = v18;
3943  if (v70 >= PortalFace._screen_space_y[v18] && v70 != max_y) {
3944  v18 += direction1;
3945  if (v18 < pNumVertices) {
3946  if (v18 < 0) v18 += pNumVertices;
3947  } else {
3948  v18 -= pNumVertices;
3949  }
3950  v31 = v18;
3951  if (PortalFace._screen_space_y[v31] -
3953  0) {
3954  v53 = ((PortalFace._screen_space_x[v31] -
3956  << 16) /
3957  (PortalFace._screen_space_y[v31] -
3959  v61 = PortalFace._screen_space_x[v29] << 16;
3960  }
3961  }
3962  far_portal->viewport_left_side[v70] = HEXRAYS_HIWORD(v62);
3963  far_portal->viewport_right_side[v70] = HEXRAYS_HIWORD(v61);
3964  if (far_portal->viewport_left_side[v70] >
3965  far_portal->viewport_right_side[v70]) {
3966  v36 = far_portal->viewport_left_side[v70] ^
3967  far_portal->viewport_right_side[v70];
3968  // v37 = far_portal->viewport_right_side[v70];
3969  far_portal->viewport_left_side[v70] = v36;
3970  v38 = far_portal->viewport_right_side[v70] ^ v36;
3971  far_portal->viewport_left_side[v70] ^= v38;
3972  far_portal->viewport_right_side[v70] = v38;
3973  }
3974  v62 += v54;
3975  v22 = v70 + 1;
3976  v61 += v53;
3977  }
3978  }
3979  //*****************************************************************************************************************************
3980  // check portals coordinates and determine max, min(проверка координат
3981  // порталов и определение макс, мин-ой у)
3982  if (max_y < near_portal->_viewport_space_y) return false;
3983  if (min_y > near_portal->_viewport_space_w) return false;
3984  if (min_y < near_portal->_viewport_space_y)
3985  min_y = near_portal->_viewport_space_y;
3986  if (max_y > near_portal->_viewport_space_w)
3987  max_y = near_portal->_viewport_space_w;
3988  if (min_y <= max_y) {
3989  for (min_y; min_y <= max_y; ++min_y) {
3990  if (far_portal->viewport_right_side[min_y] >=
3991  near_portal->viewport_left_side[min_y] &&
3992  far_portal->viewport_left_side[min_y] <=
3993  near_portal->viewport_right_side[min_y])
3994  break;
3995  }
3996  }
3997  if (max_y < min_y) return false;
3998  for (max_y; max_y >= min_y; --max_y) {
3999  if (far_portal->viewport_right_side[max_y] >=
4000  near_portal->viewport_left_side[max_y] &&
4001  far_portal->viewport_left_side[max_y] <=
4002  near_portal->viewport_right_side[max_y])
4003  break;
4004  }
4005  if (min_y >= max_y) return false;
4006  //*************************************************************************************************************************************
4007  v59 = min_y;
4008  for (v46 = max_y - min_y + 1; v46; --v46) {
4009  if (far_portal->viewport_left_side[v59] <
4010  near_portal->viewport_left_side[v59])
4011  far_portal->viewport_left_side[v59] =
4012  near_portal->viewport_left_side[v59];
4013  if (far_portal->viewport_right_side[v59] >
4014  near_portal->viewport_right_side[v59])
4015  far_portal->viewport_right_side[v59] =
4016  near_portal->viewport_right_side[v59];
4017  ++v59;
4018  }
4019  far_portal->_viewport_space_y = min_y;
4020  far_portal->_viewport_space_w = max_y;
4021  far_portal->_viewport_space_x = far_portal->viewport_left_side[min_y];
4022  far_portal->_viewport_space_z = far_portal->viewport_right_side[min_y];
4023  far_portal->_viewport_x_minID = min_y;
4024  far_portal->_viewport_z_maxID = min_y;
4025  v49 = min_y + 1;
4026  if (v49 <= max_y) {
4027  for (v49; v49 <= max_y; ++v49) {
4028  if (far_portal->viewport_left_side[v49] <
4029  far_portal->_viewport_space_x) {
4030  far_portal->_viewport_space_x =
4031  far_portal->viewport_left_side[v49];
4032  far_portal->_viewport_x_minID = v49;
4033  }
4034  if (far_portal->viewport_right_side[v49] >
4035  far_portal->_viewport_space_z) {
4036  far_portal->_viewport_space_z =
4037  far_portal->viewport_right_side[v49];
4038  far_portal->_viewport_z_maxID = v49;
4039  }
4040  }
4041  }
4042  return true;
4043 }

Перекрестные ссылки stru367::_screen_space_x, stru367::_screen_space_y, BspRenderer_PortalViewportData::_viewport_space_w, BspRenderer_PortalViewportData::_viewport_space_x, BspRenderer_PortalViewportData::_viewport_space_y, BspRenderer_PortalViewportData::_viewport_space_z, BspRenderer_PortalViewportData::_viewport_x_minID, BspRenderer_PortalViewportData::_viewport_z_maxID, stru367::direction, PortalFace, BspRenderer_PortalViewportData::viewport_left_side и BspRenderer_PortalViewportData::viewport_right_side.

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

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

◆ GetPortalScreenCoord()

int GetPortalScreenCoord ( unsigned int  uFaceID)

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

4045  {
4046  BLVFace *pFace; // ebx@1
4047  int pNextVertices; // edx@11
4048  int t; // ST28_4@12
4049  int pScreenX; // eax@22
4050  int pScreenY; // eax@27
4051  int left_num_vertices; // edi@31
4052  int right_num_vertices; // ebx@41
4053  int top_num_vertices; // edi@51
4054  int bottom_num_vertices; // ebx@61
4055  bool current_vertices_flag; // [sp+18h] [bp-10h]@9
4056  int depth_num_vertices; // [sp+1Ch] [bp-Ch]@9
4057  bool next_vertices_flag; // [sp+20h] [bp-8h]@10
4058 
4059  //Доп инфо "Программирование трёхмерных игр для windows" Ламот стр 910
4060 
4061  pFace = &pIndoor->pFaces[uFaceID];
4062  memset(&PortalFace, 0, sizeof(stru367));
4063 
4064  // get direction the face(определение направленности
4065  // фейса)*********************************************************************************
4066  if (pFace->pFacePlane_old.vNormal.x *
4067  (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].x -
4069  pFace->pFacePlane_old.vNormal.y *
4070  (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].y -
4072  pFace->pFacePlane_old.vNormal.z *
4073  (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].z -
4075  0) {
4076  PortalFace.direction = true;
4077  } else {
4078  PortalFace.direction = false;
4079  if (!(pFace->Portal())) return 0;
4080  }
4081  //*****************************************************************************************************************************************
4082  // transform to camera coordinates (генерация/конвертирование в координаты
4083  // пространства камеры)
4084 
4085  if ((signed int)pFace->uNumVertices > 0) {
4086  for (uint i = 0; i < pFace->uNumVertices; ++i) {
4088  pIndoor->pVertices[pFace->pVertexIDs[i]].x,
4089  pIndoor->pVertices[pFace->pVertexIDs[i]].y,
4090  pIndoor->pVertices[pFace->pVertexIDs[i]].z,
4093  (fixed *)&PortalFace._view_transformed_y[i + 3], false); // xyz wrong order?
4094 
4095  /*pIndoorCameraD3D->ViewClip(pIndoor->pVertices[pFace->pVertexIDs[i]].x,
4096  pIndoor->pVertices[pFace->pVertexIDs[i]].y,
4097  pIndoor->pVertices[pFace->pVertexIDs[i]].z,
4098  &PortalFace._view_transformed_z[i + 3],
4099  &PortalFace._view_transformed_x[i + 3],
4100  &PortalFace._view_transformed_y[i + 3], true);*/
4101  }
4102  }
4103 
4104  //*****************************************************************************************************************************************
4105  // check vertices for the nearest plane(проверка вершин есть ли в области за
4106  // ближайшей плоскостью)
4107  if (pFace->uNumVertices <= 0) return 0;
4108  bool bFound = false;
4109  for (uint i = 0; i < pFace->uNumVertices; ++i) {
4110  if (PortalFace._view_transformed_z[i + 3] >=
4111  0x80000) { // 8.0(0x80000) 0x196A9FF >=0x80000
4112  bFound = true;
4113  break;
4114  }
4115  }
4116  if (!bFound) return 0;
4117  //*****************************************************************************************************************************************
4118  // check for near clip plane(проверка по ближней границе)
4119  //
4120  // v0 v1
4121  // ._________________.
4122  // / \
4123  // / \
4124  // v5. . v2
4125  // | |
4126  // | |
4127  // | |
4128  // ---------------------------- 8.0(near_clip)
4129  // | |
4130  // ._______________________.
4131  // v4 v3
4132  depth_num_vertices = 0;
4139  current_vertices_flag =
4140  PortalFace._view_transformed_z[3] >= 0x80000; // 524288
4141  if (pFace->uNumVertices >= 1) {
4142  for (uint i = 1; i <= pFace->uNumVertices; ++i) {
4143  next_vertices_flag = PortalFace._view_transformed_z[i + 3] >=
4144  0x80000; // 524288;// 8.0
4145  if (current_vertices_flag ^
4146  next_vertices_flag) { // current or next vertex is near-clipped /
4147  // или текущая или следующая вершина за
4148  // ближней границей - v5
4149  if (next_vertices_flag) { // next vertex is near-clipped /
4150  // следующая вершина за ближней
4151  // границей
4152  // t = near_clip - v4.z / v5.z - v4.z
4153  t = fixpoint_div(
4154  0x80000 - PortalFace._view_transformed_z[i + 2],
4157  // New_x = (v5.x - v4.x)*t + v4.x
4158  PortalFace._view_transformed_x[depth_num_vertices] =
4160  fixpoint_mul(t,
4163  // New_y = (v5.y - v4.y)*t + v4.y
4164  PortalFace._view_transformed_y[depth_num_vertices] =
4166  fixpoint_mul(t,
4169  // New_z = 8.0(0x80000)
4170  PortalFace._view_transformed_z[depth_num_vertices] =
4171  0x80000; // 524288
4172 
4173  // test new code
4174  auto _t =
4175  (fixed::FromInt(8) -
4179  auto _x =
4181  _t *
4184  auto _y =
4186  _t *
4189  auto _z = fixed::FromInt(8);
4190 
4191  assert(_t._internal == t);
4192  assert(_x._internal ==
4193  PortalFace._view_transformed_x[depth_num_vertices]);
4194  assert(_y._internal ==
4195  PortalFace._view_transformed_y[depth_num_vertices]);
4196  assert(_z._internal ==
4197  PortalFace._view_transformed_z[depth_num_vertices]);
4198  } else { // current vertex is near-clipped / текущая вершина за
4199  // ближней границей
4200  // t = near_clip - v1.z / v0.z - v1.z
4201  t = fixpoint_div(
4202  524288 - PortalFace._view_transformed_z[i + 3],
4205  // New_x = (v0.x - v1.x)*t + v1.x
4206  PortalFace._view_transformed_x[depth_num_vertices] =
4208  fixpoint_mul(t,
4211  // New_y = (v0.x - v1.y)*t + v1.y
4212  PortalFace._view_transformed_y[depth_num_vertices] =
4214  fixpoint_mul(t,
4217  // New_z = 8.0(0x80000)
4218  PortalFace._view_transformed_z[depth_num_vertices] =
4219  0x80000; // 524288
4220 
4221  // test new code
4222  auto _t =
4223  (fixed::FromInt(8) -
4227  auto _x =
4229  _t *
4232  auto _y =
4234  _t *
4237  auto _z = fixed::FromInt(8);
4238 
4239  // test new projection against old
4240  // assert(_t._internal == t);
4241  // assert(_x._internal ==
4242  // PortalFace._view_transformed_x[depth_num_vertices]);
4243  // assert(_y._internal ==
4244  // PortalFace._view_transformed_y[depth_num_vertices]);
4245  // assert(_z._internal ==
4246  // PortalFace._view_transformed_z[depth_num_vertices]);
4247  }
4248  depth_num_vertices++;
4249  }
4250  if (next_vertices_flag) { //если следующая вершина за ближней
4251  //границей
4252  pNextVertices = depth_num_vertices++;
4253  PortalFace._view_transformed_z[pNextVertices] =
4255  PortalFace._view_transformed_x[pNextVertices] =
4257  PortalFace._view_transformed_y[pNextVertices] =
4259  }
4260  current_vertices_flag = next_vertices_flag;
4261  }
4262  }
4263 
4264  //результат: нет моргания на границе портала(когда проходим сквозь портал)
4265  //************************************************************************************************************************************
4266  // convertion in screen coordinates(конвертирование в координаты экрана)
4267  PortalFace._view_transformed_z[depth_num_vertices] =
4269  PortalFace._view_transformed_x[depth_num_vertices] =
4271  PortalFace._view_transformed_y[depth_num_vertices] =
4273  for (uint i = 0; i < depth_num_vertices; ++i) {
4274  if ((abs(PortalFace._view_transformed_x[i]) >> 13) <=
4275  abs(PortalFace._view_transformed_z[i])) {
4278  } else {
4279  if (PortalFace._view_transformed_x[i] >= 0) {
4280  if (PortalFace._view_transformed_z[i] >= 0)
4281  pScreenX = 0x400000; // 64.0
4282  else
4283  pScreenX = 0xFFC00000; // -63.0
4284  } else {
4285  if (PortalFace._view_transformed_z[i] >= 0)
4286  pScreenX = 0xFFC00000; // -63.0
4287  else
4288  pScreenX = 0x400000; // 64.0
4289  }
4290  }
4291 
4292  if ((abs(PortalFace._view_transformed_y[i]) >> 13) <=
4293  abs(PortalFace._view_transformed_z[i])) {
4296  } else {
4297  if (PortalFace._view_transformed_y[i] >= 0) {
4298  if (PortalFace._view_transformed_z[i] >= 0)
4299  pScreenY = 0x400000; // 64.0
4300  else
4301  pScreenY = 0xFFC00000; // -63.0
4302  } else {
4303  if (PortalFace._view_transformed_z[i] >= 0)
4304  pScreenY = 0xFFC00000; // -63.0
4305  else
4306  pScreenY = 0x400000; // 64.0
4307  }
4308  }
4309  PortalFace._screen_space_x[i + 12] =
4311  fixpoint_mul(HEXRAYS_SHIWORD(pBLVRenderParams->bsp_fov_rad),
4312  pScreenX);
4313  PortalFace._screen_space_y[i + 12] =
4315  fixpoint_mul(HEXRAYS_SHIWORD(pBLVRenderParams->bsp_fov_rad),
4316  pScreenY);
4317 
4318  // test new projection against old
4319  auto _x =
4322  .GetInt();
4323  auto _y =
4326  .GetInt();
4327  // assert(PortalFace._screen_space_x[i + 12] == _x);
4328  // assert(PortalFace._screen_space_y[i + 12] == _y);
4329  }
4330  // результат: при повороте камеры, когда граница портала сдвигается к краю
4331  // экрана, портал остается прозрачным(видимым)
4332 
4333  //******************************************************************************************************************************************
4334  // координаты как в Ида-базе игры так и в данном проекте перевёрнутые,т.е.
4335  // портал который в правой части экрана имеет экранные координаты которые для
4336  // левой части экрана. Например, x(оригинал) = 8, у нас х =
4337  // 468(противоположный край экрана), точно также и с у.
4338  // coordinates (original and here) are flipped horizontaly, e.g. portal on
4339  // right side of the screen x(original) = 8 becomes x = 468 (opposite side
4340  // of the screen). the same holds true for y
4341  //
4342  // check for left_clip plane(порверка по левой границе)
4343  left_num_vertices = 0;
4344  PortalFace._screen_space_x[depth_num_vertices + 12] =
4346  PortalFace._screen_space_y[depth_num_vertices + 12] =
4348  current_vertices_flag = PortalFace._screen_space_x[12] >=
4349  (signed int)pBLVRenderParams->uViewportX; // 8.0
4350  if (depth_num_vertices < 1) return 0;
4351  for (uint i = 1; i <= depth_num_vertices; ++i) {
4352  next_vertices_flag = PortalFace._screen_space_x[i + 12] >=
4353  (signed int)pBLVRenderParams->uViewportX;
4354  if (current_vertices_flag ^ next_vertices_flag) {
4355  if (next_vertices_flag) {
4356  // t = left_clip - v0.x / v1.x - v0.x
4358  PortalFace._screen_space_x[i + 11],
4359  PortalFace._screen_space_x[i + 12] -
4360  PortalFace._screen_space_x[i + 11]);
4361  // New_y = (v1.y - v0.y)*t + v0.y
4362  PortalFace._screen_space_y[left_num_vertices + 9] =
4363  PortalFace._screen_space_y[i + 11] +
4365  PortalFace._screen_space_y[i + 11]));
4366  // New_x = left_clip
4367  PortalFace._screen_space_x[left_num_vertices + 9] =
4369 
4375  auto _y =
4377  _t * (fixed::FromInt(PortalFace._screen_space_y[i + 12]) -
4379 
4380  // assert(_t._internal == t);
4381  // assert(_x.GetInt() ==
4382  // PortalFace._screen_space_x[left_num_vertices + 9]);
4383  // assert(_y.GetInt() ==
4384  // PortalFace._screen_space_y[left_num_vertices + 9]);
4385  } else {
4386  // t = left_clip - v1.x / v0.x - v1.x
4388  PortalFace._screen_space_x[i + 12],
4389  PortalFace._screen_space_x[i + 11] -
4390  PortalFace._screen_space_x[i + 12]);
4391  // New_y = (v0.y - v1.y)*t + v1.y
4392  PortalFace._screen_space_y[left_num_vertices + 9] =
4393  PortalFace._screen_space_y[i + 12] +
4395  PortalFace._screen_space_y[i + 12]));
4396  // New_x = left_clip
4397  PortalFace._screen_space_x[left_num_vertices + 9] =
4399 
4405  auto _y =
4407  _t * (fixed::FromInt(PortalFace._screen_space_y[i + 11]) -
4409 
4410  // test new projection against old
4411  // assert(_t._internal == t);
4412  // assert(_x.GetInt() ==
4413  // PortalFace._screen_space_x[left_num_vertices + 9]);
4414  // assert(_y.GetInt() ==
4415  // PortalFace._screen_space_y[left_num_vertices + 9]);
4416  }
4417  left_num_vertices++;
4418  }
4419  if (next_vertices_flag) {
4420  pNextVertices = left_num_vertices++;
4421  PortalFace._screen_space_x[pNextVertices + 9] =
4422  PortalFace._screen_space_x[i + 12];
4423  PortalFace._screen_space_y[pNextVertices + 9] =
4424  PortalFace._screen_space_y[i + 12];
4425  }
4426  current_vertices_flag = next_vertices_flag;
4427  }
4428  //*********************************************************************************************************************************
4429  // for right_clip plane(проверка по правой плоскости)
4430  right_num_vertices = 0;
4431  PortalFace._screen_space_x[left_num_vertices + 9] =
4433  PortalFace._screen_space_y[left_num_vertices + 9] =
4435  current_vertices_flag = PortalFace._screen_space_x[9] <=
4436  (signed int)pBLVRenderParams->uViewportZ; // 468.0
4437  if (left_num_vertices < 1) return 0;
4438  for (uint i = 1; i <= left_num_vertices; ++i) {
4439  next_vertices_flag = PortalFace._screen_space_x[i + 9] <=
4440  (signed int)pBLVRenderParams->uViewportZ;
4441  if (current_vertices_flag ^ next_vertices_flag) {
4442  if (next_vertices_flag) {
4443  // t = right_clip - v1.x / v0.x - v1.x
4445  PortalFace._screen_space_x[i + 8],
4446  PortalFace._screen_space_x[i + 9] -
4447  PortalFace._screen_space_x[i + 8]);
4448  // New_y = (v0.y - v1.y)*t + v1.y
4449  PortalFace._screen_space_y[right_num_vertices + 6] =
4451  PortalFace._screen_space_y[i + 8]),
4452  t) +
4453  PortalFace._screen_space_y[i + 8];
4454  // New_x = right_clip
4455  PortalFace._screen_space_x[right_num_vertices + 6] =
4457  } else {
4458  // t = right_clip - v0.x / v1.x - v0.x
4460  PortalFace._screen_space_x[i + 9],
4461  PortalFace._screen_space_x[i + 8] -
4462  PortalFace._screen_space_x[i + 9]);
4463  // New_y = (v1.y - v0.y)*t + v0.y
4464  PortalFace._screen_space_y[right_num_vertices + 6] =
4466  PortalFace._screen_space_y[i + 9]),
4467  t) +
4468  PortalFace._screen_space_y[i + 9];
4469  // New_x = right_clip
4470  PortalFace._screen_space_x[right_num_vertices + 6] =
4472  }
4473  right_num_vertices++;
4474  }
4475  if (next_vertices_flag) {
4476  pNextVertices = right_num_vertices++;
4477  PortalFace._screen_space_x[pNextVertices + 6] =
4478  PortalFace._screen_space_x[i + 9];
4479  PortalFace._screen_space_y[pNextVertices + 6] =
4480  PortalFace._screen_space_y[i + 9];
4481  }
4482  current_vertices_flag = next_vertices_flag;
4483  }
4484  //************************************************************************************************************************************
4485  // for top clip plane
4486  top_num_vertices = 0;
4487  PortalFace._screen_space_x[right_num_vertices + 6] =
4489  PortalFace._screen_space_y[right_num_vertices + 6] =
4491 
4492  current_vertices_flag = PortalFace._screen_space_y[6] >=
4493  (signed int)pBLVRenderParams->uViewportY; // 8.0
4494  if (right_num_vertices < 1) return 0;
4495  for (uint i = 1; i <= right_num_vertices; ++i) {
4496  next_vertices_flag = PortalFace._screen_space_y[i + 6] >=
4497  (signed int)pBLVRenderParams->uViewportY;
4498  if (current_vertices_flag ^ next_vertices_flag) {
4499  if (next_vertices_flag) {
4501  PortalFace._screen_space_y[i + 5],
4502  PortalFace._screen_space_y[i + 6] -
4503  PortalFace._screen_space_y[i + 5]);
4504  PortalFace._screen_space_x[top_num_vertices + 3] =
4505  ((signed int)((PortalFace._screen_space_x[i + 6] -
4506  PortalFace._screen_space_x[i + 5]) *
4507  t) >>
4508  16) +
4509  PortalFace._screen_space_x[i + 5];
4510  PortalFace._screen_space_y[top_num_vertices + 3] =
4512  } else {
4514  PortalFace._screen_space_y[i + 6],
4515  PortalFace._screen_space_y[i + 5] -
4516  PortalFace._screen_space_y[i + 6]);
4517  PortalFace._screen_space_x[top_num_vertices + 3] =
4519  PortalFace._screen_space_x[i + 6]),
4520  t) +
4521  PortalFace._screen_space_x[i + 6];
4522  PortalFace._screen_space_y[top_num_vertices + 3] =
4524  }
4525  top_num_vertices++;
4526  }
4527  current_vertices_flag = next_vertices_flag;
4528  if (next_vertices_flag) {
4529  pNextVertices = top_num_vertices++;
4530  PortalFace._screen_space_x[pNextVertices + 3] =
4531  PortalFace._screen_space_x[i + 6];
4532  PortalFace._screen_space_y[pNextVertices + 3] =
4533  PortalFace._screen_space_y[i + 6];
4534  }
4535  }
4536  //**********************************************************************************************************************************
4537  // for bottom_clip plane(проверка по нижней плоскости)
4538  bottom_num_vertices = 0;
4539  PortalFace._screen_space_x[top_num_vertices + 3] =
4541  PortalFace._screen_space_y[top_num_vertices + 3] =
4543  current_vertices_flag = PortalFace._screen_space_y[3] <=
4544  (signed int)pBLVRenderParams->uViewportW; // 351.0
4545  if (top_num_vertices < 1) return 0;
4546  for (uint i = 1; i <= top_num_vertices; ++i) {
4547  next_vertices_flag = PortalFace._screen_space_y[i + 3] <=
4548  (signed int)pBLVRenderParams->uViewportW;
4549  if (current_vertices_flag ^ next_vertices_flag) {
4550  if (next_vertices_flag) {
4552  PortalFace._screen_space_y[i + 2],
4553  PortalFace._screen_space_y[i + 3] -
4554  PortalFace._screen_space_y[i + 2]);
4555  PortalFace._screen_space_x[bottom_num_vertices] =
4557  PortalFace._screen_space_x[i + 2]),
4558  t) +
4559  PortalFace._screen_space_x[i + 2];
4560  PortalFace._screen_space_y[bottom_num_vertices] =
4562  } else {
4564  PortalFace._screen_space_y[i + 3],
4565  PortalFace._screen_space_y[i + 2] -
4566  PortalFace._screen_space_y[i + 3]);
4567  PortalFace._screen_space_x[bottom_num_vertices] =
4569  PortalFace._screen_space_x[i + 3]),
4570  t) +
4571  PortalFace._screen_space_x[i + 3];
4572  PortalFace._screen_space_y[bottom_num_vertices] =
4574  }
4575  bottom_num_vertices++;
4576  }
4577  if (next_vertices_flag) {
4578  pNextVertices = bottom_num_vertices++;
4579  PortalFace._screen_space_x[pNextVertices] =
4580  PortalFace._screen_space_x[i + 3];
4581  PortalFace._screen_space_y[pNextVertices] =
4582  PortalFace._screen_space_y[i + 3];
4583  }
4584  current_vertices_flag = next_vertices_flag;
4585  }
4586  //***************************************************************************************************************************************
4587 
4588  if (!bottom_num_vertices) return 0;
4589  PortalFace._screen_space_x[bottom_num_vertices] =
4591  PortalFace._screen_space_y[bottom_num_vertices] =
4593  // check for software(проверка для софтвар)
4594  /*if ( !render->pRenderD3D && bottom_num_vertices > 3 )
4595  {
4596  PortalFace._screen_space_x[bottom_num_vertices + 1] =
4597  PortalFace._screen_space_x[1];
4598  PortalFace._screen_space_y[bottom_num_vertices + 1] =
4599  PortalFace._screen_space_y[1]; thisf = PortalFace.direction == true ? 1 : -
4600  1; if ( bottom_num_vertices > 0 )
4601  {
4602  v62 = 1;
4603  v71 = 1;
4604  do
4605  {
4606  v63 = v62 - 1;
4607  v64 = v62 + 1;
4608  v80 = v62 + 1;
4609  if ( v62 - 1 >= bottom_num_vertices )
4610  v63 -= bottom_num_vertices;
4611  if ( v62 >= bottom_num_vertices )
4612  v62 -= bottom_num_vertices;
4613  if ( v64 >= bottom_num_vertices )
4614  v64 -= bottom_num_vertices;
4615  if ( thisf * ((PortalFace._screen_space_y[v64] -
4616  PortalFace._screen_space_y[v63])
4617  * (PortalFace._screen_space_x[v62] -
4618  PortalFace._screen_space_x[v63])
4619  - (PortalFace._screen_space_y[v62] -
4620  PortalFace._screen_space_y[v63])
4621  * (PortalFace._screen_space_x[v64] -
4622  PortalFace._screen_space_x[v63])) < 0 )
4623  {
4624  v62 = v80;
4625  v71 = v80;
4626  }
4627  else
4628  {
4629  v62 = v71;
4630  v65 = v71;
4631  if ( v71 < bottom_num_vertices || (v65 = v71 - bottom_num_vertices,
4632  v71 - bottom_num_vertices < bottom_num_vertices) )
4633  {
4634  memcpy(&PortalFace._screen_space_y[v65],
4635  &PortalFace._screen_space_y[v65 + 1], 4 * ((unsigned int)(4 *
4636  (bottom_num_vertices - v65)) >> 2));
4637  memcpy(&PortalFace._screen_space_x[v65],
4638  &PortalFace._screen_space_x[v65 + 1], 4 * ((unsigned int)(4 *
4639  (bottom_num_vertices - v65)) >> 2));
4640  }
4641  --bottom_num_vertices;
4642  }
4643  }
4644  while ( v62 - 1 < bottom_num_vertices );
4645  }
4646  PortalFace._screen_space_x[bottom_num_vertices] =
4647  PortalFace._screen_space_x[0];
4648  PortalFace._screen_space_y[bottom_num_vertices] =
4649  PortalFace._screen_space_y[0];
4650  }*/
4651  return bottom_num_vertices;
4652 }

Перекрестные ссылки stru367::_screen_space_x, stru367::_screen_space_y, stru367::_view_transformed_x, stru367::_view_transformed_y, stru367::_view_transformed_z, IndoorCameraD3D::ApplyViewTransform_TrueIfStillVisible_BLV(), BLVRenderParams::bsp_fov_rad, stru367::direction, fixpoint_div(), fixpoint_mul(), fixed::FromInt(), pBLVRenderParams, BLVFace::pFacePlane_old, IndoorLocation::pFaces, pIndoor, pIndoorCameraD3D, BLVFace::Portal(), PortalFace, BLVFace::pVertexIDs, IndoorLocation::pVertices, fixed::Raw(), BLVFace::uNumVertices, BLVRenderParams::uViewportCenterX, BLVRenderParams::uViewportCenterY, BLVRenderParams::uViewportW, BLVRenderParams::uViewportX, BLVRenderParams::uViewportY, BLVRenderParams::uViewportZ, Plane_int_::vNormal, IndoorCameraD3D::vPartyPos, Vec2< T >::x, Vec2< T >::y и Vec3< T >::z.

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

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

◆ BLV_ProcessPartyActions()

void BLV_ProcessPartyActions ( )

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

4655  { // could this be combined with odm process actions?
4656  int v1; // ebx@1
4657  int v2; // edi@1
4658  double v10; // st7@27
4659  int new_party_z; // esi@96
4660  int v38; // eax@96
4661  int v39; // ecx@106
4662  int v40; // eax@106
4663  int v42; // eax@120
4664  BLVFace *pFace; // esi@126
4665  int v46; // ecx@133
4666  int v52; // eax@140
4667  int v54; // ebx@146
4668  unsigned int uFaceEvent; // [sp+14h] [bp-4Ch]@1
4669  bool party_running_flag; // [sp+1Ch] [bp-44h]@1
4670  bool bFeatherFall; // [sp+24h] [bp-3Ch]@15
4671  unsigned int uSectorID; // [sp+28h] [bp-38h]@1
4672  bool party_walking_flag; // [sp+2Ch] [bp-34h]@1
4673  unsigned int uFaceID; // [sp+30h] [bp-30h]@1
4674  int v80; // [sp+34h] [bp-2Ch]@1
4675  int v82; // [sp+3Ch] [bp-24h]@47
4676  int _view_angle; // [sp+40h] [bp-20h]@47
4677  bool hovering; // [sp+44h] [bp-1Ch]@1
4678  int new_party_y; // [sp+48h] [bp-18h]@1
4679  int new_party_x; // [sp+4Ch] [bp-14h]@1
4680  int party_z; // [sp+50h] [bp-10h]@1
4681  int angle; // [sp+5Ch] [bp-4h]@47
4682 
4683  uFaceEvent = 0;
4684  // v89 = pParty->uFallSpeed;
4685  v1 = 0;
4686  v2 = 0;
4687  new_party_x = pParty->vPosition.x;
4688  new_party_y = pParty->vPosition.y;
4689  party_z = pParty->vPosition.z;
4690  uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y,
4691  pParty->vPosition.z);
4692  party_running_flag = false;
4693  party_walking_flag = false;
4694  hovering = false;
4695 
4696  uFaceID = -1;
4697  int floor_level =
4698  collide_against_floor(new_party_x, new_party_y, party_z + 40,
4699  &uSectorID, &uFaceID); //получить высоту пола
4700 
4701  if (pParty->bFlying) { // отключить полёт
4702  pParty->bFlying = false;
4703  if (pParty->FlyActive())
4705  ->pOverlays[pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID - 1]
4706  .field_E |= 1;
4707  }
4708 
4709  if (floor_level == -30000 || uFaceID == -1) {
4710  floor_level = collide_against_floor_approximate(
4711  new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
4712  if (floor_level == -30000 || uFaceID == -1) {
4713  __debugbreak(); // level built with errors
4718  return;
4719  }
4720  }
4721 
4725  if (!pParty->bTurnBasedModeOn) {
4726  static int dword_720CDC = 0;
4727 
4728  int v67 = OS_GetTime() / 500;
4729  if (dword_720CDC != v67) {
4733  if (dword_4F8580[0] > 60) dword_4F8580[0] = 1;
4734 
4735  dword_720CDC = v67;
4736  }
4737  }
4738 
4739  int fall_start;
4740  /*
4741  if (!pParty->FeatherFallActive())// не активно падение пера
4742  {
4743  bFeatherFall = false;
4744  if (!pParty->pPlayers[0].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT) &&
4745  // grants feather fall
4746  !pParty->pPlayers[1].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT) &&
4747  !pParty->pPlayers[2].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT) &&
4748  !pParty->pPlayers[3].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT))
4749  {
4750  fall_start = pParty->uFallStartY;
4751  }
4752  else// was missing
4753  {
4754  fall_start = floor_level;
4755  bFeatherFall = true;
4756  pParty->uFallStartY = floor_level;
4757  }
4758  }
4759  else// активно падение пера
4760  {
4761  fall_start = floor_level;
4762  bFeatherFall = true;
4763  pParty->uFallStartY = floor_level;
4764  }
4765 
4766  Reworked condition below
4767  */
4768  if (pParty->FeatherFallActive() ||
4769  pParty->pPlayers[0].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT) ||
4770  pParty->pPlayers[1].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT) ||
4771  pParty->pPlayers[2].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT) ||
4772  pParty->pPlayers[3].WearsItemAnyWhere(ITEM_ARTIFACT_LADYS_ESCORT)) {
4773  fall_start = floor_level;
4774  bFeatherFall = true;
4775  pParty->uFallStartY = floor_level;
4776  } else {
4777  bFeatherFall = false;
4778  fall_start = pParty->uFallStartY;
4779  }
4780 
4781  if (fall_start - party_z > 512 && !bFeatherFall &&
4782  party_z <= floor_level + 1) { // повреждение от падения с высоты
4783  assert(~pParty->uFlags & PARTY_FLAGS_1_LANDING); // why land in indoor?
4786  } else {
4787  for (uint i = 0; i < 4; ++i) { // receive falling damage
4788  if (!pParty->pPlayers[i].HasEnchantedItemEquipped(72) &&
4790  EQUIP_BOOTS)) {
4791  pParty->pPlayers[i].ReceiveDamage(
4792  (pParty->uFallStartY - party_z) *
4793  (0.1f * pParty->pPlayers[i].GetMaxHealth()) / 256,
4794  DMGT_PHISYCAL);
4795  v10 = (double)(20 - pParty->pPlayers[i].GetParameterBonus(
4796  pParty->pPlayers[i]
4797  .GetActualEndurance())) *
4798  flt_6BE3A4_debug_recmod1 * 2.133333333333333;
4799  pParty->pPlayers[i].SetRecoveryTime((signed __int64)v10);
4800  }
4801  }
4802  }
4803  }
4804 
4805  if (party_z > floor_level + 1) hovering = true;
4806 
4807  bool not_high_fall = false;
4808 
4809  if (party_z - floor_level <= 32) {
4810  pParty->uFallStartY = party_z;
4811  not_high_fall = true;
4812  }
4813 
4814  if (!engine->config->NoWalkSound() && pParty->walk_sound_timer) { //таймеры для звуков передвижения
4817  else
4818  pParty->walk_sound_timer = 0;
4819  }
4820 
4821  if (party_z <= floor_level + 1) { // группа ниже уровня пола
4822  party_z = floor_level + 1;
4823  pParty->uFallStartY = floor_level + 1;
4824 
4825  if (!hovering && pParty->floor_face_pid != uFaceID) { // не парящие и
4826  if (pIndoor->pFaces[uFaceID].uAttributes & FACE_PRESSURE_PLATE)
4827  uFaceEvent =
4829  .uEventID;
4830  }
4831  }
4832  if (!hovering) pParty->floor_face_pid = uFaceID;
4833 
4834  bool on_water = false;
4835  if (pIndoor->pFaces[uFaceID].Fluid()) // на воде
4836  on_water = true;
4837 
4838  // v81 = pParty->uWalkSpeed;
4839  angle = pParty->sRotationY;
4840  _view_angle = pParty->sRotationX;
4841  v82 =
4842  (unsigned __int64)(pEventTimer->dt_in_some_format *
4843  (signed __int64)((signed int)(pParty
4844  ->y_rotation_speed *
4845  stru_5C6E00
4846  ->uIntegerPi) /
4847  180)) >>
4848  16;
4849  while (pPartyActionQueue->uNumActions) {
4850  switch (pPartyActionQueue->Next()) {
4851  case PARTY_TurnLeft:
4852  if (engine->config->turn_speed > 0)
4853  angle = stru_5C6E00->uDoublePiMask & (angle + engine->config->turn_speed);
4854  else
4856  break;
4857  case PARTY_TurnRight:
4858  if (engine->config->turn_speed > 0)
4859  angle = stru_5C6E00->uDoublePiMask & (angle - engine->config->turn_speed);
4860  else
4862  break;
4863 
4864  case PARTY_FastTurnLeft:
4865  if (engine->config->turn_speed > 0)
4866  angle = stru_5C6E00->uDoublePiMask & (angle + engine->config->turn_speed);
4867  else
4868  angle = stru_5C6E00->uDoublePiMask & (angle + (int)(2.0f * fTurnSpeedMultiplier * (double)v82));
4869  break;
4870 
4871  case PARTY_FastTurnRight:
4872  if (engine->config->turn_speed > 0)
4873  angle = stru_5C6E00->uDoublePiMask & (angle - engine->config->turn_speed);
4874  else
4875  angle = stru_5C6E00->uDoublePiMask & (angle - (int)(2.0f * fTurnSpeedMultiplier * (double)v82));
4876  break;
4877 
4878  case PARTY_StrafeLeft:
4881  party_walking_flag = true;
4882  break;
4883  case PARTY_StrafeRight:
4886  party_walking_flag = true;
4887  break;
4888  case PARTY_WalkForward:
4891  party_walking_flag = true;
4892  break;
4893  case PARTY_WalkBackward:
4896  party_walking_flag = true;
4897  break;
4898  case PARTY_RunForward: //Бег вперёд
4901  party_running_flag = true;
4902  break;
4903  case PARTY_RunBackward:
4906  party_running_flag = true;
4907  break;
4908  case PARTY_LookDown:
4909  _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
4910  if (_view_angle > 128)
4911  _view_angle = 128;
4912  if (uActiveCharacter)
4914  break;
4915  case PARTY_LookUp:
4916  _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
4917  if (_view_angle < -128)
4918  _view_angle = -128;
4919  if (uActiveCharacter)
4921  break;
4922  case PARTY_CenterView:
4923  _view_angle = 0;
4924  break;
4925  case PARTY_Jump:
4926  if ((!hovering ||
4927  party_z <= floor_level + 6 && pParty->uFallSpeed <= 0) &&
4928  pParty->field_24) {
4929  hovering = true;
4930  pParty->uFallSpeed += pParty->field_24 * 96;
4931  }
4932  break;
4933  default:
4934  break;
4935  }
4936  }
4937  pParty->sRotationY = angle;
4938  pParty->sRotationX = _view_angle;
4939  if (hovering) { // парящие
4941  GetGravityStrength(); // расчёт скорости падения
4942  if (hovering && pParty->uFallSpeed <= 0) {
4943  if (pParty->uFallSpeed < -500 && !pParty->bFlying) {
4944  for (uint pl = 1; pl <= 4; pl++) {
4945  if (!pPlayers[pl]->HasEnchantedItemEquipped(72) &&
4946  !pPlayers[pl]->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS,
4947  EQUIP_BOOTS)) // was 8
4948  pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_SCARED,
4949  0);
4950  }
4951  }
4952  } else {
4953  pParty->uFallStartY = party_z;
4954  }
4955  } else { // не парящие
4956  if (pIndoor->pFaces[uFaceID].pFacePlane_old.vNormal.z < 0x8000) {
4957  pParty->uFallSpeed -=
4959  pParty->uFallStartY = party_z;
4960  } else {
4962  pParty->uFallSpeed = 0;
4963  pParty->uFallStartY = party_z;
4964  }
4965  }
4966  if (v2 * v2 + v1 * v1 < 400) {
4967  v1 = 0;
4968  v2 = 0;
4969  }
4970 
4971  stru_721530.field_84 = -1;
4972  stru_721530.field_70 = 0;
4975  stru_721530.field_0 = 1;
4977  for (uint i = 0; i < 100; i++) {
4978  new_party_z = party_z;
4979  stru_721530.position.x = new_party_x;
4980  stru_721530.position.y = new_party_y;
4981  stru_721530.position.z = stru_721530.height + party_z + 1;
4982 
4983  stru_721530.normal.x = new_party_x;
4984  stru_721530.normal.y = new_party_y;
4985  stru_721530.normal.z = stru_721530.prolly_normal_d + party_z + 1;
4986 
4987  stru_721530.velocity.x = v2;
4988  stru_721530.velocity.y = v1;
4990 
4991  stru_721530.uSectorID = uSectorID;
4992  v38 = 0;
4994  v38 = 13312;
4995  }
4996  if (stru_721530.CalcMovementExtents(v38)) break;
4997  for (uint j = 0; j < 100; ++j) {
4999  _46E0B2_collide_against_decorations(); //столкновения с декором
5000  for (v80 = 0; v80 < (signed int)uNumActors; ++v80)
5002  v80, 0); //столкновения с монстрами
5003  if (_46F04E_collide_against_portals()) //столкновения с порталами
5004  break;
5005  }
5007  v39 = stru_721530.normal2.x;
5008  uSectorID = stru_721530.normal2.y;
5010  } else {
5011  v39 = new_party_x +
5013  uSectorID = new_party_y + fixpoint_mul(stru_721530.field_7C,
5015  v40 = new_party_z +
5017  }
5018  v42 = collide_against_floor(v39, uSectorID, v40 + 40,
5019  &stru_721530.uSectorID, &uFaceID);
5020  if (v42 == -30000 || v42 - new_party_z > 128) return;
5021  if (stru_721530.field_7C >= stru_721530.field_6C) { // ???
5022  new_party_x = stru_721530.normal2.x;
5023  new_party_y = stru_721530.normal2.y;
5024  new_party_z =
5026  break;
5027  }
5028  new_party_x +=
5030  new_party_y +=
5032  uSectorID = stru_721530.uSectorID;
5034  unsigned long long v87 =
5035  new_party_z +
5037  if (PID_TYPE(stru_721530.pid) ==
5038  OBJECT_Actor) { // invis break on actor collision / при
5039  // столкновении с монстром
5040  if (pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Active()) {
5042  }
5043  viewparams->bRedrawGameUI = true;
5044  } else if (PID_TYPE(stru_721530.pid) ==
5045  OBJECT_Decoration) { // decoration collision / при
5046  // столкновении с декорацией
5047  v54 = stru_5C6E00->Atan2(
5048  new_party_x -
5049  pLevelDecorations[stru_721530.pid >> 3].vPosition.x,
5050  new_party_y -
5051  pLevelDecorations[stru_721530.pid >> 3].vPosition.y);
5052  v2 = fixpoint_mul(stru_5C6E00->Cos(v54),
5053  integer_sqrt(v2 * v2 + v1 * v1));
5054  v1 = fixpoint_mul(stru_5C6E00->Sin(v54),
5055  integer_sqrt(v2 * v2 + v1 * v1));
5056  } else if (PID_TYPE(stru_721530.pid) ==
5057  OBJECT_BModel) { // при столкновении с bmodel
5058  pFace = &pIndoor->pFaces[(signed int)stru_721530.pid >> 3];
5059  if (pFace->uPolygonType == POLYGON_Floor) { // если bmodel - пол
5060  if (pParty->uFallSpeed < 0) pParty->uFallSpeed = 0;
5061  v87 = pIndoor->pVertices[*pFace->pVertexIDs].z + 1;
5062  if (pParty->uFallStartY - v87 < 512) pParty->uFallStartY = v87;
5063  if (v2 * v2 + v1 * v1 < 400) {
5064  v1 = 0;
5065  v2 = 0;
5066  }
5067  if (pParty->floor_face_pid != PID_ID(stru_721530.pid) &&
5068  pFace->Pressure_Plate())
5069  uFaceEvent =
5071  } else { // если не пол
5072  v46 = pParty->uFallSpeed * pFace->pFacePlane_old.vNormal.z;
5073  if (pFace->uPolygonType !=
5074  POLYGON_InBetweenFloorAndWall) { // полез на холм
5075  v80 = abs(v1 * pFace->pFacePlane_old.vNormal.y + v46 +
5076  v2 * pFace->pFacePlane_old.vNormal.x) >>
5077  16;
5078  if ((stru_721530.speed >> 3) > v80)
5079  v80 = stru_721530.speed >> 3;
5080  v2 += fixpoint_mul(v80, pFace->pFacePlane_old.vNormal.x);
5081  v1 += fixpoint_mul(v80, pFace->pFacePlane_old.vNormal.y);
5082  pParty->uFallSpeed +=
5083  fixpoint_mul(v80, pFace->pFacePlane_old.vNormal.z);
5084  // v80 = pFace->pFacePlane_old.vNormal.y;
5086  ((pFace->pFacePlane_old.dist +
5087  v87 * pFace->pFacePlane_old.vNormal.z +
5088  new_party_y * pFace->pFacePlane_old.vNormal.y +
5089  new_party_x * pFace->pFacePlane_old.vNormal.x) >>
5090  16);
5091  if (v52 > 0) {
5092  new_party_x +=
5093  fixpoint_mul(v52, pFace->pFacePlane_old.vNormal.x);
5094  new_party_y +=
5095  fixpoint_mul(v52, pFace->pFacePlane_old.vNormal.y);
5096  v87 +=
5097  fixpoint_mul(v52, pFace->pFacePlane_old.vNormal.z);
5098  }
5099  if (pParty->floor_face_pid != PID_ID(stru_721530.pid) &&
5100  pFace->Pressure_Plate())
5101  uFaceEvent =
5103  }
5105  v80 = abs(v1 * pFace->pFacePlane_old.vNormal.y + v46 +
5106  v2 * pFace->pFacePlane_old.vNormal.x) >>
5107  16;
5108  if ((stru_721530.speed >> 3) > v80)
5109  v80 = stru_721530.speed >> 3;
5110  v2 += fixpoint_mul(v80, pFace->pFacePlane_old.vNormal.x);
5111  v1 += fixpoint_mul(v80, pFace->pFacePlane_old.vNormal.y);
5112  pParty->uFallSpeed +=
5113  fixpoint_mul(v80, pFace->pFacePlane_old.vNormal.z);
5114  if (v2 * v2 + v1 * v1 >= 400) {
5115  if (pParty->floor_face_pid != PID_ID(stru_721530.pid) &&
5116  pFace->Pressure_Plate())
5117  uFaceEvent =
5119  .uEventID;
5120  } else {
5121  v2 = 0;
5122  v1 = 0;
5123  pParty->uFallSpeed = 0;
5124  }
5125  }
5126  }
5127  }
5128  v2 = fixpoint_mul(58500, v2);
5129  v1 = fixpoint_mul(58500, v1);
5131  }
5132 
5133  // //Воспроизведение звуков ходьбы/бега-------------------------
5134  uint pX_ = abs(pParty->vPosition.x - new_party_x);
5135  uint pY_ = abs(pParty->vPosition.y - new_party_y);
5136  uint pZ_ = abs(pParty->vPosition.z - new_party_z);
5137  if (!engine->config->NoWalkSound() && pParty->walk_sound_timer <= 0) {
5138  pAudioPlayer->StopAll(804); // stop sound
5139  if (party_running_flag &&
5140  (!hovering || not_high_fall)) { // Бег и (не прыжок или не высокое падение )
5141  if (integer_sqrt(pX_ * pX_ + pY_ * pY_ + pZ_ * pZ_) >= 16) {
5142  if (on_water)
5143  pAudioPlayer->PlaySound(SOUND_RunWaterIndoor, 804, 1, -1, 0, 0);
5144  else if (pIndoor->pFaces[uFaceID].uAttributes & FACE_INDOOR_CARPET) //по ковру
5145  pAudioPlayer->PlaySound(SOUND_RunCarpet, -1 /*804*/, 1, -1, 0, 0);
5146  else
5147  pAudioPlayer->PlaySound(SOUND_RunWood, -1 /*804*/, 1, -1, 0, 0);
5148  pParty->walk_sound_timer = 96; // 64
5149  }
5150  } else if (party_walking_flag &&
5151  (!hovering || not_high_fall)) { // Ходьба и (не прыжок или не
5152  // высокое падение)
5153  if (integer_sqrt(pX_ * pX_ + pY_ * pY_ + pZ_ * pZ_) >= 8) {
5154  if (on_water)
5155  pAudioPlayer->PlaySound(SOUND_WalkWaterIndoor, 804, 1, -1, 0, 0);
5156  else if (pIndoor->pFaces[uFaceID].uAttributes & FACE_INDOOR_CARPET) //по ковру
5157  pAudioPlayer->PlaySound(SOUND_WalkCarpet, -1 /*804*/, 1, -1, 0, 0);
5158  else
5159  pAudioPlayer->PlaySound(SOUND_WalkWood, -1 /*804*/, 1, -1, 0, 0);
5160  pParty->walk_sound_timer = 144; // 64
5161  }
5162  }
5163  }
5164  if (integer_sqrt(pX_ * pX_ + pY_ * pY_ + pZ_ * pZ_) <
5165  8) //отключить звук ходьбы при остановке
5166  pAudioPlayer->StopAll(804);
5167  //-------------------------------------------------------------
5168  if (!hovering || !not_high_fall)
5170  else
5173  pParty->vPosition.x = new_party_x;
5174  pParty->vPosition.z = new_party_z;
5175  pParty->vPosition.y = new_party_y;
5176  // pParty->uFallSpeed = v89;
5177  if (!hovering && pIndoor->pFaces[uFaceID].uAttributes & FACE_INDOOR_LAVA)
5178  pParty->uFlags |= PARTY_FLAGS_1_BURNING; // 0x200
5179  if (uFaceEvent) EventProcessor(uFaceEvent, 0, 1);
5180 }

Перекрестные ссылки Actor::_46DF1A_collide_against_actor(), _46E0B2_collide_against_decorations(), _46E44E_collide_against_faces_and_portals(), _46F04E_collide_against_portals(), __debugbreak(), stru193_math::Atan2(), Party::bFlying, blv_prev_party_x, blv_prev_party_y, blv_prev_party_z, ViewingParams::bRedrawGameUI, Party::bTurnBasedModeOn, stru141_actor_collision_object::CalcMovementExtents(), CHARACTER_EXPRESSION_SCARED, collide_against_floor(), collide_against_floor_approximate(), stru193_math::Cos(), stru141_actor_collision_object::direction, Plane_int_::dist, DMGT_PHISYCAL, Timer::dt_in_some_format, dword_4F8580, engine, EQUIP_BOOTS, EventProcessor(), fBackwardWalkSpeedMultiplier, Party::FeatherFallActive(), stru141_actor_collision_object::field_0, Party::field_14_radius, Party::field_24, stru141_actor_collision_object::field_6C, stru141_actor_collision_object::field_70, stru141_actor_collision_object::field_7C, stru141_actor_collision_object::field_84, stru141_actor_collision_object::field_8_radius, OtherOverlay::field_E, fixpoint_mul(), Party::floor_face_pid, flt_6BE150_look_up_down_dangle, flt_6BE3A4_debug_recmod1, BLVFace::Fluid(), Party::FlyActive(), fTurnSpeedMultiplier, fWalkSpeedMultiplier, GetGravityStrength(), IndoorLocation::GetSector(), stru141_actor_collision_object::height, integer_sqrt(), ITEM_ARTIFACT_HERMES_SANDALS, ITEM_ARTIFACT_LADYS_ESCORT, ActionQueue::Next(), stru141_actor_collision_object::normal, stru141_actor_collision_object::normal2, OBJECT_Actor, OBJECT_BModel, OBJECT_Decoration, OS_GetTime(), PARTY_BUFF_FLY, PARTY_BUFF_INVISIBILITY, PARTY_CenterView, PARTY_FastTurnLeft, PARTY_FastTurnRight, PARTY_FLAGS_1_BURNING, PARTY_FLAGS_1_FALLING, PARTY_FLAGS_1_LANDING, PARTY_Jump, PARTY_LookDown, PARTY_LookUp, PARTY_RunBackward, PARTY_RunForward, PARTY_StrafeLeft, PARTY_StrafeRight, PARTY_TurnLeft, PARTY_TurnRight, PARTY_WalkBackward, PARTY_WalkForward, pAudioPlayer, pEventTimer, IndoorLocation::pFaceExtras, BLVFace::pFacePlane_old, IndoorLocation::pFaces, stru141_actor_collision_object::pid, pIndoor, AudioPlayer::PlaySound(), pLevelDecorations, POLYGON_Floor, POLYGON_InBetweenFloorAndWall, stru141_actor_collision_object::position, pOtherOverlayList, OtherOverlayList::pOverlays, pParty, pPartyActionQueue, Party::pPartyBuffs, pPlayers, Party::pPlayers, BLVFace::Pressure_Plate(), stru141_actor_collision_object::prolly_normal_d, pTurnEngine, BLVFace::pVertexIDs, IndoorLocation::pVertices, stru193_math::Sin(), SOUND_RunCarpet, SOUND_RunWaterIndoor, SOUND_RunWood, SOUND_WalkCarpet, SOUND_WalkWaterIndoor, SOUND_WalkWood, SPEECH_63, SPEECH_64, stru141_actor_collision_object::speed, Party::sRotationX, Party::sRotationY, AudioPlayer::StopAll(), stru_5C6E00, stru_721530, TE_MOVEMENT, stru262_TurnBased::turn_stage, uActiveCharacter, BLVFace::uAttributes, stru193_math::uDoublePiMask, BLVFaceExtra::uEventID, BLVFace::uFaceExtraID, Party::uFallSpeed, Party::uFallStartY, Party::uFlags, ActionQueue::uNumActions, uNumActors, Party::uPartyHeight, BLVFace::uPolygonType, stru141_actor_collision_object::uSectorID, Timer::uTimeElapsed, Party::uWalkSpeed, stru141_actor_collision_object::velocity, viewparams, Plane_int_::vNormal, Party::vPosition и Party::walk_sound_timer.

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

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

◆ Door_switch_animation()

void Door_switch_animation ( unsigned int  uDoorID,
int  a2 
)

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

5183  {
5184  int old_state; // eax@1
5185  signed int door_id; // esi@2
5186 
5187  if (!pIndoor->pDoors) return;
5188  for (door_id = 0; door_id < 200; ++door_id) {
5189  if (pIndoor->pDoors[door_id].uDoorID == uDoorID) break;
5190  }
5191  if (door_id >= 200) {
5192  Error("Unable to find Door ID: %i!", uDoorID);
5193  }
5194  old_state = pIndoor->pDoors[door_id].uState;
5195  // old_state: 0 - в нижнем положении/закрыто
5196  // 2 - в верхнем положении/открыто,
5197  // a2: 1 - открыть
5198  // 2 - опустить/поднять
5199  if (a2 == 2) {
5200  if (pIndoor->pDoors[door_id].uState == BLVDoor::Closing ||
5201  pIndoor->pDoors[door_id].uState == BLVDoor::Opening)
5202  return;
5203  if (pIndoor->pDoors[door_id].uState) {
5204  if (pIndoor->pDoors[door_id].uState != BLVDoor::Closed &&
5205  pIndoor->pDoors[door_id].uState != BLVDoor::Closing) {
5206  pIndoor->pDoors[door_id].uState = BLVDoor::Closing;
5207  if (old_state == BLVDoor::Open) {
5208  pIndoor->pDoors[door_id].uTimeSinceTriggered = 0;
5209  return;
5210  }
5211  if (pIndoor->pDoors[door_id].uTimeSinceTriggered != 15360) {
5212  pIndoor->pDoors[door_id].uTimeSinceTriggered =
5213  (pIndoor->pDoors[door_id].uMoveLength << 7) /
5214  pIndoor->pDoors[door_id].uOpenSpeed -
5215  ((signed int)(pIndoor->pDoors[door_id]
5217  pIndoor->pDoors[door_id].uCloseSpeed) /
5218  128
5219  << 7) /
5220  pIndoor->pDoors[door_id].uOpenSpeed;
5221  return;
5222  }
5223  pIndoor->pDoors[door_id].uTimeSinceTriggered = 15360;
5224  }
5225  return;
5226  }
5227  } else {
5228  if (a2 == 0) {
5229  if (pIndoor->pDoors[door_id].uState != BLVDoor::Closed &&
5230  pIndoor->pDoors[door_id].uState != BLVDoor::Closing) {
5231  pIndoor->pDoors[door_id].uState = BLVDoor::Closing;
5232  if (old_state == BLVDoor::Open) {
5233  pIndoor->pDoors[door_id].uTimeSinceTriggered = 0;
5234  return;
5235  }
5236  if (pIndoor->pDoors[door_id].uTimeSinceTriggered != 15360) {
5237  pIndoor->pDoors[door_id].uTimeSinceTriggered =
5238  (pIndoor->pDoors[door_id].uMoveLength << 7) /
5239  pIndoor->pDoors[door_id].uOpenSpeed -
5240  ((signed int)(pIndoor->pDoors[door_id]
5242  pIndoor->pDoors[door_id].uCloseSpeed) /
5243  128
5244  << 7) /
5245  pIndoor->pDoors[door_id].uOpenSpeed;
5246  return;
5247  }
5248  pIndoor->pDoors[door_id].uTimeSinceTriggered = 15360;
5249  }
5250  return;
5251  }
5252  if (a2 != 1) return;
5253  }
5254  if (old_state != BLVDoor::Open && old_state != BLVDoor::Opening) {
5255  pIndoor->pDoors[door_id].uState = BLVDoor::Opening;
5256  if (old_state == BLVDoor::Closed) {
5257  pIndoor->pDoors[door_id].uTimeSinceTriggered = 0;
5258  return;
5259  }
5260  if (pIndoor->pDoors[door_id].uTimeSinceTriggered != 15360) {
5261  pIndoor->pDoors[door_id].uTimeSinceTriggered =
5262  (pIndoor->pDoors[door_id].uMoveLength << 7) /
5263  pIndoor->pDoors[door_id].uCloseSpeed -
5264  ((signed int)(pIndoor->pDoors[door_id].uTimeSinceTriggered *
5265  pIndoor->pDoors[door_id].uOpenSpeed) /
5266  128
5267  << 7) /
5268  pIndoor->pDoors[door_id].uCloseSpeed;
5269  return;
5270  }
5271  pIndoor->pDoors[door_id].uTimeSinceTriggered = 15360;
5272  }
5273  return;
5274 }

Перекрестные ссылки BLVDoor::Closed, BLVDoor::Closing, BLVDoor::Open, BLVDoor::Opening, IndoorLocation::pDoors, pIndoor, BLVDoor::uCloseSpeed, BLVDoor::uDoorID, BLVDoor::uMoveLength, BLVDoor::uOpenSpeed, BLVDoor::uState и BLVDoor::uTimeSinceTriggered.

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

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

◆ sub_4088E9()

int sub_4088E9 ( int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
)

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

5277  {
5278  signed int result; // eax@1
5279 
5280  result =
5281  integer_sqrt(abs(x2 - x1) * abs(x2 - x1) + abs(y2 - y1) * abs(y2 - y1));
5282  if (result)
5283  result = abs(((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / result);
5284  return result;
5285 }

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

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

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

◆ GetAlertStatus()

int GetAlertStatus ( )

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

5287  {
5288  int result;
5289 
5292  else
5294 
5295  return result;
5296 }

Перекрестные ссылки OutdoorLocation::ddm, IndoorLocation::dlv, DDM_DLV_Header::field_C_alert, LEVEL_Indoor, LEVEL_Outdoor, pIndoor, pOutdoor и uCurrentlyLoadedLevelType.

Используется в OutdoorLocation::InitalizeActors(), ODM_LoadAndInitialize(), PrepareToLoadBLV(), Actor::SearchActorByGroup(), Actor::SearchActorByID(), Actor::SearchActorByMonsterID() и Actor::SearchAliveActors().

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

◆ _45063B_spawn_some_monster()

int _45063B_spawn_some_monster ( MapInfo a1,
int  a2 
)

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

5298  {
5299  int result = 0; // eax@8
5300  int v6; // edi@11
5301  int v7; // ebx@11
5302  int v9; // ebx@12
5303  int v10; // eax@12
5304  char v11 = 0; // zf@16
5305  int v12; // edi@20
5306  int v13; // eax@20
5307  int v14; // ebx@20
5308  int v15; // eax@20
5309  int v16; // eax@20
5310  int v17; // eax@20
5311  int v18; // eax@21
5312  SpawnPointMM7 v19; // [sp+Ch] [bp-38h]@1
5313  int v22; // [sp+2Ch] [bp-18h]@3
5314  unsigned int uFaceID; // [sp+38h] [bp-Ch]@10
5315  int v26 = 0; // [sp+3Ch] [bp-8h]@11
5316  int v27; // [sp+40h] [bp-4h]@11
5317 
5318  if (!uNumActors) return 0;
5319 
5320  for (uint mon_id = 0; mon_id < uNumActors; ++mon_id) {
5321  if ((pActors[mon_id].pMonsterInfo.uID < 121 ||
5322  pActors[mon_id].pMonsterInfo.uID > 123) && // Dwarf FemaleC A-C
5323  (pActors[mon_id].pMonsterInfo.uID < 124 ||
5324  pActors[mon_id].pMonsterInfo.uID > 126) && // Dwarf MaleA A-C
5325  (pActors[mon_id].pMonsterInfo.uID < 133 ||
5326  pActors[mon_id].pMonsterInfo.uID > 135) && // Peasant Elf FemaleA A-C
5327  pActors[mon_id].CanAct()) {
5329  v22 = 0;
5330  uint face_id = 0;
5331  for (face_id; face_id < 100; ++face_id) {
5332  v6 = rand() % 1024 + 512;
5333  v7 = rand() % (signed int)stru_5C6E00->uIntegerDoublePi;
5334  v19.vPosition.x = pParty->vPosition.x + fixpoint_mul(stru_5C6E00->Cos(v7), v6);
5335  v19.uIndex = a2;
5336  v19.vPosition.y = fixpoint_mul(stru_5C6E00->Sin(v7), v6) + pParty->vPosition.y;
5337  v19.vPosition.z = pParty->vPosition.z;
5338  bool bInWater = false;
5339  v27 = 0;
5340  v19.vPosition.z = ODM_GetFloorLevel(
5341  v19.vPosition.x, v19.vPosition.y, pParty->vPosition.z,
5342  0, &bInWater, &v27, 0);
5343  for (BSPModel &model : pOutdoor->pBModels) {
5344  v9 = abs(v19.vPosition.y - model.vBoundingCenter.y);
5345  v10 = abs(v19.vPosition.x - model.vBoundingCenter.x);
5346  if (int_get_vector_length(v10, v9, 0) <
5347  model.sBoundingRadius + 256) {
5348  v22 = 1;
5349  break;
5350  }
5351  }
5352  if (v22) {
5353  v11 = face_id == 100;
5354  break;
5355  }
5356  }
5357  v11 = face_id == 100;
5358  } else if (uCurrentlyLoadedLevelType == LEVEL_Indoor) {
5359  v22 =
5361  pParty->vPosition.z);
5362  for (uint i = 0; i < 100; ++i) {
5363  v12 = rand() % 512 + 256;
5364  v13 = rand();
5365  v14 = v13 % (int)stru_5C6E00->uIntegerDoublePi;
5366  v15 = stru_5C6E00->Cos(v13 % (int)stru_5C6E00->uIntegerDoublePi);
5367  v19.vPosition.x = pParty->vPosition.x + fixpoint_mul(v15, v12);
5368  v16 = stru_5C6E00->Sin(v13 % (int)stru_5C6E00->uIntegerDoublePi);
5369  v19.vPosition.y = fixpoint_mul(v16, v12) + pParty->vPosition.y;
5370  v19.vPosition.z = pParty->vPosition.z;
5371  v19.uIndex = a2;
5372  v17 = pIndoor->GetSector(v19.vPosition.x, v19.vPosition.y, pParty->vPosition.z);
5373  if (v17 == v22) {
5374  v18 = BLV_GetFloorLevel(v19.vPosition.x, v19.vPosition.y,
5375  v19.vPosition.z, v17, &uFaceID);
5376  v19.vPosition.z = v18;
5377  if (v18 != -30000) {
5378  if (abs(v18 - pParty->vPosition.z) <= 1024) break;
5379  }
5380  }
5381  }
5382  v11 = v26 == 100;
5383  }
5384 
5385  if (v11) {
5386  result = 0;
5387  } else {
5388  SpawnEncounter(a1, &v19, 0, 0, 1);
5389  result = a2;
5390  }
5391  }
5392 
5393  // break;
5394  // v22 = v3->pMonsterInfo.uID - 1;
5395  // v4 = (signed __int64)((double)v22 * 0.3333333333333333);
5396  // if ( (int)v4 != 40 )
5397  //{
5398  // if ( (int)v4 != 41 && (int)v4 != 44 && v3->CanAct() )
5399  // break;
5400  //}
5401  // ++v2;
5402  // ++v3;
5403  // if ( v2 >= (signed int)uNumActors )
5404  // goto LABEL_8;
5405  }
5406  return result;
5407 }

Перекрестные ссылки BLV_GetFloorLevel(), stru193_math::Cos(), fixpoint_mul(), IndoorLocation::GetSector(), int_get_vector_length(), LEVEL_Indoor, LEVEL_Outdoor, ODM_GetFloorLevel(), pActors, OutdoorLocation::pBModels, pIndoor, pOutdoor, pParty, BSPModel::sBoundingRadius, stru193_math::Sin(), SpawnEncounter(), stru_5C6E00, uCurrentlyLoadedLevelType, SpawnPointMM7::uIndex, stru193_math::uIntegerDoublePi, uNumActors, BSPModel::vBoundingCenter, Party::vPosition и SpawnPointMM7::vPosition.

Используется в Application::Game::EventLoop().

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

◆ sub_450521_ProllyDropItemAt()

int sub_450521_ProllyDropItemAt ( int  ecx0,
int  a2,
int  a3,
int  a4,
int  a5,
uint16_t  a6 
)

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

5409  {
5410  SpriteObject a1;
5411  pItemsTable->GenerateItem(ecx0, a2, &a1.containing_item);
5414  a1.vPosition.x = a3;
5415  a1.vPosition.y = a4;
5416  a1.vPosition.z = a5;
5417  a1.uFacing = a6;
5418  a1.uAttributes = 0;
5419  a1.uSectorID = pIndoor->GetSector(a3, a4, a5);
5420  a1.uSpriteFrameID = 0;
5421  return a1.Create(0, 0, 0, 0);
5422 }

Перекрестные ссылки SpriteObject::containing_item, SpriteObject::Create(), ItemsTable::GenerateItem(), IndoorLocation::GetSector(), ObjectList::ObjectIDByItemID(), pIndoor, ItemsTable::pItems, pItemsTable, pObjectList, SpriteObject::uAttributes, SpriteObject::uFacing, ItemGen::uItemID, SpriteObject::uObjectDescID, SpriteObject::uSectorID, SpriteObject::uSpriteFrameID, SpriteObject::uType и SpriteObject::vPosition.

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

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

◆ sub_4075DB()

bool sub_4075DB ( int  x,
int  y,
int  z,
BLVFace face 
)

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

5424  {
5425  int v8; // edi@2
5426  int v25; // eax@22
5427  bool result; // eax@25
5428  int a3a; // [sp+24h] [bp+8h]@14
5429  int a4a; // [sp+28h] [bp+Ch]@2
5430 
5431  std::array<int, 52> dword_4F5CC8_ys; // idb
5432  std::array<int, 52> dword_4F5D98_xs; // idb
5433 
5434  if (face->uAttributes & FACE_XY_PLANE) {
5435  a4a = x;
5436  v8 = y;
5437  for (int i = 0; i < face->uNumVertices; i++) {
5438  dword_4F5D98_xs[i] = pIndoor->pVertices[face->pVertexIDs[i]].x;
5439  dword_4F5CC8_ys[i] = pIndoor->pVertices[face->pVertexIDs[i]].y;
5440  }
5441  } else {
5442  v8 = z;
5443  if (face->uAttributes & FACE_XZ_PLANE) {
5444  a4a = x;
5445  for (int i = 0; i < face->uNumVertices; i++) {
5446  dword_4F5D98_xs[i] = pIndoor->pVertices[face->pVertexIDs[i]].x;
5447  dword_4F5CC8_ys[i] = pIndoor->pVertices[face->pVertexIDs[i]].z;
5448  }
5449  } else {
5450  a4a = y;
5451  for (int i = 0; i < face->uNumVertices; i++) {
5452  dword_4F5D98_xs[i] = pIndoor->pVertices[face->pVertexIDs[i]].y;
5453  dword_4F5CC8_ys[i] = pIndoor->pVertices[face->pVertexIDs[i]].z;
5454  }
5455  }
5456  }
5457  a3a = 0;
5458  dword_4F5D98_xs[face->uNumVertices] = dword_4F5D98_xs[0];
5459  dword_4F5CC8_ys[face->uNumVertices] = dword_4F5CC8_ys[0];
5460  for (int i = 0; i < face->uNumVertices && a3a < 2; i++) {
5461  if ((dword_4F5CC8_ys[i] >= v8) ^ (dword_4F5CC8_ys[i + 1] >= v8)) {
5462  // if( dword_4F5D98_xs[i + 1] >= a4a || dword_4F5D98_xs[i] >= a4a)
5463  if (!(dword_4F5D98_xs[i + 1] >= a4a && dword_4F5D98_xs[i] < a4a)) {
5464  if ((dword_4F5D98_xs[i + 1] < a4a && dword_4F5D98_xs[i] >= a4a)) {
5465  ++a3a;
5466  // || (v25 = dword_4F5D98_xs[i + 1] -
5467  // dword_4F5D98_xs[i],LODWORD(v26) = v25 << 16, HIDWORD(v26) =
5468  // v25 >> 16, dword_4F5D98_xs[i] + ((signed int)(((unsigned
5469  // __int64)(v26 / (dword_4F5CC4_ys[i + 2] - dword_4F5CC4_ys[i +
5470  // 1])* ((v8 - dword_4F5CC4_ys[i + 1]) << 16)) >> 16)
5471  // + 32768) >> 16) >= a4a) )
5472  } else {
5473  v25 = fixpoint_div(dword_4F5D98_xs[i + 1] - dword_4F5D98_xs[i],
5474  dword_4F5CC8_ys[i + 1] - dword_4F5CC8_ys[i]);
5475  if (dword_4F5D98_xs[i] + (fixpoint_mul(v25, (v8 - dword_4F5CC8_ys[i]) << 16) + 0x8000 >> 16) >= a4a)
5476  ++a3a;
5477  }
5478  }
5479  }
5480  }
5481  result = 1;
5482  if (a3a != 1) result = 0;
5483  return result;
5484 }

Перекрестные ссылки fixpoint_div(), fixpoint_mul(), pIndoor и IndoorLocation::pVertices.

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

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

◆ sub_4077F1()

bool sub_4077F1 ( int  a1,
int  a2,
int  a3,
ODMFace face,
BSPVertexBuffer a5 
)

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

5486  {
5487  int a4a; // [sp+28h] [bp+Ch]@2
5488  int a5a; // [sp+2Ch] [bp+10h]@14
5489 
5490  std::array<int, 52> dword_4F5B24_ys; // idb
5491  std::array<int, 52> dword_4F5BF4_xs; // idb
5492 
5493  // __debugbreak(); // срабатывает при нападении стрекозавров с огнём
5494 
5495  if (face->uAttributes & FACE_XY_PLANE) {
5496  a4a = a1;
5497  a3 = a2;
5498  for (int i = 0; i < face->uNumVertices; i++) {
5499  dword_4F5BF4_xs[i + 1] = a5->pVertices[face->pVertexIDs[i]].x;
5500  dword_4F5B24_ys[i + 1] = a5->pVertices[face->pVertexIDs[i]].y;
5501  }
5502  } else {
5503  if (face->uAttributes & FACE_XY_PLANE) {
5504  a4a = a1;
5505  for (int i = 0; i < face->uNumVertices; i++) {
5506  dword_4F5BF4_xs[i + 1] = a5->pVertices[face->pVertexIDs[i]].x;
5507  dword_4F5B24_ys[i + 1] = a5->pVertices[face->pVertexIDs[i]].z;
5508  }
5509  } else {
5510  a4a = a2;
5511  for (int i = 0; i < face->uNumVertices; i++) {
5512  dword_4F5BF4_xs[i + 1] = a5->pVertices[face->pVertexIDs[i]].y;
5513  dword_4F5B24_ys[i + 1] = a5->pVertices[face->pVertexIDs[i]].z;
5514  }
5515  }
5516  }
5517  a5a = 0;
5518  dword_4F5BF4_xs[face->uNumVertices + 1] = dword_4F5BF4_xs[1];
5519  dword_4F5B24_ys[face->uNumVertices + 1] = dword_4F5B24_ys[1];
5520  for (int i = 0; i < face->uNumVertices; i++) {
5521  if (a5a >= 2) break;
5522  if ((dword_4F5B24_ys[i + 1] >= a3) ^ (dword_4F5B24_ys[i + 2] >= a3)) {
5523  if (dword_4F5BF4_xs[i + 2] >= a4a || dword_4F5BF4_xs[i] >= a4a) {
5524  if (dword_4F5BF4_xs[i + 2] >= a4a &&
5525  dword_4F5BF4_xs[i + 1] >= a4a) {
5526  ++a5a;
5527  } else {
5528  // v23 = (__int64)(dword_4F5BF4_xs[i + 2] -
5529  // dword_4F5BF4_xs[i + 1]) << 16;
5530  __int64 _a =
5531  dword_4F5B24_ys[i + 2] - dword_4F5B24_ys[i + 1];
5532  __int64 _b = (__int64)(a3 - dword_4F5B24_ys[i + 1]) << 16;
5533 
5534  if (dword_4F5BF4_xs[i + 1] +
5535  ((((((__int64)(dword_4F5BF4_xs[i + 2] -
5536  dword_4F5BF4_xs[i + 1])
5537  << 16) /
5538  _a * _b) >>
5539  16) +
5540  0x8000) >>
5541  16) >=
5542  a4a)
5543  ++a5a;
5544  }
5545  }
5546  }
5547  }
5548 
5549  if (a5a != 1) return false;
5550  return true;
5551 }

Перекрестные ссылки BSPVertexBuffer::pVertices.

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

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

◆ FindBillboardsLightLevels_BLV()

void FindBillboardsLightLevels_BLV ( )

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

5654  {
5655  for (uint i = 0; i < uNumBillboardsToDraw; ++i) {
5656  if (pBillboardRenderList[i].field_1E & 2 ||
5658  !pBillboardRenderList[i].uIndoorSectorID)
5660  else
5663  }
5664 }

Перекрестные ссылки _43F55F_get_billboard_light_level(), RenderBillboard::dimming_level, LEVEL_Indoor, pBillboardRenderList, uCurrentlyLoadedLevelType и uNumBillboardsToDraw.

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

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

◆ collide_against_floor_approximate()

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

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

5669  {
5670  int result; // eax@1
5671 
5672  *pSectorID = pIndoor->GetSector(x - 2, y, z + 40);
5673  result = collide_against_floor(x - 2, y, z + 40, pSectorID, pFaceID);
5674  if (result == -30000 || !*pSectorID) {
5675  *pSectorID = pIndoor->GetSector(x + 2, y, z + 40);
5676  result = collide_against_floor(x + 2, y, z + 40, pSectorID, pFaceID);
5677  if (result == -30000 || !*pSectorID) {
5678  *pSectorID = pIndoor->GetSector(x, y - 2, z + 40);
5679  result =
5680  collide_against_floor(x, y - 2, z + 40, pSectorID, pFaceID);
5681  if (result == -30000 || !*pSectorID) {
5682  *pSectorID = pIndoor->GetSector(x, y + 2, z + 40);
5683  result =
5684  collide_against_floor(x, y + 2, z + 40, pSectorID, pFaceID);
5685  if (result == -30000 || !*pSectorID) {
5686  *pSectorID = pIndoor->GetSector(x, y, z + 140);
5687  result = collide_against_floor(x, y, z + 140, pSectorID,
5688  pFaceID);
5689  }
5690  }
5691  }
5692  }
5693  return result;
5694 }

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

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

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

Переменные

◆ pIndoor

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

Используется в CastSpellInfoHelpers::_427E01_cast_spell(), Player::_42FA66_do_explosive_impact(), _43F55F_get_billboard_light_level(), _43F5C8_get_point_light_level_with_respect_to_lights(), ViewingParams::_443365(), _45063B_spawn_some_monster(), _46E0B2_collide_against_decorations(), _46E44E_collide_against_faces_and_portals(), _46F04E_collide_against_portals(), AddBspNodeToRenderList(), BspRenderer::AddFaceToRenderList_d3d(), Player::AddVariable(), Actor::AI_RangedAttack(), Actor::AI_SpellAttack(), DecalBuilder::ApplyBloodsplatDecals_IndoorFace(), Actor::ApplyFineForKillingPeasant(), LightmapBuilder::ApplyLights_IndoorFace(), Actor::Arena_summon_actor(), ArenaFight(), Vis::BLV_CreateIntersectFacesVertexCoordList(), BLV_GetFloorLevel(), BLV_ProcessPartyActions(), BLV_UpdateDoors(), stru10::CalcPolygonLimits(), collide_against_floor(), collide_against_floor_approximate(), Player::CompareVariable(), SpriteObject::Create_Splash_Object(), IndoorCameraD3D::DebugDrawPortal(), Vis::DetermineFacetIntersection(), DoInteractionWithTopmostZObject(), Door_switch_animation(), Engine::Draw(), DrawBook_Map_sub(), Engine::DrawGUI(), RenderOpenGL::DrawIndoorPolygon(), Render::DrawIndoorSky(), Engine::DropHeldItem(), EventCastSpell(), Application::Game::EventLoop(), EventProcessor(), IndoorLocation::ExecDraw_d3d(), Actor::Explode(), FaceFlowTextureOffset(), GameUI_DrawMinimap(), GameUI_WritePointedObjectStatusString(), GetAlertStatus(), Actor::GetDirectionInfo(), Party::GetPartyReputation(), GetPortalScreenCoord(), Vis::is_part_of_selection(), IndoorCameraD3D::IsCulled(), Actor::MakeActorAIList_BLV(), Render::MakeScreenshot(), Engine::OnGameViewportClick(), OnMapLoad(), Chest::Open(), Vis::PickIndoorFaces_Keyboard(), Vis::PickIndoorFaces_Mouse(), AudioPlayer::PlaySound(), IndoorCameraD3D::PrepareAndDrawDebugOutline(), PrepareDrawLists_BLV(), PrepareToLoadBLV(), BLVRenderParams::Reset(), Engine::ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(), SaveGame(), Player::SetVariable(), SpawnEncounter(), MapInfo::SpawnRandomTreasure(), Actor::StealFrom(), sub_4070EF_prolly_detect_player(), sub_4075DB(), sub_407A1C(), Party::sub_421B2C_PlaceInInventory_or_DropPickedItem(), SpriteObject::sub_42F7EB_DropItemAt(), sub_4406BC(), sub_44861E_set_texture_indoor(), sub_44892E_set_faces_bit(), sub_44FA4C_spawn_light_elemental(), sub_450521_ProllyDropItemAt(), sub_475665(), sub_4B1447_party_fine(), Player::SubtractVariable(), Actor::SummonMinion(), TempleDialog(), IndoorLocation::ToggleLight(), UpdateActors_BLV() и SpriteObject::UpdateObject_fn0_BLV().

◆ pBLVRenderParams

◆ uCurrentlyLoadedLevelType

LEVEL_TYPE uCurrentlyLoadedLevelType = LEVEL_null

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

Используется в CastSpellInfoHelpers::_427E01_cast_spell(), _43F55F_get_billboard_light_level(), _43F5C8_get_point_light_level_with_respect_to_lights(), ViewingParams::_443365(), Engine::_44EEA7(), _45063B_spawn_some_monster(), LightmapBuilder::_45BE86_build_light_polygon(), _494035_timed_effects__water_walking_damage__etc(), DecalBuilder::_49B790_build_decal_geometry(), Render::_4A4CC9_AddSomeBillboard(), Player::AddVariable(), Actor::AI_Pursue2(), Actor::AI_Pursue3(), Actor::AI_SpellAttack(), Actor::ApplyFineForKillingPeasant(), Actor::Arena_summon_actor(), ArenaFight(), Render::BeginSceneD3D(), ViewingParams::CenterOnPartyZoomIn(), CheckActors_proximity(), Player::CompareVariable(), Vis::DetermineFacetIntersection(), Vis::DoesRayIntersectBillboard(), DoInteractionWithTopmostZObject(), Engine::Draw(), DrawBook_Map_sub(), Render::DrawDecal(), Engine::DrawGUI(), Render::DrawLightmap(), Render::DrawProjectile(), EventCastSpell(), Application::Game::EventLoop(), FindBillboardsLightLevels_BLV(), GameUI_DrawMinimap(), GameUI_GetMinimapHintText(), GameUI_WritePointedObjectStatusString(), GetActorTintColor(), GetAlertStatus(), Actor::GetDirectionInfo(), IndoorCameraD3D::GetFarClip(), GetMapBookHintText(), IndoorCameraD3D::GetNearClip(), Party::GetPartyReputation(), IndoorCameraD3D::GetPickDepth(), GUIWindow_Transition::GUIWindow_Transition(), Vis::is_part_of_selection(), Render::MakeScreenshot(), MM7Initialization(), Engine::OnGameViewportClick(), OnMapLoad(), Chest::Open(), Engine::OutlineSelection(), Vis::PickKeyboard(), Vis::PickMouse(), AudioPlayer::PlaySound(), PrepareToLoadBLV(), PrepareToLoadODM(), PrepareToLoadRestUI(), Keyboard::ProcessInputActions(), IndoorCameraD3D::Project(), Engine::ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(), SaveGame(), Player::SetVariable(), SpawnEncounter(), Actor::StealFrom(), sub_4070EF_prolly_detect_player(), sub_407A1C(), sub_44861E_set_texture(), sub_44892E_set_faces_bit(), sub_44FA4C_spawn_light_elemental(), sub_4B1447_party_fine(), Player::SubtractVariable(), Actor::SummonMinion(), TempleDialog(), IndoorLocation::ToggleLight(), TrainingDialog(), UnprojectX(), UnprojectY(), Actor::UpdateActorAI(), UpdateObjects(), UpdateUserInput_and_MapSpecificStuff(), UseNPCSkill() и ParticleEngine::ViewProject_TrueIfStillVisible_BLV().

◆ Lights

◆ stru_F81018

stru337 stru_F81018

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

◆ stru_F8A590

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

◆ pBspRenderer

◆ stru_721530

◆ stru_F83B80

std::array<stru352, 480> stru_F83B80

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

◆ pDoorSoundIDsByLocationID

unsigned __int16 pDoorSoundIDsByLocationID[78]
Инициализатор
= {
300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 404, 302, 306, 308, 304, 308, 302, 400, 302, 300,
308, 308, 306, 308, 308, 304, 300, 404, 406, 300, 400, 406, 404,
306, 302, 408, 304, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 404, 304,
400, 300, 300, 404, 304, 400, 300, 300, 404, 304, 400, 300, 300}

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

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

◆ _4E6BDC_loc_names

std::array<const char *, 11> _4E6BDC_loc_names
Инициализатор
= {
"mdt12.blv", "d18.blv", "mdt14.blv", "d37.blv",
"mdk01.blv", "mdt01.blv", "mdr01.blv", "mdt10.blv",
"mdt09.blv", "mdt15.blv", "mdt11.blv"}

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

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

BLVFace::uPolygonType
PolygonType uPolygonType
Definition: Indoor.h:487
SpriteObject
Definition: SpriteObject.h:189
PARTY_FLAGS_1_FALLING
@ PARTY_FLAGS_1_FALLING
Definition: Party.h:58
LightsData::pDeltaUV
int pDeltaUV[2]
Definition: Indoor.h:25
BspRenderer_stru0::uViewportY
uint16_t uViewportY
Definition: Indoor.h:778
TE_MOVEMENT
@ TE_MOVEMENT
Definition: TurnEngine.h:22
DecorationDesc_mm6::DontDraw
bool DontDraw()
Definition: DecorationList.h:29
LightsStack_StationaryLight_::uNumLightsActive
unsigned int uNumLightsActive
Definition: Lights.h:65
stru367::_screen_space_y
std::array< int, 60 > _screen_space_y
Definition: stru367.h:14
fWalkSpeedMultiplier
float fWalkSpeedMultiplier
Definition: mm7_data.cpp:706
TE_ATTACK
@ TE_ATTACK
Definition: TurnEngine.h:21
BLVFace::Portal
bool Portal() const
Definition: Indoor.h:448
uNumActors
size_t uNumActors
Definition: Actor.cpp:39
DMGT_PHISYCAL
@ DMGT_PHISYCAL
Definition: Items.h:15
Party::vPosition
Vec3_int_ vPosition
Definition: Party.h:250
BLVDoor::Closed
@ Closed
Definition: Indoor.h:380
BSPModel::pVertices
struct BSPVertexBuffer pVertices
Definition: BSPModel.h:189
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
pLevelDecorations
std::array< LevelDecoration, 3000 > pLevelDecorations
Definition: Decoration.cpp:8
stru193_math::uIntegerDoublePi
static const unsigned int uIntegerDoublePi
Definition: OurMath.h:90
BLV_UpdateDoors
void BLV_UpdateDoors()
Definition: Indoor.cpp:1506
Party::uFallSpeed
int uFallSpeed
Definition: Party.h:259
uSpeakingCharacter
int uSpeakingCharacter
Definition: mm7_data.cpp:764
BspRenderer::uNumVisibleNotEmptySectors
unsigned int uNumVisibleNotEmptySectors
Definition: Indoor.h:818
Dying
@ Dying
Definition: Actor.h:79
BLVDoor::pZOffsets
uint16_t * pZOffsets
Definition: Indoor.h:400
int16_t
signed __int16 int16_t
Definition: SDL_config.h:36
BLVFace::uNumVertices
uint8_t uNumVertices
Definition: Indoor.h:488
Timer::uTimeElapsed
unsigned int uTimeElapsed
Definition: Time.h:133
SpriteObject::uFacing
unsigned __int16 uFacing
Definition: SpriteObject.h:220
Party::field_24
int field_24
Definition: Party.h:245
v
const GLdouble * v
Definition: SDL_opengl.h:2064
BLVFaceExtra
Definition: Indoor.h:496
MapStats::pInfos
MapInfo pInfos[77]
Definition: MapInfo.h:79
stru141_actor_collision_object::field_6C
int field_6C
Definition: Indoor.h:168
BLVDoor::pDeltaVs
int16_t * pDeltaVs
Definition: Indoor.h:397
DecorationList::GetDecoration
DecorationDesc * GetDecoration(unsigned int index)
Definition: DecorationList.h:65
Party::GetPlayingTime
GameTime & GetPlayingTime()
Definition: Party.h:230
stru193_math::uDoublePiMask
static const unsigned int uDoublePiMask
Definition: OurMath.h:91
fixed::Raw
static fixed Raw(int value)
Definition: OurMath.h:31
Actor::AI_StandOrBored
static void AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, struct AIDirection *a4)
Definition: Actor.cpp:1100
GameTime::GetDays
int GetDays() const
Definition: Time.h:32
BLVFace::pFacePlane_old
struct Plane_int_ pFacePlane_old
Definition: Indoor.h:471
PARTY_StrafeLeft
@ PARTY_StrafeLeft
Definition: Party.h:98
Lights
LightsData Lights
Definition: Indoor.cpp:54
Vec2::x
T x
Definition: VectorTypes.h:12
TeleportToStartingPoint
void TeleportToStartingPoint(MapStartPoint point)
Definition: MapInfo.cpp:308
fTurnSpeedMultiplier
float fTurnSpeedMultiplier
Definition: mm7_data.cpp:708
BspRenderer::num_faces
unsigned int num_faces
Definition: Indoor.h:812
SPEECH_63
@ SPEECH_63
Definition: Player.h:109
BSPModel::vPosition
Vec3_int_ vPosition
Definition: BSPModel.h:173
BspRenderer_PortalViewportData::viewport_right_side
int16_t viewport_right_side[480]
Definition: Indoor.h:760
IndoorLocation::pSectors
struct BLVSector * pSectors
Definition: Indoor.h:634
CHARACTER_EXPRESSION_SCARED
@ CHARACTER_EXPRESSION_SCARED
Definition: Player.h:385
OutdoorLocation::pBModels
BSPModelList pBModels
Definition: Outdoor.h:119
pSpriteObjects
std::array< SpriteObject, MAX_SPRITE_OBJECTS > pSpriteObjects
Definition: SpriteObject.cpp:34
BspRenderer_stru0::PortalScreenData
BspRenderer_PortalViewportData PortalScreenData
Definition: Indoor.h:782
stru141_actor_collision_object::speed
int speed
Definition: Indoor.h:166
PARTY_LookDown
@ PARTY_LookDown
Definition: Party.h:103
BLVFace::pVertexIDs
uint16_t * pVertexIDs
Definition: Indoor.h:476
BLVDoor::pFaceIDs
uint16_t * pFaceIDs
Definition: Indoor.h:394
PARTY_FLAGS_1_BURNING
@ PARTY_FLAGS_1_BURNING
Definition: Party.h:63
DecorationDesc::uColoredLightRed
uint8_t uColoredLightRed
Definition: DecorationList.h:50
BSPNode::uCoplanarOffset
int16_t uCoplanarOffset
Definition: BSPModel.h:45
OBJECT_Item
@ OBJECT_Item
Definition: Actor.h:66
ai_arrays_size
int ai_arrays_size
Definition: mm7_data.cpp:503
uNumBillboardsToDraw
unsigned int uNumBillboardsToDraw
Definition: RenderOpenGL.cpp:55
ItemsTable::SetSpecialBonus
void SetSpecialBonus(ItemGen *pItem)
Definition: Items.cpp:472
stru141_actor_collision_object::uSectorID
unsigned int uSectorID
Definition: Indoor.h:170
Party::sRotationX
int sRotationX
Definition: Party.h:252
IndoorLocation::pSpawnPoints
struct SpawnPointMM7 * pSpawnPoints
Definition: Indoor.h:647
collide_against_floor_approximate
int collide_against_floor_approximate(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID)
Definition: Indoor.cpp:5667
BspRenderer::AddFaceToRenderList_d3d
void AddFaceToRenderList_d3d(unsigned int node_id, unsigned int uFaceID)
Definition: Indoor.cpp:584
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:407
BLVRenderParams::Reset
void Reset()
Definition: Indoor.cpp:163
FindBillboardsLightLevels_BLV
void FindBillboardsLightLevels_BLV()
Definition: Indoor.cpp:5654
pBLVRenderParams
BLVRenderParams * pBLVRenderParams
Definition: Indoor.cpp:50
Party::FeatherFallActive
bool FeatherFallActive()
Definition: Party.h:214
PlayerSpeechID
enum PlayerSpeech PlayerSpeechID
Definition: Player.cpp:48
fixpoint_div
__int64 fixpoint_div(int a1, int a2)
Definition: OurMath.cpp:147
MapStats::GetMapInfo
MAP_TYPE GetMapInfo(const String &Str2)
Definition: MapInfo.cpp:225
GameUI_StatusBar_NothingHere
void GameUI_StatusBar_NothingHere()
Definition: UIStatusBar.cpp:57
Actor
Definition: Actor.h:151
SpriteObject::uSectorID
__int16 uSectorID
Definition: SpriteObject.h:223
Party::TorchLightLastIntensity
float TorchLightLastIntensity
Definition: Party.h:328
AudioPlayer::PlaySound
void PlaySound(SoundID eSoundID, int pid, unsigned int uNumRepeats, int x, int y, int a7)
Definition: AudioPlayer.cpp:195
POLYGON_InBetweenFloorAndWall
@ POLYGON_InBetweenFloorAndWall
Definition: Indoor.h:221
BBox_short_::x1
int16_t x1
Definition: VectorTypes.h:114
MonsterInfo::Hostility_Friendly
@ Hostility_Friendly
Definition: Monsters.h:111
BLVFace::pXInterceptDisplacements
int16_t * pXInterceptDisplacements
Definition: Indoor.h:477
engine
std::shared_ptr< Engine > engine
Definition: Engine.cpp:130
IndoorLocation::pFaceExtras
struct BLVFaceExtra * pFaceExtras
Definition: Indoor.h:632
DecorationInteraction
void DecorationInteraction(unsigned int id, unsigned int pid)
Definition: Viewport.cpp:271
Texture
Definition: Texture.h:4
stru193_math::uIntegerHalfPi
static const unsigned int uIntegerHalfPi
Definition: OurMath.h:89
RenderBillboard::dimming_level
uint16_t dimming_level
Definition: IRender.h:43
BLVFaceExtra::uEventID
uint16_t uEventID
Definition: Indoor.h:512
BSPModel::sBoundingRadius
int32_t sBoundingRadius
Definition: BSPModel.h:187
Actor::AI_FaceObject
static void AI_FaceObject(unsigned int uActorID, unsigned int uObjID, int UNUSED, struct AIDirection *Dir_In)
Definition: Actor.cpp:1072
bNoNPCHiring
char bNoNPCHiring
Definition: mm7_data.cpp:720
BLVDoor::uMoveLength
int uMoveLength
Definition: Indoor.h:390
BLVDoor::Opening
@ Opening
Definition: Indoor.h:381
Party::FlyActive
bool FlyActive()
Definition: Party.h:202
BspRenderer_stru0::uSectorID
uint16_t uSectorID
Definition: Indoor.h:776
SPEECH_46
@ SPEECH_46
Definition: Player.h:92
PARTY_WalkForward
@ PARTY_WalkForward
Definition: Party.h:100
ObjectList::ObjectIDByItemID
unsigned int ObjectIDByItemID(unsigned int uItemID)
Definition: ObjectList.cpp:7
BBox_short_::y1
int16_t y1
Definition: VectorTypes.h:116
UpdateObjects
void UpdateObjects()
Definition: Render.cpp:4955
Party::flt_TorchlightColorR
float flt_TorchlightColorR
Definition: Party.h:325
BLVSector::uNumNonBSPFaces
uint16_t uNumNonBSPFaces
Definition: Indoor.h:540
stru141_actor_collision_object::normal
Vec3_int_ normal
Definition: Indoor.h:159
BLVDoor::uOpenSpeed
int uOpenSpeed
Definition: Indoor.h:391
Party::pPlayers
std::array< Player, 4 > pPlayers
Definition: Party.h:310
BSPNode::uBack
int16_t uBack
Definition: BSPModel.h:44
SpawnPointMM7
Definition: Indoor.h:304
SpriteObject::uType
SPRITE_OBJECT_TYPE uType
Definition: SpriteObject.h:215
ACTOR_BUFF_SLOWED
@ ACTOR_BUFF_SLOWED
Definition: Actor.h:45
stru367::direction
bool direction
Definition: stru367.h:9
BLVDoor::uNumFaces
uint16_t uNumFaces
Definition: Indoor.h:402
POLYGON_Floor
@ POLYGON_Floor
Definition: Indoor.h:220
sub_4077F1
bool sub_4077F1(int a1, int a2, int a3, ODMFace *face, BSPVertexBuffer *a5)
Definition: Indoor.cpp:5486
OBJECT_Decoration
@ OBJECT_Decoration
Definition: Actor.h:69
BSPNode
Definition: BSPModel.h:42
SOUND_RunWaterIndoor
@ SOUND_RunWaterIndoor
Definition: AudioPlayer.h:32
pPlayers
NZIArray< struct Player *, 5 > pPlayers
Definition: Player.cpp:46
x1
GLuint GLfloat GLfloat GLfloat x1
Definition: SDL_opengl_glext.h:8586
SpriteObject::uSpriteFrameID
unsigned __int16 uSpriteFrameID
Definition: SpriteObject.h:224
BLVRenderParams::bsp_fov_rad
int bsp_fov_rad
Definition: Indoor.h:692
pIndoor
IndoorLocation * pIndoor
Definition: Indoor.cpp:49
Actor::_46DF1A_collide_against_actor
static bool _46DF1A_collide_against_actor(int a1, int a2)
Definition: Actor.cpp:2699
stru367::_screen_space_x
std::array< int, 60 > _screen_space_x
Definition: stru367.h:15
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
collide_against_floor
int collide_against_floor(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID)
Definition: Render.cpp:4711
PARTY_BUFF_TORCHLIGHT
@ PARTY_BUFF_TORCHLIGHT
Definition: Party.h:87
UpdateActors_BLV
void UpdateActors_BLV()
Definition: Indoor.cpp:1718
Plane_int_::vNormal
Vec3_int_ vNormal
Definition: VectorTypes.h:107
pTurnEngine
struct stru262_TurnBased * pTurnEngine
Definition: TurnEngine.cpp:21
Dead
@ Dead
Definition: Actor.h:80
SOUND_WalkWaterIndoor
@ SOUND_WalkWaterIndoor
Definition: AudioPlayer.h:54
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
pMapStats
struct MapStats * pMapStats
Definition: mm7_data.cpp:20
SpriteObject::uObjectDescID
unsigned __int16 uObjectDescID
Definition: SpriteObject.h:217
AIDirection
Definition: Actor.h:126
Party::pPartyBuffs
std::array< SpellBuff, 20 > pPartyBuffs
Definition: Party.h:309
AudioPlayer::StopAll
void StopAll(int sample_id)
Definition: AudioPlayer.cpp:189
OBJECT_Actor
@ OBJECT_Actor
Definition: Actor.h:67
BLVSector::uNumFloors
uint16_t uNumFloors
Definition: Indoor.h:524
Party::uFallStartY
int uFallStartY
Definition: Party.h:265
BLVRenderParams::uViewportZ
unsigned int uViewportZ
Definition: Indoor.h:698
fixed::FromInt
static fixed FromInt(int value)
Definition: OurMath.h:29
Party::uPartyHeight
unsigned int uPartyHeight
Definition: Party.h:237
IndoorLocation::uNumDoors
int uNumDoors
Definition: Indoor.h:637
_4E94D0_light_type
char _4E94D0_light_type
Definition: mm7_data.cpp:305
pItemsTable
struct ItemsTable * pItemsTable
Definition: Items.cpp:37
PARTY_FLAGS_1_LANDING
@ PARTY_FLAGS_1_LANDING
Definition: Party.h:62
GetAlertStatus
int GetAlertStatus()
Definition: Indoor.cpp:5287
MapInfo::SpawnRandomTreasure
int SpawnRandomTreasure(struct SpawnPointMM7 *a2)
Definition: MapInfo.cpp:240
OtherOverlayList::pOverlays
OtherOverlay pOverlays[50]
Definition: Overlays.h:36
y
EGLSurface EGLint EGLint y
Definition: SDL_egl.h:1596
IndoorLocation::Load
bool Load(const String &filename, int num_days_played, int respawn_interval_days, char *pDest)
Definition: Indoor.cpp:858
PARTY_LookUp
@ PARTY_LookUp
Definition: Party.h:102
BspRenderer_stru0::uViewportW
uint16_t uViewportW
Definition: Indoor.h:780
IndoorCameraD3D::vPartyPos
Vec3< int > vPartyPos
Definition: IndoorCameraD3D.h:253
BLVFace::Ethereal
bool Ethereal() const
Definition: Indoor.h:459
CURRENT_SCREEN::SCREEN_BRANCHLESS_NPC_DIALOG
@ SCREEN_BRANCHLESS_NPC_DIALOG
AddBspNodeToRenderList
void AddBspNodeToRenderList(unsigned int node_id)
Definition: Indoor.cpp:2970
Vec2::y
T y
Definition: VectorTypes.h:13
BLVSector::pFaceIDs
uint16_t * pFaceIDs
Definition: Indoor.h:541
BLVDoor::pDeltaUs
int16_t * pDeltaUs
Definition: Indoor.h:396
BspRenderer_PortalViewportData::_viewport_space_y
int _viewport_space_y
Definition: Indoor.h:753
stru141_actor_collision_object::field_0
int field_0
Definition: Indoor.h:151
SpriteObject::vPosition
struct Vec3_int_ vPosition
Definition: SpriteObject.h:218
DDM_DLV_Header::field_C_alert
int field_C_alert
Definition: Indoor.h:97
pParty
Party * pParty
Definition: Party.cpp:30
flt_6BE3AC_debug_recmod1_x_1_6
float flt_6BE3AC_debug_recmod1_x_1_6
Definition: mm7_data.cpp:718
_46ED8A_collide_against_sprite_objects
void _46ED8A_collide_against_sprite_objects(unsigned int _this)
Definition: Render.cpp:4732
BLVDoor::pXOffsets
uint16_t * pXOffsets
Definition: Indoor.h:398
BspRenderer_PortalViewportData::_viewport_space_z
int _viewport_space_z
Definition: Indoor.h:756
IndoorLocation::pNodes
struct BSPNode * pNodes
Definition: Indoor.h:640
BspRenderer_stru0::uFaceID
uint16_t uFaceID
Definition: Indoor.h:783
IndoorLocation::uNumSpawnPoints
unsigned int uNumSpawnPoints
Definition: Indoor.h:646
stru141_actor_collision_object::field_8_radius
int field_8_radius
Definition: Indoor.h:153
BLVFace::zCalc3
int zCalc3
Definition: Indoor.h:474
BLVRenderParams::uViewportW
unsigned int uViewportW
Definition: Indoor.h:699
LEVEL_DECORATION_INVISIBLE
@ LEVEL_DECORATION_INVISIBLE
Definition: Decoration.h:14
BspRenderer::nodes
BspRenderer_stru0 nodes[150]
Definition: Indoor.h:817
Party::bFlying
unsigned int bFlying
Definition: Party.h:266
Party::flt_TorchlightColorB
float flt_TorchlightColorB
Definition: Party.h:327
GetGravityStrength
unsigned int GetGravityStrength()
Definition: Engine.cpp:1500
stru141_actor_collision_object::normal2
Vec3_int_ normal2
Definition: Indoor.h:161
ITEM_ARTIFACT_LADYS_ESCORT
@ ITEM_ARTIFACT_LADYS_ESCORT
Definition: Items.h:189
ITEM_ARTIFACT_HERMES_SANDALS
@ ITEM_ARTIFACT_HERMES_SANDALS
Definition: Items.h:182
OBJECT_BModel
@ OBJECT_BModel
Definition: Actor.h:70
BLVSector::pPortals
uint16_t * pPortals
Definition: Indoor.h:538
x
EGLSurface EGLint x
Definition: SDL_egl.h:1596
BspRenderer_stru0::uViewportX
uint16_t uViewportX
Definition: Indoor.h:777
DecorationDesc_mm6::uLightRadius
int16_t uLightRadius
Definition: DecorationList.h:42
_43F55F_get_billboard_light_level
int _43F55F_get_billboard_light_level(RenderBillboard *a1, int uBaseLightLevel)
Definition: Render.cpp:4211
stru367::_view_transformed_x
std::array< int, 60 > _view_transformed_x
Definition: stru367.h:11
stru141_actor_collision_object::field_7C
int field_7C
Definition: Indoor.h:172
pGameLoadingUI_ProgressBar
GUIProgressBar * pGameLoadingUI_ProgressBar
Definition: GUIProgressBar.cpp:14
viewparams
struct ViewingParams * viewparams
Definition: mm7_data.cpp:22
ItemsTable::GenerateItem
void GenerateItem(int treasure_level, unsigned int uTreasureType, ItemGen *pItem)
Definition: Items.cpp:680
OS_GetTime
unsigned int OS_GetTime()
Definition: Lin.cpp:12
Disabled
@ Disabled
Definition: Actor.h:94
PARTY_FastTurnRight
@ PARTY_FastTurnRight
Definition: Party.h:114
PlayLevelMusic
void PlayLevelMusic()
Definition: AudioPlayer.cpp:377
MonsterInfo::uID
uint16_t uID
Definition: Monsters.h:169
BLVFaceExtra::sTextureDeltaV
int16_t sTextureDeltaV
Definition: Indoor.h:510
stru367::_view_transformed_y
std::array< int, 60 > _view_transformed_y
Definition: stru367.h:12
BLVDoor
Definition: Indoor.h:378
PARTY_TurnRight
@ PARTY_TurnRight
Definition: Party.h:97
check_event_triggers
void check_event_triggers()
Definition: Events.cpp:1215
BLVFace::uSectorID
uint16_t uSectorID
Definition: Indoor.h:484
BLVFace
Definition: Indoor.h:424
PARTY_CenterView
@ PARTY_CenterView
Definition: Party.h:104
ItemGen::uItemID
int uItemID
Definition: Items.h:326
BLVSector::uFirstBSPNode
int16_t uFirstBSPNode
Definition: Indoor.h:561
PARTY_RunBackward
@ PARTY_RunBackward
Definition: Party.h:112
stru123::_decor_events
std::array< unsigned char, 125 > _decor_events
Definition: stru123.h:8
Timer::dt_in_some_format
int dt_in_some_format
Definition: Time.h:134
v1
GLfloat GLfloat v1
Definition: SDL_opengl_glext.h:694
IndoorLocation::dlv
struct DDM_DLV_Header dlv
Definition: Indoor.h:648
Log::Warning
void Warning(const wchar_t *pFormat,...)
Definition: Log.cpp:28
stru141_actor_collision_object::field_70
int field_70
Definition: Indoor.h:169
BLV_ProcessPartyActions
void BLV_ProcessPartyActions()
Definition: Indoor.cpp:4655
fixpoint_mul
__int64 fixpoint_mul(int a1, int a2)
Definition: OurMath.cpp:138
stru141_actor_collision_object::height
int height
Definition: Indoor.h:154
pActors
std::array< Actor, 500 > pActors
Definition: Actor.cpp:38
BLVDoor::uState
State uState
Definition: Indoor.h:405
IndoorLocation::PrepareItemsRenderList_BLV
void PrepareItemsRenderList_BLV()
Definition: Indoor.cpp:2871
GUIProgressBar::Reset
void Reset(uint8_t uMaxProgress)
Definition: GUIProgressBar.cpp:78
SPEECH_64
@ SPEECH_64
Definition: Player.h:110
BLVRenderParams::uViewportCenterY
int uViewportCenterY
Definition: Indoor.h:705
uNumLevelDecorations
size_t uNumLevelDecorations
Definition: Decoration.cpp:9
BLVRenderParams::uViewportX
unsigned int uViewportX
Definition: Indoor.h:696
ActionQueue::Next
PartyAction Next()
Definition: Party.cpp:1204
Party::uFlags
unsigned int uFlags
Definition: Party.h:313
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
_46EF01_collision_chech_player
int _46EF01_collision_chech_player(int a1)
Definition: Render.cpp:4790
BspRenderer::pVisibleSectorIDs_toDrawDecorsActorsEtcFrom
uint16_t pVisibleSectorIDs_toDrawDecorsActorsEtcFrom[6]
Definition: Indoor.h:819
EQUIP_POTION
@ EQUIP_POTION
Definition: Items.h:241
BLVFace::zCalc2
int zCalc2
Definition: Indoor.h:473
Party::uWalkSpeed
unsigned int uWalkSpeed
Definition: Party.h:243
BLVSector::uNumPortals
int16_t uNumPortals
Definition: Indoor.h:536
LEVEL_Outdoor
@ LEVEL_Outdoor
Definition: Indoor.h:287
BspRenderer::num_nodes
unsigned int num_nodes
Definition: Indoor.h:816
BspRenderer_stru0
Definition: Indoor.h:767
pPartyActionQueue
struct ActionQueue * pPartyActionQueue
Definition: Party.cpp:32
BspRenderer_PortalViewportData::_viewport_space_x
int _viewport_space_x
Definition: Indoor.h:755
BLVSector::pFloors
uint16_t * pFloors
Definition: Indoor.h:526
MapInfo
Definition: MapInfo.h:35
BspRenderer_PortalViewportData::_viewport_z_maxID
int _viewport_z_maxID
Definition: Indoor.h:758
TE_WAIT
@ TE_WAIT
Definition: TurnEngine.h:20
pCurrentMapName
String pCurrentMapName
Definition: mm7_data.cpp:712
Removed
@ Removed
Definition: Actor.h:86
PortalFace
stru367 PortalFace
Definition: mm7_data.cpp:564
pPaletteManager
PaletteManager * pPaletteManager
Definition: PaletteManager.cpp:7
BLVDoor::uNumVertices
uint16_t uNumVertices
Definition: Indoor.h:401
BSPNode::uCoplanarSize
int16_t uCoplanarSize
Definition: BSPModel.h:46
ViewingParams::_443365
void _443365()
Definition: Viewport.cpp:177
BspRenderer_PortalViewportData::_viewport_x_minID
int _viewport_x_minID
Definition: Indoor.h:757
SpriteObject::InitializeSpriteObjects
static void InitializeSpriteObjects()
Definition: SpriteObject.cpp:898
BLVFace::pBounding
struct BBox_short_ pBounding
Definition: Indoor.h:486
t
GLdouble GLdouble t
Definition: SDL_opengl.h:2071
BspRenderer_PortalViewportData::viewport_left_side
int16_t viewport_left_side[480]
Definition: Indoor.h:759
OutdoorLocation::ddm
struct DDM_DLV_Header ddm
Definition: Outdoor.h:131
blv_prev_party_y
int blv_prev_party_y
Definition: mm7_data.cpp:739
BLVDoor::pVertexIDs
uint16_t * pVertexIDs
Definition: Indoor.h:393
LEVEL_Indoor
@ LEVEL_Indoor
Definition: Indoor.h:286
IndoorCameraD3D::ApplyViewTransform_TrueIfStillVisible_BLV
bool ApplyViewTransform_TrueIfStillVisible_BLV(int x, int y, int z, fixed *pOutX, fixed *pOutZ, fixed *pOutY, bool clip_plane_test)
Definition: IndoorCameraD3D.cpp:88
Plane_int_::dist
int dist
Definition: VectorTypes.h:108
_46E44E_collide_against_faces_and_portals
int _46E44E_collide_against_faces_and_portals(unsigned int b1)
Definition: Render.cpp:4350
_6807E0_num_decorations_with_sounds_6807B8
int _6807E0_num_decorations_with_sounds_6807B8
Definition: mm7_data.cpp:686
SpriteObject::Create
int Create(int yaw, int pitch, int a4, int a5)
Definition: SpriteObject.cpp:56
SpriteObject::containing_item
struct ItemGen containing_item
Definition: SpriteObject.h:227
PARTY_TurnLeft
@ PARTY_TurnLeft
Definition: Party.h:96
SOUND_RunCarpet
@ SOUND_RunCarpet
Definition: AudioPlayer.h:23
SPRITE_OBJECT_TYPE
SPRITE_OBJECT_TYPE
Definition: SpriteObject.h:5
OBJECT_Player
@ OBJECT_Player
Definition: Actor.h:68
Party::bTurnBasedModeOn
bool bTurnBasedModeOn
Definition: Party.h:305
Summoned
@ Summoned
Definition: Actor.h:92
BLVRenderParams::uPartySectorID
int uPartySectorID
Definition: Indoor.h:681
PaletteManager::RecalculateAll
void RecalculateAll()
Definition: PaletteManager.cpp:784
BspRenderer_PortalViewportData::GetViewportData
void GetViewportData(int16_t x, int y, int16_t z, int w)
Definition: Indoor.cpp:3181
uNumDecorationsDrawnThisFrame
int uNumDecorationsDrawnThisFrame
Definition: RenderOpenGL.cpp:53
PARTY_BUFF_INVISIBILITY
@ PARTY_BUFF_INVISIBILITY
Definition: Party.h:82
_4D864C_force_sw_render_rules
char _4D864C_force_sw_render_rules
Definition: mm7_data.cpp:208
BLVDoor::vDirection
Vec3_int_ vDirection
Definition: Indoor.h:389
LightsStack_MobileLight_::uNumLightsActive
unsigned int uNumLightsActive
Definition: Lights.h:88
OtherOverlay::field_E
int16_t field_E
Definition: Overlays.h:18
BspRenderer_stru0::viewing_portal_id
unsigned int viewing_portal_id
Definition: Indoor.h:785
dword_4F8580
std::array< int, 182 > dword_4F8580
Definition: mm7_data.cpp:506
BLVFace::pYInterceptDisplacements
int16_t * pYInterceptDisplacements
Definition: Indoor.h:478
uNumSpriteObjects
size_t uNumSpriteObjects
Definition: SpriteObject.cpp:33
BLVFace::resource
void * resource
Definition: Indoor.h:483
SOUND_WalkCarpet
@ SOUND_WalkCarpet
Definition: AudioPlayer.h:45
BLVFace::Pressure_Plate
bool Pressure_Plate() const
Definition: Indoor.h:456
stru367::_view_transformed_z
std::array< int, 48 > _view_transformed_z
Definition: stru367.h:13
ActionQueue::uNumActions
unsigned int uNumActions
Definition: Party.h:128
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
stru193_math::Atan2
unsigned int Atan2(int x, int y)
Definition: OurMath.cpp:46
pOtherOverlayList
struct OtherOverlayList * pOtherOverlayList
Definition: Overlays.cpp:19
BLVFaceExtra::sTextureDeltaU
int16_t sTextureDeltaU
Definition: Indoor.h:509
sub_4088E9
int sub_4088E9(int x1, int y1, int x2, int y2, int x3, int y3)
Definition: Indoor.cpp:5277
sub_4406BC
void sub_4406BC(unsigned int node_id, unsigned int uFirstNode)
Definition: Indoor.cpp:2987
stru141_actor_collision_object::field_84
int field_84
Definition: Indoor.h:174
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
Party::field_14_radius
int field_14_radius
Definition: Party.h:241
x2
GLfixed GLfixed x2
Definition: SDL_opengl_glext.h:4586
stru141_actor_collision_object::prolly_normal_d
int prolly_normal_d
Definition: Indoor.h:152
blv_prev_party_x
int blv_prev_party_x
Definition: mm7_data.cpp:737
BLVSector::pDecorationIDs
uint16_t * pDecorationIDs
Definition: Indoor.h:550
BLVSector::uNumFaces
uint16_t uNumFaces
Definition: Indoor.h:539
flt_6BE150_look_up_down_dangle
float flt_6BE150_look_up_down_dangle
Definition: mm7_data.cpp:709
BLVDoor::pYOffsets
uint16_t * pYOffsets
Definition: Indoor.h:399
DecorationDesc_mm6::uSoundID
int16_t uSoundID
Definition: DecorationList.h:45
v2
GLfloat GLfloat GLfloat v2
Definition: SDL_opengl_glext.h:695
flt_6BE3A4_debug_recmod1
float flt_6BE3A4_debug_recmod1
Definition: mm7_data.cpp:716
ANIM_Walking
@ ANIM_Walking
Definition: Actor.h:100
integer_sqrt
int integer_sqrt(int val)
Definition: OurMath.cpp:164
SOUND_RunWood
@ SOUND_RunWood
Definition: AudioPlayer.h:33
uint
unsigned int uint
Definition: MM7.h:4
BLVDoor::Closing
@ Closing
Definition: Indoor.h:383
sub_4075DB
bool sub_4075DB(int x, int y, int z, BLVFace *face)
Definition: Indoor.cpp:5424
uActiveCharacter
unsigned int uActiveCharacter
Definition: mm7_data.cpp:555
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)
Fleeing
@ Fleeing
Definition: Actor.h:82
BLVFace::Fluid
bool Fluid() const
Definition: Indoor.h:449
Actor::AI_Flee
static void AI_Flee(unsigned int uActorID, signed int edx0, int uActionLength, struct AIDirection *a4)
Definition: Actor.cpp:2070
DecorationDesc_mm6::uDecorationHeight
uint16_t uDecorationHeight
Definition: DecorationList.h:40
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4586
BLVRenderParams::uViewportCenterX
int uViewportCenterX
Definition: Indoor.h:704
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
PARTY_BUFF_FLY
@ PARTY_BUFF_FLY
Definition: Party.h:78
OBJECT_BLVDoor
@ OBJECT_BLVDoor
Definition: Actor.h:65
BLVDoor::uAttributes
unsigned int uAttributes
Definition: Indoor.h:386
y2
GLfixed GLfixed GLfixed y2
Definition: SDL_opengl_glext.h:4586
DecorationList::InitializeDecorationSprite
void InitializeDecorationSprite(unsigned int uDecID)
Definition: DecorationList.cpp:45
uNumSpritesDrawnThisFrame
int uNumSpritesDrawnThisFrame
Definition: RenderOpenGL.cpp:56
SpawnPointMM7::vPosition
Vec3_int_ vPosition
Definition: Indoor.h:314
stru193_math::Cos
int Cos(int angle)
Definition: OurMath.cpp:28
Party::TorchlightActive
bool TorchlightActive()
Definition: Party.h:199
stru_5C6E00
struct stru193_math * stru_5C6E00
Definition: mm7_data.cpp:19
ODM_GetFloorLevel
int ODM_GetFloorLevel(int X, signed int Y, int Z, int __unused, bool *pIsOnWater, int *bmodel_pid, int bWaterWalk)
Definition: Outdoor.cpp:1877
Party::walk_sound_timer
int walk_sound_timer
Definition: Party.h:263
angle
GLfloat angle
Definition: SDL_opengl_glext.h:6100
ViewingParams::bRedrawGameUI
int bRedrawGameUI
Definition: Viewport.h:74
ActorInteraction
bool ActorInteraction(unsigned int id)
Definition: Viewport.cpp:250
BSPVertexBuffer::pVertices
Vec3_int_ * pVertices
Definition: BSPModel.h:53
dword_6BE364_game_settings_1
int dword_6BE364_game_settings_1
Definition: mm7_data.cpp:714
IndoorLocation::pVertices
struct Vec3_short_ * pVertices
Definition: Indoor.h:628
stru367
Definition: stru367.h:8
DecorationDesc
Definition: DecorationList.h:49
SoundID
SoundID
Definition: AudioPlayer.h:10
pBillboardRenderList
RenderBillboard pBillboardRenderList[500]
Definition: RenderOpenGL.cpp:54
EventProcessor
void EventProcessor(int uEventID, int targetObj, int canShowMessages, int entry_line)
Definition: Events.cpp:260
PARTY_Jump
@ PARTY_Jump
Definition: Party.h:107
uCurrentlyLoadedLevelType
LEVEL_TYPE uCurrentlyLoadedLevelType
Definition: Indoor.cpp:52
stru_721530
stru141_actor_collision_object stru_721530
Definition: Indoor.cpp:58
Is_out15odm_underwater
char Is_out15odm_underwater()
Definition: Outdoor.cpp:3377
blv_prev_party_z
int blv_prev_party_z
Definition: mm7_data.cpp:738
IndoorLocation::GetSector
int GetSector(int sX, int sY, int sZ)
Definition: Indoor.cpp:1279
IndoorLocation::pFaces
struct BLVFace * pFaces
Definition: Indoor.h:630
uLevel_StartingPointType
MapStartPoint uLevel_StartingPointType
Definition: Outdoor.cpp:46
stru193_math::Sin
int Sin(int angle)
Definition: OurMath.cpp:133
LightsStack_StationaryLight_::AddLight
bool AddLight(int16_t x, int16_t y, int16_t z, int16_t a5, unsigned char r, unsigned char g, unsigned char b, char uLightType)
Definition: LightsStack.cpp:30
pAudioPlayer
AudioPlayer * pAudioPlayer
Definition: AudioPlayer.cpp:20
BSPNode::uFront
int16_t uFront
Definition: BSPModel.h:43
SpawnEncounter
void SpawnEncounter(MapInfo *pMapInfo, SpawnPointMM7 *spawn, int a3, int a4, int a5)
Definition: Actor.cpp:5063
stru141_actor_collision_object::CalcMovementExtents
int CalcMovementExtents(int a2)
Definition: Indoor.cpp:5697
BSPModel
Definition: BSPModel.h:163
fixed
Definition: OurMath.h:21
BLVSector
Definition: Indoor.h:522
Party::floor_face_pid
int floor_face_pid
Definition: Party.h:262
offset
GLintptr offset
Definition: SDL_opengl_glext.h:541
logger
Log * logger
Definition: IocContainer.cpp:47
PlayerSpeech
PlayerSpeech
Definition: Player.h:46
pMobileLightsStack
LightsStack_MobileLight_ * pMobileLightsStack
Definition: LightmapBuilder.cpp:14
Actor::PrepareSprites
void PrepareSprites(char load_sounds_if_bit1_set)
Definition: Actor.cpp:2481
stru_5E4C90_MapPersistVars
stru123 stru_5E4C90_MapPersistVars
Definition: mm7_data.cpp:23
BspRenderer::MakeVisibleSectorList
void MakeVisibleSectorList()
Definition: Indoor.cpp:3692
BLVDoor::uDoorID
unsigned int uDoorID
Definition: Indoor.h:387
res
GLuint res
Definition: SDL_opengl_glext.h:7940
RespawnGlobalDecorations
void RespawnGlobalDecorations()
Definition: DecorationList.cpp:70
DecorationDesc::uColoredLightBlue
uint8_t uColoredLightBlue
Definition: DecorationList.h:52
pOutdoor
OutdoorLocation * pOutdoor
Definition: Outdoor.cpp:48
SOUND_WalkWood
@ SOUND_WalkWood
Definition: AudioPlayer.h:55
BspRenderer_PortalViewportData::_viewport_space_w
int _viewport_space_w
Definition: Indoor.h:754
GUIProgressBar::Progress
void Progress()
Definition: GUIProgressBar.cpp:83
BLVSector::field_0
int32_t field_0
Definition: Indoor.h:523
PaletteManager::pPalette_tintColor
unsigned char pPalette_tintColor[3]
Definition: PaletteManager.h:36
MapInfo::uRespawnIntervalDays
unsigned int uRespawnIntervalDays
Definition: MapInfo.h:45
SpawnPointMM7::uIndex
uint16_t uIndex
Definition: Indoor.h:317
pDoorSoundIDsByLocationID
unsigned __int16 pDoorSoundIDsByLocationID[78]
Definition: Indoor.cpp:61
_A750D8_player_speech_timer
int64_t _A750D8_player_speech_timer
Definition: mm7_data.cpp:763
IndoorLocation::PrepareDecorationsRenderList_BLV
void PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID)
Definition: Indoor.cpp:3042
SpriteObject::uAttributes
unsigned __int16 uAttributes
Definition: SpriteObject.h:222
BLVSector::uNumDecorations
uint16_t uNumDecorations
Definition: Indoor.h:548
pIndoorCameraD3D
IndoorCameraD3D * pIndoorCameraD3D
Definition: IndoorCameraD3D.cpp:21
_46E0B2_collide_against_decorations
void _46E0B2_collide_against_decorations()
Definition: Render.cpp:4855
Actor::pMonsterInfo
struct MonsterInfo pMonsterInfo
Definition: Actor.h:292
ai_near_actors_ids
std::array< unsigned int, 500 > ai_near_actors_ids
Definition: mm7_data.cpp:505
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1112
stru141_actor_collision_object::position
Vec3_int_ position
Definition: Indoor.h:160
_6807B8_level_decorations_ids
std::array< int, 777 > _6807B8_level_decorations_ids
Definition: mm7_data.cpp:685
_46F04E_collide_against_portals
int _46F04E_collide_against_portals()
Definition: Render.cpp:4895
PARTY_WalkBackward
@ PARTY_WalkBackward
Definition: Party.h:101
uint32_t
unsigned __int32 uint32_t
Definition: SDL_config.h:39
BLVRenderParams::uViewportY
unsigned int uViewportY
Definition: Indoor.h:697
PARTY_FastTurnLeft
@ PARTY_FastTurnLeft
Definition: Party.h:113
stru141_actor_collision_object::velocity
Vec3_int_ velocity
Definition: Indoor.h:158
BspRenderer_stru0::uViewportZ
uint16_t uViewportZ
Definition: Indoor.h:779
IndoorLocation::PrepareActorRenderList_BLV
void PrepareActorRenderList_BLV()
Definition: Indoor.cpp:2739
ItemInteraction
void ItemInteraction(unsigned int item_id)
Definition: Viewport.cpp:224
BLV_GetFloorLevel
int BLV_GetFloorLevel(int x, int y, int z, unsigned int uSectorID, unsigned int *pFaceID)
Definition: Indoor.cpp:2530
Party::sRotationY
int sRotationY
Definition: Party.h:251
BLVDoor::Open
@ Open
Definition: Indoor.h:382
stru262_TurnBased::turn_stage
int turn_stage
Definition: TurnEngine.h:75
EQUIP_BOOTS
@ EQUIP_BOOTS
Definition: Items.h:236
IndoorLocation::pDoors
struct BLVDoor * pDoors
Definition: Indoor.h:638
PrepareBspRenderList_BLV
void PrepareBspRenderList_BLV()
Definition: Indoor.cpp:3159
LightsStack_MobileLight_::AddLight
bool AddLight(int16_t x, int16_t y, int16_t z, int16_t uSectorID, int uRadius, uint8_t r, uint8_t g, uint8_t b, char a10)
Definition: LightsStack.cpp:6
POLYGON_Ceiling
@ POLYGON_Ceiling
Definition: Indoor.h:222
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
PARTY_RunForward
@ PARTY_RunForward
Definition: Party.h:111
Pursuing
@ Pursuing
Definition: Actor.h:81
BLVFace::uAttributes
unsigned int uAttributes
Definition: Indoor.h:475
DecorationDesc::uColoredLightGreen
uint8_t uColoredLightGreen
Definition: DecorationList.h:51
Actor::InitializeActors
static void InitializeActors()
Definition: Actor.cpp:3334
dword_6BE13C_uCurrentlyLoadedLocationID
int dword_6BE13C_uCurrentlyLoadedLocationID
Definition: mm7_data.cpp:705
Vec3::z
T z
Definition: VectorTypes.h:27
pObjectList
struct ObjectList * pObjectList
Definition: ObjectList.cpp:5
ItemsTable::pItems
NZIArray< ItemDesc, 800 > pItems
Definition: Items.h:460
BLVDoor::uTimeSinceTriggered
unsigned int uTimeSinceTriggered
Definition: Indoor.h:388
Party::flt_TorchlightColorG
float flt_TorchlightColorG
Definition: Party.h:326
PARTY_StrafeRight
@ PARTY_StrafeRight
Definition: Party.h:99
pDecorationList
struct DecorationList * pDecorationList
Definition: DecorationList.cpp:11
fBackwardWalkSpeedMultiplier
float fBackwardWalkSpeedMultiplier
Definition: mm7_data.cpp:707
BLVDoor::uCloseSpeed
int uCloseSpeed
Definition: Indoor.h:392
stru141_actor_collision_object::pid
unsigned int pid
Definition: Indoor.h:171
BLVFace::uFaceExtraID
uint16_t uFaceExtraID
Definition: Indoor.h:482
BLVFace::zCalc1
int zCalc1
Definition: Indoor.h:472
pBspRenderer
BspRenderer * pBspRenderer
Definition: Indoor.cpp:57
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52