diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp index 32600838..27ca0df6 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp @@ -870,6 +870,9 @@ hsBool plClient::MsgReceive(plMessage* msg) //============================================================================ hsBool plClient::IHandleMovieMsg(plMovieMsg* mov) { + if (mov != nullptr) + hsStatusMessageF("MovieMsg received 0x%x", mov->GetCmd()); + if( !(mov->GetFileName() && *mov->GetFileName()) ) return true; @@ -1517,6 +1520,8 @@ hsBool plClient::StartInit() plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pLMod->GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plAudioSysMsg::Index(), pLMod->GetKey()); + + // Init the movie player handler plgDispatch::Dispatch()->RegisterForExactType(plMovieMsg::Index(), GetKey()); // @@ -1549,7 +1554,6 @@ hsBool plClient::StartInit() IPlayIntroMovie("avi/intro1.webm", 0.f, 0.f, 0.f, 1.f, 1.f, 0.75); IPlayIntroMovie("avi/EventIntro.webm", 0.f, 0.f, 0.f, 1.f, 1.f, 0.75); - IPlayIntroMovie("avi/URULiveIntro.webm", 0.f, 0.f, 0.f, 1.f, 1.f, 0.75); plSynchedObject::PushSynchDisabled(false); // enable dirty tracking diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp index 9577ba72..fbcb6fcf 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp @@ -177,7 +177,7 @@ plMoviePlayer::plMoviePlayer() fPosition(hsPoint2()), fPlaying(false), fPaused(false), - fMoviePath(nullptr) + fMoviePath(nullptr) { fScale.Set(1.0f, 1.0f); } @@ -193,7 +193,7 @@ plMoviePlayer::~plMoviePlayer() delete fReader; } #endif - delete[] fMoviePath; + delete[] fMoviePath; } bool plMoviePlayer::IOpenMovie() @@ -247,9 +247,9 @@ bool plMoviePlayer::ILoadAudio() #ifdef PLASMA_USE_WEBM // Fetch audio track information if (!fAudioTrack.get()) { - hsStatusMessage("Movie ILoadAudio fAudioTrack NIL\n"); + hsStatusMessage("Movie ILoadAudio fAudioTrack NIL\n"); return false; - } + } const mkvparser::AudioTrack* audio = static_cast(fAudioTrack->GetTrack()); plWAVHeader header; header.fFormatTag = plWAVHeader::kPCMFormatTag; @@ -312,9 +312,9 @@ void plMoviePlayer::IProcessVideoFrame(const std::vector& frames) vpx_image_t* img = nullptr; // We have to decode all the frames, but we only want to display the most recent one to the user. - for (std::vector::const_iterator frame = frames.begin(); frame != frames.end(); frame++) { + for (std::vector::const_iterator frame = frames.begin(); frame != frames.end(); frame++) { const std::auto_ptr& buf = frame->first; - UInt32 size = static_cast(frame->second); + UInt32 size = static_cast(frame->second); img = fVpx->Decode(buf.get(), size); } @@ -329,7 +329,7 @@ void plMoviePlayer::IProcessVideoFrame(const std::vector& frames) break; default: - hsAssert(false, "image format"); + hsAssert(false, "image format"); } // Flush new data to the device @@ -349,6 +349,7 @@ bool plMoviePlayer::Start() if (!IOpenMovie()) return false; hsAssert(fVideoTrack.get(), "nil video track -- expect bad things to happen!"); + plStatusLog::AddLineS("movie.log", "%s: Start movie playback", fMoviePath); hsStatusMessageF("Opened movie %s\n", fMoviePath); // Initialize VPX @@ -365,8 +366,8 @@ bool plMoviePlayer::Start() return false; // Decode the audio track and load it into a sound buffer - if (!ILoadAudio()) { - hsStatusMessage("... movie audio track load failed\n"); + if (!ILoadAudio()) { + hsStatusMessage("... movie audio track load failed\n"); return false; } hsStatusMessage("... movie audio track buffered\n"); @@ -376,7 +377,7 @@ bool plMoviePlayer::Start() fAudioSound->Play(); fPlaying = true; - hsStatusMessage("... plMoviePlayer::Start() returns\n"); + hsStatusMessage("... movie start success\n"); return true; #else return false; diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.h b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.h index 3a1b70ca..8455f276 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.h +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.h @@ -103,10 +103,10 @@ public: const char *GetFileName() const { return fMoviePath; } void SetFileName(const char* filename) - { - delete[] fMoviePath; - fMoviePath = hsStrcpy(filename); - } + { + delete[] fMoviePath; + fMoviePath = hsStrcpy(filename); + } void SetColor(const hsColorRGBA& c) { } const hsColorRGBA GetColor() const { return hsColorRGBA(); } diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAudio/plWin32VideoSound.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAudio/plWin32VideoSound.cpp index 44540c05..1bb46c09 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAudio/plWin32VideoSound.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAudio/plWin32VideoSound.cpp @@ -59,7 +59,7 @@ plWin32VideoSound::plWin32VideoSound(const plWAVHeader& header) : plWin32Sound() uniqueID++; char keyName[32]; - StrPrintf(keyName, arrsize(keyName), "VoiceSound_%d", uniqueID); + StrPrintf(keyName, arrsize(keyName), "VideoSound_%d", uniqueID); hsgResMgr::ResMgr()->NewKey(keyName, this, plLocation::kGlobalFixedLoc); }