dungeon/src/SpriteAtlas.h

22 lines
485 B
C
Raw Normal View History

2017-09-17 13:43:13 +02:00
#pragma once
2017-09-17 20:07:38 +02:00
#include <string>
2017-09-17 13:43:13 +02:00
class Renderer;
struct Sprite;
// Automatically splits a tileset image to seperate sprites.
2017-12-31 21:51:57 +01:00
class SpriteAtlas {
2017-09-17 13:43:13 +02:00
Sprite* sprites;
int amount;
2017-09-23 22:06:36 +02:00
int tile_width;
int tile_height;
2017-09-17 13:43:13 +02:00
public:
2017-12-31 21:51:57 +01:00
SpriteAtlas(Renderer* renderer, std::string imgPath, int imgWidth, int imgHeight, int tileWidth, int tileHeight);
~SpriteAtlas();
2017-09-23 22:06:36 +02:00
int get_amount();
int get_tile_width();
int get_tile_height();
2017-09-21 22:44:05 +02:00
Sprite* get_sprite(int tileId);
2017-09-17 13:43:13 +02:00
};