Finished the first pass of moving everything around and cleaning up as much as possible.

This commit is contained in:
Zed A. Shaw 2025-01-17 03:45:05 -05:00
parent d47f6f996d
commit adfb6367d7
9 changed files with 163 additions and 87 deletions

View file

@ -2,7 +2,6 @@
#include <fmt/core.h>
#include <SFML/Graphics.hpp>
#include <SFML/Graphics/Image.hpp>
#include <numbers>
#include <algorithm>
#include <cmath>
@ -11,38 +10,11 @@
#include <array>
#include "dbc.hpp"
#include <memory>
#include "texture.hpp"
using matrix::Matrix;
struct Sprite {
double x;
double y;
int texture;
// ZED: this should be a separate transform parameter
double elevation=0;
int uDiv=1;
int vDiv=1;
};
using RGBA = uint32_t;
struct TexturePack {
int NUM_SPRITES=1;
int NUM_TEXTURES=11;
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<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);
Sprite &get_sprite(size_t sprite_num);
std::vector<uint32_t>& get(size_t num);
};
struct Raycaster {
int PITCH=0;