mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-13 10:18:53 +01:00
Global videoEnable parameter now also enables/disables intro videos and background videos.
This commit is contained in:
parent
051eec348f
commit
6b3bae4344
@ -23,6 +23,9 @@
|
|||||||
#include "../../SDL.h"
|
#include "../../SDL.h"
|
||||||
|
|
||||||
|
|
||||||
|
bool Video::enabled_ = true;
|
||||||
|
|
||||||
|
|
||||||
Video::Video(std::string file, std::string altFile, int numLoops, Page &p, float scaleX, float scaleY)
|
Video::Video(std::string file, std::string altFile, int numLoops, Page &p, float scaleX, float scaleY)
|
||||||
: Component(p)
|
: Component(p)
|
||||||
, video_(NULL)
|
, video_(NULL)
|
||||||
@ -46,6 +49,12 @@ Video::~Video( )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Video::setEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
enabled_ = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Video::update(float dt)
|
void Video::update(float dt)
|
||||||
{
|
{
|
||||||
if(video_)
|
if(video_)
|
||||||
@ -78,7 +87,7 @@ void Video::allocateGraphicsMemory( )
|
|||||||
|
|
||||||
Component::allocateGraphicsMemory( );
|
Component::allocateGraphicsMemory( );
|
||||||
|
|
||||||
if (!video_)
|
if (enabled_ && !video_)
|
||||||
{
|
{
|
||||||
std::string file = "";
|
std::string file = "";
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,7 @@ class Video : public Component
|
|||||||
public:
|
public:
|
||||||
Video( std::string file, std::string altFile, int numLoops, Page &page, float scaleX, float scaleY );
|
Video( std::string file, std::string altFile, int numLoops, Page &page, float scaleX, float scaleY );
|
||||||
virtual ~Video( );
|
virtual ~Video( );
|
||||||
|
static void setEnabled(bool enabled);
|
||||||
void update(float dt);
|
void update(float dt);
|
||||||
void freeGraphicsMemory( );
|
void freeGraphicsMemory( );
|
||||||
void allocateGraphicsMemory( );
|
void allocateGraphicsMemory( );
|
||||||
@ -37,4 +38,8 @@ protected:
|
|||||||
int numLoops_;
|
int numLoops_;
|
||||||
float scaleX_;
|
float scaleX_;
|
||||||
float scaleY_;
|
float scaleY_;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static bool enabled_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
#include "Graphics/PageBuilder.h"
|
#include "Graphics/PageBuilder.h"
|
||||||
#include "Graphics/Page.h"
|
#include "Graphics/Page.h"
|
||||||
#include "Graphics/Component/ScrollingList.h"
|
#include "Graphics/Component/ScrollingList.h"
|
||||||
|
#include "Graphics/Component/Video.h"
|
||||||
#include "Video/VideoFactory.h"
|
#include "Video/VideoFactory.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -214,6 +215,7 @@ void RetroFE::run()
|
|||||||
VideoFactory::setEnabled(videoEnable);
|
VideoFactory::setEnabled(videoEnable);
|
||||||
VideoFactory::setNumLoops(videoLoop);
|
VideoFactory::setNumLoops(videoLoop);
|
||||||
VideoFactory::createVideo(); // pre-initialize the gstreamer engine
|
VideoFactory::createVideo(); // pre-initialize the gstreamer engine
|
||||||
|
Video::setEnabled(videoEnable);
|
||||||
|
|
||||||
|
|
||||||
initializeThread = SDL_CreateThread(initialize, "RetroFEInit", (void *)this);
|
initializeThread = SDL_CreateThread(initialize, "RetroFEInit", (void *)this);
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
std::string retrofe_version_major = "0";
|
std::string retrofe_version_major = "0";
|
||||||
std::string retrofe_version_minor = "7";
|
std::string retrofe_version_minor = "7";
|
||||||
std::string retrofe_version_build = "6";
|
std::string retrofe_version_build = "7";
|
||||||
|
|
||||||
|
|
||||||
std::string Version::getString()
|
std::string Version::getString()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user