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/WindowHandler.h"
#ifdef VCMI_ANDROID
#if defined(VCMI_ANDROID)
#include "../../lib/CAndroidVMHelper.h"
#endif
#ifdef VCMI_IOS
#elif defined(VCMI_IOS)
#include "../ios/utils.h"
#endif
@@ -299,12 +298,11 @@ void InputSourceTouch::emitPinchEvent(const SDL_TouchFingerEvent & tfinger)
}
void InputSourceTouch::hapticFeedback() {
if(hapticFeedbackEnabled) {
if(params.hapticFeedbackEnabled) {
#if defined(VCMI_ANDROID)
CAndroidVMHelper vmHelper;
vmHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "hapticFeedback");
#endif
#if defined(VCMI_IOS)
CAndroidVMHelper vmHelper;
vmHelper.callStaticVoidMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "hapticFeedback");
#elif defined(VCMI_IOS)
iOS_utils::hapticFeedback();
#endif
}

View File

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