|
@@ -125,8 +125,7 @@ void CTerrainRect::clickLeft(tribool down, bool previousState)
|
|
|
if(indeterminate(down))
|
|
|
return;
|
|
|
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
- // todo ios
|
|
|
+#if defined(VCMI_ANDROID) || defined(VCMI_IOS)
|
|
|
if(adventureInt->swipeEnabled)
|
|
|
{
|
|
|
if(handleSwipeStateChange((bool)down == true))
|
|
@@ -139,7 +138,7 @@ void CTerrainRect::clickLeft(tribool down, bool previousState)
|
|
|
#endif
|
|
|
if(down == false)
|
|
|
return;
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
+#if defined(VCMI_ANDROID) || defined(VCMI_IOS)
|
|
|
}
|
|
|
#endif
|
|
|
int3 mp = whichTileIsIt();
|
|
@@ -151,8 +150,7 @@ void CTerrainRect::clickLeft(tribool down, bool previousState)
|
|
|
|
|
|
void CTerrainRect::clickRight(tribool down, bool previousState)
|
|
|
{
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
- // todo ios
|
|
|
+#if defined(VCMI_ANDROID) || defined(VCMI_IOS)
|
|
|
if(adventureInt->swipeEnabled && isSwiping)
|
|
|
return;
|
|
|
#endif
|
|
@@ -181,12 +179,11 @@ void CTerrainRect::mouseMoved(const SDL_MouseMotionEvent & sEvent)
|
|
|
|
|
|
void CTerrainRect::handleSwipeMove(const SDL_MouseMotionEvent & sEvent)
|
|
|
{
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
- // todo ios
|
|
|
- if(sEvent.state == 0) // any "button" is enough on android
|
|
|
-#else //!VCMI_ANDROID
|
|
|
+#if defined(VCMI_ANDROID) || defined(VCMI_IOS)
|
|
|
+ if(sEvent.state == 0) // any "button" is enough on mobile
|
|
|
+#else
|
|
|
if((sEvent.state & SDL_BUTTON_MMASK) == 0) // swipe only works with middle mouse on other platforms
|
|
|
-#endif //!VCMI_ANDROID
|
|
|
+#endif
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
@@ -1052,10 +1049,9 @@ void CAdvMapInt::show(SDL_Surface * to)
|
|
|
{
|
|
|
handleSwipeUpdate();
|
|
|
}
|
|
|
-#ifdef VCMI_ANDROID // on android, map-moving mode is exclusive (TODO technically it might work with both enabled; to be checked)
|
|
|
- // todo ios
|
|
|
+#if defined(VCMI_ANDROID) || defined(VCMI_IOS) // on mobile, map-moving mode is exclusive (TODO technically it might work with both enabled; to be checked)
|
|
|
else
|
|
|
-#endif // VCMI_ANDROID
|
|
|
+#endif
|
|
|
{
|
|
|
handleMapScrollingUpdate();
|
|
|
}
|
|
@@ -1455,8 +1451,7 @@ void CAdvMapInt::select(const CArmedInstance *sel, bool centerView)
|
|
|
|
|
|
void CAdvMapInt::mouseMoved( const SDL_MouseMotionEvent & sEvent )
|
|
|
{
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
- // todo ios
|
|
|
+#if defined(VCMI_ANDROID) || defined(VCMI_IOS)
|
|
|
if(swipeEnabled)
|
|
|
return;
|
|
|
#endif
|