diff options
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);  | 
