summaryrefslogtreecommitdiff
path: root/platform/android/java_godot_lib_jni.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-09 08:33:26 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-09 08:33:26 +0100
commite7905f4f48c18daa948838549f2846b79d4bd1d4 (patch)
treea7e81d1d846ef21c71834fc5290ac9f24303306a /platform/android/java_godot_lib_jni.cpp
parentbb08997b8725780670be30afa96354e7c38586fd (diff)
parent2b815df3c19499f9fcf1575cfce1477876030e81 (diff)
Merge pull request #71045 from reduz/use-bitfield-in-core-types
Use BitField<> in core type masks
Diffstat (limited to 'platform/android/java_godot_lib_jni.cpp')
-rw-r--r--platform/android/java_godot_lib_jni.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp
index b502e587a7..e6cdd7932a 100644
--- a/platform/android/java_godot_lib_jni.cpp
+++ b/platform/android/java_godot_lib_jni.cpp
@@ -353,19 +353,19 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyhat(JNIEnv *env, j
AndroidInputHandler::JoypadEvent jevent;
jevent.device = p_device;
jevent.type = AndroidInputHandler::JOY_EVENT_HAT;
- HatMask hat = HatMask::CENTER;
+ BitField<HatMask> hat;
if (p_hat_x != 0) {
if (p_hat_x < 0) {
- hat |= HatMask::LEFT;
+ hat.set_flag(HatMask::LEFT);
} else {
- hat |= HatMask::RIGHT;
+ hat.set_flag(HatMask::RIGHT);
}
}
if (p_hat_y != 0) {
if (p_hat_y < 0) {
- hat |= HatMask::UP;
+ hat.set_flag(HatMask::UP);
} else {
- hat |= HatMask::DOWN;
+ hat.set_flag(HatMask::DOWN);
}
}
jevent.hat = hat;