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

38
textures2.cpp Normal file
View file

@ -0,0 +1,38 @@
#include "textures2.hpp"
namespace textures {
static TextureManager textures;
static bool initialized = false;
void init() {
if(!initialized) {
textures.load_tiles();
textures.load_sprites();
initialized = true;
}
}
SpriteTexture get(std::string name) {
return textures.get(name);
}
sf::Image load_image(std::string filename) {
return textures.load_image(filename);
}
const uint32_t* get_surface(size_t num) {
return textures.get_surface(num);
}
matrix::Matrix convert_char_to_texture(matrix::Matrix &from) {
return textures.convert_char_to_texture(from);
}
const uint32_t* get_floor() {
return (const uint32_t *)textures.floor.getPixelsPtr();
}
const uint32_t* get_ceiling() {
return (const uint32_t *)textures.ceiling.getPixelsPtr();
}
};