forked from RippeR37/BattleCity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSprites.h
36 lines (28 loc) · 1.04 KB
/
Sprites.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**************************************************
Autor: Damian "RippeR" Dyñdo
URL: http://warsztat.gd/projects.php?x=view&id=2063
**************************************************/
#ifndef SPRITES_H_INCLUDED
#define SPRITES_H_INCLUDED
#include <string>
#include <map>
using namespace std;
struct SpriteData {
SpriteData() { }
SpriteData(int frame_count, double frame_duration, double left, double bottom, double width, double height, bool loop, string atlas) :
frame_count(frame_count), frame_duration(frame_duration), left(left), bottom(bottom), width(width),
height(height), loop(loop), atlas(atlas) { }
int frame_count;
double frame_duration, left, bottom, width, height;
bool loop;
string atlas;
};
class CSprites {
public:
CSprites();
SpriteData& Get(const string &name);
private:
void Insert(const string& name, const SpriteData& data) { m_sprites.insert(make_pair(name,data)); }
map <string, SpriteData> m_sprites;
};
#endif // SPRITES_H_INCLUDED