summaryrefslogtreecommitdiff
path: root/src/world.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-17 08:12:13 +0000
committerPaweł Redman <pawel.redman@gmail.com>2017-12-17 08:12:13 +0000
commita44122dc7336640c4f20cd9845f26e38a55ec1cd (patch)
tree92734d2cae14e548d054ed5992319af9019ecba7 /src/world.cpp
parent68d83476cacf077bb409f5dd1bafb99ac11d3e43 (diff)
Improve decos: more variations and fewer patterns.
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp18
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,