mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-27 02:05:06 +01:00
Fixed menuIndex tween sets (was not picking right xml sibling).
This commit is contained in:
parent
6601457a8d
commit
262114ba99
@ -57,6 +57,7 @@ void ReloadableMedia::Update(float dt)
|
||||
// wait for the right moment to reload the image
|
||||
if (ReloadRequested && (HighlightExitComplete || FirstLoad))
|
||||
{
|
||||
|
||||
ReloadTexture();
|
||||
ReloadRequested = false;
|
||||
FirstLoad = false;
|
||||
|
||||
@ -455,7 +455,7 @@ void ScrollingList::Update(float dt)
|
||||
CircularIncrement(spriteIndex, SpriteList);
|
||||
}
|
||||
|
||||
if(scrollStopped || scrollChanged)
|
||||
if(scrollStopped)
|
||||
{
|
||||
ComponentItemBinding *sprite = GetPendingCollectionItemSprite();
|
||||
Item *item = NULL;
|
||||
|
||||
@ -473,7 +473,7 @@ TweenSet *PageBuilder::CreateTweenInstance(xml_node<> *componentXml)
|
||||
|
||||
void PageBuilder::BuildTweenSets(TweenSet *tweens, xml_node<> *componentXml, std::string tagName, std::string tweenName)
|
||||
{
|
||||
for(componentXml = componentXml->first_node(tagName.c_str()); componentXml; componentXml = componentXml->next_sibling(tweenName.c_str()))
|
||||
for(componentXml = componentXml->first_node(tagName.c_str()); componentXml; componentXml = componentXml->next_sibling(tagName.c_str()))
|
||||
{
|
||||
xml_attribute<> *indexXml = componentXml->first_attribute("menuIndex");
|
||||
int index = (indexXml) ? Utils::ConvertInt(indexXml->value()) : -1;
|
||||
|
||||
@ -75,8 +75,6 @@ int RetroFE::Initialize(void *context)
|
||||
RetroFE *instance = static_cast<RetroFE *>(context);
|
||||
|
||||
Logger::Write(Logger::ZONE_INFO, "RetroFE", "Initializing");
|
||||
bool videoEnable = true;
|
||||
int videoLoop = 0;
|
||||
|
||||
if(!instance->Input.Initialize()) return -1;
|
||||
|
||||
@ -96,12 +94,6 @@ int RetroFE::Initialize(void *context)
|
||||
return -1;
|
||||
}
|
||||
|
||||
instance->Config.GetProperty("videoEnable", videoEnable);
|
||||
instance->Config.GetProperty("videoLoop", videoLoop);
|
||||
|
||||
VideoFactory::SetEnabled(videoEnable);
|
||||
VideoFactory::SetNumLoops(videoLoop);
|
||||
|
||||
instance->Initialized = true;
|
||||
return 0;
|
||||
}
|
||||
@ -188,6 +180,16 @@ void RetroFE::Run()
|
||||
|
||||
FC.Initialize();
|
||||
|
||||
bool videoEnable = true;
|
||||
int videoLoop = 0;
|
||||
Config.GetProperty("videoEnable", videoEnable);
|
||||
Config.GetProperty("videoLoop", videoLoop);
|
||||
|
||||
VideoFactory::SetEnabled(videoEnable);
|
||||
VideoFactory::SetNumLoops(videoLoop);
|
||||
VideoFactory::CreateVideo(); // pre-initialize the gstreamer engine
|
||||
|
||||
|
||||
InitializeThread = SDL_CreateThread(Initialize, "RetroFEInit", (void *)this);
|
||||
|
||||
if(!InitializeThread)
|
||||
@ -442,28 +444,6 @@ RetroFE::RETROFE_STATE RetroFE::ProcessUserInput(Page *page)
|
||||
return state;
|
||||
}
|
||||
|
||||
void RetroFE::WaitToInitialize()
|
||||
{
|
||||
Logger::Write(Logger::ZONE_INFO, "RetroFE", "Loading splash screen");
|
||||
|
||||
PageBuilder pb("splash", Config, &FC);
|
||||
Page * page = pb.BuildPage();
|
||||
|
||||
while(!Initialized)
|
||||
{
|
||||
SDL_SetRenderDrawColor(SDL::GetRenderer(), 0x0, 0x0, 0x00, 0xFF);
|
||||
SDL_RenderClear(SDL::GetRenderer());
|
||||
|
||||
page->Draw();
|
||||
SDL_RenderPresent(SDL::GetRenderer());
|
||||
}
|
||||
|
||||
int status = 0;
|
||||
delete page;
|
||||
SDL_WaitThread(InitializeThread, &status);
|
||||
}
|
||||
|
||||
|
||||
Page *RetroFE::LoadPage()
|
||||
{
|
||||
std::string layoutName;
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
#include "Execute/AttractMode.h"
|
||||
#include "Graphics/FontCache.h"
|
||||
#include "Video/IVideo.h"
|
||||
#include "Video/VideoFactory.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
@ -42,7 +43,7 @@ public:
|
||||
void LaunchEnter();
|
||||
void LaunchExit();
|
||||
private:
|
||||
bool Initialized;
|
||||
volatile bool Initialized;
|
||||
SDL_Thread *InitializeThread;
|
||||
static int Initialize(void *context);
|
||||
|
||||
@ -60,7 +61,6 @@ private:
|
||||
void Render();
|
||||
bool Back(bool &exit);
|
||||
void Quit();
|
||||
void WaitToInitialize();
|
||||
Page *LoadPage();
|
||||
Page *LoadSplashPage();
|
||||
RETROFE_STATE ProcessUserInput(Page *page);
|
||||
|
||||
@ -129,7 +129,7 @@ void GStreamerVideo::ProcessNewBuffer (GstElement *fakesink, GstBuffer *buf, Gst
|
||||
|
||||
bool GStreamerVideo::Initialize()
|
||||
{
|
||||
bool retVal = true;
|
||||
if(Initialized) { return true; }
|
||||
|
||||
std::string path = Configuration::GetAbsolutePath() + "/Core";
|
||||
gst_init(NULL, NULL);
|
||||
@ -141,7 +141,7 @@ bool GStreamerVideo::Initialize()
|
||||
|
||||
Initialized = true;
|
||||
|
||||
return retVal;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GStreamerVideo::DeInitialize()
|
||||
|
||||
@ -20,7 +20,7 @@ class IVideo;
|
||||
class VideoFactory
|
||||
{
|
||||
public:
|
||||
IVideo *CreateVideo();
|
||||
static IVideo *CreateVideo();
|
||||
static void SetEnabled(bool enabled);
|
||||
static void SetNumLoops(int numLoops);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user