diff --git a/Package/Environment/Common/layouts/Default 16x9/splash.xml b/Package/Environment/Common/layouts/Default 16x9/splash.xml index 025e7cc..972bde5 100644 --- a/Package/Environment/Common/layouts/Default 16x9/splash.xml +++ b/Package/Environment/Common/layouts/Default 16x9/splash.xml @@ -1,4 +1,4 @@ - + diff --git a/RetroFE/Source/Graphics/Page.cpp b/RetroFE/Source/Graphics/Page.cpp index d408e01..ec5dabb 100644 --- a/RetroFE/Source/Graphics/Page.cpp +++ b/RetroFE/Source/Graphics/Page.cpp @@ -40,6 +40,7 @@ Page::Page(Configuration &config) , SelectSoundChunk(NULL) , HasSoundedWhenActive(false) , FirstSoundPlayed(false) + , MinShowTime(0) { } @@ -286,6 +287,15 @@ void Page::RemoveSelectedItem() } +void Page::SetMinShowTime(float value) +{ + MinShowTime = value; +} + +float Page::GetMinShowTime() +{ + return MinShowTime; +} void Page::Highlight() { diff --git a/RetroFE/Source/Graphics/Page.h b/RetroFE/Source/Graphics/Page.h index 0ff8f21..86282bc 100644 --- a/RetroFE/Source/Graphics/Page.h +++ b/RetroFE/Source/Graphics/Page.h @@ -73,6 +73,8 @@ public: void LaunchEnter(); void LaunchExit(); std::string GetCollectionName(); + void SetMinShowTime(float value); + float GetMinShowTime(); private: void Highlight(); @@ -100,6 +102,8 @@ private: Sound *SelectSoundChunk; bool HasSoundedWhenActive; bool FirstSoundPlayed; + float MinShowTime; + float ElapsedTime; }; diff --git a/RetroFE/Source/Graphics/PageBuilder.cpp b/RetroFE/Source/Graphics/PageBuilder.cpp index 77c4713..7a8d175 100644 --- a/RetroFE/Source/Graphics/PageBuilder.cpp +++ b/RetroFE/Source/Graphics/PageBuilder.cpp @@ -113,6 +113,7 @@ Page *PageBuilder::BuildPage() xml_attribute<> *fontXml = root->first_attribute("font"); xml_attribute<> *fontColorXml = root->first_attribute("fontColor"); xml_attribute<> *fontSizeXml = root->first_attribute("loadFontSize"); + xml_attribute<> *minShowTimeXml = root->first_attribute("minShowTime"); int layoutHeight; int layoutWidth; @@ -165,6 +166,11 @@ Page *PageBuilder::BuildPage() page = new Page(Config); + if(minShowTimeXml) + { + page->SetMinShowTime(Utils::ConvertFloat(minShowTimeXml->value())); + } + // load sounds for(xml_node<> *sound = root->first_node("sound"); sound; sound = sound->next_sibling("sound")) { diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index 238f656..48865f1 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -179,7 +179,7 @@ void RetroFE::Run() if(!SDL::Initialize(Config)) return; FC.Initialize(); - + float preloadTime = 0; bool videoEnable = true; int videoLoop = 0; Config.GetProperty("videoEnable", videoEnable); @@ -215,6 +215,7 @@ void RetroFE::Run() bool splashMode = true; Launcher l(*this, Config); + preloadTime = static_cast(SDL_GetTicks()) / 1000; while (running) { @@ -242,7 +243,7 @@ void RetroFE::Run() (void)SDL_PollEvent(&e); } - if(Initialized && splashMode) + if(Initialized && splashMode && CurrentPage->GetMinShowTime() <= (CurrentTime - preloadTime)) { SDL_WaitThread(InitializeThread, &initializeStatus); @@ -317,7 +318,7 @@ void RetroFE::Run() if(running) { lastTime = CurrentTime; - CurrentTime = (float)SDL_GetTicks() / 1000; + CurrentTime = static_cast(SDL_GetTicks()) / 1000; if (CurrentTime < lastTime) {