+
+
+
+
+
+
+
+
9 #ifndef YAGE_SPRITESHEET_H
+
10 #define YAGE_SPRITESHEET_H
+
+
+
+
14 #include <rapidjson/reader.h>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
39 typedef std::map<std::string, details::Coordinate>
SpriteMap;
+
+
+
42 :
public rapidjson::BaseReaderHandler<rapidjson::UTF8<>, SpriteSheetHandler>
+
+
+
+
+
+
48 bool Uint(
unsigned u);
+
49 bool Int64(int64_t i);
+
+
+
52 bool String(
const char *str, rapidjson::SizeType length,
bool copy);
+
+
54 bool Key(
const char *str, rapidjson::SizeType length,
bool copy);
+
+
56 bool EndObject(rapidjson::SizeType memberCount);
+
+
58 bool EndArray(rapidjson::SizeType memberCount);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
79 SpriteSheet(std::string pngFileName, std::string jsonFileName);
+
+
81 void sprite(std::string spriteName)
const;
+
+
+
+
+
+
+
+
+
+
Coordinate coord_
Definition: spritesheet.h:65
+
bool handleNumber(int i)
Definition: spritesheet.cpp:98
+
Definition: spritesheet.h:76
+
int image_width_
Definition: spritesheet.h:67
+
Coordinate(int x_i, int y_i, int width_i, int height_i)
Definition: spritesheet.h:33
+
Definition: spritesheet.h:41
+
bool Uint64(uint64_t u)
Definition: spritesheet.cpp:42
+
bool Null()
Definition: spritesheet.cpp:17
+
SpriteSheet(std::string pngFileName, std::string jsonFileName)
+
int depth_
Definition: spritesheet.h:66
+
bool String(const char *str, rapidjson::SizeType length, bool copy)
Definition: spritesheet.cpp:52
+
SpriteMap spriteMap() const
Definition: spritesheet.cpp:93
+
+
bool StartArray()
Definition: spritesheet.cpp:83
+
bool Key(const char *str, rapidjson::SizeType length, bool copy)
Definition: spritesheet.cpp:57
+
std::string current_image_
Definition: spritesheet.h:64
+
int x
Definition: spritesheet.h:26
+
bool EndArray(rapidjson::SizeType memberCount)
Definition: spritesheet.cpp:88
+
+
std::map< std::string, details::Coordinate > SpriteMap
Definition: spritesheet.h:39
+
Texture texture_
Definition: spritesheet.h:84
+
int width
Definition: spritesheet.h:28
+
void sprite(std::string spriteName) const
+
int height
Definition: spritesheet.h:29
+
int image_height_
Definition: spritesheet.h:68
+
bool StartObject()
Definition: spritesheet.cpp:63
+
bool EndObject(rapidjson::SizeType memberCount)
Definition: spritesheet.cpp:74
+
bool Double(double d)
Definition: spritesheet.cpp:47
+
std::string current_key_
Definition: spritesheet.h:63
+
bool Int(int i)
Definition: spritesheet.cpp:27
+
+
Definition: spritesheet.h:25
+
int y
Definition: spritesheet.h:27
+
bool Uint(unsigned u)
Definition: spritesheet.cpp:32
+
SpriteMap map_
Definition: spritesheet.h:69
+
bool Bool(bool b)
Definition: spritesheet.cpp:22
+
bool Int64(int64_t i)
Definition: spritesheet.cpp:37
+
details::SpriteMap fileLocations_
Definition: spritesheet.h:85
+