Euphoria
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libs
files
src
files
scalingsprite.cc
Go to the documentation of this file.
1
#include "
files/scalingsprite.h
"
2
3
#include "
io/json.h
"
4
5
6
namespace
eu::files::scalingsprite
7
{
8
JSON_PARSE_FUNC
(
Rect
)
9
{
10
JSON_BEGIN_OBJECT
();
11
JSON_VAL
(
Int
, left);
12
JSON_VAL
(
Int
, right);
13
JSON_VAL
(
Int
, top);
14
JSON_VAL
(
Int
, bottom);
15
JSON_END_OBJECT
();
16
}
17
18
namespace
19
{
20
int
c_tint_to_int(jsonh::tint t)
21
{
22
// todo(Gustav): add error handling for when tint is larger than int
23
return
static_cast<
int
>
(t);
24
}
25
}
26
27
JSON_PARSE_FUNC
(
ScalingSprite
)
28
{
29
JSON_BEGIN_OBJECT
();
30
JSON_ARRAY_PROP_CON
(
Int
, rows, c_tint_to_int);
31
JSON_ARRAY_PROP_CON
(
Int
, cols, c_tint_to_int);
32
JSON_ARRAY
(
Rect
, rects);
33
JSON_END_OBJECT
();
34
}
35
}
json.h
JSON_ARRAY_PROP_CON
#define JSON_ARRAY_PROP_CON(TYPE, PROP, CON)
Definition:
json.h:149
JSON_BEGIN_OBJECT
#define JSON_BEGIN_OBJECT()
Definition:
json.h:86
JSON_VAL
#define JSON_VAL(TYPE, PROP)
Definition:
json.h:128
JSON_END_OBJECT
#define JSON_END_OBJECT()
Definition:
json.h:166
JSON_ARRAY
#define JSON_ARRAY(TYPE, PROP)
Definition:
json.h:132
eu::files::scalingsprite
Definition:
scalingsprite.cc:7
eu::files::scalingsprite::JSON_PARSE_FUNC
JSON_PARSE_FUNC(Rect)
Definition:
scalingsprite.cc:8
eu::render::gl::Int
int Int
Definition:
gltypes.h:7
scalingsprite.h
eu::files::scalingsprite::Rect
Definition:
scalingsprite.h:8
eu::files::scalingsprite::ScalingSprite
Definition:
scalingsprite.h:15