diff options
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/world.cpp b/src/world.cpp index a41b793..7256aee 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -29,17 +29,26 @@ void register_tile(uint8_t type, cflags_t cflags) void world_t::generate(sector_t *sector, sector_index_t index, bool partial) { + bool gen_tiles = false, gen_decos = false; + sector->index = index; sector->bounds.v[0] = (v2f_t)index * SECTOR_SIZE; sector->bounds.v[1] = sector->bounds.v[0] + v2f_t(SECTOR_SIZE, SECTOR_SIZE); - sector->empty = false; - generator(this, index, sector, generator_data); + if (sector->empty) { + if (partial) + gen_tiles = true; + else + gen_tiles = gen_decos = true; + } else + gen_decos = true; - if (partial) - return; + sector->empty = false; + generator(this, index, sector, gen_tiles, gen_decos, generator_data); + // Unused, for now. + /* for (coord_t ly = 0; ly < SECTOR_SIZE; ly++) for (coord_t lx = 0; lx < SECTOR_SIZE; lx++) { tile_t *tile; @@ -58,6 +67,7 @@ void world_t::generate(sector_t *sector, sector_index_t index, bool partial) tile->neighbors |= (1 << i); } } + */ } bool world_t::find_path(v2f_t src, v2f_t dst, cmodel_t *cmodel, entity_t *ignore, |