summaryrefslogtreecommitdiff
path: root/platform/android/java_godot_view_wrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/java_godot_view_wrapper.cpp')
-rw-r--r--platform/android/java_godot_view_wrapper.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/platform/android/java_godot_view_wrapper.cpp b/platform/android/java_godot_view_wrapper.cpp
index 5605d834fa..0153ba96fc 100644
--- a/platform/android/java_godot_view_wrapper.cpp
+++ b/platform/android/java_godot_view_wrapper.cpp
@@ -34,7 +34,7 @@
GodotJavaViewWrapper::GodotJavaViewWrapper(jobject godot_view) {
JNIEnv *env = get_jni_env();
- ERR_FAIL_COND(env == nullptr);
+ ERR_FAIL_NULL(env);
_godot_view = env->NewGlobalRef(godot_view);
@@ -48,27 +48,27 @@ GodotJavaViewWrapper::GodotJavaViewWrapper(jobject godot_view) {
}
void GodotJavaViewWrapper::request_pointer_capture() {
- if (_request_pointer_capture != 0) {
+ if (_request_pointer_capture != nullptr) {
JNIEnv *env = get_jni_env();
- ERR_FAIL_COND(env == nullptr);
+ ERR_FAIL_NULL(env);
env->CallVoidMethod(_godot_view, _request_pointer_capture);
}
}
void GodotJavaViewWrapper::release_pointer_capture() {
- if (_request_pointer_capture != 0) {
+ if (_request_pointer_capture != nullptr) {
JNIEnv *env = get_jni_env();
- ERR_FAIL_COND(env == nullptr);
+ ERR_FAIL_NULL(env);
env->CallVoidMethod(_godot_view, _release_pointer_capture);
}
}
void GodotJavaViewWrapper::set_pointer_icon(int pointer_type) {
- if (_set_pointer_icon != 0) {
+ if (_set_pointer_icon != nullptr) {
JNIEnv *env = get_jni_env();
- ERR_FAIL_COND(env == nullptr);
+ ERR_FAIL_NULL(env);
env->CallVoidMethod(_godot_view, _set_pointer_icon, pointer_type);
}
@@ -76,7 +76,7 @@ void GodotJavaViewWrapper::set_pointer_icon(int pointer_type) {
GodotJavaViewWrapper::~GodotJavaViewWrapper() {
JNIEnv *env = get_jni_env();
- ERR_FAIL_COND(env == nullptr);
+ ERR_FAIL_NULL(env);
env->DeleteGlobalRef(_godot_view);
env->DeleteGlobalRef(_cls);