Finished the first pass of moving everything around and cleaning up as much as possible.
This commit is contained in:
parent
d47f6f996d
commit
adfb6367d7
9 changed files with 163 additions and 87 deletions
33
texture.hpp
Normal file
33
texture.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
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 = std::vector<uint32_t>;
|
||||
|
||||
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<Image> images;
|
||||
std::vector<Sprite> sprites{{4.0, 3.55, 6}};
|
||||
Image floor;
|
||||
Image ceiling;
|
||||
|
||||
void load_textures();
|
||||
std::vector<uint32_t> load_image(std::string filename);
|
||||
Sprite &get_sprite(size_t sprite_num);
|
||||
Image& get_texture(size_t num);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue