Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
ed0655cd
Commit
ed0655cd
authored
Feb 29, 2020
by
PouleyKetchoupp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compilation fixes on Android
parent
8ffa35e4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
20 deletions
+27
-20
rid_owner.h
core/rid_owner.h
+4
-0
audio_driver_opensl.cpp
platform/android/audio_driver_opensl.cpp
+2
-2
detect.py
platform/android/detect.py
+0
-1
java_godot_lib_jni.cpp
platform/android/java_godot_lib_jni.cpp
+11
-15
os_android.cpp
platform/android/os_android.cpp
+10
-2
No files found.
core/rid_owner.h
View file @
ed0655cd
...
@@ -298,7 +298,11 @@ public:
...
@@ -298,7 +298,11 @@ public:
if
(
description
)
{
if
(
description
)
{
print_error
(
"ERROR: "
+
itos
(
alloc_count
)
+
" RID allocations of type '"
+
description
+
"' were leaked at exit."
);
print_error
(
"ERROR: "
+
itos
(
alloc_count
)
+
" RID allocations of type '"
+
description
+
"' were leaked at exit."
);
}
else
{
}
else
{
#ifdef NO_SAFE_CAST
print_error
(
"ERROR: "
+
itos
(
alloc_count
)
+
" RID allocations of type 'unknown' were leaked at exit."
);
#else
print_error
(
"ERROR: "
+
itos
(
alloc_count
)
+
" RID allocations of type '"
+
typeid
(
T
).
name
()
+
"' were leaked at exit."
);
print_error
(
"ERROR: "
+
itos
(
alloc_count
)
+
" RID allocations of type '"
+
typeid
(
T
).
name
()
+
"' were leaked at exit."
);
#endif
}
}
for
(
size_t
i
=
0
;
i
<
max_alloc
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
max_alloc
;
i
++
)
{
...
...
platform/android/audio_driver_opensl.cpp
View file @
ed0655cd
...
@@ -328,13 +328,13 @@ AudioDriver::SpeakerMode AudioDriverOpenSL::get_speaker_mode() const {
...
@@ -328,13 +328,13 @@ AudioDriver::SpeakerMode AudioDriverOpenSL::get_speaker_mode() const {
void
AudioDriverOpenSL
::
lock
()
{
void
AudioDriverOpenSL
::
lock
()
{
if
(
active
&&
mutex
)
if
(
active
)
mutex
.
lock
();
mutex
.
lock
();
}
}
void
AudioDriverOpenSL
::
unlock
()
{
void
AudioDriverOpenSL
::
unlock
()
{
if
(
active
&&
mutex
)
if
(
active
)
mutex
.
unlock
();
mutex
.
unlock
();
}
}
...
...
platform/android/detect.py
View file @
ed0655cd
...
@@ -205,7 +205,6 @@ def configure(env):
...
@@ -205,7 +205,6 @@ def configure(env):
env
.
Append
(
CPPFLAGS
=
[
"-isystem"
,
env
[
"ANDROID_NDK_ROOT"
]
+
"/sources/cxx-stl/llvm-libc++/include"
])
env
.
Append
(
CPPFLAGS
=
[
"-isystem"
,
env
[
"ANDROID_NDK_ROOT"
]
+
"/sources/cxx-stl/llvm-libc++/include"
])
env
.
Append
(
CPPFLAGS
=
[
"-isystem"
,
env
[
"ANDROID_NDK_ROOT"
]
+
"/sources/cxx-stl/llvm-libc++abi/include"
])
env
.
Append
(
CPPFLAGS
=
[
"-isystem"
,
env
[
"ANDROID_NDK_ROOT"
]
+
"/sources/cxx-stl/llvm-libc++abi/include"
])
env
.
Append
(
CXXFLAGS
=
[
"-std=gnu++14"
])
# Disable exceptions and rtti on non-tools (template) builds
# Disable exceptions and rtti on non-tools (template) builds
if
env
[
'tools'
]:
if
env
[
'tools'
]:
...
...
platform/android/java_godot_lib_jni.cpp
View file @
ed0655cd
...
@@ -187,7 +187,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
...
@@ -187,7 +187,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
Vector
<
int
>
array
=
*
p_arg
;
Vector
<
int
>
array
=
*
p_arg
;
jintArray
arr
=
env
->
NewIntArray
(
array
.
size
());
jintArray
arr
=
env
->
NewIntArray
(
array
.
size
());
const
int
*
r
=
array
.
ptr
();
const
int
*
r
=
array
.
ptr
();
env
->
SetIntArrayRegion
(
arr
,
0
,
array
.
size
(),
r
.
ptr
()
);
env
->
SetIntArrayRegion
(
arr
,
0
,
array
.
size
(),
r
);
v
.
val
.
l
=
arr
;
v
.
val
.
l
=
arr
;
v
.
obj
=
arr
;
v
.
obj
=
arr
;
...
@@ -196,7 +196,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
...
@@ -196,7 +196,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
Vector
<
uint8_t
>
array
=
*
p_arg
;
Vector
<
uint8_t
>
array
=
*
p_arg
;
jbyteArray
arr
=
env
->
NewByteArray
(
array
.
size
());
jbyteArray
arr
=
env
->
NewByteArray
(
array
.
size
());
const
uint8_t
*
r
=
array
.
ptr
();
const
uint8_t
*
r
=
array
.
ptr
();
env
->
SetByteArrayRegion
(
arr
,
0
,
array
.
size
(),
reinterpret_cast
<
const
signed
char
*>
(
r
.
ptr
()
));
env
->
SetByteArrayRegion
(
arr
,
0
,
array
.
size
(),
reinterpret_cast
<
const
signed
char
*>
(
r
));
v
.
val
.
l
=
arr
;
v
.
val
.
l
=
arr
;
v
.
obj
=
arr
;
v
.
obj
=
arr
;
...
@@ -206,7 +206,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
...
@@ -206,7 +206,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant *p_a
Vector
<
float
>
array
=
*
p_arg
;
Vector
<
float
>
array
=
*
p_arg
;
jfloatArray
arr
=
env
->
NewFloatArray
(
array
.
size
());
jfloatArray
arr
=
env
->
NewFloatArray
(
array
.
size
());
const
float
*
r
=
array
.
ptr
();
const
float
*
r
=
array
.
ptr
();
env
->
SetFloatArrayRegion
(
arr
,
0
,
array
.
size
(),
r
.
ptr
()
);
env
->
SetFloatArrayRegion
(
arr
,
0
,
array
.
size
(),
r
);
v
.
val
.
l
=
arr
;
v
.
val
.
l
=
arr
;
v
.
obj
=
arr
;
v
.
obj
=
arr
;
...
@@ -293,8 +293,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
...
@@ -293,8 +293,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
sarr
.
resize
(
fCount
);
sarr
.
resize
(
fCount
);
int
*
w
=
sarr
.
ptrw
();
int
*
w
=
sarr
.
ptrw
();
env
->
GetIntArrayRegion
(
arr
,
0
,
fCount
,
w
.
ptr
());
env
->
GetIntArrayRegion
(
arr
,
0
,
fCount
,
w
);
w
.
release
();
return
sarr
;
return
sarr
;
};
};
...
@@ -306,8 +305,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
...
@@ -306,8 +305,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
sarr
.
resize
(
fCount
);
sarr
.
resize
(
fCount
);
uint8_t
*
w
=
sarr
.
ptrw
();
uint8_t
*
w
=
sarr
.
ptrw
();
env
->
GetByteArrayRegion
(
arr
,
0
,
fCount
,
reinterpret_cast
<
signed
char
*>
(
w
.
ptr
()));
env
->
GetByteArrayRegion
(
arr
,
0
,
fCount
,
reinterpret_cast
<
signed
char
*>
(
w
));
w
.
release
();
return
sarr
;
return
sarr
;
};
};
...
@@ -332,7 +330,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
...
@@ -332,7 +330,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
double
n
;
double
n
;
env
->
GetDoubleArrayRegion
(
arr
,
i
,
1
,
&
n
);
env
->
GetDoubleArrayRegion
(
arr
,
i
,
1
,
&
n
);
w
.
ptr
()
[
i
]
=
n
;
w
[
i
]
=
n
;
};
};
return
sarr
;
return
sarr
;
};
};
...
@@ -350,7 +348,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
...
@@ -350,7 +348,7 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
float
n
;
float
n
;
env
->
GetFloatArrayRegion
(
arr
,
i
,
1
,
&
n
);
env
->
GetFloatArrayRegion
(
arr
,
i
,
1
,
&
n
);
w
.
ptr
()
[
i
]
=
n
;
w
[
i
]
=
n
;
};
};
return
sarr
;
return
sarr
;
};
};
...
@@ -518,8 +516,7 @@ public:
...
@@ -518,8 +516,7 @@ public:
sarr
.
resize
(
fCount
);
sarr
.
resize
(
fCount
);
int
*
w
=
sarr
.
ptrw
();
int
*
w
=
sarr
.
ptrw
();
env
->
GetIntArrayRegion
(
arr
,
0
,
fCount
,
w
.
ptr
());
env
->
GetIntArrayRegion
(
arr
,
0
,
fCount
,
w
);
w
.
release
();
ret
=
sarr
;
ret
=
sarr
;
env
->
DeleteLocalRef
(
arr
);
env
->
DeleteLocalRef
(
arr
);
}
break
;
}
break
;
...
@@ -532,8 +529,7 @@ public:
...
@@ -532,8 +529,7 @@ public:
sarr
.
resize
(
fCount
);
sarr
.
resize
(
fCount
);
float
*
w
=
sarr
.
ptrw
();
float
*
w
=
sarr
.
ptrw
();
env
->
GetFloatArrayRegion
(
arr
,
0
,
fCount
,
w
.
ptr
());
env
->
GetFloatArrayRegion
(
arr
,
0
,
fCount
,
w
);
w
.
release
();
ret
=
sarr
;
ret
=
sarr
;
env
->
DeleteLocalRef
(
arr
);
env
->
DeleteLocalRef
(
arr
);
}
break
;
}
break
;
...
@@ -1354,7 +1350,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv *env, j
...
@@ -1354,7 +1350,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv *env, j
JNIEXPORT
void
JNICALL
Java_org_godotengine_godot_GodotLib_callobject
(
JNIEnv
*
env
,
jobject
p_obj
,
jint
ID
,
jstring
method
,
jobjectArray
params
)
{
JNIEXPORT
void
JNICALL
Java_org_godotengine_godot_GodotLib_callobject
(
JNIEnv
*
env
,
jobject
p_obj
,
jint
ID
,
jstring
method
,
jobjectArray
params
)
{
Object
*
obj
=
ObjectDB
::
get_instance
(
ID
);
Object
*
obj
=
ObjectDB
::
get_instance
(
ObjectID
((
uint64_t
)
ID
)
);
ERR_FAIL_COND
(
!
obj
);
ERR_FAIL_COND
(
!
obj
);
int
res
=
env
->
PushLocalFrame
(
16
);
int
res
=
env
->
PushLocalFrame
(
16
);
...
@@ -1386,7 +1382,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *en
...
@@ -1386,7 +1382,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv *en
JNIEXPORT
void
JNICALL
Java_org_godotengine_godot_GodotLib_calldeferred
(
JNIEnv
*
env
,
jobject
p_obj
,
jint
ID
,
jstring
method
,
jobjectArray
params
)
{
JNIEXPORT
void
JNICALL
Java_org_godotengine_godot_GodotLib_calldeferred
(
JNIEnv
*
env
,
jobject
p_obj
,
jint
ID
,
jstring
method
,
jobjectArray
params
)
{
Object
*
obj
=
ObjectDB
::
get_instance
(
ID
);
Object
*
obj
=
ObjectDB
::
get_instance
(
ObjectID
((
uint64_t
)
ID
)
);
ERR_FAIL_COND
(
!
obj
);
ERR_FAIL_COND
(
!
obj
);
int
res
=
env
->
PushLocalFrame
(
16
);
int
res
=
env
->
PushLocalFrame
(
16
);
...
...
platform/android/os_android.cpp
View file @
ed0655cd
...
@@ -32,7 +32,9 @@
...
@@ -32,7 +32,9 @@
#include "core/io/file_access_buffered_fa.h"
#include "core/io/file_access_buffered_fa.h"
#include "core/project_settings.h"
#include "core/project_settings.h"
#if defined(OPENGL_ENABLED)
#include "drivers/gles2/rasterizer_gles2.h"
#include "drivers/gles2/rasterizer_gles2.h"
#endif
#include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/file_access_unix.h"
#include "drivers/unix/file_access_unix.h"
#include "file_access_android.h"
#include "file_access_android.h"
...
@@ -120,10 +122,12 @@ int OS_Android::get_current_video_driver() const {
...
@@ -120,10 +122,12 @@ int OS_Android::get_current_video_driver() const {
Error
OS_Android
::
initialize
(
const
VideoMode
&
p_desired
,
int
p_video_driver
,
int
p_audio_driver
)
{
Error
OS_Android
::
initialize
(
const
VideoMode
&
p_desired
,
int
p_video_driver
,
int
p_audio_driver
)
{
bool
gl_initialization_error
=
false
;
// FIXME: Add Vulkan support. Readd fallback code from Vulkan to GLES2?
// FIXME: Add Vulkan support. Readd fallback code from Vulkan to GLES2?
#if defined(OPENGL_ENABLED)
if
(
video_driver_index
==
VIDEO_DRIVER_GLES2
)
{
bool
gl_initialization_error
=
false
;
if
(
RasterizerGLES2
::
is_viable
()
==
OK
)
{
if
(
RasterizerGLES2
::
is_viable
()
==
OK
)
{
RasterizerGLES2
::
register_config
();
RasterizerGLES2
::
register_config
();
RasterizerGLES2
::
make_current
();
RasterizerGLES2
::
make_current
();
...
@@ -137,6 +141,8 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
...
@@ -137,6 +141,8 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
"Unable to initialize video driver"
);
"Unable to initialize video driver"
);
return
ERR_UNAVAILABLE
;
return
ERR_UNAVAILABLE
;
}
}
}
#endif
video_driver_index
=
p_video_driver
;
video_driver_index
=
p_video_driver
;
...
@@ -753,6 +759,8 @@ OS_Android::OS_Android(GodotJavaWrapper *p_godot_java, GodotIOJavaWrapper *p_god
...
@@ -753,6 +759,8 @@ OS_Android::OS_Android(GodotJavaWrapper *p_godot_java, GodotIOJavaWrapper *p_god
//rasterizer = NULL;
//rasterizer = NULL;
use_gl2
=
false
;
use_gl2
=
false
;
visual_server
=
NULL
;
godot_java
=
p_godot_java
;
godot_java
=
p_godot_java
;
godot_io_java
=
p_godot_io_java
;
godot_io_java
=
p_godot_io_java
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment