Trying a new 'glowing moss' texture to sort out how to make the raycaster alter the light of a surface that has its own light.

This commit is contained in:
Zed A. Shaw 2025-05-24 00:47:44 -04:00
parent e361984c40
commit 9dcc2036aa
12 changed files with 109 additions and 51 deletions

View file

@ -533,6 +533,32 @@ namespace shiterator { using std::vector, std::queue, std::array; using
}
};
/*
* Same as rando_rect_t but it uses a centered box.
*/
template<typename MAT>
struct rando_box_t {
size_t x;
size_t y;
size_t x_offset;
size_t y_offset;
box_t<MAT> it;
rando_box_t(MAT &mat, size_t start_x, size_t start_y, size_t size) :
it{mat, start_x, start_y, size}
{
x_offset = Random::uniform(size_t(0), it.right);
y_offset = Random::uniform(size_t(0), it.bottom);
}
bool next() {
bool done = it.next();
x = it.left + ((it.x + x_offset) % it.right);
y = it.top + ((it.y + y_offset) % it.bottom);
return done;
}
};
/*
* WIP: This one is used to place entities randomly but
* could be used for effects like random destruction of floors.