Intermediate refactor to move everything over to using the textures module rather than everyone using one TexturePack thing.

This commit is contained in:
Zed A. Shaw 2025-02-21 03:00:56 -05:00
parent 6c1d851e85
commit f3e1413022
23 changed files with 129 additions and 64 deletions

View file

@ -2,10 +2,10 @@
#include <SFML/Graphics.hpp>
#include <SFML/System/Clock.hpp>
#include "texture.hpp"
#include "animator.hpp"
#include "spatialmap.hpp"
#include "levelmanager.hpp"
#include "texture.hpp"
using matrix::Matrix;
using RGBA = uint32_t;
@ -14,7 +14,6 @@ struct Raycaster {
int $pitch=0;
sf::Clock $clock;
sf::Shader $brightness;
TexturePack &$textures;
double $pos_x = 0;
double $pos_y = 0;
@ -27,6 +26,8 @@ struct Raycaster {
double $plane_y = 0.66;
sf::Texture $view_texture;
sf::Sprite $view_sprite;
const uint32_t *$floor_texture = nullptr;
const uint32_t *$ceiling_texture = nullptr;
std::unique_ptr<RGBA[]> $pixels = nullptr;
@ -40,7 +41,7 @@ struct Raycaster {
std::vector<double> $zbuffer; // width
Animator $anim;
Raycaster(TexturePack &textures, int width, int height);
Raycaster(int width, int height);
void cast_rays();
void draw_ceiling_floor();