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

Patches contributed by Adam to resolve movie playback:

- vcxproj file issues (local paths, Debug configurations)
- defer movie playback until mouse plate properly sized
- correct conditional and type for plMoviePlayer::Start() reference fVideoTrack
- fix typing to call plPlanarImage::Yuv420ToRgba() causing color artifacting
This commit is contained in:
2020-08-11 10:17:46 -06:00
committed by rarified
parent 33a1e301f7
commit b233409580
5 changed files with 17 additions and 18 deletions

View File

@ -1519,11 +1519,6 @@ hsBool plClient::StartInit()
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/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
//
@ -1552,6 +1547,10 @@ hsBool plClient::StartInit()
plMouseDevice::Instance()->SetDisplayResolution((float)fPipeline->Width(), (float)fPipeline->Height());
plInputManager::SetRecenterMouse(false);
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
if (StrCmp(NetCommGetStartupAge()->ageDatasetName, "StartUp") == 0)

View File

@ -347,7 +347,7 @@ bool plMoviePlayer::Start()
#ifdef PLASMA_USE_WEBM
if (!IOpenMovie())
return false;
hsAssert(fVideoTrack, "nil video track -- expect bad things to happen!");
hsAssert(fVideoTrack.get(), "nil video track -- expect bad things to happen!");
hsStatusMessageF("Opened movie %s\n", fMoviePath);
// Initialize VPX
@ -415,7 +415,7 @@ bool plMoviePlayer::NextFrame()
fMovieTime += frameTimeDelta;
std::vector<blkbuf_t> video;
if (fVideoTrack.get() != nullptr || !fVideoTrack->GetFrames(fReader, fMovieTime * 1000000, video)) {
if (fVideoTrack.get() == nullptr || !fVideoTrack->GetFrames(fReader, fMovieTime * 1000000, video)) {
Stop();
return false;
}

View File

@ -44,7 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
///////////////////////////////////////////////////////////////////////////////
static UInt8 Clip(UInt32 val) {
static UInt8 Clip(Int32 val) {
if (val < 0) {
return 0;
} else if (val > 255) {
@ -83,10 +83,10 @@ void plPlanarImage::Yuv420ToRgba(UInt32 w, UInt32 h, const Int32* stride, UInt8*
size_t v_idx = stride[2] * (i/2) + (j/2);
size_t dest_idx = w * i + j;
UInt32 y = static_cast<UInt32>(y_src[y_idx]);
UInt32 u = static_cast<UInt32>(u_src[u_idx]);
UInt32 v = static_cast<UInt32>(v_src[v_idx]);
UInt32 y1 = (y - 16) * YG;
Int32 y = static_cast<Int32>(y_src[y_idx]);
Int32 u = static_cast<Int32>(u_src[u_idx]);
Int32 v = static_cast<Int32>(v_src[v_idx]);
Int32 y1 = (y - 16) * YG;
dest[dest_idx*4+0] = Clip(((u * UB + v * VB) - (BB) + y1) >> 6);
dest[dest_idx*4+1] = Clip(((u * UG + v * VG) - (BG) + y1) >> 6);