This commit is contained in:
GabsPuNs
2026-06-05 16:05:55 -04:00
parent d6e58df26d
commit 8bea50b1e5
29 changed files with 162 additions and 1670 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;
}