summaryrefslogtreecommitdiff
path: root/src/game/worldgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/worldgen.cpp')
-rw-r--r--src/game/worldgen.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game/worldgen.cpp b/src/game/worldgen.cpp
index 01b05ca..e5f19c8 100644
--- a/src/game/worldgen.cpp
+++ b/src/game/worldgen.cpp
@@ -8,6 +8,7 @@ void add_decoration(world_t *world, state_t *game, v2f_t x, float noise)
{
deco_t *deco;
deco_type_t type;
+ v2f_t center, offset;
if (noise < 0.3)
return;
@@ -21,9 +22,13 @@ void add_decoration(world_t *world, state_t *game, v2f_t x, float noise)
else
type = DECO_STONE_SMALL;
+ offset[0] = world->perlin.get(x, 0.17331f);
+ offset[1] = world->perlin.get(x, 0.19571f);
+ center = x + v2f_t(0.5f, 0.5f) + offset.norm() * 0.1;
+
deco = new deco_t(game, type);
- deco->spawn(world, x);
- deco->phase_shift = noise * 500.0;
+ deco->phase_shift = offset[0] * 500.0;
+ deco->place(world, x);
}
void worldgen(world_t *world, sector_index_t index, sector_t *sector, void *data)