|
|
@ -37,7 +37,7 @@ union ColorConv { |
|
|
|
//
|
|
|
|
//
|
|
|
|
inline uint32_t new_new_lighting(uint32_t pixel, float dist, int level) { |
|
|
|
inline uint32_t new_new_lighting(uint32_t pixel, float dist, int level) { |
|
|
|
ColorConv conv{.as_int=pixel}; |
|
|
|
ColorConv conv{.as_int=pixel}; |
|
|
|
float intensity = (float(level) * PERCENT) / (dist+1) * 2.5; |
|
|
|
float intensity = (float(level) * PERCENT) / (dist + 1) * 2.5; |
|
|
|
|
|
|
|
|
|
|
|
conv.as_color.r *= intensity; |
|
|
|
conv.as_color.r *= intensity; |
|
|
|
conv.as_color.g *= intensity; |
|
|
|
conv.as_color.g *= intensity; |
|
|
@ -304,7 +304,7 @@ void Raycaster::cast_rays() { |
|
|
|
int draw_end = line_height / 2 + $height / 2 + $pitch; |
|
|
|
int draw_end = line_height / 2 + $height / 2 + $pitch; |
|
|
|
if(draw_end >= $height) draw_end = $height - 1; |
|
|
|
if(draw_end >= $height) draw_end = $height - 1; |
|
|
|
|
|
|
|
|
|
|
|
auto texture = textures::get_surface($map[map_y][map_x] - 1); |
|
|
|
auto texture = textures::get_surface($map[map_y][map_x]); |
|
|
|
|
|
|
|
|
|
|
|
// calculate value of wall_x
|
|
|
|
// calculate value of wall_x
|
|
|
|
double wall_x; // where exactly the wall was hit
|
|
|
|
double wall_x; // where exactly the wall was hit
|
|
|
|