From 9c15295a269ec791d555af95b858877f1b3f2d62 Mon Sep 17 00:00:00 2001 From: Pieter Hulshoff Date: Sun, 21 Aug 2016 18:29:43 +0200 Subject: [PATCH] Fixed onEnter/onMenuEnter/onHighlightEnter animation issues due to art loading time. Improved animation smoothness on default theme. --- .../Common/layouts/Aeon Nox/layout 16x9.xml | 178 +++++++++--------- .../Common/layouts/Aeon Nox/layout 4x3.xml | 178 +++++++++--------- .../layouts/Aeon Nox/layout LSR 16x9.xml | 154 +++++++-------- .../layouts/Aeon Nox/layout LSR 4x3.xml | 154 +++++++-------- .../Common/layouts/Aeon Nox/layout.xml | 178 +++++++++--------- RetroFE/Source/RetroFE.cpp | 101 ++++++---- RetroFE/Source/RetroFE.h | 4 + 7 files changed, 485 insertions(+), 462 deletions(-) diff --git a/Package/Environment/Common/layouts/Aeon Nox/layout 16x9.xml b/Package/Environment/Common/layouts/Aeon Nox/layout 16x9.xml index 3c5b19f..1d49ea4 100644 --- a/Package/Environment/Common/layouts/Aeon Nox/layout 16x9.xml +++ b/Package/Environment/Common/layouts/Aeon Nox/layout 16x9.xml @@ -218,12 +218,12 @@ - + - + @@ -252,12 +252,12 @@ - + - + @@ -286,12 +286,12 @@ - + - + @@ -320,12 +320,12 @@ - + - + @@ -353,12 +353,12 @@ - + - + @@ -386,12 +386,12 @@ - + - + @@ -405,12 +405,12 @@ - + - + @@ -441,12 +441,12 @@ - + - + @@ -456,12 +456,12 @@ - + - + @@ -489,12 +489,12 @@ - + - + @@ -507,12 +507,12 @@ - + - + @@ -522,12 +522,12 @@ - + - + @@ -555,12 +555,12 @@ - + - + @@ -573,12 +573,12 @@ - + - + @@ -588,12 +588,12 @@ - + - + @@ -621,12 +621,12 @@ - + - + @@ -639,12 +639,12 @@ - + - + @@ -654,12 +654,12 @@ - + - + @@ -687,12 +687,12 @@ - + - + @@ -705,12 +705,12 @@ - + - + @@ -720,12 +720,12 @@ - + - + @@ -753,12 +753,12 @@ - + - + @@ -771,12 +771,12 @@ - + - + @@ -786,12 +786,12 @@ - + - + @@ -819,12 +819,12 @@ - + - + @@ -853,12 +853,12 @@ - + - + @@ -887,12 +887,12 @@ - + - + @@ -921,12 +921,12 @@ - + - + @@ -955,12 +955,12 @@ - + - + @@ -1354,7 +1354,7 @@ - + @@ -1384,12 +1384,12 @@ - + - + @@ -1413,12 +1413,12 @@ - + - + @@ -1442,12 +1442,12 @@ - + - + @@ -1471,12 +1471,12 @@ - + - + @@ -1500,12 +1500,12 @@ - + - + @@ -1529,12 +1529,12 @@ - + - + @@ -1558,12 +1558,12 @@ - + - + @@ -1587,12 +1587,12 @@ - + - + @@ -1616,12 +1616,12 @@ - + - + @@ -1645,12 +1645,12 @@ - + - + @@ -1674,12 +1674,12 @@ - + - + @@ -1709,12 +1709,12 @@ - + - + @@ -1738,12 +1738,12 @@ - + - + @@ -1924,12 +1924,12 @@ - + - + @@ -1958,12 +1958,12 @@ - + - + diff --git a/Package/Environment/Common/layouts/Aeon Nox/layout 4x3.xml b/Package/Environment/Common/layouts/Aeon Nox/layout 4x3.xml index 6f9dc16..2bfc3eb 100644 --- a/Package/Environment/Common/layouts/Aeon Nox/layout 4x3.xml +++ b/Package/Environment/Common/layouts/Aeon Nox/layout 4x3.xml @@ -218,12 +218,12 @@ - + - + @@ -252,12 +252,12 @@ - + - + @@ -286,12 +286,12 @@ - + - + @@ -320,12 +320,12 @@ - + - + @@ -353,12 +353,12 @@ - + - + @@ -386,12 +386,12 @@ - + - + @@ -405,12 +405,12 @@ - + - + @@ -441,12 +441,12 @@ - + - + @@ -456,12 +456,12 @@ - + - + @@ -489,12 +489,12 @@ - + - + @@ -507,12 +507,12 @@ - + - + @@ -522,12 +522,12 @@ - + - + @@ -555,12 +555,12 @@ - + - + @@ -573,12 +573,12 @@ - + - + @@ -588,12 +588,12 @@ - + - + @@ -621,12 +621,12 @@ - + - + @@ -639,12 +639,12 @@ - + - + @@ -654,12 +654,12 @@ - + - + @@ -687,12 +687,12 @@ - + - + @@ -705,12 +705,12 @@ - + - + @@ -720,12 +720,12 @@ - + - + @@ -753,12 +753,12 @@ - + - + @@ -771,12 +771,12 @@ - + - + @@ -786,12 +786,12 @@ - + - + @@ -819,12 +819,12 @@ - + - + @@ -853,12 +853,12 @@ - + - + @@ -887,12 +887,12 @@ - + - + @@ -921,12 +921,12 @@ - + - + @@ -955,12 +955,12 @@ - + - + @@ -1354,7 +1354,7 @@ - + @@ -1384,12 +1384,12 @@ - + - + @@ -1413,12 +1413,12 @@ - + - + @@ -1442,12 +1442,12 @@ - + - + @@ -1471,12 +1471,12 @@ - + - + @@ -1500,12 +1500,12 @@ - + - + @@ -1529,12 +1529,12 @@ - + - + @@ -1558,12 +1558,12 @@ - + - + @@ -1587,12 +1587,12 @@ - + - + @@ -1616,12 +1616,12 @@ - + - + @@ -1645,12 +1645,12 @@ - + - + @@ -1674,12 +1674,12 @@ - + - + @@ -1709,12 +1709,12 @@ - + - + @@ -1738,12 +1738,12 @@ - + - + @@ -1924,12 +1924,12 @@ - + - + @@ -1958,12 +1958,12 @@ - + - + diff --git a/Package/Environment/Common/layouts/Aeon Nox/layout LSR 16x9.xml b/Package/Environment/Common/layouts/Aeon Nox/layout LSR 16x9.xml index 494f529..8cf5907 100644 --- a/Package/Environment/Common/layouts/Aeon Nox/layout LSR 16x9.xml +++ b/Package/Environment/Common/layouts/Aeon Nox/layout LSR 16x9.xml @@ -203,12 +203,12 @@ - + - + @@ -239,12 +239,12 @@ - + - + @@ -254,12 +254,12 @@ - + - + @@ -287,12 +287,12 @@ - + - + @@ -305,12 +305,12 @@ - + - + @@ -320,12 +320,12 @@ - + - + @@ -353,12 +353,12 @@ - + - + @@ -371,12 +371,12 @@ - + - + @@ -386,12 +386,12 @@ - + - + @@ -419,12 +419,12 @@ - + - + @@ -437,12 +437,12 @@ - + - + @@ -452,12 +452,12 @@ - + - + @@ -485,12 +485,12 @@ - + - + @@ -503,12 +503,12 @@ - + - + @@ -518,12 +518,12 @@ - + - + @@ -551,12 +551,12 @@ - + - + @@ -569,12 +569,12 @@ - + - + @@ -584,12 +584,12 @@ - + - + @@ -617,12 +617,12 @@ - + - + @@ -651,12 +651,12 @@ - + - + @@ -685,12 +685,12 @@ - + - + @@ -719,12 +719,12 @@ - + - + @@ -753,12 +753,12 @@ - + - + @@ -1152,7 +1152,7 @@ - + @@ -1182,12 +1182,12 @@ - + - + @@ -1211,12 +1211,12 @@ - + - + @@ -1240,12 +1240,12 @@ - + - + @@ -1269,12 +1269,12 @@ - + - + @@ -1298,12 +1298,12 @@ - + - + @@ -1327,12 +1327,12 @@ - + - + @@ -1356,12 +1356,12 @@ - + - + @@ -1385,12 +1385,12 @@ - + - + @@ -1414,12 +1414,12 @@ - + - + @@ -1443,12 +1443,12 @@ - + - + @@ -1472,12 +1472,12 @@ - + - + @@ -1507,12 +1507,12 @@ - + - + @@ -1536,12 +1536,12 @@ - + - + @@ -1621,12 +1621,12 @@ - + - + @@ -1655,12 +1655,12 @@ - + - + diff --git a/Package/Environment/Common/layouts/Aeon Nox/layout LSR 4x3.xml b/Package/Environment/Common/layouts/Aeon Nox/layout LSR 4x3.xml index 94ae5bc..217ba07 100644 --- a/Package/Environment/Common/layouts/Aeon Nox/layout LSR 4x3.xml +++ b/Package/Environment/Common/layouts/Aeon Nox/layout LSR 4x3.xml @@ -203,12 +203,12 @@ - + - + @@ -239,12 +239,12 @@ - + - + @@ -254,12 +254,12 @@ - + - + @@ -287,12 +287,12 @@ - + - + @@ -305,12 +305,12 @@ - + - + @@ -320,12 +320,12 @@ - + - + @@ -353,12 +353,12 @@ - + - + @@ -371,12 +371,12 @@ - + - + @@ -386,12 +386,12 @@ - + - + @@ -419,12 +419,12 @@ - + - + @@ -437,12 +437,12 @@ - + - + @@ -452,12 +452,12 @@ - + - + @@ -485,12 +485,12 @@ - + - + @@ -503,12 +503,12 @@ - + - + @@ -518,12 +518,12 @@ - + - + @@ -551,12 +551,12 @@ - + - + @@ -569,12 +569,12 @@ - + - + @@ -584,12 +584,12 @@ - + - + @@ -617,12 +617,12 @@ - + - + @@ -651,12 +651,12 @@ - + - + @@ -685,12 +685,12 @@ - + - + @@ -719,12 +719,12 @@ - + - + @@ -753,12 +753,12 @@ - + - + @@ -1152,7 +1152,7 @@ - + @@ -1182,12 +1182,12 @@ - + - + @@ -1211,12 +1211,12 @@ - + - + @@ -1240,12 +1240,12 @@ - + - + @@ -1269,12 +1269,12 @@ - + - + @@ -1298,12 +1298,12 @@ - + - + @@ -1327,12 +1327,12 @@ - + - + @@ -1356,12 +1356,12 @@ - + - + @@ -1385,12 +1385,12 @@ - + - + @@ -1414,12 +1414,12 @@ - + - + @@ -1443,12 +1443,12 @@ - + - + @@ -1472,12 +1472,12 @@ - + - + @@ -1507,12 +1507,12 @@ - + - + @@ -1536,12 +1536,12 @@ - + - + @@ -1621,12 +1621,12 @@ - + - + @@ -1655,12 +1655,12 @@ - + - + diff --git a/Package/Environment/Common/layouts/Aeon Nox/layout.xml b/Package/Environment/Common/layouts/Aeon Nox/layout.xml index 3c5b19f..1d49ea4 100644 --- a/Package/Environment/Common/layouts/Aeon Nox/layout.xml +++ b/Package/Environment/Common/layouts/Aeon Nox/layout.xml @@ -218,12 +218,12 @@ - + - + @@ -252,12 +252,12 @@ - + - + @@ -286,12 +286,12 @@ - + - + @@ -320,12 +320,12 @@ - + - + @@ -353,12 +353,12 @@ - + - + @@ -386,12 +386,12 @@ - + - + @@ -405,12 +405,12 @@ - + - + @@ -441,12 +441,12 @@ - + - + @@ -456,12 +456,12 @@ - + - + @@ -489,12 +489,12 @@ - + - + @@ -507,12 +507,12 @@ - + - + @@ -522,12 +522,12 @@ - + - + @@ -555,12 +555,12 @@ - + - + @@ -573,12 +573,12 @@ - + - + @@ -588,12 +588,12 @@ - + - + @@ -621,12 +621,12 @@ - + - + @@ -639,12 +639,12 @@ - + - + @@ -654,12 +654,12 @@ - + - + @@ -687,12 +687,12 @@ - + - + @@ -705,12 +705,12 @@ - + - + @@ -720,12 +720,12 @@ - + - + @@ -753,12 +753,12 @@ - + - + @@ -771,12 +771,12 @@ - + - + @@ -786,12 +786,12 @@ - + - + @@ -819,12 +819,12 @@ - + - + @@ -853,12 +853,12 @@ - + - + @@ -887,12 +887,12 @@ - + - + @@ -921,12 +921,12 @@ - + - + @@ -955,12 +955,12 @@ - + - + @@ -1354,7 +1354,7 @@ - + @@ -1384,12 +1384,12 @@ - + - + @@ -1413,12 +1413,12 @@ - + - + @@ -1442,12 +1442,12 @@ - + - + @@ -1471,12 +1471,12 @@ - + - + @@ -1500,12 +1500,12 @@ - + - + @@ -1529,12 +1529,12 @@ - + - + @@ -1558,12 +1558,12 @@ - + - + @@ -1587,12 +1587,12 @@ - + - + @@ -1616,12 +1616,12 @@ - + - + @@ -1645,12 +1645,12 @@ - + - + @@ -1674,12 +1674,12 @@ - + - + @@ -1709,12 +1709,12 @@ - + - + @@ -1738,12 +1738,12 @@ - + - + @@ -1924,12 +1924,12 @@ - + - + @@ -1958,12 +1958,12 @@ - + - + diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index e2b5398..4c4fbbf 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -295,6 +295,11 @@ void RetroFE::run() } break; + case RETROFE_LOAD_ART: + currentPage_->start(); + state = RETROFE_ENTER; + break; + case RETROFE_ENTER: if(currentPage_->isIdle()) { @@ -327,9 +332,8 @@ void RetroFE::run() currentPage_->pushCollection(info); currentPage_->onNewItemSelected(); currentPage_->reallocateMenuSpritePoints(); - currentPage_->start(); - state = RETROFE_ENTER; + state = RETROFE_LOAD_ART; } else { @@ -346,15 +350,19 @@ void RetroFE::run() case RETROFE_HIGHLIGHT_EXIT: if ((processUserInput(currentPage_) == RETROFE_HIGHLIGHT_REQUEST) || - (currentPage_->isGraphicsIdle() && currentPage_->isMenuScrolling())) + (currentPage_->isGraphicsIdle() && currentPage_->isMenuScrolling()) || + (currentPage_->isIdle())) { currentPage_->onNewItemSelected(); - currentPage_->highlightEnter(); - state = RETROFE_HIGHLIGHT_ENTER; + state = RETROFE_HIGHLIGHT_LOAD_ART; } - else if (currentPage_->isIdle()) + break; + + case RETROFE_HIGHLIGHT_LOAD_ART: + if ((processUserInput(currentPage_) == RETROFE_HIGHLIGHT_REQUEST) || + (currentPage_->isGraphicsIdle() && currentPage_->isMenuScrolling()) || + (currentPage_->isIdle())) { - currentPage_->onNewItemSelected(); currentPage_->highlightEnter(); state = RETROFE_HIGHLIGHT_ENTER; } @@ -390,7 +398,6 @@ void RetroFE::run() currentPage_->freeGraphicsMemory(); pages_.push( currentPage_ ); currentPage_ = page; - currentPage_->start(); } bool menuSort = true; @@ -424,21 +431,29 @@ void RetroFE::run() currentPage_->onNewItemSelected(); currentPage_->reallocateMenuSpritePoints(); - if (currentPage_->getMenuDepth() != 1 ) - { - currentPage_->enterMenu(); - } - state = RETROFE_NEXT_PAGE_MENU_ENTER; + state = RETROFE_NEXT_PAGE_MENU_LOAD_ART; } break; + case RETROFE_NEXT_PAGE_MENU_LOAD_ART: + if (currentPage_->getMenuDepth() != 1 ) + { + currentPage_->enterMenu(); + } + else + { + currentPage_->start(); + } + state = RETROFE_NEXT_PAGE_MENU_ENTER; + break; + case RETROFE_NEXT_PAGE_MENU_ENTER: - if(currentPage_->isIdle()) - { - state = RETROFE_IDLE; - } + if(currentPage_->isIdle()) + { + state = RETROFE_IDLE; + } break; case RETROFE_LAUNCH_REQUEST: @@ -462,36 +477,40 @@ void RetroFE::run() break; case RETROFE_BACK_MENU_EXIT: - if(currentPage_->isIdle()) - { - lastMenuOffsets_[currentPage_->getCollectionName()] = currentPage_->getScrollOffsetIndex(); - lastMenuPlaylists_[currentPage_->getCollectionName()] = currentPage_->getPlaylistName(); - if (currentPage_->getMenuDepth() == 1) + if(currentPage_->isIdle()) { - currentPage_->DeInitialize(); - delete currentPage_; - currentPage_ = pages_.top(); - pages_.pop(); - currentPage_->allocateGraphicsMemory(); + lastMenuOffsets_[currentPage_->getCollectionName()] = currentPage_->getScrollOffsetIndex(); + lastMenuPlaylists_[currentPage_->getCollectionName()] = currentPage_->getPlaylistName(); + if (currentPage_->getMenuDepth() == 1) + { + currentPage_->DeInitialize(); + delete currentPage_; + currentPage_ = pages_.top(); + pages_.pop(); + currentPage_->allocateGraphicsMemory(); + } + else + { + currentPage_->popCollection(); + } + config_.setProperty("currentCollection", currentPage_->getCollectionName()); + currentPage_->onNewItemSelected(); + currentPage_->reallocateMenuSpritePoints(); + state = RETROFE_BACK_MENU_LOAD_ART; } - else - { - currentPage_->popCollection(); - } - config_.setProperty("currentCollection", currentPage_->getCollectionName()); - currentPage_->onNewItemSelected(); - currentPage_->reallocateMenuSpritePoints(); + break; + + case RETROFE_BACK_MENU_LOAD_ART: currentPage_->enterMenu(); state = RETROFE_BACK_MENU_ENTER; - } - break; + break; case RETROFE_BACK_MENU_ENTER: - if(currentPage_->isIdle()) - { - state = RETROFE_IDLE; - } - break; + if(currentPage_->isIdle()) + { + state = RETROFE_IDLE; + } + break; case RETROFE_NEW: if(currentPage_->isIdle()) diff --git a/RetroFE/Source/RetroFE.h b/RetroFE/Source/RetroFE.h index 3e33e4c..b0c9a1d 100644 --- a/RetroFE/Source/RetroFE.h +++ b/RetroFE/Source/RetroFE.h @@ -52,17 +52,21 @@ private: enum RETROFE_STATE { RETROFE_IDLE, + RETROFE_LOAD_ART, RETROFE_ENTER, RETROFE_SPLASH_EXIT, RETROFE_HIGHLIGHT_REQUEST, RETROFE_HIGHLIGHT_EXIT, + RETROFE_HIGHLIGHT_LOAD_ART, RETROFE_HIGHLIGHT_ENTER, RETROFE_NEXT_PAGE_REQUEST, RETROFE_NEXT_PAGE_MENU_EXIT, + RETROFE_NEXT_PAGE_MENU_LOAD_ART, RETROFE_NEXT_PAGE_MENU_ENTER, RETROFE_LAUNCH_REQUEST, RETROFE_BACK_REQUEST, RETROFE_BACK_MENU_EXIT, + RETROFE_BACK_MENU_LOAD_ART, RETROFE_BACK_MENU_ENTER, RETROFE_NEW, RETROFE_QUIT_REQUEST,