blob: 5f83a8e10734f4d76c6f9ad8e5821351101d8899 (
plain)
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
|
#include "os_flash.h"
#include "main/main.h"
#include "rasterizer_flash.h"
#include "drivers/gles1/rasterizer_gles1.h"
#include "servers/visual/visual_server_raster.h"
#include "dir_access_flash.h"
//#include "AS3.h"
int OSFlash::get_video_driver_count() const {
return 1;
};
const char * OSFlash::get_video_driver_name(int p_driver) const {
return "Flash";
};
OS::VideoMode OSFlash::get_default_video_mode() const {
return OS::VideoMode();
};
int OSFlash::get_audio_driver_count() const {
return 1;
};
const char * OSFlash::get_audio_driver_name(int p_driver) const {
return "Flash";
};
void OSFlash::initialize_core() {
OS_Unix::initialize_core();
//DirAccessFlash::make_default();
};
void OSFlash::initialize(const OS::VideoMode& p_desired,int p_video_driver,int p_audio_driver) {
input = memnew( InputDefault );
rasterizer = memnew( RasterizerGLES1(false) );
//rasterizer = memnew( RasterizerFlash(false) );
visual_server = memnew( VisualServerRaster(rasterizer) );
visual_server->init();
visual_server->cursor_set_visible(false, 0);
audio_driver = memnew(AudioDriverDummy);
audio_driver->set_singleton();
audio_driver->init();
sample_manager = memnew( SampleManagerMallocSW );
audio_server = memnew( AudioServerSW(sample_manager) );
audio_server->set_mixer_params(AudioMixerSW::INTERPOLATION_LINEAR,false);
audio_server->init();
spatial_sound_server = memnew( SpatialSoundServerSW );
spatial_sound_server->init();
spatial_sound_2d_server = memnew( SpatialSound2DServerSW );
spatial_sound_2d_server->init();
physics_server = memnew( PhysicsServerSW );
physics_server->init();
physics_2d_server = memnew( Physics2DServerSW );
physics_2d_server->init();
};
void OSFlash::set_main_loop( MainLoop * p_main_loop ) {
input->set_main_loop(p_main_loop);
main_loop=p_main_loop;
};
void OSFlash::delete_main_loop() {
memdelete( main_loop );
main_loop = NULL;
};
void OSFlash::finalize() {
memdelete(input);
};
void OSFlash::set_mouse_show(bool p_show) {
};
void OSFlash::set_mouse_grab(bool p_grab) {
};
bool OSFlash::is_mouse_grab_enabled() const {
return false;
};
Point2 OSFlash::get_mouse_pos() const {
return Point2();
};
int OSFlash::get_mouse_button_state() const {
return 0;
};
void OSFlash::set_window_title(const String& p_title) {
};
bool OSFlash::has_virtual_keyboard() const {
return false;
};
void OSFlash::show_virtual_keyboard(const String& p_existing_text,const Rect2& p_screen_rect) {
};
void OSFlash::hide_virtual_keyboard() {
};
void OSFlash::set_video_mode(const OS::VideoMode& p_video_mode,int p_screen) {
default_videomode = p_video_mode;
};
OS::VideoMode OSFlash::get_video_mode(int p_screen) const {
return default_videomode;
};
void OSFlash::get_fullscreen_mode_list(List<OS::VideoMode> *p_list,int p_screen) const {
p_list->push_back(default_videomode);
};
String OSFlash::get_name() {
return "Flash";
};
MainLoop *OSFlash::get_main_loop() const {
return main_loop;
};
bool OSFlash::can_draw() const {
return true;
}
void OSFlash::set_cursor_shape(CursorShape p_shape) {
};
bool OSFlash::has_touchscreen_ui_hint() const {
return false;
};
Error OSFlash::shell_open(String p_uri) {
return ERR_UNAVAILABLE;
};
void OSFlash::yield() {
//flyield();
//inline_as3(
// "flyield();\n"
//);
};
bool OSFlash::iterate() {
if (!main_loop)
return true;
return Main::iteration();
};
|