diff options
Diffstat (limited to 'platform')
27 files changed, 97 insertions, 96 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 fa9474bfe8..021a92ca1e 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[] = { @@ -344,6 +344,7 @@ class EditorExportAndroid : public EditorExportPlatform { } d.name = vendor + " " + device; + if (device == String()) continue; } ndevices.push_back(d); @@ -576,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; @@ -630,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; @@ -759,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()); @@ -1054,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,7 +1086,7 @@ public: r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_large"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_xlarge"), true)); - 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"), "")); } @@ -1485,7 +1490,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); @@ -1619,7 +1624,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); diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 92c9be5d43..c23037f3e0 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -184,6 +184,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 +254,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; 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/crash_handler_osx.mm b/platform/osx/crash_handler_osx.mm index 9ad3437f0f..490155bb24 100644 --- a/platform/osx/crash_handler_osx.mm +++ b/platform/osx/crash_handler_osx.mm @@ -68,8 +68,9 @@ static uint64_t load_address() { } static void handle_crash(int sig) { - if (OS::get_singleton() == NULL) - return; + if (OS::get_singleton() == NULL) { + abort(); + } void *bt_buffer[256]; size_t size = backtrace(bt_buffer, 256); @@ -151,6 +152,7 @@ CrashHandler::CrashHandler() { } CrashHandler::~CrashHandler() { + disable(); } void CrashHandler::disable() { 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 266b0c5cc9..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): @@ -56,7 +54,7 @@ def configure(env): ## Compiler configuration if env['use_llvm']: - if ('clang++' not in env['CXX']): + if ('clang++' not in os.path.basename(env['CXX'])): env["CC"] = "clang" env["CXX"] = "clang++" env["LINK"] = "clang++" 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/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/crash_handler_x11.cpp b/platform/x11/crash_handler_x11.cpp index ab9275e49f..79c3d9aece 100644 --- a/platform/x11/crash_handler_x11.cpp +++ b/platform/x11/crash_handler_x11.cpp @@ -45,8 +45,9 @@ #include <stdlib.h> static void handle_crash(int sig) { - if (OS::get_singleton() == NULL) - return; + if (OS::get_singleton() == NULL) { + abort(); + } void *bt_buffer[256]; size_t size = backtrace(bt_buffer, 256); @@ -119,6 +120,7 @@ CrashHandler::CrashHandler() { } CrashHandler::~CrashHandler() { + disable(); } void CrashHandler::disable() { diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 6a7a426804..ee59e9b5a1 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -86,7 +86,7 @@ def configure(env): env.Prepend(CCFLAGS=['-O3', '-ffast-math']) else: #optimize for size env.Prepend(CCFLAGS=['-Os']) - + if (env["debug_symbols"] == "yes"): env.Prepend(CCFLAGS=['-g1']) if (env["debug_symbols"] == "full"): @@ -115,12 +115,12 @@ def configure(env): ## Compiler configuration - if 'CXX' in env and 'clang' in env['CXX']: + if 'CXX' in env and 'clang' in os.path.basename(env['CXX']): # Convenience check to enforce the use_llvm overrides when CXX is clang(++) env['use_llvm'] = True if env['use_llvm']: - if ('clang++' not in env['CXX']): + if ('clang++' not in os.path.basename(env['CXX'])): env["CC"] = "clang" env["CXX"] = "clang++" env["LINK"] = "clang++" @@ -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" |