mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 17:58:53 +01:00
Removing NullVideo so a ReloadableMedia component will instead display an image.
This commit is contained in:
parent
25dcaeada8
commit
6d49d3cc1b
@ -186,10 +186,7 @@ set(RETROFE_SOURCES
|
|||||||
"${SQLITE3_ROOT}/sqlite3.c"
|
"${SQLITE3_ROOT}/sqlite3.c"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NO_VIDEO)
|
if(NOT NO_VIDEO)
|
||||||
set(RETROFE_HEADERS ${RETROFE_HEADERS} "${RETROFE_DIR}/Source/Video/NullVideo.h")
|
|
||||||
set(RETROFE_SOURCES ${RETROFE_SOURCES} "${RETROFE_DIR}/Source/Video/NullVideo.cpp")
|
|
||||||
else()
|
|
||||||
set(RETROFE_HEADERS ${RETROFE_HEADERS} "${RETROFE_DIR}/Source/Video/GStreamerVideo.h")
|
set(RETROFE_HEADERS ${RETROFE_HEADERS} "${RETROFE_DIR}/Source/Video/GStreamerVideo.h")
|
||||||
set(RETROFE_SOURCES ${RETROFE_SOURCES} "${RETROFE_DIR}/Source/Video/GStreamerVideo.cpp")
|
set(RETROFE_SOURCES ${RETROFE_SOURCES} "${RETROFE_DIR}/Source/Video/GStreamerVideo.cpp")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -1,79 +0,0 @@
|
|||||||
/* This file is part of RetroFE.
|
|
||||||
*
|
|
||||||
* RetroFE is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* RetroFE is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with RetroFE. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#include "NullVideo.h"
|
|
||||||
#include "../Utility/Log.h"
|
|
||||||
#include "../SDL.h"
|
|
||||||
#include <sstream>
|
|
||||||
#include <cstring>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <SDL2/SDL.h>
|
|
||||||
|
|
||||||
NullVideo::NullVideo()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
NullVideo::~NullVideo()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void NullVideo::SetNumLoops(int n)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Texture *NullVideo::GetTexture() const
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NullVideo::Initialize()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NullVideo::DeInitialize()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NullVideo::Stop()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NullVideo::Play(std::string file)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int NullVideo::GetHeight()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int NullVideo::GetWidth()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void NullVideo::Draw()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void NullVideo::Update(float dt)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
/* This file is part of RetroFE.
|
|
||||||
*
|
|
||||||
* RetroFE is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* RetroFE is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with RetroFE. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "IVideo.h"
|
|
||||||
|
|
||||||
class NullVideo : public IVideo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
NullVideo();
|
|
||||||
~NullVideo();
|
|
||||||
bool Initialize();
|
|
||||||
bool Play(std::string file);
|
|
||||||
bool Stop();
|
|
||||||
bool DeInitialize();
|
|
||||||
SDL_Texture *GetTexture() const;
|
|
||||||
void Update(float dt);
|
|
||||||
void Draw();
|
|
||||||
void SetNumLoops(int n);
|
|
||||||
void FreeElements();
|
|
||||||
int GetHeight();
|
|
||||||
int GetWidth();
|
|
||||||
};
|
|
||||||
@ -17,9 +17,7 @@
|
|||||||
#include "VideoFactory.h"
|
#include "VideoFactory.h"
|
||||||
#include "IVideo.h"
|
#include "IVideo.h"
|
||||||
|
|
||||||
#ifdef NO_VIDEO
|
#ifndef NO_VIDEO
|
||||||
#include "NullVideo.h"
|
|
||||||
#else
|
|
||||||
#include "GStreamerVideo.h"
|
#include "GStreamerVideo.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -32,14 +30,9 @@ IVideo *VideoFactory::CreateVideo()
|
|||||||
|
|
||||||
if(Enabled && !Instance)
|
if(Enabled && !Instance)
|
||||||
{
|
{
|
||||||
#ifdef NO_VIDEO
|
|
||||||
Instance = new NullVideo();
|
|
||||||
#else
|
|
||||||
Instance = new GStreamerVideo();
|
|
||||||
#endif
|
|
||||||
Instance->Initialize();
|
|
||||||
|
|
||||||
#ifndef NO_VIDEO
|
#ifndef NO_VIDEO
|
||||||
|
Instance = new GStreamerVideo();
|
||||||
|
Instance->Initialize();
|
||||||
((GStreamerVideo *)(Instance))->SetNumLoops(NumLoops);
|
((GStreamerVideo *)(Instance))->SetNumLoops(NumLoops);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user