Add WMO portal culling infrastructure and fix single-player character flow

Portal-based visibility culling for WMO rendering (disabled by default,
needs debugging for complex WMOs like Stormwind). Skip character creation
screen when characters already exist in single-player mode.
This commit is contained in:
Kelsi 2026-02-05 15:31:00 -08:00
parent 669d89c108
commit 77a21609a8
6 changed files with 262 additions and 3 deletions

View file

@ -356,6 +356,21 @@ WMOModel WMOLoader::load(const std::vector<uint8_t>& wmoData) {
break;
}
case MOPR: {
// Portal references - links groups via portals
uint32_t nRefs = chunkSize / 8; // Each reference is 8 bytes
for (uint32_t i = 0; i < nRefs; i++) {
WMOPortalRef ref;
ref.portalIndex = read<uint16_t>(wmoData, offset);
ref.groupIndex = read<uint16_t>(wmoData, offset);
ref.side = read<int16_t>(wmoData, offset);
ref.padding = read<uint16_t>(wmoData, offset);
model.portalRefs.push_back(ref);
}
core::Logger::getInstance().info("WMO portal refs: ", model.portalRefs.size());
break;
}
default:
// Unknown chunk, skip it
break;