Add an ability to mark the main UI dirty so that it forces a render at specific times.

This commit is contained in:
Zed A. Shaw 2025-02-22 23:26:47 -05:00
parent b8bafdcab5
commit fa6311f10c
6 changed files with 20 additions and 8 deletions

View file

@ -273,7 +273,7 @@ void Raycaster::cast_rays() {
int tex_y = (int)tex_pos & (texture_height - 1);
tex_pos += step;
RGBA pixel = texture[texture_height * tex_y + tex_x];
float light_level = lights[map_y][map_x];
int light_level = lights[map_y][map_x];
$pixels[pixcoord(x, y)] = new_lighting(pixel, light_level);
}
@ -338,7 +338,7 @@ void Raycaster::draw_ceiling_floor() {
// floor_x cell_x to find the texture x/y. How?
int map_x = int(floor_x);
int map_y = int(floor_y);
float light_level = matrix::inbounds(lights, map_x, map_y) ? lights[map_y][map_x] : 30;
int light_level = matrix::inbounds(lights, map_x, map_y) ? lights[map_y][map_x] : 30;
// FLOOR
color = $floor_texture[texture_width * ty + tx];