Tiles now record their textures and this is loaded from the map then converted to an indexed integer on the fly.

This commit is contained in:
Zed A. Shaw 2025-01-31 13:37:01 -05:00
parent 9e3e347e4a
commit a67d25ee10
10 changed files with 64 additions and 66 deletions

View file

@ -27,8 +27,8 @@ inline uint32_t dumb_lighting(uint32_t pixel, double distance) {
return conv.as_int;
}
Raycaster::Raycaster(sf::RenderWindow& window, Matrix &map, int width, int height) :
Raycaster::Raycaster(sf::RenderWindow& window, TexturePack &textures, Matrix &map, int width, int height) :
$textures(textures),
$view_texture({(unsigned int)width, (unsigned int)height}),
$view_sprite($view_texture),
$width(width), $height(height),
@ -41,9 +41,6 @@ Raycaster::Raycaster(sf::RenderWindow& window, Matrix &map, int width, int heigh
{
$view_sprite.setPosition({0, 0});
$pixels = make_unique<RGBA[]>($width * $height);
$textures.load_textures();
$textures.load_sprites();
$textures.position_sprite(4.0, 3.55, "evil_eye");
$view_texture.setSmooth(false);
}