Cleanups and state reduction.

This mainly moves datamembers around and tries to avoid caching of
results of calculations when the calculations are cheap.
This commit is contained in:
Tobias Loose
2013-12-07 12:58:20 +01:00
parent 4514725aba
commit 14c164364e
10 changed files with 167 additions and 150 deletions

View File

@@ -35,18 +35,14 @@ void GridDeckView::UpdateViewState(float dt)
if(mScrollOffset <= -1.0f)
{
deck()->next();
deck()->next();
SwitchPosition(2);
mScrollEasing.translate(1.0f);
reloadIndexes();
mCurrentSelection = (mCurrentSelection >= 6) ? mCurrentSelection - 2 : -1;
}
else if(mScrollOffset >= 1.0f)
{
deck()->prev();
deck()->prev();
SwitchPosition(-2);
mScrollEasing.translate(-1.0f);
reloadIndexes();
mCurrentSelection = (mCurrentSelection >= 0 && mCurrentSelection < 10) ? mCurrentSelection + 2 : -1;
}