fix weak_ptr leak

This commit is contained in:
MihailRis
2024-12-12 02:40:59 +03:00
parent 863146cf6b
commit 7e92a16016
4 changed files with 73 additions and 39 deletions
+3 -4
View File
@@ -2,16 +2,15 @@
#include "util/data_io.hpp"
#include <assert.h>
#include <cassert>
#include <cstring>
void Lightmap::set(const Lightmap* lightmap) {
set(lightmap->map);
}
void Lightmap::set(const light_t* map) {
for (size_t i = 0; i < CHUNK_VOL; i++) {
this->map[i] = map[i];
}
std::memcpy(this->map, map, sizeof(light_t) * CHUNK_VOL);
}
static_assert(sizeof(light_t) == 2, "replace dataio calls to new light_t");