mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-06-08 11:03:14 +00:00
Cleanups
This commit is contained in:
@@ -468,7 +468,7 @@ LevelChunk *RandomLevelSource::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);
|
||||
@@ -507,7 +507,7 @@ LevelChunk *RandomLevelSource::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);
|
||||
|
||||
return levelChunk;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user