- Removed useless filter swiping interface

- Removed pointless #ifdef IOS ... it was perfectly OK before the IOS code. Basically if you don't understand the code AND if you cannot test it, you should not modify it =(
- Readded a gard against short horizontal swipe. There were removed cause there are some gards in the iOS frontend ...
- Note that all this code use non-normalized coordinates, so something should be done in this sense in the frontends...
This commit is contained in:
Xawotihs@gmail.com
2012-02-04 23:25:58 +00:00
parent bbb6c15d76
commit 8e8a0d6eeb
+2 -14
View File
@@ -1779,24 +1779,12 @@ void GameStateDeckViewer::OnScroll(int inXVelocity, int inYVelocity)
int magnitude = static_cast<int>( sqrtf( (float )( (inXVelocity * inXVelocity) + (inXVelocity * inXVelocity)))); int magnitude = static_cast<int>( sqrtf( (float )( (inXVelocity * inXVelocity) + (inXVelocity * inXVelocity))));
bool flickHorizontal = (abs(inXVelocity) > abs(inYVelocity)); bool flickHorizontal = (abs(inXVelocity) > abs(inYVelocity));
#ifdef IOS
bool flickUp = !flickHorizontal && (inYVelocity > 0) ? true : false; bool flickUp = !flickHorizontal && (inYVelocity > 0) ? true : false;
bool flickRight = flickHorizontal && (inXVelocity < 0) ? true : false; bool flickRight = flickHorizontal && (inXVelocity < 0) ? true : false;
#else
bool flickUp = !flickHorizontal && (inYVelocity < 0) ? true : false;
bool flickRight = flickHorizontal && (inXVelocity > 0) ? true : false;
#endif
if (mStage == STAGE_FILTERS)
{
if (flickHorizontal) if (flickHorizontal)
mEngine->HoldKey_NoRepeat( flickRight ? JGE_BTN_RIGHT : JGE_BTN_LEFT);
else
mEngine->HoldKey_NoRepeat(flickUp ? JGE_BTN_UP : JGE_BTN_DOWN);
}
else
{ {
if (flickHorizontal) if(abs(inXVelocity) > 300)
{ {
//determine how many cards to move, the faster the velocity the more cards to move. //determine how many cards to move, the faster the velocity the more cards to move.
// the display is setup so that there is a max of 2 cards to the left and 7 cards to the right // the display is setup so that there is a max of 2 cards to the left and 7 cards to the right
@@ -1816,7 +1804,7 @@ void GameStateDeckViewer::OnScroll(int inXVelocity, int inYVelocity)
mEngine->LeftClicked(static_cast<int>(cardsCoordinates[offset].first), static_cast<int>(cardsCoordinates[offset].second)); mEngine->LeftClicked(static_cast<int>(cardsCoordinates[offset].first), static_cast<int>(cardsCoordinates[offset].second));
mEngine->HoldKey_NoRepeat(JGE_BTN_OK); mEngine->HoldKey_NoRepeat(JGE_BTN_OK);
} }
}
else else
mEngine->HoldKey_NoRepeat(flickUp ? JGE_BTN_UP : JGE_BTN_DOWN); mEngine->HoldKey_NoRepeat(flickUp ? JGE_BTN_UP : JGE_BTN_DOWN);
}
} }