- 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:
@@ -1779,44 +1779,32 @@ void GameStateDeckViewer::OnScroll(int inXVelocity, int inYVelocity)
|
||||
int magnitude = static_cast<int>( sqrtf( (float )( (inXVelocity * inXVelocity) + (inXVelocity * inXVelocity))));
|
||||
|
||||
bool flickHorizontal = (abs(inXVelocity) > abs(inYVelocity));
|
||||
#ifdef IOS
|
||||
bool flickUp = !flickHorizontal && (inYVelocity > 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.
|
||||
// the display is setup so that there is a max of 2 cards to the left and 7 cards to the right
|
||||
// of the current card.
|
||||
// the display is setup so that there is a max of 2 cards to the left and 7 cards to the right
|
||||
// of the current card.
|
||||
int numCards = (magnitude / 500) % 8;
|
||||
int offset = 0;
|
||||
if ( (numCards == 0) && magnitude) numCards = 7;
|
||||
if ( !flickRight)
|
||||
if ( !flickRight)
|
||||
{
|
||||
if (numCards > 1)
|
||||
if (numCards > 1)
|
||||
offset = 0;
|
||||
}
|
||||
else
|
||||
offset = 2 + numCards;
|
||||
|
||||
|
||||
mEngine->LeftClickedProcessed();
|
||||
mEngine->LeftClicked(static_cast<int>(cardsCoordinates[offset].first), static_cast<int>(cardsCoordinates[offset].second));
|
||||
mEngine->HoldKey_NoRepeat(JGE_BTN_OK);
|
||||
}
|
||||
else
|
||||
mEngine->HoldKey_NoRepeat(flickUp ? JGE_BTN_UP : JGE_BTN_DOWN);
|
||||
}
|
||||
else
|
||||
mEngine->HoldKey_NoRepeat(flickUp ? JGE_BTN_UP : JGE_BTN_DOWN);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user