mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add AreaMap2D
This commit is contained in:
parent
f70ac5c190
commit
c3569b5dd4
11 changed files with 282 additions and 179 deletions
|
|
@ -124,17 +124,16 @@ void BlocksController::randomTick(
|
|||
|
||||
void BlocksController::randomTick(int tickid, int parts) {
|
||||
auto indices = level->content->getIndices();
|
||||
const int w = chunks->w;
|
||||
const int d = chunks->d;
|
||||
const auto& size = chunks->getSize();
|
||||
int segments = 4;
|
||||
|
||||
for (uint z = padding; z < d - padding; z++) {
|
||||
for (uint x = padding; x < w - padding; x++) {
|
||||
int index = z * w + x;
|
||||
for (uint z = padding; z < size.y - padding; z++) {
|
||||
for (uint x = padding; x < size.x - padding; x++) {
|
||||
int index = z * size.x + x;
|
||||
if ((index + tickid) % parts != 0) {
|
||||
continue;
|
||||
}
|
||||
auto& chunk = chunks->chunks[index];
|
||||
auto& chunk = chunks->getChunks()[index];
|
||||
if (chunk == nullptr || !chunk->flags.lighted) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue