mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 11:12:29 +00:00
feat(ui): update CSimpleMovieFrame methods
This commit is contained in:
parent
967408b2e7
commit
676fd280c6
2 changed files with 26 additions and 0 deletions
|
|
@ -23,6 +23,14 @@ void CSimpleMovieFrame::RegisterScriptMethods(lua_State* L) {
|
||||||
FrameScript_Object::FillScriptMethodTable(L, SimpleMovieFrameMethods, NUM_SIMPLE_MOVIE_FRAME_SCRIPT_METHODS);
|
FrameScript_Object::FillScriptMethodTable(L, SimpleMovieFrameMethods, NUM_SIMPLE_MOVIE_FRAME_SCRIPT_METHODS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimpleMovieFrame::RenderMovie(void* param) {
|
||||||
|
auto movieFrame = reinterpret_cast<CSimpleMovieFrame*>(param);
|
||||||
|
if (movieFrame->m_isPlaying) {
|
||||||
|
// movieFrame->UpdateTiming();
|
||||||
|
// movieFrame->Render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FrameScript_Object::ScriptIx* CSimpleMovieFrame::GetScriptByName(const char* name, ScriptData& data) {
|
FrameScript_Object::ScriptIx* CSimpleMovieFrame::GetScriptByName(const char* name, ScriptData& data) {
|
||||||
auto parentScript = CSimpleFrame::GetScriptByName(name, data);
|
auto parentScript = CSimpleFrame::GetScriptByName(name, data);
|
||||||
|
|
||||||
|
|
@ -58,6 +66,10 @@ int32_t CSimpleMovieFrame::GetScriptMetaTable() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleMovieFrame::OnFrameRender(CRenderBatch* batch, uint32_t layer) {
|
void CSimpleMovieFrame::OnFrameRender(CRenderBatch* batch, uint32_t layer) {
|
||||||
|
this->CSimpleFrame::OnFrameRender(batch, layer);
|
||||||
|
if (layer == DRAWLAYER_ARTWORK) {
|
||||||
|
batch->QueueCallback(&CSimpleMovieFrame::RenderMovie, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CSimpleMovieFrame::CSimpleMovieFrame(CSimpleFrame* parent)
|
CSimpleMovieFrame::CSimpleMovieFrame(CSimpleFrame* parent)
|
||||||
|
|
@ -80,6 +92,18 @@ int32_t CSimpleMovieFrame::StartMovie(const char* filename, int32_t volume) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleMovieFrame::StopMovie() {
|
void CSimpleMovieFrame::StopMovie() {
|
||||||
|
if (!this->m_isPlaying) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnloadDivxDecoder
|
||||||
|
// CloseAudio
|
||||||
|
// CloseCaptions
|
||||||
|
this->m_isStopped = 0;
|
||||||
|
this->m_isPlaying = 0;
|
||||||
|
if (this->m_onMovieFinished.luaRef) {
|
||||||
|
this->RunScript(this->m_onMovieFinished, 0, nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleMovieFrame::ParseAVIFile(const char* filename) {
|
int32_t CSimpleMovieFrame::ParseAVIFile(const char* filename) {
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,11 @@ class CSimpleMovieFrame : public CSimpleFrame {
|
||||||
static void CreateScriptMetaTable();
|
static void CreateScriptMetaTable();
|
||||||
static int32_t GetObjectType();
|
static int32_t GetObjectType();
|
||||||
static void RegisterScriptMethods(lua_State* L);
|
static void RegisterScriptMethods(lua_State* L);
|
||||||
|
static void RenderMovie(void* param);
|
||||||
|
|
||||||
// Member variables
|
// Member variables
|
||||||
int32_t m_isPlaying = 0;
|
int32_t m_isPlaying = 0;
|
||||||
|
int32_t m_isStopped = 0;
|
||||||
int32_t m_enableSubtitles = 0;
|
int32_t m_enableSubtitles = 0;
|
||||||
char m_filename[256];
|
char m_filename[256];
|
||||||
int32_t m_volume = 100;
|
int32_t m_volume = 100;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue