mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
make chunk lightmap optional
This commit is contained in:
parent
64f7c19766
commit
5250c748be
12 changed files with 103 additions and 73 deletions
|
|
@ -434,7 +434,8 @@ inline void get_voxels_impl(
|
|||
}
|
||||
} else {
|
||||
const voxel* cvoxels = chunk->voxels;
|
||||
const light_t* clights = chunk->lightmap.getLights();
|
||||
const light_t* clights =
|
||||
chunk->lightmap ? chunk->lightmap->getLights() : nullptr;
|
||||
for (int ly = y; ly < y + h; ly++) {
|
||||
for (int lz = std::max(z, cz * CHUNK_D);
|
||||
lz < std::min(z + d, (cz + 1) * CHUNK_D);
|
||||
|
|
@ -451,7 +452,8 @@ inline void get_voxels_impl(
|
|||
CHUNK_D
|
||||
);
|
||||
voxels[vidx] = cvoxels[cidx];
|
||||
light_t light = clights[cidx];
|
||||
light_t light = clights ? clights[cidx]
|
||||
: Lightmap::SUN_LIGHT_ONLY;
|
||||
if (backlight) {
|
||||
const auto block = blocks.get(voxels[vidx].id);
|
||||
if (block && block->lightPassing) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue