mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Use SDL_RWops for video loading
It should fix Android video support. For emscripten it's still not working.
This commit is contained in:
parent
561469f4fd
commit
c8a0a42e62
@ -79,6 +79,7 @@ CMovie::fileCloseMovie ()
|
|||||||
if (m_movie)
|
if (m_movie)
|
||||||
{
|
{
|
||||||
Kit_CloseSource (m_movie);
|
Kit_CloseSource (m_movie);
|
||||||
|
SDL_RWclose (this->rw_ops);
|
||||||
m_movie = nullptr;
|
m_movie = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,9 +99,13 @@ CMovie::fileOpenMovie (const std::string & pFilename)
|
|||||||
if (m_fMovieOpen)
|
if (m_fMovieOpen)
|
||||||
fileCloseMovie ();
|
fileCloseMovie ();
|
||||||
|
|
||||||
|
this->rw_ops = SDL_RWFromFile (path.c_str (), "rb");
|
||||||
|
if (!this->rw_ops)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Open up the sourcefile.
|
// Open up the sourcefile.
|
||||||
// This can be a local file, network url, ...
|
// This can be a local file, network url, ...
|
||||||
m_movie = Kit_CreateSourceFromUrl (path.c_str ());
|
m_movie = Kit_CreateSourceFromRW (rw_ops);
|
||||||
if (m_movie)
|
if (m_movie)
|
||||||
{
|
{
|
||||||
// Create the player
|
// Create the player
|
||||||
|
@ -57,6 +57,7 @@ protected:
|
|||||||
SDL_Texture * m_videoTex;
|
SDL_Texture * m_videoTex;
|
||||||
Sint32 m_ret;
|
Sint32 m_ret;
|
||||||
SDL_AudioDeviceID m_audioDev;
|
SDL_AudioDeviceID m_audioDev;
|
||||||
|
SDL_RWops * rw_ops;
|
||||||
|
|
||||||
char m_audiobuf[AUDIOBUFFER_SIZE];
|
char m_audiobuf[AUDIOBUFFER_SIZE];
|
||||||
bool m_bEnable;
|
bool m_bEnable;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user