diff --git a/raycaster.cpp b/raycaster.cpp index e0a8b1c..2608ff7 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -37,7 +37,7 @@ union ColorConv { // inline uint32_t new_new_lighting(uint32_t pixel, float dist, int level) { 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.g *= intensity; @@ -304,7 +304,7 @@ void Raycaster::cast_rays() { int draw_end = line_height / 2 + $height / 2 + $pitch; 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 double wall_x; // where exactly the wall was hit