mirror of
https://github.com/rust-mobile/android-activity.git
synced 2026-07-11 00:58:54 +00:00
GameActivity PATCH: compilation fixes
Fixes some compilation bugs in the upstream AGDK glue code: https://issuetracker.google.com/issues/229997306
This commit is contained in:
@@ -1080,7 +1080,7 @@ extern "C" void GameActivityKeyEvent_fromJava(JNIEnv *env, jobject keyEvent,
|
||||
|
||||
static bool onTouchEvent_native(JNIEnv *env, jobject javaGameActivity,
|
||||
jlong handle, jobject motionEvent) {
|
||||
if (handle == 0) return;
|
||||
if (handle == 0) return false;
|
||||
NativeCode *code = (NativeCode *)handle;
|
||||
if (code->callbacks.onTouchEvent == nullptr) return false;
|
||||
|
||||
@@ -1091,7 +1091,7 @@ static bool onTouchEvent_native(JNIEnv *env, jobject javaGameActivity,
|
||||
|
||||
static bool onKeyUp_native(JNIEnv *env, jobject javaGameActivity, jlong handle,
|
||||
jobject keyEvent) {
|
||||
if (handle == 0) return;
|
||||
if (handle == 0) return false;
|
||||
NativeCode *code = (NativeCode *)handle;
|
||||
if (code->callbacks.onKeyUp == nullptr) return false;
|
||||
|
||||
@@ -1102,9 +1102,9 @@ static bool onKeyUp_native(JNIEnv *env, jobject javaGameActivity, jlong handle,
|
||||
|
||||
static bool onKeyDown_native(JNIEnv *env, jobject javaGameActivity,
|
||||
jlong handle, jobject keyEvent) {
|
||||
if (handle == 0) return;
|
||||
if (handle == 0) return false;
|
||||
NativeCode *code = (NativeCode *)handle;
|
||||
if (code->callbacks.onKeyDown == nullptr) return;
|
||||
if (code->callbacks.onKeyDown == nullptr) return false;
|
||||
|
||||
static GameActivityKeyEvent c_event;
|
||||
GameActivityKeyEvent_fromJava(env, keyEvent, &c_event);
|
||||
@@ -1223,7 +1223,7 @@ static const char *const kWindowInsetsCompatTypePathName =
|
||||
|
||||
#define GET_FIELD_ID(var, clazz, fieldName, fieldDescriptor) \
|
||||
var = env->GetFieldID(clazz, fieldName, fieldDescriptor); \
|
||||
LOG_FATAL_IF(!var, "Unable to find field %s" fieldName);
|
||||
LOG_FATAL_IF(!var, "Unable to find field %s", fieldName);
|
||||
|
||||
static int jniRegisterNativeMethods(JNIEnv *env, const char *className,
|
||||
const JNINativeMethod *methods,
|
||||
|
||||
@@ -210,8 +210,6 @@ GameTextInput::GameTextInput(JNIEnv *env, uint32_t max_string_size)
|
||||
env_->GetFieldID(stateJavaClass_, "composingRegionStart", "I");
|
||||
stateClassInfo_.composingRegionEnd =
|
||||
env_->GetFieldID(stateJavaClass_, "composingRegionEnd", "I");
|
||||
|
||||
return s_gameTextInput.get();
|
||||
}
|
||||
|
||||
GameTextInput::~GameTextInput() {
|
||||
|
||||
Reference in New Issue
Block a user