mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 01:46:42 +00:00
EMI: use enableSubtitles parameter of StartMovie lua function
This commit is contained in:
parent
9b1b336a7b
commit
ff930b84de
@ -155,16 +155,25 @@ void Lua_V2::GetCPUSpeed() {
|
||||
// the only real difference from L1 is the lack of looping
|
||||
void Lua_V2::StartMovie() {
|
||||
lua_Object name = lua_getparam(1);
|
||||
lua_Object subtitlesObj = lua_getparam(2);
|
||||
|
||||
if (!lua_isstring(name)) {
|
||||
lua_pushnil();
|
||||
return;
|
||||
}
|
||||
Lua_V1::CleanBuffer();
|
||||
|
||||
bool showSubtitles = false;
|
||||
if (lua_isnumber(subtitlesObj)) {
|
||||
if ((int)lua_getnumber(subtitlesObj)) {
|
||||
showSubtitles = true;
|
||||
}
|
||||
}
|
||||
|
||||
GrimEngine::EngineMode prevEngineMode = g_grim->getMode();
|
||||
g_grim->setMode(GrimEngine::SmushMode);
|
||||
g_grim->setMovieSubtitle(NULL);
|
||||
bool result = g_movie->play(lua_getstring(name), false, 0, 0);
|
||||
bool result = g_movie->play(lua_getstring(name), false, 0, 0, true, showSubtitles);
|
||||
if (!result)
|
||||
g_grim->setMode(prevEngineMode);
|
||||
pushbool(result);
|
||||
|
@ -41,6 +41,7 @@ MoviePlayer::MoviePlayer() {
|
||||
_videoLooping = false;
|
||||
_videoPause = true;
|
||||
_updateNeeded = false;
|
||||
_showSubtitles = true;
|
||||
_movieTime = 0;
|
||||
_frame = -1;
|
||||
_x = 0;
|
||||
@ -149,13 +150,14 @@ void MoviePlayer::deinit() {
|
||||
_videoFinished = true;
|
||||
}
|
||||
|
||||
bool MoviePlayer::play(const Common::String &filename, bool looping, int x, int y, bool start) {
|
||||
bool MoviePlayer::play(const Common::String &filename, bool looping, int x, int y, bool start, bool showSubtitles) {
|
||||
Common::StackLock lock(_frameMutex);
|
||||
deinit();
|
||||
_x = x;
|
||||
_y = y;
|
||||
_fname = filename;
|
||||
_videoLooping = looping;
|
||||
_showSubtitles = showSubtitles;
|
||||
|
||||
if (!loadFile(_fname))
|
||||
return false;
|
||||
|
@ -41,6 +41,7 @@ protected:
|
||||
Graphics::Surface *_externalSurface;
|
||||
int32 _frame;
|
||||
bool _updateNeeded;
|
||||
bool _showSubtitles;
|
||||
float _movieTime;
|
||||
int _channels;
|
||||
int _freq;
|
||||
@ -66,7 +67,7 @@ public:
|
||||
* @see init
|
||||
* @see stop
|
||||
*/
|
||||
virtual bool play(const Common::String &filename, bool looping, int x, int y, bool start = true);
|
||||
virtual bool play(const Common::String &filename, bool looping, int x, int y, bool start = true, bool showSubtitles = false);
|
||||
virtual void stop();
|
||||
virtual void pause(bool p);
|
||||
virtual bool isPlaying() { return !_videoFinished; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user