forked from clickteam-plugin/TiledMapLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRExtension.h
198 lines (177 loc) · 4.64 KB
/
RExtension.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#pragma once
enum Conditions
{
CONDITION_RAISE_ERROR = 0,
CONDITION_MAP_LOADED,
CONDITION_PARSING_FINISHED,
CONDITION_TILESET_LOADED,
CONDITION_LAYER_LOADED,
CONDITION_TILE_LOADED,
CONDITION_OBJECT_GROUP_LOADED,
CONDITION_OBJECT_LOADED
};
enum Actions
{
ACTION_LOAD_MAP = 0,
ACTION_MAP_OFFSET
};
enum Expressions
{
EXPRESSION_LAST_ERROR = 0,
EXPRESSION_MAP_WIDTH,
EXPRESSION_MAP_HEIGHT,
EXPRESSION_MAP_TILE_WIDTH,
EXPRESSION_MAP_TILE_HEIGHT,
EXPRESSION_MAP_ORIENTATION,
EXPRESSION_MAP_VERSION,
EXPRESSION_MAP_PROPERTY,
EXPRESSION_TILESET_NAME,
EXPRESSION_TILESET_IMAGE_PATH,
EXPRESSION_TILESET_ID,
EXPRESSION_TILESET_FIRST_GID,
EXPRESSION_TILESET_WIDTH,
EXPRESSION_TILESET_HEIGHT,
EXPRESSION_TILESET_TILE_WIDTH,
EXPRESSION_TILESET_TILE_HEIGHT,
EXPRESSION_TILESET_SPACING,
EXPRESSION_TILESET_MARGIN,
EXPRESSION_TILESET_X_TILE_OFFSET,
EXPRESSION_TILESET_Y_TILE_OFFSET,
EXPRESSION_TILESET_PROPERTY,
EXPRESSION_LAYER_NAME,
EXPRESSION_LAYER_WIDTH,
EXPRESSION_LAYER_HEIGHT,
EXPRESSION_LAYER_OPACITY,
EXPRESSION_LAYER_IS_VISIBLE,
EXPRESSION_LAYER_PROPERTY,
EXPRESSION_TILE_GID,
EXPRESSION_TILE_WIDTH,
EXPRESSION_TILE_HEIGHT,
EXPRESSION_TILE_POS_MAP_X,
EXPRESSION_TILE_POS_MAP_Y,
EXPRESSION_TILE_ASSOC_TILESET_ID,
EXPRESSION_TILE_POS_TILESET_X,
EXPRESSION_TILE_POS_TILESET_Y,
EXPRESSION_TILE_PROPERTY,
EXPRESSION_OBJECT_GROUP_NAME,
EXPRESSION_OBJECT_GROUP_DRAW_ORDER,
EXPRESSION_OBJECT_GROUP_WIDTH,
EXPRESSION_OBJECT_GROUP_HEIGHT,
EXPRESSION_OBJECT_GROUP_OPACITY,
EXPRESSION_OBJECT_GROUP_IS_VISIBLE,
EXPRESSION_OBJECT_GROUP_PROPERTY,
EXPRESSION_OBJECT_NAME,
EXPRESSION_OBJECT_TYPE,
EXPRESSION_OBJECT_POS_MAP_X,
EXPRESSION_OBJECT_POS_MAP_Y,
EXPRESSION_OBJECT_WIDTH,
EXPRESSION_OBJECT_HEIGHT,
EXPRESSION_OBJECT_ROTATION,
EXPRESSION_OBJECT_GID,
EXPRESSION_OBJECT_VERTICES,
EXPRESSION_OBJECT_BOX2D_VERTICES,
EXPRESSION_OBJECT_IS_POLYGON,
EXPRESSION_OBJECT_IS_POLYLINE,
EXPRESSION_OBJECT_IS_ELLIPSE,
EXPRESSION_OBJECT_IS_FLIPPED_HORIZONTALLY,
EXPRESSION_OBJECT_IS_FLIPPED_VERTICALLY,
EXPRESSION_OBJECT_IS_FLIPPED_DIAGONALLY,
EXPRESSION_OBJECT_IS_VISIBLE,
EXPRESSION_OBJECT_PROPERTY,
EXPRESSION_OBJECT_ID,
EXPRESSION_TILE_IS_FLIPPED_HORIZONTALLY,
EXPRESSION_TILE_IS_FLIPPED_VERTICALLY,
EXPRESSION_TILE_IS_FLIPPED_DIAGONALLY
};
/// Members
int mOffsetX;
int mOffsetY;
TiledMapLoader::Map *mMap;
TiledMapLoader::Tileset *mTileset;
TiledMapLoader::Layer *mLayer;
TiledMapLoader::Tile *mTile;
TiledMapLoader::ObjectGroup *mObjectGroup;
TiledMapLoader::Object *mObject;
/// Error handling
const char *mLastError;
void raiseError(const char *);
/// Raise condition as event
void raiseEvent(int eventCode);
/// Actions
void loadMap(char *);
void setMapOffset(int, int);
/// Conditions
bool onError();
bool onMapLoaded();
bool onParsingFinished();
bool onTilesetLoaded();
bool onLayerLoaded();
bool onTileLoaded();
bool onObjectGroupLoaded();
bool onObjectLoaded();
/// Expressions
char *getLastError();
int getMapWidth();
int getMapHeight();
int getMapTileWidth();
int getMapTileHeight();
char *getMapOrientation();
char *getMapVersion();
char *getMapProperty(char *, char *);
char *getTilesetName();
char *getTilesetImagePath();
int getTilesetId();
int getTilesetFirstGid();
int getTilesetWidth();
int getTilesetHeight();
int getTilesetTileWidth();
int getTilesetTileHeight();
int getTilesetSpacing();
int getTilesetMargin();
int getTilesetXTileOffset();
int getTilesetYTileOffset();
char *getTilesetProperty(char *, char *);
char *getLayerName();
int getLayerWidth();
int getLayerHeight();
float getLayerOpacity();
int isLayerVisible();
char *getLayerProperty(char *, char *);
int getTileGid();
int getTileWidth();
int getTileHeight();
int getTilePositionOnMapX();
int getTilePositionOnMapY();
int getTileAssociatedTilesetId();
int getTilePositionOnTilesetX();
int getTilePositionOnTilesetY();
int isTileFlippedHorizontally();
int isTileFlippedVertically();
int isTileFlippedDiagonally();
char *getTileProperty(char *, char *);
char *getObjectGroupName();
char *getObjectGroupDrawOrder();
int getObjectGroupWidth();
int getObjectGroupHeight();
float getObjectGroupOpacity();
int isObjectGroupVisible();
char *getObjectGroupProperty(char *, char *);
char *getObjectName();
char *getObjectType();
int getObjectPosOnMapX();
int getObjectPosOnMapY();
float getObjectWidth();
float getObjectHeight();
float getObjectRotation();
int getObjectTileGid();
char *getObjectVertices(char *);
char *getObjectBox2DVertices(char *);
int isObjectPolygon();
int isObjectPolyline();
int isObjectEllipse();
int isObjectFlippedHorizontally();
int isObjectFlippedVertically();
int isObjectFlippedDiagonally();
int isObjectVisible();
char *getObjectProperty(char *, char *);
int getObjectId();