From 0e5a826935cd1e5ef1e3061d029e2aafea038f47 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 26 Sep 2017 14:18:22 +0100 Subject: Adding --- spritesheet_8h_source.html | 125 ++++++++------------------------------------- 1 file changed, 20 insertions(+), 105 deletions(-) (limited to 'spritesheet_8h_source.html') diff --git a/spritesheet_8h_source.html b/spritesheet_8h_source.html index eb922f07..4e21ff8c 100644 --- a/spritesheet_8h_source.html +++ b/spritesheet_8h_source.html @@ -3,23 +3,22 @@ - + + YAGE: yage/base/spritesheet.h Source File + + - @@ -28,7 +27,7 @@ -
+
YAGE  v0.1.1
@@ -39,40 +38,19 @@
- + - - + + + +
+
@@ -107,82 +85,19 @@ $(document).ready(function(){initNavTree('spritesheet_8h_source.html','');});
spritesheet.h
-Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
-
2  * spritesheet.h
-
3  *
-
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
-
5  * MIT License, see LICENSE file for more details.
-
6  * ----------------------------------------------------------------------------
-
7  */
-
8 
-
9 #ifndef YAGE_SPRITESHEET_H
-
10 #define YAGE_SPRITESHEET_H
-
11 
-
12 #include "texture.h"
-
13 
-
14 #include <rapidjson/reader.h>
-
15 
-
16 #include <map>
-
17 #include <string>
-
18 
-
19 namespace yage
-
20 {
-
21 
-
22 namespace details
-
23 {
-
24 
-
25 struct Coordinate {
-
26  int x;
-
27  int y;
-
28  int width;
-
29  int height;
-
30 
-
31  Coordinate() = default;
-
32 
-
33  Coordinate(int x_i, int y_i, int width_i, int height_i)
-
34  : x(x_i), y(y_i), width(width_i), height(height_i)
-
35  {
-
36  }
-
37 };
-
38 
-
39 typedef std::map<std::string, details::Coordinate> SpriteMap;
-
40 
-
41 } // namespace details
-
42 
- -
44 {
-
45 public:
-
46  SpriteSheet(std::string pngFileName, std::string jsonFileName);
-
47 
-
48  void sprite(std::string spriteName) const;
-
49  std::string fileContent(std::string jsonFileName) const;
-
50 
-
51 private:
- - -
54 
-
55  details::SpriteMap parseJson(int &width, int &height, const std::string &jsonContent) const;
-
56 };
-
57 
-
58 } // namespace yage
-
59 
-
60 #endif
-
Definition: spritesheet.h:43
+Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * spritesheet.h
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
5  * MIT License, see LICENSE file for more details.
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef YAGE_SPRITESHEET_H
10 #define YAGE_SPRITESHEET_H
11 
12 #include "texture.h"
13 
14 #include <rapidjson/reader.h>
15 
16 #include <map>
17 #include <string>
18 
19 namespace yage
20 {
21 
22 namespace details
23 {
24 
25 struct Coordinate {
26  int x;
27  int y;
28  int width;
29  int height;
30 
31  Coordinate() = default;
32 
33  Coordinate(int x_i, int y_i, int width_i, int height_i)
34  : x(x_i), y(y_i), width(width_i), height(height_i)
35  {
36  }
37 };
38 
39 typedef std::map<std::string, details::Coordinate> SpriteMap;
40 
41 } // namespace details
42 
44 {
45 public:
46  SpriteSheet(std::string pngFileName, std::string jsonFileName);
47 
48  void sprite(std::string spriteName) const;
49  std::string fileContent(std::string jsonFileName) const;
50 
51 private:
54 
55  details::SpriteMap parseJson(int &width, int &height, const std::string &jsonContent) const;
56 };
57 
58 } // namespace yage
59 
60 #endif
Definition: spritesheet.h:43
Coordinate(int x_i, int y_i, int width_i, int height_i)
Definition: spritesheet.h:33
-
SpriteSheet(std::string pngFileName, std::string jsonFileName)
Definition: spritesheet.cpp:26
int x
Definition: spritesheet.h:26
-
details::SpriteMap parseJson(int &width, int &height, const std::string &jsonContent) const
Definition: spritesheet.cpp:41
std::map< std::string, details::Coordinate > SpriteMap
Definition: spritesheet.h:39
Texture texture_
Definition: spritesheet.h:52
int width
Definition: spritesheet.h:28
-
void sprite(std::string spriteName) const
int height
Definition: spritesheet.h:29
-
std::string fileContent(std::string jsonFileName) const
Definition: spritesheet.cpp:31
Definition: texture.h:17
Definition: spritesheet.h:25
int y
Definition: spritesheet.h:27
+
Project namespace.
Definition: camera2d.cpp:13
details::SpriteMap fileLocations_
Definition: spritesheet.h:53
@@ -190,9 +105,9 @@ $(document).ready(function(){initNavTree('spritesheet_8h_source.html','');}); -- cgit