Brought in Amit's latest and will now merge in my fixing from last night into his to get them synced up.

This commit is contained in:
Zed A. Shaw 2025-01-17 11:00:49 -05:00
parent adfb6367d7
commit c91e8fc543
8 changed files with 116 additions and 68 deletions

View file

@ -6,10 +6,11 @@
#include <numbers>
#include <algorithm>
#include <cmath>
#include "amt/matrix.hpp"
#include "matrix.hpp"
#include <cstdlib>
#include <array>
#include "dbc.hpp"
#include "pixel.hpp"
#include <memory>
using Matrix = amt::Matrix<int>;
@ -32,15 +33,15 @@ struct TexturePack {
int TEXTURE_WIDTH=256; // must be power of two
int TEXTURE_HEIGHT=256; // must be power of two
std::vector<std::vector<uint32_t>> images;
std::vector<amt::PixelBuf> images;
std::vector<Sprite> SPRITE{{4.0, 3.55, 8}};
const int floor = 3;
const int ceiling = 6;
void load_textures();
std::vector<uint32_t> load_image(const char *filename);
amt::PixelBuf load_image(const char *filename);
Sprite &get_sprite(size_t sprite_num);
std::vector<uint32_t>& get(size_t num);
amt::PixelBuf& get(size_t num);
};
struct Raycaster {
@ -61,10 +62,10 @@ struct Raycaster {
sf::Sprite view_sprite;
//ZED: USE smart pointer for this
std::unique_ptr<RGBA[]> pixels = nullptr;
int $width;
int $height;
amt::PixelBuf pixels;
sf::RenderWindow& $window;
Matrix& $map;
std::vector<int> spriteOrder;