Global videoEnable parameter now also enables/disables intro videos and background videos.

This commit is contained in:
Pieter Hulshoff 2016-08-28 08:37:59 +02:00
parent 051eec348f
commit 6b3bae4344
4 changed files with 18 additions and 2 deletions

View File

@ -23,6 +23,9 @@
#include "../../SDL.h"
bool Video::enabled_ = true;
Video::Video(std::string file, std::string altFile, int numLoops, Page &p, float scaleX, float scaleY)
: Component(p)
, video_(NULL)
@ -46,6 +49,12 @@ Video::~Video( )
}
void Video::setEnabled(bool enabled)
{
enabled_ = enabled;
}
void Video::update(float dt)
{
if(video_)
@ -78,7 +87,7 @@ void Video::allocateGraphicsMemory( )
Component::allocateGraphicsMemory( );
if (!video_)
if (enabled_ && !video_)
{
std::string file = "";

View File

@ -24,6 +24,7 @@ class Video : public Component
public:
Video( std::string file, std::string altFile, int numLoops, Page &page, float scaleX, float scaleY );
virtual ~Video( );
static void setEnabled(bool enabled);
void update(float dt);
void freeGraphicsMemory( );
void allocateGraphicsMemory( );
@ -37,4 +38,8 @@ protected:
int numLoops_;
float scaleX_;
float scaleY_;
private:
static bool enabled_;
};

View File

@ -28,6 +28,7 @@
#include "Graphics/PageBuilder.h"
#include "Graphics/Page.h"
#include "Graphics/Component/ScrollingList.h"
#include "Graphics/Component/Video.h"
#include "Video/VideoFactory.h"
#include <vector>
#include <string>
@ -214,6 +215,7 @@ void RetroFE::run()
VideoFactory::setEnabled(videoEnable);
VideoFactory::setNumLoops(videoLoop);
VideoFactory::createVideo(); // pre-initialize the gstreamer engine
Video::setEnabled(videoEnable);
initializeThread = SDL_CreateThread(initialize, "RetroFEInit", (void *)this);

View File

@ -20,7 +20,7 @@
std::string retrofe_version_major = "0";
std::string retrofe_version_minor = "7";
std::string retrofe_version_build = "6";
std::string retrofe_version_build = "7";
std::string Version::getString()