~mjmendoza/quixie/trunk

« back to all changes in this revision

Viewing changes to inc/cls/kse_Game.hpp

  • Committer: creek23
  • Date: 2014-05-27 17:02:50 UTC
  • Revision ID: svn-v4:5d579d6f-57a3-4165-9b1e-6dacaf8da75a:quixie:641
line-by-line C++ conversion attempt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
extern int kseMAP_CURRENT_RENDER;
 
2
 
 
3
 
 
4
const kseMAP_MOVE = 1 //is it related to kseMAP_MOVE_TILEBASED_MODE
 
5
 
 
6
/*
 
7
 Used for checking if no playing entity was set.
 
8
 
 
9
 @remarks It does not seem to be implemented.
 
10
*/
 
11
const kseMAP_NO_PLAYER = 0
 
12
 
 
13
/*
 
14
 Used for checking if no entity was attached to a map.
 
15
 Flag for there is no entity in the tile location.
 
16
 
 
17
 @remarks It does not seem to be implemented.
 
18
*/
 
19
const kseMAP_NO_ENTITY = 0
 
20
 
 
21
/*
 
22
 Used for checking if no tileset was attached to a map.
 
23
 
 
24
 @remarks None.
 
25
*/
 
26
const kseMAP_NO_TILESET = -1
 
27
 
 
28
/*
 
29
 Indicates how will the map move.
 
30
 
 
31
 @remarks Non-tile-based mode is not yet implemented.
 
32
*/
 
33
const kseMAP_MOVE_TILEBASED_MODE = 0
 
34
 
 
35
/*
 
36
 Indicates how many times to move a map when arrow key is pressed.
 
37
 
 
38
 @return Integer
 
39
 @remarks None.
 
40
*/
 
41
extern int iMapMoveCtrMax;
 
42
 
 
43
/*
 
44
 Counts the movement.
 
45
 
 
46
 @return Integer
 
47
 @remarks None.
 
48
*/
 
49
extern int iMapMoveCtr;
 
50
 
 
51
/*
 
52
 Indicates pixels to travel.
 
53
 
 
54
 @return Integer
 
55
 @remarks None.
 
56
*/
 
57
extern int iMapMove;
 
58
 
 
59
/*
 
60
 Indicates layer for obstructions.
 
61
 
 
62
 @return Integer
 
63
 @remarks None.
 
64
*/
 
65
extern int iObsLayer;
 
66
 
 
67
/*
 
68
 Indicates layer for triggers.
 
69
 
 
70
 @return Integer
 
71
 @remarks None.
 
72
*/
 
73
extern int iTrgLayer;
 
74
 
 
75
/*
 
76
 Current map filename being executed.
 
77
 
 
78
 @return String
 
79
 @remarks None.
 
80
*/
 
81
extern string sMapName;
 
82
 
 
83
/*
 
84
 Current map's layer count.
 
85
 
 
86
 @return Integer
 
87
 @remarks None.
 
88
*/
 
89
extern int iMapLayers;
 
90
 
 
91
/*
 
92
 Game's map width.
 
93
 
 
94
 @return Integer
 
95
 @remarks None.
 
96
*/
 
97
extern int iMapWidth;
 
98
 
 
99
/*
 
100
 Game's map height.
 
101
 
 
102
 @return Integer
 
103
 @remarks None.
 
104
*/
 
105
extern int iMapHeight;
 
106
 
 
107
/*
 
108
 Indicates layer on which entities reside.
 
109
 
 
110
 @return Integer
 
111
 @remarks None.
 
112
*/
 
113
extern int iMapEntityLayer;
 
114
 
 
115
/*
 
116
 To check if game is focuusing on an entity.
 
117
 
 
118
 @return Byte
 
119
 @remarks None.
 
120
*/
 
121
extern bool bMapFocusingOnEntity;
 
122
 
 
123
/*
 
124
 For <b>Game:Render()</b>; needed to hook controls on map
 
125
 
 
126
 @return Byte
 
127
 @remarks Needed for rendering.
 
128
*/
 
129
extern bool bMapRender;
 
130
 
 
131
/*
 
132
 For <b>Game:Render()</b>s pause-state checking; needed to hook controls on map
 
133
 
 
134
 @return Byte
 
135
 @remarks Needed for rendering.
 
136
*/
 
137
extern bool bMapRendering;
 
138
 
 
139
/*
 
140
 To check if user map should move left.
 
141
 
 
142
 @return Byte
 
143
 @remarks Needed to hook controls on game.
 
144
*/
 
145
extern bool bMapMoveLeft;
 
146
 
 
147
/*
 
148
 To check if user map should move right.
 
149
 
 
150
 @return Byte
 
151
 @remarks Needed to hook controls on game.
 
152
*/
 
153
extern bool bMapMoveRight;
 
154
 
 
155
/*
 
156
 To check if user map should move up.
 
157
 
 
158
 @return Byte
 
159
 @remarks Needed to hook controls on game.
 
160
*/
 
161
extern bool bMapMoveUp;
 
162
 
 
163
/*
 
164
 To check if user map should move down.
 
165
 
 
166
 @return Byte
 
167
 @remarks Needed to hook controls on game.
 
168
*/
 
169
extern bool bMapMoveDown;
 
170
 
 
171
 
 
172
/*struct typeMapTile {
 
173
        bool bStatic  //not animated
 
174
        int iDelay;   //how many times a frame will be showed; connected to animated tiles
 
175
        int iChance;  //x/100 -> chance for a trigger(event) be triggered; connected to trigger tiles
 
176
        bool bTBlit;   //render with transparency
 
177
        bool bHide;     //should this tile be shown or not
 
178
        int iCtr;        //animation counter
 
179
        int iIdx;        //would contain the:
 
180
                                                //   - index from tileset
 
181
                                                //   - or, index from an animation
 
182
                                                //   - or, obstruction data
 
183
                                                //   - or, index from triggers
 
184
        //since there is an entity layer, instead of using the
 
185
        //variables above, let's use another for entity location
 
186
        //iEntityIdx As Integer   'who is that entity
 
187
};
 
188
*/
 
189
 
 
190
/*
 
191
Type typeTileAnimation
 
192
        bool bUsed;
 
193
        int iCtr;               //frame counter
 
194
        'int iTiles[10000];     //will hold series of tiles for animation
 
195
 
 
196
                        int *iTiles; //will hold series of tiles for animation
 
197
                        int iTileMax;   //   for ubound
 
198
};
 
199
*/
 
200
 
 
201
/*
 
202
struct typeTileTrigger {
 
203
        bool bUsed;
 
204
        string sFunction;  //function to call when triggered
 
205
};
 
206
*/
 
207
 
 
208
/*
 
209
extern iMapEntityHandlers();                //will hold array of entity-indices
 
210
        extern long int iMapEntityHandlersCtr;             //counts the number of entity-indices
 
211
extern vector<typeTileAnimation> kseTileAnimation; //will hold array of sequence of tiles-indices for animated tiles
 
212
        extern long int iTileAnimationCtr;                          //counts the number of sequences for tiles-indices of animated tiles
 
213
extern vector<typeTileTrigger> kseTileTrigger;      //will hold array of triggers for a tile
 
214
        extern long int iTileTriggerCtr;                            //counts the number of triggers
 
215
*/
 
216
 
 
217
//dev api
 
218
void Engine_CheckForMovement();
 
219
void Engine_RunMapScript(string fxName, bool bWarn = true);
 
220
void Engine_RunScript(string sScriptFile, string fxName, string sFileExt = ".ks", bool bWarn = true);
 
221
void Engine_SpriteBillboardCheckup();
 
222
 
 
223
int KSE_GetSpriteAnimation(int iEntity);
 
224
int KSE_GetTileAnimation(int iTileIdx, int iMID);
 
225
bool ReDim_MapEntity(int new_list_count, int map_idx);
 
226
bool ReDim_MapEntityName(int new_list_count, int map_idx);
 
227
 
 
228
//functions
 
229
int GameAttachEntity(long int &iIndex);
 
230
int GameDetachEntity(long int &iIndex);
 
231
int GameEntityGetX(long int &iIndex);
 
232
int GameEntityGetY(long int &iIndex);
 
233
int GameEntitySetX(long int &iIndex);
 
234
int GameEntitySetY(long int &iIndex);
 
235
int GameFocusEntity(long int &iIndex);
 
236
int GameGetCameraX(long int &iIndex);
 
237
int GameGetCameraY(long int &iIndex);
 
238
int GamePause(long int &iIndex);
 
239
int GameRender(long int &iIndex);
 
240
int GameResume(long int &iIndex);
 
241
int GameSetCameraX(long int &iIndex);
 
242
int GameSetCameraY(long int &iIndex);
 
243
int GameSetPlayer(long int &iIndex);
 
244
int GameStop(long int &iIndex);
 
245
//wrappers
 
246
int Game_SkipCloseParenthesisAfter(string sWhat, long int &iIndex);
 
247
int Game_SkipCommaAfter(string sWhat, long int &iIndex);
 
248
int Game_SkipOpenParenthesisAfter(string sWhat, long int &iIndex);
 
249
//class
 
250
int SynGame(long int &iIndex);