summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/SCsub15
-rw-r--r--platform/android/build.gradle.template3
-rw-r--r--platform/android/os_android.cpp2
-rw-r--r--platform/javascript/detect.py28
-rw-r--r--platform/x11/os_x11.cpp3
5 files changed, 31 insertions, 20 deletions
diff --git a/platform/android/SCsub b/platform/android/SCsub
index 86f8c40f83..e8536953a3 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -49,10 +49,11 @@ gradle_text = gradle_basein.read()
gradle_maven_repos_text = ""
if len(env.android_maven_repos) > 0:
- gradle_maven_repos_text += "maven {\n"
+ gradle_maven_repos_text += ""
for x in env.android_maven_repos:
+ gradle_maven_repos_text += "\tmaven {\n"
gradle_maven_repos_text += "\t\t" + x + "\n"
- gradle_maven_repos_text += "\t}\n"
+ gradle_maven_repos_text += "\t}\n"
gradle_maven_dependencies_text = ""
@@ -64,7 +65,14 @@ gradle_java_dirs_text = ""
for x in env.android_java_dirs:
gradle_java_dirs_text += ",'" + x.replace("\\", "/") + "'"
+gradle_plugins = ""
+for x in env.android_gradle_plugins:
+ gradle_plugins += "apply plugin: \"" + x + "\"\n"
+gradle_classpath = ""
+for x in env.android_gradle_classpath:
+ gradle_classpath += "\t\tclasspath \"" + x + "\"\n"
+
gradle_res_dirs_text = ""
for x in env.android_res_dirs:
@@ -95,7 +103,8 @@ gradle_text = gradle_text.replace("$$GRADLE_ASSET_DIRS$$", gradle_asset_dirs_tex
gradle_text = gradle_text.replace("$$GRADLE_AIDL_DIRS$$", gradle_aidl_dirs_text)
gradle_text = gradle_text.replace("$$GRADLE_JNI_DIRS$$", gradle_jni_dirs_text)
gradle_text = gradle_text.replace("$$GRADLE_DEFAULT_CONFIG$$", gradle_default_config_text)
-
+gradle_text = gradle_text.replace("$$GRADLE_PLUGINS$$", gradle_plugins)
+gradle_text = gradle_text.replace("$$GRADLE_CLASSPATH$$", gradle_classpath)
gradle_baseout.write(gradle_text)
gradle_baseout.close()
diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template
index c46a15bd12..24aab8e01f 100644
--- a/platform/android/build.gradle.template
+++ b/platform/android/build.gradle.template
@@ -4,6 +4,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
+ $$GRADLE_CLASSPATH$$
}
}
@@ -83,3 +84,5 @@ android {
variant.outputs.get(0).setOutputFile(new File("${projectDir}/../../../bin", "android_${variant.name}.apk"))
}
}
+
+$$GRADLE_PLUGINS$$
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 60719f6d42..705f0df46e 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -421,6 +421,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev.mouse_button.y = touch[0].pos.y;
ev.mouse_button.global_x = touch[0].pos.x;
ev.mouse_button.global_y = touch[0].pos.y;
+ input->set_mouse_pos(Point2(touch[0].pos.x,touch[0].pos.y));
last_mouse = touch[0].pos;
input->parse_input_event(ev);
}
@@ -503,6 +504,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev.mouse_button.y = touch[0].pos.y;
ev.mouse_button.global_x = touch[0].pos.x;
ev.mouse_button.global_y = touch[0].pos.y;
+ input->set_mouse_pos(Point2(touch[0].pos.x,touch[0].pos.y));
input->parse_input_event(ev);
for (int i = 0; i < touch.size(); i++) {
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index c828045179..f82eae9ff2 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -28,7 +28,6 @@ def get_flags():
return [
('tools', 'no'),
('module_etc1_enabled', 'no'),
- ('module_mpc_enabled', 'no'),
('module_theora_enabled', 'no'),
]
@@ -70,13 +69,16 @@ def configure(env):
env['LIBSUFFIX'] = '.bc'
if (env["target"] == "release"):
- env.Append(CCFLAGS=['-O2'])
+ env.Append(CCFLAGS=['-O3'])
+ env.Append(LINKFLAGS=['-O3'])
elif (env["target"] == "release_debug"):
env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
+ env.Append(LINKFLAGS=['-O2'])
+ # retain function names at the cost of file size, for backtraces and profiling
+ env.Append(LINKFLAGS=['--profiling-funcs'])
elif (env["target"] == "debug"):
- env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-O2', '-DDEBUG_ENABLED'])
- #env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-g4', '-DDEBUG_ENABLED'])
- env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC'])
+ env.Append(CCFLAGS=['-O1', '-D_DEBUG', '-Wall', '-g', '-DDEBUG_ENABLED'])
+ env.Append(LINKFLAGS=['-O1', '-g'])
# TODO: Move that to opus module's config
if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"):
@@ -84,16 +86,15 @@ def configure(env):
# These flags help keep the file size down
env.Append(CPPFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST', '-fno-rtti'])
- env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL', '-DMPC_FIXED_POINT', '-DTYPED_METHOD_BIND', '-DNO_THREADS'])
+ env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DTYPED_METHOD_BIND', '-DNO_THREADS'])
env.Append(CPPFLAGS=['-DGLES3_ENABLED'])
+ env.Append(LINKFLAGS=['-s', 'USE_WEBGL2=1'])
- if env['wasm'] == 'yes':
+ if (env['wasm'] == 'yes'):
env.Append(LINKFLAGS=['-s', 'BINARYEN=1'])
- # Maximum memory size is baked into the WebAssembly binary during
- # compilation, so we need to enable memory growth to allow setting
- # TOTAL_MEMORY at runtime. The value set at runtime must be higher than
- # what is set during compilation, check TOTAL_MEMORY in Emscripten's
- # src/settings.js for the default.
+ # In contrast to asm.js, enabling memory growth on WebAssembly has no
+ # major performance impact, and causes only a negligible increase in
+ # memory size.
env.Append(LINKFLAGS=['-s', 'ALLOW_MEMORY_GROWTH=1'])
env.extra_suffix = '.webassembly' + env.extra_suffix
else:
@@ -103,8 +104,5 @@ def configure(env):
if env['javascript_eval'] == 'yes':
env.Append(CPPFLAGS=['-DJAVASCRIPT_EVAL_ENABLED'])
- env.Append(LINKFLAGS=['-O2'])
- env.Append(LINKFLAGS=['-s', 'USE_WEBGL2=1'])
- # env.Append(LINKFLAGS=['-g4'])
import methods
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 4f79f2fb5d..d7cb69f2b9 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -332,12 +332,11 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
WARN_PRINT("XCreateIC couldn't create xic");
}
- XcursorSetTheme(x11_display, "default");
cursor_size = XcursorGetDefaultSize(x11_display);
cursor_theme = XcursorGetTheme(x11_display);
if (!cursor_theme) {
- print_line("not found theme");
+ WARN_PRINT("Could not find cursor theme");
cursor_theme = "default";
}