diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-03-31 16:28:38 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-03-31 16:28:38 +0200 |
commit | e6f9705e91ab01a1ecdab9c4999fa29b3980a42a (patch) | |
tree | 969a3561ce6f653274086fc6ef9a99cd2bdacde1 /src/game/game.cpp | |
parent | d151da72a5b760f400b3d2538387d493c477dd92 (diff) |
Adjust ambient volume.
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r-- | src/game/game.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp index 2818c0b..f21bccd 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -283,9 +283,12 @@ void state_t::tick(ntime_t time_) } } +#define XRES 9 +#define YRES 9 + void state_t::compute_ambience(render::state_t *render) { - const size_t samples = 25; + const size_t samples = XRES * YRES; rectf_t area; v2f_t origins[AMBIENT_COUNT]; size_t hits[AMBIENT_COUNT]; @@ -298,14 +301,14 @@ void state_t::compute_ambience(render::state_t *render) } // resolution chosen arbitrarily - for (size_t y = 0; y < 5; y++) - for (size_t x = 0; x < 5; x++) { + for (size_t y = 0; y < YRES; y++) + for (size_t x = 0; x < XRES; x++) { v2f_t point; world::tile_t *tile; int type; - point[0] = lerp(area[0][0], area[1][0], y / 4.0f); - point[1] = lerp(area[0][1], area[1][1], x / 4.0f); + point[0] = lerp(area[0][0], area[1][0], y / (YRES - 1.0f)); + point[1] = lerp(area[0][1], area[1][1], x / (XRES - 1.0f)); tile = world.get_tile(world::tile_index_t(point), world::SECTOR_FULL); |