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 | |
parent | d151da72a5b760f400b3d2538387d493c477dd92 (diff) |
Adjust ambient volume.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/assets.cpp | 5 | ||||
-rw-r--r-- | src/game/game.cpp | 13 | ||||
-rw-r--r-- | src/game/units.cpp | 2 |
3 files changed, 13 insertions, 7 deletions
diff --git a/src/game/assets.cpp b/src/game/assets.cpp index a020bf6..8ca0592 100644 --- a/src/game/assets.cpp +++ b/src/game/assets.cpp @@ -86,10 +86,11 @@ void load(void) ambients[AMBIENT_NEXUS].load("assets/ambience/nexus.ogg"); ambients[AMBIENT_CHASM].load("assets/ambience/chasm.ogg"); - ambients[AMBIENT_CHASM].volume = 4.0f; + ambients[AMBIENT_CHASM].volume = 12.0f; ambients[AMBIENT_WIND].load("assets/ambience/wind.ogg"); + ambients[AMBIENT_WIND].volume = 3.0f; ambients[AMBIENT_WATER].load("assets/ambience/water.ogg"); - ambients[AMBIENT_WATER].volume = 0.2f; + ambients[AMBIENT_WATER].volume = 0.1f; } } // namespace game::assets 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); diff --git a/src/game/units.cpp b/src/game/units.cpp index 47e729c..63c16db 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -583,6 +583,8 @@ void unit_spider_t::target_and_attack(void) void unit_spider_t::on_think(void) { + return; + target_and_attack(); keep_moving(4.0); |