refactor: deduplicate terrain grid lookup logic, remove unnecessary cast

Add IsValidForSceneLookup(), GetSceneIDAtGrid(), and GridToWorldPos()
to Raw::Chunk. Use them in GenerateTerrainMesh, GetSceneIDFromPosition,
SpawnScenePoints, and SpawnAllScenePoints instead of duplicated inline
math. Remove unnecessary static_cast in LoadSceneTransitionInfo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-06-24 18:38:23 -05:00
parent feeaf339d4
commit 0eeb5b0285
5 changed files with 58 additions and 124 deletions

View File

@@ -397,7 +397,7 @@ SceneTransitionInfo Zone::LoadSceneTransitionInfo(std::istream& file) {
uint32_t sceneID, layerID;
BinaryIO::BinaryRead(file, sceneID);
BinaryIO::BinaryRead(file, layerID);
info.sceneID = LWOSCENEID(static_cast<int32_t>(sceneID), layerID);
info.sceneID = LWOSCENEID(sceneID, layerID);
BinaryIO::BinaryRead(file, info.position);
return info;
}