Amit's code mostly converted to use the new texture.hpp but there's an error on line amt/pixel.hpp:472

This commit is contained in:
Zed A. Shaw 2025-01-17 11:36:03 -05:00
parent c91e8fc543
commit 4d31a4daf2
9 changed files with 98 additions and 92 deletions

34
amt/texture.hpp Normal file
View file

@ -0,0 +1,34 @@
#pragma once
#include <cstdint>
#include <vector>
#include <string>
#include "amt/pixel.hpp"
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 Image = amt::PixelBuf;
struct TexturePack {
int NUM_SPRITES=1;
static const int TEXTURE_WIDTH=256; // must be power of two
static const int TEXTURE_HEIGHT=256; // must be power of two
std::vector<amt::PixelBuf> images;
std::vector<Sprite> sprites{{4.0, 3.55, 6}};
Image floor;
Image ceiling;
void load_textures();
amt::PixelBuf load_image(std::string filename);
Sprite& get_sprite(size_t sprite_num);
Image& get_texture(size_t num);
};