This commit is contained in:
GabsPuNs
2026-06-05 16:05:55 -04:00
parent 77ad7e0e90
commit 22a1aa3a74
29 changed files with 160 additions and 1668 deletions

View File

@@ -272,7 +272,7 @@ LevelChunk *HellRandomLevelSource::getChunk(int xOffs, int zOffs)
// 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed
int blocksSize = Level::genDepth * 16 * 16;
BYTE *tileData = static_cast<BYTE *>(XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE));
BYTE *tileData = static_cast<BYTE *>(malloc(blocksSize));
XMemSet128(tileData,0,blocksSize);
byteArray blocks = byteArray(tileData,blocksSize);
// byteArray blocks = byteArray(16 * level->depth * 16);
@@ -287,7 +287,7 @@ LevelChunk *HellRandomLevelSource::getChunk(int xOffs, int zOffs)
// Also now need to free the passed in blocks as the LevelChunk doesn't use the passed in allocation anymore.
LevelChunk *levelChunk = new LevelChunk(level, blocks, xOffs, zOffs);
levelChunk->setCheckAllLight();
XPhysicalFree(tileData);
free(tileData);
return levelChunk;
}