Euphoria
scalingsprite.cc
Go to the documentation of this file.
1 #include "files/scalingsprite.h"
2 
3 #include "io/json.h"
4 
5 
7 {
9  {
11  JSON_VAL(Int, left);
12  JSON_VAL(Int, right);
13  JSON_VAL(Int, top);
14  JSON_VAL(Int, bottom);
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 
28  {
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);
34  }
35 }
#define JSON_ARRAY_PROP_CON(TYPE, PROP, CON)
Definition: json.h:149
#define JSON_BEGIN_OBJECT()
Definition: json.h:86
#define JSON_VAL(TYPE, PROP)
Definition: json.h:128
#define JSON_END_OBJECT()
Definition: json.h:166
#define JSON_ARRAY(TYPE, PROP)
Definition: json.h:132