1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

changes from code review

This commit is contained in:
Michael
2023-07-08 21:02:03 +02:00
committed by GitHub
parent 70b7f992de
commit d911756827
2 changed files with 8 additions and 11 deletions

View File

@@ -22,10 +22,9 @@
#include "../gui/MouseButton.h" #include "../gui/MouseButton.h"
#include "../gui/WindowHandler.h" #include "../gui/WindowHandler.h"
#ifdef VCMI_ANDROID #if defined(VCMI_ANDROID)
#include "../../lib/CAndroidVMHelper.h" #include "../../lib/CAndroidVMHelper.h"
#endif #elif defined(VCMI_IOS)
#ifdef VCMI_IOS
#include "../ios/utils.h" #include "../ios/utils.h"
#endif #endif
@@ -299,12 +298,11 @@ void InputSourceTouch::emitPinchEvent(const SDL_TouchFingerEvent & tfinger)
} }
void InputSourceTouch::hapticFeedback() { void InputSourceTouch::hapticFeedback() {
if(hapticFeedbackEnabled) { if(params.hapticFeedbackEnabled) {
#if defined(VCMI_ANDROID) #if defined(VCMI_ANDROID)
CAndroidVMHelper vmHelper; CAndroidVMHelper vmHelper;
vmHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "hapticFeedback"); vmHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "hapticFeedback");
#endif #elif defined(VCMI_IOS)
#if defined(VCMI_IOS)
iOS_utils::hapticFeedback(); iOS_utils::hapticFeedback();
#endif #endif
} }

View File

@@ -46,8 +46,7 @@ void hideLoadingIndicator()
void hapticFeedback() void hapticFeedback()
{ {
UIImpactFeedbackGenerator *hapticGen = [[UIImpactFeedbackGenerator alloc] initWithStyle:(UIImpactFeedbackStyleLight)]; auto hapticGen = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight];
[hapticGen impactOccurred]; [hapticGen impactOccurred];
hapticGen = NULL;
} }
} }