1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 04:09:16 +00:00

Updates to C++ typing, integrate movie playing into plClient.

This version compiles, but does not render movies.  WIP.
(Has some rearranged message registration in StartInit() for testing)
This commit is contained in:
rarified
2020-08-10 11:09:26 -06:00
parent 4b3f16a912
commit 401fedd610
12 changed files with 329 additions and 15 deletions

View File

@ -1510,12 +1510,19 @@ hsBool plClient::StartInit()
fGameGUIMgr->Init();
plgAudioSys::Activate(true);
// create the listener for the audio system:
plListener* pLMod = TRACKED_NEW plListener;
pLMod->RegisterAs(kListenerMod_KEY );
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pLMod->GetKey());
plgDispatch::Dispatch()->RegisterForExactType(plAudioSysMsg::Index(), pLMod->GetKey());
plgDispatch::Dispatch()->RegisterForExactType(plMovieMsg::Index(), GetKey());
plConst(hsScalar) delay(2.f);
IPlayIntroMovie("avi/intro1.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);
plgDispatch::Dispatch()->RegisterForExactType(plMovieMsg::Index(), GetKey());
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);
//
// Init Net before loading things
@ -1545,13 +1552,6 @@ hsBool plClient::StartInit()
plMouseDevice::Instance()->SetDisplayResolution((float)fPipeline->Width(), (float)fPipeline->Height());
plInputManager::SetRecenterMouse(false);
// create the listener for the audio system:
plListener* pLMod = TRACKED_NEW plListener;
pLMod->RegisterAs(kListenerMod_KEY );
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pLMod->GetKey());
plgDispatch::Dispatch()->RegisterForExactType(plAudioSysMsg::Index(), pLMod->GetKey());
plSynchedObject::PushSynchDisabled(false); // enable dirty tracking
if (StrCmp(NetCommGetStartupAge()->ageDatasetName, "StartUp") == 0)

View File

@ -245,8 +245,10 @@ bool plMoviePlayer::ILoadAudio()
{
#ifdef PLASMA_USE_WEBM
// Fetch audio track information
if (!fAudioTrack.get())
if (!fAudioTrack.get()) {
hsStatusMessage("Movie ILoadAudio fAudioTrack NIL\n");
return false;
}
const mkvparser::AudioTrack* audio = static_cast<const mkvparser::AudioTrack*>(fAudioTrack->GetTrack());
plWAVHeader header;
header.fFormatTag = plWAVHeader::kPCMFormatTag;
@ -346,6 +348,7 @@ bool plMoviePlayer::Start()
if (!IOpenMovie())
return false;
hsAssert(fVideoTrack, "nil video track -- expect bad things to happen!");
hsStatusMessageF("Opened movie %s\n", fMoviePath);
// Initialize VPX
const mkvparser::VideoTrack* video = static_cast<const mkvparser::VideoTrack*>(fVideoTrack->GetTrack());
@ -353,19 +356,26 @@ bool plMoviePlayer::Start()
plStatusLog::AddLineS("movie.log", "%s: Not a VP9 video track!", fMoviePath);
return false;
}
hsStatusMessageF("... movie track selected, codec: %s\n", video->GetCodecId());
if (VPX* vpx = VPX::Create())
fVpx.reset(vpx);
else
return false;
// Decode the audio track and load it into a sound buffer
if (!ILoadAudio())
if (!ILoadAudio()) {
hsStatusMessage("... movie audio track load failed\n");
return false;
}
hsStatusMessage("... movie audio track buffered\n");
fLastFrameTime = static_cast<Int64>(hsTimer::GetMilliSeconds());
fAudioSound->Play();
fPlaying = true;
hsStatusMessage("... plMoviePlayer::Start() returns\n");
return true;
#else
return false;