summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-03 15:34:29 +0200
committerGitHub <noreply@github.com>2018-10-03 15:34:29 +0200
commit874e3b4a37f68d12341d172fe7c6076cce4de517 (patch)
tree64c3778299810f2d601ba141628aae37a20b859b
parentf8484bb77d6ddf1f5078d804a8abff3d106d6cab (diff)
parentd952126caf35fbc58db6976e6cc8be8baba95638 (diff)
Merge pull request #22676 from akien-mga/fix-warnings
Fix warnings in Android platform
-rw-r--r--doc/classes/OS.xml1
-rw-r--r--drivers/unix/dir_access_unix.cpp2
-rw-r--r--modules/mobile_vr/mobile_vr_interface.cpp1
-rw-r--r--platform/android/SCsub14
-rw-r--r--platform/android/audio_driver_opensl.cpp17
-rw-r--r--platform/android/audio_driver_opensl.h11
-rw-r--r--platform/android/java_glue.cpp12
-rw-r--r--platform/android/os_android.cpp5
-rw-r--r--platform/android/os_android.h4
9 files changed, 22 insertions, 45 deletions
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index dad4ce898d..26684836ea 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -583,6 +583,7 @@
</argument>
<description>
Plays native video from the specified path, at the given volume and with audio and subtitle tracks.
+ Note: This method is only implemented on Android and iOS, and the current Android implementation does not support the [code]volume[/code], [code]audio_track[/code] and [code]subtitle_track[/code] options.
</description>
</method>
<method name="native_video_stop">
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index a5a9258c4a..48b4369b7e 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -391,7 +391,7 @@ size_t DirAccessUnix::get_space_left() {
return vfs.f_bfree * vfs.f_bsize;
#else
-#warning THIS IS BROKEN
+ // FIXME: Implement this.
return 0;
#endif
};
diff --git a/modules/mobile_vr/mobile_vr_interface.cpp b/modules/mobile_vr/mobile_vr_interface.cpp
index b9a404709e..87e4ddd900 100644
--- a/modules/mobile_vr/mobile_vr_interface.cpp
+++ b/modules/mobile_vr/mobile_vr_interface.cpp
@@ -398,7 +398,6 @@ void MobileVRInterface::commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_t
ERR_FAIL_COND(p_screen_rect == Rect2());
Rect2 dest = p_screen_rect;
- float aspect_ratio = 0.5 * p_screen_rect.size.x / p_screen_rect.size.y;
Vector2 eye_center;
// we output half a screen
diff --git a/platform/android/SCsub b/platform/android/SCsub
index 807506000f..da2219b9e4 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -18,14 +18,17 @@ android_files = [
'dir_access_jandroid.cpp',
'thread_jandroid.cpp',
'audio_driver_jandroid.cpp',
- 'ifaddrs_android.cpp',
- 'android_native_app_glue.c',
'java_glue.cpp',
- 'cpu-features.c',
'java_class_wrapper.cpp',
# 'power_android.cpp'
]
+thirdparty_files = [
+ 'ifaddrs_android.cpp',
+ 'android_native_app_glue.c',
+ 'cpu-features.c',
+]
+
env_android = env.Clone()
if env['target'] == "profile":
env_android.Append(CPPFLAGS=['-DPROFILER_ENABLED'])
@@ -34,6 +37,11 @@ android_objects = []
for x in android_files:
android_objects.append(env_android.SharedObject(x))
+env_thirdparty = env_android.Clone()
+env_thirdparty.disable_warnings()
+for x in thirdparty_files:
+ android_objects.append(env_thirdparty.SharedObject(x))
+
prog = None
abspath = env.Dir(".").abspath
diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp
index 28e3ea962f..21c61f6ca0 100644
--- a/platform/android/audio_driver_opensl.cpp
+++ b/platform/android/audio_driver_opensl.cpp
@@ -38,12 +38,7 @@
/* Structure for passing information to callback function */
void AudioDriverOpenSL::_buffer_callback(
- SLAndroidSimpleBufferQueueItf queueItf
- /* SLuint32 eventFlags,
- const void * pBuffer,
- SLuint32 bufferSize,
- SLuint32 dataUsed*/
-) {
+ SLAndroidSimpleBufferQueueItf queueItf) {
bool mix = true;
@@ -85,7 +80,6 @@ void AudioDriverOpenSL::_buffer_callbacks(
AudioDriverOpenSL *ad = (AudioDriverOpenSL *)pContext;
- //ad->_buffer_callback(queueItf,eventFlags,pBuffer,bufferSize,dataUsed);
ad->_buffer_callback(queueItf);
}
@@ -98,12 +92,9 @@ const char *AudioDriverOpenSL::get_name() const {
Error AudioDriverOpenSL::init() {
- SLresult
- res;
+ SLresult res;
SLEngineOption EngineOption[] = {
- (SLuint32)SL_ENGINEOPTION_THREADSAFE,
- (SLuint32)SL_BOOLEAN_TRUE
-
+ { (SLuint32)SL_ENGINEOPTION_THREADSAFE, (SLuint32)SL_BOOLEAN_TRUE }
};
res = slCreateEngine(&sl, 1, EngineOption, 0, NULL, NULL);
if (res != SL_RESULT_SUCCESS) {
@@ -126,8 +117,6 @@ void AudioDriverOpenSL::start() {
mutex = Mutex::create();
active = false;
- SLint32 numOutputs = 0;
- SLuint32 deviceID = 0;
SLresult res;
buffer_size = 1024;
diff --git a/platform/android/audio_driver_opensl.h b/platform/android/audio_driver_opensl.h
index 8e879b27c5..39e1315a02 100644
--- a/platform/android/audio_driver_opensl.h
+++ b/platform/android/audio_driver_opensl.h
@@ -70,19 +70,10 @@ class AudioDriverOpenSL : public AudioDriver {
static AudioDriverOpenSL *s_ad;
void _buffer_callback(
- SLAndroidSimpleBufferQueueItf queueItf
- /* SLuint32 eventFlags,
- const void * pBuffer,
- SLuint32 bufferSize,
- SLuint32 dataUsed*/
- );
+ SLAndroidSimpleBufferQueueItf queueItf);
static void _buffer_callbacks(
SLAndroidSimpleBufferQueueItf queueItf,
- /*SLuint32 eventFlags,
- const void * pBuffer,
- SLuint32 bufferSize,
- SLuint32 dataUsed,*/
void *pContext);
public:
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index 6cf49758bc..c3be3a3f11 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -589,8 +589,6 @@ TST tst;
static bool initialized = false;
static int step = 0;
-static bool resized = false;
-static bool resized_reload = false;
static Size2 new_size;
static Vector3 accelerometer;
static Vector3 gravity;
@@ -792,7 +790,6 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en
_getClipboard = env->GetMethodID(cls, "getClipboard", "()Ljava/lang/String;");
_setClipboard = env->GetMethodID(cls, "setClipboard", "(Ljava/lang/String;)V");
- jclass clsio = env->FindClass("org/godotengine/godot/Godot");
if (cls) {
jclass c = env->GetObjectClass(gob);
_openURI = env->GetMethodID(c, "openURI", "(Ljava/lang/String;)I");
@@ -886,8 +883,6 @@ static void _initialize_java_modules() {
ERR_EXPLAIN("Couldn't find proper initialize function 'public static Godot.SingletonBase Class::initialize(Activity p_activity)' initializer for singleton class: " + m);
ERR_CONTINUE(!initialize);
}
- jobject obj = env->CallStaticObjectMethod(singletonClass, initialize, _godot_instance);
- jobject gob = env->NewGlobalRef(obj);
}
}
}
@@ -931,13 +926,6 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, j
if (os_android)
os_android->set_display_size(Size2(width, height));
-
- /*input_mutex->lock();
- resized=true;
- if (reload)
- resized_reload=true;
- new_size=Size2(width,height);
- input_mutex->unlock();*/
}
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *env, jobject obj, bool p_32_bits) {
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 484ca4fff8..30bc413459 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -677,13 +677,14 @@ String OS_Android::get_unique_id() const {
return OS::get_unique_id();
}
-Error OS_Android::native_video_play(String p_path, float p_volume) {
+Error OS_Android::native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track) {
+ // FIXME: Add support for volume, audio and subtitle tracks
if (video_play_func)
video_play_func(p_path);
return OK;
}
-bool OS_Android::native_video_is_playing() {
+bool OS_Android::native_video_is_playing() const {
if (video_is_playing_func)
return video_is_playing_func();
return false;
diff --git a/platform/android/os_android.h b/platform/android/os_android.h
index 9594c6fdf4..e89a380e4c 100644
--- a/platform/android/os_android.h
+++ b/platform/android/os_android.h
@@ -237,8 +237,8 @@ public:
void process_event(Ref<InputEvent> p_event);
void init_video_mode(int p_video_width, int p_video_height);
- virtual Error native_video_play(String p_path, float p_volume);
- virtual bool native_video_is_playing();
+ virtual Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track);
+ virtual bool native_video_is_playing() const;
virtual void native_video_pause();
virtual void native_video_stop();