mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-06 01:54:51 +01:00
Chunk: zero data buffers to avoid using unitialized data
This commit is contained in:
parent
f8a66ee6b6
commit
22bc6db52a
1 changed files with 3 additions and 0 deletions
|
@ -117,7 +117,10 @@ void Chunk::analyzeChunk() {
|
||||||
blockSkyLight.reset(new uint8_t[maxY * SIZE * SIZE / 2]);
|
blockSkyLight.reset(new uint8_t[maxY * SIZE * SIZE / 2]);
|
||||||
blockBlockLight.reset(new uint8_t[maxY * SIZE * SIZE / 2]);
|
blockBlockLight.reset(new uint8_t[maxY * SIZE * SIZE / 2]);
|
||||||
|
|
||||||
|
std::memset(blockIDs.get(), 0, maxY * SIZE * SIZE);
|
||||||
|
std::memset(blockData.get(), 0, maxY * SIZE * SIZE / 2);
|
||||||
std::memset(blockSkyLight.get(), 0xff, maxY * SIZE * SIZE / 2);
|
std::memset(blockSkyLight.get(), 0xff, maxY * SIZE * SIZE / 2);
|
||||||
|
std::memset(blockBlockLight.get(), 0, maxY * SIZE * SIZE / 2);
|
||||||
|
|
||||||
|
|
||||||
for (auto §ion : *sections) {
|
for (auto §ion : *sections) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue