Fixed menuIndex tween sets (was not picking right xml sibling).

This commit is contained in:
emb
2015-02-03 21:35:38 -06:00
parent 6601457a8d
commit 262114ba99
7 changed files with 18 additions and 37 deletions

View File

@@ -57,6 +57,7 @@ void ReloadableMedia::Update(float dt)
// wait for the right moment to reload the image // wait for the right moment to reload the image
if (ReloadRequested && (HighlightExitComplete || FirstLoad)) if (ReloadRequested && (HighlightExitComplete || FirstLoad))
{ {
ReloadTexture(); ReloadTexture();
ReloadRequested = false; ReloadRequested = false;
FirstLoad = false; FirstLoad = false;

View File

@@ -455,7 +455,7 @@ void ScrollingList::Update(float dt)
CircularIncrement(spriteIndex, SpriteList); CircularIncrement(spriteIndex, SpriteList);
} }
if(scrollStopped || scrollChanged) if(scrollStopped)
{ {
ComponentItemBinding *sprite = GetPendingCollectionItemSprite(); ComponentItemBinding *sprite = GetPendingCollectionItemSprite();
Item *item = NULL; Item *item = NULL;

View File

@@ -473,7 +473,7 @@ TweenSet *PageBuilder::CreateTweenInstance(xml_node<> *componentXml)
void PageBuilder::BuildTweenSets(TweenSet *tweens, xml_node<> *componentXml, std::string tagName, std::string tweenName) 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"); xml_attribute<> *indexXml = componentXml->first_attribute("menuIndex");
int index = (indexXml) ? Utils::ConvertInt(indexXml->value()) : -1; int index = (indexXml) ? Utils::ConvertInt(indexXml->value()) : -1;

View File

@@ -75,8 +75,6 @@ int RetroFE::Initialize(void *context)
RetroFE *instance = static_cast<RetroFE *>(context); RetroFE *instance = static_cast<RetroFE *>(context);
Logger::Write(Logger::ZONE_INFO, "RetroFE", "Initializing"); Logger::Write(Logger::ZONE_INFO, "RetroFE", "Initializing");
bool videoEnable = true;
int videoLoop = 0;
if(!instance->Input.Initialize()) return -1; if(!instance->Input.Initialize()) return -1;
@@ -96,12 +94,6 @@ int RetroFE::Initialize(void *context)
return -1; return -1;
} }
instance->Config.GetProperty("videoEnable", videoEnable);
instance->Config.GetProperty("videoLoop", videoLoop);
VideoFactory::SetEnabled(videoEnable);
VideoFactory::SetNumLoops(videoLoop);
instance->Initialized = true; instance->Initialized = true;
return 0; return 0;
} }
@@ -188,6 +180,16 @@ void RetroFE::Run()
FC.Initialize(); 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); InitializeThread = SDL_CreateThread(Initialize, "RetroFEInit", (void *)this);
if(!InitializeThread) if(!InitializeThread)
@@ -442,28 +444,6 @@ RetroFE::RETROFE_STATE RetroFE::ProcessUserInput(Page *page)
return state; 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() Page *RetroFE::LoadPage()
{ {
std::string layoutName; std::string layoutName;

View File

@@ -22,6 +22,7 @@
#include "Execute/AttractMode.h" #include "Execute/AttractMode.h"
#include "Graphics/FontCache.h" #include "Graphics/FontCache.h"
#include "Video/IVideo.h" #include "Video/IVideo.h"
#include "Video/VideoFactory.h"
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <list> #include <list>
#include <vector> #include <vector>
@@ -42,7 +43,7 @@ public:
void LaunchEnter(); void LaunchEnter();
void LaunchExit(); void LaunchExit();
private: private:
bool Initialized; volatile bool Initialized;
SDL_Thread *InitializeThread; SDL_Thread *InitializeThread;
static int Initialize(void *context); static int Initialize(void *context);
@@ -60,7 +61,6 @@ private:
void Render(); void Render();
bool Back(bool &exit); bool Back(bool &exit);
void Quit(); void Quit();
void WaitToInitialize();
Page *LoadPage(); Page *LoadPage();
Page *LoadSplashPage(); Page *LoadSplashPage();
RETROFE_STATE ProcessUserInput(Page *page); RETROFE_STATE ProcessUserInput(Page *page);

View File

@@ -129,7 +129,7 @@ void GStreamerVideo::ProcessNewBuffer (GstElement *fakesink, GstBuffer *buf, Gst
bool GStreamerVideo::Initialize() bool GStreamerVideo::Initialize()
{ {
bool retVal = true; if(Initialized) { return true; }
std::string path = Configuration::GetAbsolutePath() + "/Core"; std::string path = Configuration::GetAbsolutePath() + "/Core";
gst_init(NULL, NULL); gst_init(NULL, NULL);
@@ -141,7 +141,7 @@ bool GStreamerVideo::Initialize()
Initialized = true; Initialized = true;
return retVal; return true;
} }
bool GStreamerVideo::DeInitialize() bool GStreamerVideo::DeInitialize()

View File

@@ -20,7 +20,7 @@ class IVideo;
class VideoFactory class VideoFactory
{ {
public: public:
IVideo *CreateVideo(); static IVideo *CreateVideo();
static void SetEnabled(bool enabled); static void SetEnabled(bool enabled);
static void SetNumLoops(int numLoops); static void SetNumLoops(int numLoops);