inventory regions, minor refactor

This commit is contained in:
MihailRis
2024-01-31 00:14:43 +03:00
parent a57fba4fa4
commit 49fdcdfb27
29 changed files with 259 additions and 160 deletions
+5 -17
View File
@@ -3,26 +3,14 @@
#include "../util/data_io.h"
Lightmap::Lightmap(){
map = new light_t[CHUNK_VOL];
for (uint i = 0; i < CHUNK_VOL; i++){
map[i] = 0x0000;
}
}
Lightmap::~Lightmap(){
delete[] map;
}
void Lightmap::set(const Lightmap* lightmap) {
for (unsigned int i = 0; i < CHUNK_VOL; i++){
map[i] = lightmap->map[i];
}
set(lightmap->map);
}
void Lightmap::set(light_t* map) {
delete[] this->map;
this->map = map;
void Lightmap::set(const light_t* map) {
for (size_t i = 0; i < CHUNK_VOL; i++) {
this->map[i] = map[i];
}
}
static_assert(sizeof(light_t) == 2, "replace dataio calls to new light_t");