Browse Source

Change appearance of UruLiveIntro (Yeesha) movie to post-avatar setup

Also small whitespace cleanup
rarified/movieplayer
rarified 4 years ago
parent
commit
14e3118aaa
  1. 6
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp
  2. 21
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp
  3. 8
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.h
  4. 2
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAudio/plWin32VideoSound.cpp

6
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

21
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<const mkvparser::AudioTrack*>(fAudioTrack->GetTrack());
plWAVHeader header;
header.fFormatTag = plWAVHeader::kPCMFormatTag;
@ -312,9 +312,9 @@ void plMoviePlayer::IProcessVideoFrame(const std::vector<blkbuf_t>& 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<blkbuf_t>::const_iterator frame = frames.begin(); frame != frames.end(); frame++) {
for (std::vector<blkbuf_t>::const_iterator frame = frames.begin(); frame != frames.end(); frame++) {
const std::auto_ptr<UInt8>& buf = frame->first;
UInt32 size = static_cast<UInt32>(frame->second);
UInt32 size = static_cast<UInt32>(frame->second);
img = fVpx->Decode(buf.get(), size);
}
@ -329,7 +329,7 @@ void plMoviePlayer::IProcessVideoFrame(const std::vector<blkbuf_t>& 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;

8
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(); }

2
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);
}

Loading…
Cancel
Save