Files
SatyandClaude Opus 5.5 6a3666e4b6 Port run-83 hit stand-ins and fix phantom terrain walls blocking movement
- Fix CMap::GetChunkFacets: impassable test uses the chunk MapObjFlag
  (MAPOBJ_FLAG_IMPASSABLE at +0xC) like 12340, not MCNK header flag 0x40
  (vertex colours). Most chunks got 32000-high wall facets, so the player
  could jump but not walk.
- Ship paths: GetPosition, path time, accel/decel distance, roll/pitch.
- Transports: Transport::UpdateMovement, CollideWithTransport, owner matrix.
- Map objects: IsAllLoaded, footprints, TriData query chain (QueryTris,
  GetTrisTerrain/Chunk, GetTriSubchunk, QueryTrisMapObjDefs),
  QueryIntersectingModels.
- Water ripples, projected-texture shadow drawing (shadow.cpp).
- World states, LFG best random dungeon, quest POI, ComSat session lookup,
  blood record, virtual items, guild roster query.
- Logout path: tradeskill close, LCD, DBCache_ClearPending, chat/macro/
  saved-variable/account-data saving, tracked quests/achievements/
  tutorials, UnloadAddOns, SaveAddOnEnableState, ~CGWorldFrame,
  SmartScreenRectShutdown.
- Fixes: TriData batch heights stored as float* (was truncating uint32 on
  x64), TimeInRange is a ShipPath member, ComSat lookup takes the session
  type, roll/pitch names swapped in MapObjTransport::UpdateMovement,
  removed windows.h from Object/Passenger.h.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-01 15:33:24 +02:00

90 lines
2.5 KiB
C++

#include "FVBBList.h"
#include "Engine/Source/Gx/CGxDevice/CGxDevice.h"
#include "Engine/Source/Gx/CGxBuf.h"
#include "Engine/Source/Gx/CGxPool.h"
// VERIFY: 931e6f81 manual
// OFFSET: 0x007D55B0
void FVBBList::Release(Block* block) {
if (!block) {
return;
}
*block->m_owner = nullptr;
block->m_owner = nullptr;
block->m_link.Unlink();
this->m_blocks.LinkToTail(block);
}
// VERIFY: 59fe6fba manual
// OFFSET: 0x007D58B0
void FVBBList::Initialize(EGxPoolTarget target, EGxPoolUsage usage, uint32_t itemSize, uint32_t itemCount, uint32_t blockCount) {
this->m_blockSize = itemSize * itemCount;
this->m_pool = g_theGxDevicePtr->PoolCreate(target, usage, blockCount * this->m_blockSize, GxPoolHintBit_Unk2, target ? "FVBBList_idx" : "FVBBList_vtx");
for (uint32_t i = 0; i < blockCount; i++) {
Block* block = this->m_blocks.NewNode(2, 0, 0);
block->m_buf = g_theGxDevicePtr->BufCreate(this->m_pool, itemSize, itemCount, i * this->m_blockSize);
}
}
// VERIFY: 7f2e6e9c manual
// OFFSET: 0x007D5D50
void FVBBList::Destroy() {
Block* block = this->m_blocks.Head();
while (!this->m_blocks.IsEnd(block)) {
Block* next = this->m_blocks.RawNext(block);
CGxBuf* buf = block->m_buf;
if (buf && buf != g_theGxDevicePtr->BufStream(buf->m_pool->m_target, 0, 0)) {
g_theGxDevicePtr->BufDestroy(buf);
}
this->m_blocks.DeleteNode(block);
block = next;
}
if (this->m_pool) {
g_theGxDevicePtr->PoolDestroy(this->m_pool);
}
}
// VERIFY: 8a1a34ab manual
// OFFSET: 0x007D5540
FVBBList::Block* FVBBList::AllocBlock(Block** owner) {
Block* block = this->m_blocks.Head();
block->m_link.Unlink();
this->m_usedBlocks.LinkToTail(block);
block->m_buf->unk_001C = 0;
block->m_owner = owner;
return block;
}
// VERIFY: c47a50ff manual
// OFFSET: 0x007D5DE0
void FVBBList::AcquireBlock(Block** owner) {
if (!this->m_blocks.Head()) {
Block* oldest = this->m_usedBlocks.Head();
Block* newest = this->m_usedBlocks.Head();
for (Block* block = this->m_usedBlocks.Head(); block; block = this->m_usedBlocks.Next(block)) {
if (block->unk_0008 < oldest->unk_0008) {
oldest = block;
}
if (block->unk_0008 > newest->unk_0008) {
newest = block;
}
}
if (newest->unk_0008 - oldest->unk_0008 <= 10) {
return;
}
this->Release(oldest);
}
*owner = this->AllocBlock(owner);
}