summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/SCsub2
-rw-r--r--platform/android/SCsub10
-rw-r--r--platform/android/export/export.cpp33
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java15
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotView.java20
-rw-r--r--platform/haiku/context_gl_haiku.h6
-rw-r--r--platform/haiku/detect.py2
-rw-r--r--platform/haiku/platform_config.h4
-rw-r--r--platform/iphone/SCsub3
-rw-r--r--platform/iphone/export/export.cpp8
-rw-r--r--platform/javascript/http_client_javascript.cpp6
-rw-r--r--platform/javascript/javascript_eval.cpp3
-rw-r--r--platform/javascript/os_javascript.cpp32
-rw-r--r--platform/javascript/os_javascript.h2
-rw-r--r--platform/osx/SCsub2
-rw-r--r--platform/osx/export/export.cpp4
-rw-r--r--platform/osx/platform_config.h4
-rw-r--r--platform/server/SCsub2
-rw-r--r--platform/server/detect.py4
-rw-r--r--platform/uwp/gl_context_egl.h6
-rw-r--r--platform/windows/SCsub4
-rw-r--r--platform/windows/context_gl_win.h2
-rw-r--r--platform/windows/os_windows.cpp4
-rw-r--r--platform/windows/platform_config.h4
-rw-r--r--platform/x11/SCsub2
-rw-r--r--platform/x11/context_gl_x11.h2
-rw-r--r--platform/x11/detect.py5
-rw-r--r--platform/x11/os_x11.cpp12
-rw-r--r--platform/x11/os_x11.h11
-rw-r--r--platform/x11/platform_config.h4
30 files changed, 117 insertions, 101 deletions
diff --git a/platform/SCsub b/platform/SCsub
index 0f9c2047a0..aa83154ee0 100644
--- a/platform/SCsub
+++ b/platform/SCsub
@@ -29,5 +29,3 @@ platform_sources.append('register_platform_apis.gen.cpp')
lib = env.add_library('platform', platform_sources)
env.Prepend(LIBS=lib)
-
-Export('env')
diff --git a/platform/android/SCsub b/platform/android/SCsub
index 31fee5722c..807506000f 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -1,12 +1,12 @@
#!/usr/bin/env python
+Import('env')
+
import shutil
from compat import open_utf8
from distutils.version import LooseVersion
from detect import get_ndk_version
-Import('env')
-
android_files = [
'os_android.cpp',
@@ -26,10 +26,6 @@ android_files = [
# 'power_android.cpp'
]
-# env.Depends('#core/math/vector3.h', 'vector3_psp.h')
-
-#obj = env.SharedObject('godot_android.cpp')
-
env_android = env.Clone()
if env['target'] == "profile":
env_android.Append(CPPFLAGS=['-DPROFILER_ENABLED'])
@@ -174,4 +170,4 @@ if lib_arch_dir != '':
ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"])
if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("15.0.4075724"):
stl_lib_path = str(env['ANDROID_NDK_ROOT']) + '/sources/cxx-stl/llvm-libc++/libs/' + lib_arch_dir + '/libc++_shared.so'
- env_android.Command(out_dir + '/libc++_shared.so', stl_lib_path, Copy("$TARGET", "$SOURCE")) \ No newline at end of file
+ env_android.Command(out_dir + '/libc++_shared.so', stl_lib_path, Copy("$TARGET", "$SOURCE"))
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 6ec7d27464..3b503e2657 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -194,8 +194,8 @@ static const char *android_perms[] = {
};
struct LauncherIcon {
- char *option_id;
- char *export_path;
+ const char *option_id;
+ const char *export_path;
};
static const LauncherIcon launcher_icons[] = {
@@ -577,11 +577,11 @@ class EditorExportAndroid : public EditorExportPlatform {
uint32_t ofs = 8;
uint32_t string_count = 0;
- uint32_t styles_count = 0;
+ //uint32_t styles_count = 0;
uint32_t string_flags = 0;
uint32_t string_data_offset = 0;
- uint32_t styles_offset = 0;
+ //uint32_t styles_offset = 0;
uint32_t string_table_begins = 0;
uint32_t string_table_ends = 0;
Vector<uint8_t> stable_extra;
@@ -631,16 +631,16 @@ class EditorExportAndroid : public EditorExportPlatform {
int iofs = ofs + 8;
string_count = decode_uint32(&p_manifest[iofs]);
- styles_count = decode_uint32(&p_manifest[iofs + 4]);
+ //styles_count = decode_uint32(&p_manifest[iofs + 4]);
string_flags = decode_uint32(&p_manifest[iofs + 8]);
string_data_offset = decode_uint32(&p_manifest[iofs + 12]);
- styles_offset = decode_uint32(&p_manifest[iofs + 16]);
+ //styles_offset = decode_uint32(&p_manifest[iofs + 16]);
/*
printf("string count: %i\n",string_count);
printf("flags: %i\n",string_flags);
printf("sdata ofs: %i\n",string_data_offset);
printf("styles ofs: %i\n",styles_offset);
- */
+ */
uint32_t st_offset = iofs + 20;
string_table.resize(string_count);
uint32_t string_end = 0;
@@ -760,7 +760,6 @@ class EditorExportAndroid : public EditorExportPlatform {
// save manifest ending so we can restore it
Vector<uint8_t> manifest_end;
uint32_t manifest_cur_size = p_manifest.size();
- uint32_t node_size = size;
manifest_end.resize(p_manifest.size() - ofs);
memcpy(manifest_end.ptrw(), &p_manifest[ofs], manifest_end.size());
@@ -1055,7 +1054,12 @@ public:
if (api == 0)
r_features->push_back("etc");
else*/
- r_features->push_back("etc2");
+ String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name");
+ if (driver == "GLES2") {
+ r_features->push_back("etc");
+ } else {
+ r_features->push_back("etc2");
+ }
Vector<String> abis = get_enabled_abis(p_preset);
for (int i = 0; i < abis.size(); ++i) {
@@ -1081,8 +1085,9 @@ public:
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_normal"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_large"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_xlarge"), true));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/opengl_debug"), false));
- for (int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
+ for (unsigned int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_icons[i].option_id, PROPERTY_HINT_FILE, "*.png"), ""));
}
@@ -1434,6 +1439,7 @@ public:
bool use_32_fb = p_preset->get("graphics/32_bits_framebuffer");
bool immersive = p_preset->get("screen/immersive_mode");
+ bool debug_opengl = p_preset->get("screen/opengl_debug");
bool _signed = p_preset->get("package/signed");
@@ -1486,7 +1492,7 @@ public:
if (file == "res/drawable/icon.png") {
bool found = false;
- for (int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
+ for (unsigned int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
String icon_path = String(p_preset->get(launcher_icons[i].option_id)).strip_edges();
if (icon_path != "" && icon_path.ends_with(".png")) {
FileAccess *f = FileAccess::open(icon_path, FileAccess::READ);
@@ -1620,7 +1626,7 @@ public:
APKExportData ed;
ed.ep = &ep;
ed.apk = unaligned_apk;
- for (int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
+ for (unsigned int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
String icon_path = String(p_preset->get(launcher_icons[i].option_id)).strip_edges();
if (icon_path != "" && icon_path.ends_with(".png") && FileAccess::exists(icon_path)) {
Vector<uint8_t> data = FileAccess::get_file_as_array(icon_path);
@@ -1635,6 +1641,9 @@ public:
if (immersive)
cl.push_back("--use_immersive");
+ if (debug_opengl)
+ cl.push_back("--debug_opengl");
+
if (cl.size()) {
//add comandline
Vector<uint8_t> clf;
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index 92c9be5d43..ab37f7a02c 100644
--- a/platform/android/java/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -116,6 +116,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
private boolean use_32_bits = false;
private boolean use_immersive = false;
+ private boolean use_debug_opengl = false;
private boolean mStatePaused;
private int mState;
private boolean keep_screen_on = true;
@@ -184,6 +185,9 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
protected void onMainActivityResult(int requestCode, int resultCode, Intent data) {
}
+ protected void onMainRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+ }
+
protected void onMainPause() {}
protected void onMainResume() {}
protected void onMainDestroy() {}
@@ -251,6 +255,13 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
}
};
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+ for (int i = 0; i < singleton_count; i++) {
+ singletons[i].onMainRequestPermissionsResult(requestCode, permissions, grantResults);
+ }
+ };
+
public void onVideoInit() {
boolean use_gl3 = getGLESVersionCode() >= 0x00030000;
@@ -268,7 +279,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
// ...add to FrameLayout
layout.addView(edittext);
- mView = new GodotView(getApplication(), io, use_gl3, use_32_bits, this);
+ mView = new GodotView(getApplication(), io, use_gl3, use_32_bits, use_debug_opengl,this);
layout.addView(mView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
edittext.setView(mView);
io.setEdit(edittext);
@@ -461,6 +472,8 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
boolean has_extra = i < command_line.length - 1;
if (command_line[i].equals("--use_depth_32")) {
use_32_bits = true;
+ } else if (command_line[i].equals("--debug_opengl")) {
+ use_debug_opengl = true;
} else if (command_line[i].equals("--use_immersive")) {
use_immersive = true;
if (Build.VERSION.SDK_INT >= 19.0) { // check if the application runs on an android 4.4+
diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java
index 23723c2696..181ffc3b4b 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotView.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotView.java
@@ -81,16 +81,18 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
private static boolean firsttime = true;
private static boolean use_gl3 = false;
private static boolean use_32 = false;
+ private static boolean use_debug_opengl = false;
private Godot activity;
private InputManagerCompat mInputManager;
- public GodotView(Context context, GodotIO p_io, boolean p_use_gl3, boolean p_use_32_bits, Godot p_activity) {
+ public GodotView(Context context, GodotIO p_io, boolean p_use_gl3, boolean p_use_32_bits, boolean p_use_debug_opengl,Godot p_activity) {
super(context);
ctx = context;
io = p_io;
use_gl3 = p_use_gl3;
use_32 = p_use_32_bits;
+ use_debug_opengl = p_use_debug_opengl;
activity = p_activity;
@@ -406,6 +408,9 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
setRenderer(new Renderer());
}
+ private static final int _EGL_CONTEXT_FLAGS_KHR = 0x30FC;
+ private static final int _EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR= 0x00000001;
+
private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
@@ -415,9 +420,16 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
Log.w(TAG, "creating OpenGL ES 2.0 context :");
checkEglError("Before eglCreateContext", egl);
- int[] attrib_list2 = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
- int[] attrib_list3 = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL10.EGL_NONE };
- EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, use_gl3 ? attrib_list3 : attrib_list2);
+ EGLContext context;
+ if (use_debug_opengl) {
+ int[] attrib_list2 = { EGL_CONTEXT_CLIENT_VERSION, 2,_EGL_CONTEXT_FLAGS_KHR,_EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR, EGL10.EGL_NONE };
+ int[] attrib_list3 = { EGL_CONTEXT_CLIENT_VERSION, 3,_EGL_CONTEXT_FLAGS_KHR,_EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR, EGL10.EGL_NONE };
+ context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, use_gl3 ? attrib_list3 : attrib_list2);
+ } else {
+ int[] attrib_list2 = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
+ int[] attrib_list3 = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL10.EGL_NONE };
+ context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, use_gl3 ? attrib_list3 : attrib_list2);
+ }
checkEglError("After eglCreateContext", egl);
return context;
}
diff --git a/platform/haiku/context_gl_haiku.h b/platform/haiku/context_gl_haiku.h
index 74f09984f2..2c20570a8d 100644
--- a/platform/haiku/context_gl_haiku.h
+++ b/platform/haiku/context_gl_haiku.h
@@ -46,9 +46,6 @@ private:
bool use_vsync;
public:
- ContextGL_Haiku(HaikuDirectWindow *p_window);
- ~ContextGL_Haiku();
-
virtual Error initialize();
virtual void release_current();
virtual void make_current();
@@ -58,6 +55,9 @@ public:
virtual void set_use_vsync(bool p_use);
virtual bool is_using_vsync() const;
+
+ ContextGL_Haiku(HaikuDirectWindow *p_window);
+ virtual ~ContextGL_Haiku();
};
#endif
diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py
index 7ecdd2bb11..8d704ac657 100644
--- a/platform/haiku/detect.py
+++ b/platform/haiku/detect.py
@@ -148,7 +148,7 @@ def configure(env):
## Flags
env.Append(CPPPATH=['#platform/haiku'])
- env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED', '-DGLES_OVER_GL'])
+ env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED'])
env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED'])
# env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
diff --git a/platform/haiku/platform_config.h b/platform/haiku/platform_config.h
index 72c8ee2535..b00510f5a1 100644
--- a/platform/haiku/platform_config.h
+++ b/platform/haiku/platform_config.h
@@ -33,5 +33,5 @@
// for ifaddrs.h needed in drivers/unix/ip_unix.cpp
#define _BSD_SOURCE 1
-#define GLES3_INCLUDE_H "glad/glad.h"
-#define GLES2_INCLUDE_H "glad/glad.h"
+#define GLES3_INCLUDE_H "thirdparty/glad/glad/glad.h"
+#define GLES2_INCLUDE_H "thirdparty/glad/glad/glad.h"
diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub
index b96bec16b4..debf051eda 100644
--- a/platform/iphone/SCsub
+++ b/platform/iphone/SCsub
@@ -1,8 +1,9 @@
#!/usr/bin/env python
-import os
Import('env')
+import os
+
iphone_lib = [
'godot_iphone.cpp',
'os_iphone.cpp',
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index aae9d97a28..63bc4a519b 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -203,7 +203,7 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options)
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_40x40", PROPERTY_HINT_FILE, "*.png"), "")); // Spotlight
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_80x80", PROPERTY_HINT_FILE, "*.png"), "")); // Spotlight on devices with retina display
- for (int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) {
+ for (unsigned int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) {
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, loading_screen_infos[i].preset_key, PROPERTY_HINT_FILE, "*.png"), ""));
}
@@ -353,7 +353,7 @@ Error EditorExportPlatformIOS::_export_icons(const Ref<EditorExportPreset> &p_pr
DirAccess *da = DirAccess::open(p_iconset_dir);
ERR_FAIL_COND_V(!da, ERR_CANT_OPEN);
- for (int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) {
+ for (unsigned int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) {
IconInfo info = icon_infos[i];
String icon_path = p_preset->get(info.preset_key);
if (icon_path.length() == 0) {
@@ -403,7 +403,7 @@ Error EditorExportPlatformIOS::_export_loading_screens(const Ref<EditorExportPre
DirAccess *da = DirAccess::open(p_dest_dir);
ERR_FAIL_COND_V(!da, ERR_CANT_OPEN);
- for (int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) {
+ for (unsigned int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) {
LoadingScreenInfo info = loading_screen_infos[i];
String loading_screen_file = p_preset->get(info.preset_key);
if (loading_screen_file.size() > 0) {
@@ -490,7 +490,7 @@ private:
static String _hex_pad(uint32_t num) {
Vector<char> ret;
ret.resize(sizeof(num) * 2);
- for (int i = 0; i < sizeof(num) * 2; ++i) {
+ for (unsigned int i = 0; i < sizeof(num) * 2; ++i) {
uint8_t four_bits = (num >> (sizeof(num) * 8 - (i + 1) * 4)) & 0xF;
ret.write[i] = _hex_char(four_bits);
}
diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp
index 4fb41d4dc9..ccf4f8a11b 100644
--- a/platform/javascript/http_client_javascript.cpp
+++ b/platform/javascript/http_client_javascript.cpp
@@ -237,7 +237,7 @@ Error HTTPClient::poll() {
case STATUS_CONNECTION_ERROR:
return ERR_CONNECTION_ERROR;
- case STATUS_REQUESTING:
+ case STATUS_REQUESTING: {
#ifdef DEBUG_ENABLED
if (!has_polled) {
@@ -281,6 +281,10 @@ Error HTTPClient::poll() {
godot_xhr_get_response(xhr_id, write.ptr(), polled_response.size());
write = PoolByteArray::Write();
break;
+ }
+
+ default:
+ ERR_FAIL_V(ERR_BUG);
}
return OK;
}
diff --git a/platform/javascript/javascript_eval.cpp b/platform/javascript/javascript_eval.cpp
index 07b4c192e6..9b8174cc71 100644
--- a/platform/javascript/javascript_eval.cpp
+++ b/platform/javascript/javascript_eval.cpp
@@ -140,8 +140,9 @@ Variant JavaScript::eval(const String &p_code, bool p_use_global_exec_context) {
case Variant::POOL_BYTE_ARRAY:
arr_write = PoolByteArray::Write();
return arr;
+ default:
+ return Variant();
}
- return Variant();
}
#endif // JAVASCRIPT_EVAL_ENABLED
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index b0ec3c4245..7c7aeac980 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -31,12 +31,12 @@
#include "os_javascript.h"
#include "core/io/file_access_buffered_fa.h"
-#include "gles2/rasterizer_gles2.h"
-#include "gles3/rasterizer_gles3.h"
+#include "drivers/gles2/rasterizer_gles2.h"
+#include "drivers/gles3/rasterizer_gles3.h"
+#include "drivers/unix/dir_access_unix.h"
+#include "drivers/unix/file_access_unix.h"
#include "main/main.h"
#include "servers/visual/visual_server_raster.h"
-#include "unix/dir_access_unix.h"
-#include "unix/file_access_unix.h"
#include <emscripten.h>
#include <png.h>
@@ -121,14 +121,14 @@ void OS_JavaScript::set_window_size(const Size2 p_size) {
emscripten_exit_soft_fullscreen();
window_maximized = false;
}
- emscripten_set_canvas_size(p_size.x, p_size.y);
+ emscripten_set_canvas_element_size(NULL, p_size.x, p_size.y);
}
}
Size2 OS_JavaScript::get_window_size() const {
- int canvas[3];
- emscripten_get_canvas_size(canvas, canvas + 1, canvas + 2);
+ int canvas[2];
+ emscripten_get_canvas_element_size(NULL, canvas, canvas + 1);
return Size2(canvas[0], canvas[1]);
}
@@ -378,15 +378,13 @@ static void set_css_cursor(const char *p_cursor) {
/* clang-format on */
}
-static const char *get_css_cursor() {
+static bool is_css_cursor_hidden() {
- char cursor[16];
/* clang-format off */
- EM_ASM_INT({
- stringToUTF8(Module.canvas.style.cursor ? Module.canvas.style.cursor : 'auto', $0, 16);
- }, cursor);
+ return EM_ASM_INT({
+ return Module.canvas.style.cursor === 'none';
+ });
/* clang-format on */
- return cursor;
}
void OS_JavaScript::set_cursor_shape(CursorShape p_shape) {
@@ -430,7 +428,7 @@ void OS_JavaScript::set_mouse_mode(OS::MouseMode p_mode) {
OS::MouseMode OS_JavaScript::get_mouse_mode() const {
- if (String::utf8(get_css_cursor()) == "none")
+ if (is_css_cursor_hidden())
return MOUSE_MODE_HIDDEN;
EmscriptenPointerlockChangeEvent ev;
@@ -835,13 +833,13 @@ bool OS_JavaScript::main_loop_iterate() {
strategy.canvasResizedCallback = NULL;
emscripten_enter_soft_fullscreen(NULL, &strategy);
} else {
- emscripten_set_canvas_size(windowed_size.width, windowed_size.height);
+ emscripten_set_canvas_element_size(NULL, windowed_size.width, windowed_size.height);
}
just_exited_fullscreen = false;
}
- int canvas[3];
- emscripten_get_canvas_size(canvas, canvas + 1, canvas + 2);
+ int canvas[2];
+ emscripten_get_canvas_element_size(NULL, canvas, canvas + 1);
video_mode.width = canvas[0];
video_mode.height = canvas[1];
if (!window_maximized && !video_mode.fullscreen && !just_exited_fullscreen && !entering_fullscreen) {
diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h
index ddcbf8c7c9..84075898ac 100644
--- a/platform/javascript/os_javascript.h
+++ b/platform/javascript/os_javascript.h
@@ -32,10 +32,10 @@
#define OS_JAVASCRIPT_H
#include "audio_driver_javascript.h"
+#include "drivers/unix/os_unix.h"
#include "main/input_default.h"
#include "servers/audio_server.h"
#include "servers/visual/rasterizer.h"
-#include "unix/os_unix.h"
#include <emscripten/html5.h>
diff --git a/platform/osx/SCsub b/platform/osx/SCsub
index 5c973c30c2..dc407eee9e 100644
--- a/platform/osx/SCsub
+++ b/platform/osx/SCsub
@@ -1,8 +1,8 @@
#!/usr/bin/env python
-import os
Import('env')
+import os
from platform_methods import run_in_subprocess
import platform_osx_builders
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index b0232e2990..27b4fdc228 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -461,7 +461,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
fi.internal_fa = info.internal_fa;
fi.external_fa = info.external_fa;
- int zerr = zipOpenNewFileInZip(dst_pkg_zip,
+ zipOpenNewFileInZip(dst_pkg_zip,
file.utf8().get_data(),
&fi,
NULL,
@@ -472,7 +472,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
Z_DEFLATED,
Z_DEFAULT_COMPRESSION);
- zerr = zipWriteInFileInZip(dst_pkg_zip, data.ptr(), data.size());
+ zipWriteInFileInZip(dst_pkg_zip, data.ptr(), data.size());
zipCloseFileInZip(dst_pkg_zip);
}
}
diff --git a/platform/osx/platform_config.h b/platform/osx/platform_config.h
index 3f72831d77..1d32d5b5b9 100644
--- a/platform/osx/platform_config.h
+++ b/platform/osx/platform_config.h
@@ -30,6 +30,6 @@
#include <alloca.h>
-#define GLES3_INCLUDE_H "glad/glad.h"
-#define GLES2_INCLUDE_H "glad/glad.h"
+#define GLES3_INCLUDE_H "thirdparty/glad/glad/glad.h"
+#define GLES2_INCLUDE_H "thirdparty/glad/glad/glad.h"
#define PTHREAD_RENAME_SELF
diff --git a/platform/server/SCsub b/platform/server/SCsub
index 0788ad75ae..c9082f9b3a 100644
--- a/platform/server/SCsub
+++ b/platform/server/SCsub
@@ -2,11 +2,9 @@
Import('env')
-
common_server = [\
"os_server.cpp",\
"#platform/x11/crash_handler_x11.cpp",
"#platform/x11/power_x11.cpp",
]
-
prog = env.add_program('#bin/godot_server', ['godot_server.cpp'] + common_server)
diff --git a/platform/server/detect.py b/platform/server/detect.py
index e921bf4a5f..597a2ff6a0 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -29,9 +29,7 @@ def get_opts():
def get_flags():
- return [
- ("module_mobile_vr_enabled", False),
- ]
+ return []
def configure(env):
diff --git a/platform/uwp/gl_context_egl.h b/platform/uwp/gl_context_egl.h
index 3e3c4a0f57..3c7115cc34 100644
--- a/platform/uwp/gl_context_egl.h
+++ b/platform/uwp/gl_context_egl.h
@@ -71,8 +71,8 @@ public:
virtual int get_window_height();
virtual void swap_buffers();
- void set_use_vsync(bool use) { vsync = use; }
- bool is_using_vsync() const { return vsync; }
+ virtual void set_use_vsync(bool use) { vsync = use; }
+ virtual bool is_using_vsync() const { return vsync; }
virtual Error initialize();
void reset();
@@ -80,7 +80,7 @@ public:
void cleanup();
ContextEGL(CoreWindow ^ p_window, Driver p_driver);
- ~ContextEGL();
+ virtual ~ContextEGL();
};
#endif
diff --git a/platform/windows/SCsub b/platform/windows/SCsub
index 5dfb1592e0..e07d373c4b 100644
--- a/platform/windows/SCsub
+++ b/platform/windows/SCsub
@@ -1,8 +1,8 @@
#!/usr/bin/env python
-import os
Import('env')
+import os
from platform_methods import run_in_subprocess
import platform_windows_builders
@@ -19,9 +19,7 @@ common_win = [
]
res_file = 'godot_res.rc'
-
res_target = "godot_res" + env["OBJSUFFIX"]
-
res_obj = env.RES(res_target, res_file)
prog = env.add_program('#bin/godot', common_win + res_obj, PROGSUFFIX=env["PROGSUFFIX"])
diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h
index af2f89568e..5bcdb433b3 100644
--- a/platform/windows/context_gl_win.h
+++ b/platform/windows/context_gl_win.h
@@ -69,7 +69,7 @@ public:
virtual bool is_using_vsync() const;
ContextGL_Win(HWND hwnd, bool p_opengl_3_context);
- ~ContextGL_Win();
+ virtual ~ContextGL_Win();
};
#endif
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index d575525f93..e8c209c0fc 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -458,7 +458,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
*/
}
- if (window_has_focus && main_loop)
+ if (window_has_focus && main_loop && mm->get_relative() != Vector2())
input->parse_input_event(mm);
}
delete[] lpb;
@@ -697,7 +697,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
last_button_state = mb->get_button_mask();
mb->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
- if (mouse_mode == MOUSE_MODE_CAPTURED) {
+ if (mouse_mode == MOUSE_MODE_CAPTURED && !use_raw_input) {
mb->set_position(Vector2(old_x, old_y));
}
diff --git a/platform/windows/platform_config.h b/platform/windows/platform_config.h
index d100385e80..aa020ed470 100644
--- a/platform/windows/platform_config.h
+++ b/platform/windows/platform_config.h
@@ -32,5 +32,5 @@
//#else
//#include <alloca.h>
//#endif
-#define GLES3_INCLUDE_H "glad/glad.h"
-#define GLES2_INCLUDE_H "glad/glad.h"
+#define GLES3_INCLUDE_H "thirdparty/glad/glad/glad.h"
+#define GLES2_INCLUDE_H "thirdparty/glad/glad/glad.h"
diff --git a/platform/x11/SCsub b/platform/x11/SCsub
index d3901eb798..97d3d1b514 100644
--- a/platform/x11/SCsub
+++ b/platform/x11/SCsub
@@ -1,8 +1,8 @@
#!/usr/bin/env python
-import os
Import('env')
+import os
from platform_methods import run_in_subprocess
import platform_x11_builders
diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h
index ab0379a2fe..be3083d957 100644
--- a/platform/x11/context_gl_x11.h
+++ b/platform/x11/context_gl_x11.h
@@ -79,7 +79,7 @@ public:
virtual bool is_using_vsync() const;
ContextGL_X11(::Display *p_x11_display, ::Window &p_x11_window, const OS::VideoMode &p_default_video_mode, ContextType p_context_type);
- ~ContextGL_X11();
+ virtual ~ContextGL_X11();
};
#endif
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 905546e724..ee59e9b5a1 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -250,7 +250,8 @@ def configure(env):
if (os.system("pkg-config --exists alsa") == 0): # 0 means found
print("Enabling ALSA")
env.Append(CPPFLAGS=["-DALSA_ENABLED", "-DALSAMIDI_ENABLED"])
- env.ParseConfig('pkg-config alsa --cflags --libs')
+ # Don't parse --cflags, we don't need to add /usr/include/alsa to include path
+ env.ParseConfig('pkg-config alsa --libs')
else:
print("ALSA libraries not found, disabling driver")
@@ -278,7 +279,7 @@ def configure(env):
env.ParseConfig('pkg-config zlib --cflags --libs')
env.Append(CPPPATH=['#platform/x11'])
- env.Append(CPPFLAGS=['-DX11_ENABLED', '-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED', '-DGLES_OVER_GL'])
+ env.Append(CPPFLAGS=['-DX11_ENABLED', '-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED'])
env.Append(LIBS=['GL', 'pthread'])
if (platform.system() == "Linux"):
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 3d05a650da..5be0b9304a 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1995,15 +1995,9 @@ void OS_X11::process_xevents() {
} break;
case MotionNotify: {
- // FUCK YOU X11 API YOU SERIOUSLY GROSS ME OUT
- // YOU ARE AS GROSS AS LOOKING AT A PUTRID PILE
- // OF POOP STICKING OUT OF A CLOGGED TOILET
- // HOW THE FUCK I AM SUPPOSED TO KNOW WHICH ONE
- // OF THE MOTION NOTIFY EVENTS IS THE ONE GENERATED
- // BY WARPING THE MOUSE POINTER?
- // YOU ARE FORCING ME TO FILTER ONE BY ONE TO FIND IT
- // PLEASE DO ME A FAVOR AND DIE DROWNED IN A FECAL
- // MOUNTAIN BECAUSE THAT'S WHERE YOU BELONG.
+ // The X11 API requires filtering one-by-one through the motion
+ // notify events, in order to figure out which event is the one
+ // generated by warping the mouse pointer.
while (true) {
if (mouse_mode == MOUSE_MODE_CAPTURED && event.xmotion.x == current_videomode.width / 2 && event.xmotion.y == current_videomode.height / 2) {
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 47ff257455..bb8411e213 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -34,17 +34,17 @@
#include "context_gl_x11.h"
#include "core/os/input.h"
#include "crash_handler_x11.h"
-#include "drivers/unix/os_unix.h"
-#include "servers/visual_server.h"
-//#include "servers/visual/visual_server_wrap_mt.h"
#include "drivers/alsa/audio_driver_alsa.h"
#include "drivers/alsamidi/alsa_midi.h"
#include "drivers/pulseaudio/audio_driver_pulseaudio.h"
+#include "drivers/unix/os_unix.h"
#include "joypad_linux.h"
#include "main/input_default.h"
#include "power_x11.h"
#include "servers/audio_server.h"
#include "servers/visual/rasterizer.h"
+#include "servers/visual_server.h"
+//#include "servers/visual/visual_server_wrap_mt.h"
#include <X11/Xcursor/Xcursor.h>
#include <X11/Xlib.h>
@@ -145,7 +145,6 @@ class OS_X11 : public OS_Unix {
void handle_key_event(XKeyEvent *p_event, bool p_echo = false);
void process_xevents();
virtual void delete_main_loop();
- IP_Unix *ip_unix;
bool force_quit;
bool minimized;
@@ -177,8 +176,6 @@ class OS_X11 : public OS_Unix {
AudioDriverPulseAudio driver_pulseaudio;
#endif
- Atom net_wm_icon;
-
PowerX11 *power_manager;
bool layered_window;
@@ -186,8 +183,6 @@ class OS_X11 : public OS_Unix {
CrashHandler crash_handler;
int video_driver_index;
- int audio_driver_index;
- unsigned int capture_idle;
bool maximized;
//void set_wm_border(bool p_enabled);
void set_wm_fullscreen(bool p_enabled);
diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h
index b757be49c3..f6d7f5a8cd 100644
--- a/platform/x11/platform_config.h
+++ b/platform/x11/platform_config.h
@@ -36,5 +36,5 @@
#define PTHREAD_BSD_SET_NAME
#endif
-#define GLES3_INCLUDE_H "glad/glad.h"
-#define GLES2_INCLUDE_H "glad/glad.h"
+#define GLES3_INCLUDE_H "thirdparty/glad/glad/glad.h"
+#define GLES2_INCLUDE_H "thirdparty/glad/glad/glad.h"