raycaster/textures2.cpp

38 lines
831 B
C++

#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();
}
};