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

@@ -69,7 +69,7 @@ LevelChunk *FlatLevelSource::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 chunksSize = Level::genDepth * 16 * 16;
BYTE *tileData = static_cast<BYTE *>(XPhysicalAlloc(chunksSize, MAXULONG_PTR, 4096, PAGE_READWRITE));
BYTE *tileData = static_cast<BYTE *>(malloc(chunksSize));
XMemSet128(tileData,0,chunksSize);
byteArray blocks = byteArray(tileData,chunksSize);
// byteArray blocks = byteArray(16 * level->depth * 16);
@@ -87,7 +87,7 @@ LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs)
// 4J - this now creates compressed block data from the blocks array passed in, so moved it until after the blocks are actually finalised. We 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);
XPhysicalFree(tileData);
free(tileData);
levelChunk->recalcHeightmap();