-
Notifications
You must be signed in to change notification settings - Fork 183
/
player.h
243 lines (192 loc) · 5.04 KB
/
player.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/*
* This file is part of EasyRPG Player.
*
* EasyRPG Player is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EasyRPG Player is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PLAYER_H_
#define _PLAYER_H_
// Headers
#include "baseui.h"
#include <vector>
/**
* Player namespace.
*/
namespace Player {
/** Bitmask for type of emulated engine */
enum EngineType {
EngineNone = 0,
/** All versions of RPG Maker 2000 */
EngineRpg2k = 1,
/** All versions of RPG Maker 2003 */
EngineRpg2k3 = 2,
/** RPG Maker 2000 v1.50 or newer, 2003 v1.05 or newer */
EngineMajorUpdated = 4,
/** RPG Maker 2003 v1.10 or newer (Official English translation) */
EngineRpg2k3E = 8
};
/**
* Initializes EasyRPG Player.
*/
void Init(int argc, char *argv[]);
/**
* Runs the game engine.
*/
void Run();
/**
* Runs the game loop.
*/
void MainLoop();
/**
* Pauses the game engine.
*/
void Pause();
/**
* Resumes the game engine.
*/
void Resume();
/**
* Updates EasyRPG Player.
*
* @param update_scene Whether to update the current scene.
*/
void Update(bool update_scene = true);
/**
* Returns executed game frames since player start.
* Should be 60 fps when game ran fast enough.
*
* @return Update frames since player start
*/
int GetFrames();
/**
* Resets the fps count (both updates and frames per second).
* Should be called after an expensive operation.
*/
void FrameReset();
/**
* Exits EasyRPG Player.
*/
void Exit();
/**
* Parses the command line arguments.
*/
void ParseCommandLine(int argc, char *argv[]);
/**
* Initializes all game objects
*/
void CreateGameObjects();
/**
* Resets all game objects. Faster then CreateGameObjects because
* the database is not reparsed.
*/
void ResetGameObjects();
/**
* Loads all databases.
*/
void LoadDatabase();
/**
* Loads savegame data.
*
* @param save_file Savegame file to load
*/
void LoadSavegame(const std::string& save_file);
/**
* Moves the player to the start map.
*/
void SetupPlayerSpawn();
/**
* Gets current codepage.
*
* @return current codepage
*/
std::string GetEncoding();
/**
* @return Whether engine is RPG2k
*/
bool IsRPG2k();
/**
* @return If engine is RPG2k3 v1.09a or older
*/
bool IsRPG2k3Legacy();
/**
* @return If engine is RPG2k3
*/
bool IsRPG2k3();
/**
* @return If engine is RPG2k v1.50 or newer, or RPG2k3 v1.05 or newer
*/
bool IsMajorUpdatedVersion();
/**
* @return If engine is the official English release (v1.10) or newer.
*/
bool IsRPG2k3E();
/**
* @return if encoding is CP932 or not
*/
bool IsCP932();
/** Output program version on stdout */
void PrintVersion();
/** Output program usage information on stdout */
void PrintUsage();
/** Exit flag, if true will exit application on next Player::Update. */
extern bool exit_flag;
/** Reset flag, if true will restart game on next Player::Update. */
extern bool reset_flag;
/** Debug flag, if true will run game in debug mode. */
extern bool debug_flag;
/** Hide Title flag, if true title scene will run without image and music. */
extern bool hide_title_flag;
/** Window flag, if true will run in window mode instead of full screen. */
extern bool window_flag;
/** FPS flag, if true will display frames per second counter. */
extern bool fps_flag;
/** Battle Test flag, if true will run battle test. */
extern bool battle_test_flag;
/** Battle Test Troop ID to fight with if battle test is run. */
extern int battle_test_troop_id;
/** Overwrite party x position */
extern int party_x_position;
/** Overwrite party y position */
extern int party_y_position;
/** Overwrite starting party members */
extern std::vector<int> party_members;
/** Overwrite start map */
extern int start_map_id;
/** New game flag, if true a new game starts directly. */
extern bool new_game_flag;
/** If set, savegame is loaded directly */
extern int load_game_id;
/** Prevent adding of RTP paths to the file finder */
extern bool no_rtp_flag;
/** Mutes audio playback */
extern bool no_audio_flag;
/** Encoding used */
extern std::string encoding;
/** Backslash recoded */
extern std::string escape_symbol;
/** Currently interpreted engine. */
extern int engine;
/** Game title. */
extern std::string game_title;
#ifdef EMSCRIPTEN
/** Name of game emscripten uses */
extern std::string emscripten_game_name;
#endif
#ifdef _3DS
/** Use DSP instead of CSND */
extern bool use_dsp;
/** Is executed from a .3dsx (otherwise .cia) */
extern bool is_3dsx;
#endif
}
#endif