|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <memory>
|
|
|
|
#include "matrix.hpp"
|
|
|
|
|
|
|
|
struct SpriteTexture {
|
|
|
|
std::shared_ptr<sf::Sprite> sprite = nullptr;
|
|
|
|
std::shared_ptr<sf::Texture> texture = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Sprite {
|
|
|
|
double x;
|
|
|
|
double y;
|
|
|
|
SpriteTexture sprite;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TexturePack {
|
|
|
|
std::vector<sf::Image> surfaces;
|
|
|
|
std::unordered_map<std::string, SpriteTexture> sprite_textures;
|
|
|
|
std::unordered_map<wchar_t, int> char_to_texture;
|
|
|
|
sf::Image floor;
|
|
|
|
sf::Image ceiling;
|
|
|
|
SpriteTexture sword;
|
|
|
|
|
|
|
|
void load_tiles();
|
|
|
|
void load_sprites();
|
|
|
|
sf::Image load_image(std::string filename);
|
|
|
|
const uint32_t* get_surface(size_t num);
|
|
|
|
|
|
|
|
// ZED: this is ugly so maybe you should like rewrite it or something
|
|
|
|
matrix::Matrix convert_char_to_texture(matrix::Matrix &from);
|
|
|
|
};
|