-
Notifications
You must be signed in to change notification settings - Fork 121
/
PFmain.h
97 lines (85 loc) · 3.75 KB
/
PFmain.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
/** Copyright (C) 2011 Josh Ventura
*** Copyright (C) 2013-2014 Robert B. Colton
***
*** This file is a part of the ENIGMA Development Environment.
***
*** ENIGMA 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, version 3 of the license or any later version.
***
*** This application and its source code is distributed AS-IS, 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 this code. If not, see <http://www.gnu.org/licenses/>
**/
#ifndef ENIGMA_PLATFORM_MAIN
#define ENIGMA_PLATFORM_MAIN
#include <string>
namespace enigma {
extern bool game_isending;
extern int game_return;
extern int parameterc;
extern std::string* parameters;
extern int pausedSteps;
extern int current_room_speed;
extern int frames_count;
extern unsigned long current_time_mcs;
extern bool game_window_focused;
int enigma_main(int argc, char** argv);
int game_ending();
void Sleep(int ms);
void compute_window_scaling();
void compute_window_size();
void initialize_directory_globals();
void set_program_args(int argc, char** argv);
void initTimer();
int updateTimer();
int gameWait();
void set_room_speed(int rs);
}
namespace enigma_insecure {
void execute_shell(std::string operation, std::string fname, std::string args, bool wait = false);
void execute_shell_for_output(const std::string &command, std::string& res);
}
namespace enigma_user {
extern std::string working_directory;
extern std::string program_directory;
extern std::string temp_directory;
extern std::string keyboard_string;
extern int keyboard_key;
extern double fps;
extern unsigned long delta_time;
extern unsigned long current_time;
void sleep(int ms);
void game_end();
void game_end(int ret);
void action_end_game();
void url_open(std::string url,std::string target="_self",std::string options="");
void url_open_ext(std::string url, std::string target);
void url_open_full(std::string url, std::string target,std::string options);
void action_webpage(const std::string &url);
// Data type could be unsigned for the paramter since the collection is size_t, however this would make the function not behave as GM.
// show_message(parameter_string(-1)); in GM8.1 will show an empty string, if this function cast the parameter to unsigned that won't be the behavior.
std::string parameter_string(int x);
// This function does not work the same as GM8.1, while it returns the native argument count, GM8.1 reports an argument count of 0 for an empty game, even
// though the first parameter which is the filename is successfully returned from parameter_string. So the assumption is GM8.1's version always reports 1 less
// than the ENIGMA version.
int parameter_count();
unsigned long long disk_size(std::string drive);
unsigned long long disk_free(std::string drive);
void set_program_priority(int value);
void execute_shell(std::string fname, std::string args);
void execute_shell(std::string operation, std::string fname, std::string args);
std::string execute_shell_for_output(const std::string &command);
void execute_program(std::string fname, std::string args, bool wait);
void execute_program(std::string operation, std::string fname, std::string args, bool wait);
std::string filename_absolute(std::string fname);
std::string filename_join(std::string prefix, std::string suffix);
std::string environment_get_variable(std::string name);
bool environment_set_variable(const std::string &name, const std::string &value);
bool set_working_directory(std::string dname);
}
#endif //ENIGMA_PLATFORM_MAIN