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

VS2003: changes for older compiler

- nullptr not defined, use nil
- remove unused VCXPROJ with wrong name plMoviePlayer
- std::begin, std::end not defined, conditionally include code for plLocalization::GetLanguageCodes()
      on _MSC_VER >= 1800
- add PLASMA_USE_WEBM to appropriate VS projects
- fix library references to opus, vpx and speex
This commit is contained in:
rarified
2020-08-12 16:28:42 -06:00
parent 14e3118aaa
commit f3c0a81b0b
9 changed files with 32 additions and 324 deletions

View File

@ -98,23 +98,23 @@ public:
static VPX* Create()
{
VPX* instance = new VPX;
if (vpx_codec_dec_init(&instance->codec, iface, nullptr, 0)) {
if (vpx_codec_dec_init(&instance->codec, iface, nil, 0)) {
hsAssert(false, vpx_codec_error_detail(&instance->codec));
delete instance;
return nullptr;
return nil;
}
return instance;
}
vpx_image_t* Decode(UInt8* buf, UInt32 size)
{
if (vpx_codec_decode(&codec, buf, size, nullptr, 0) != VPX_CODEC_OK) {
if (vpx_codec_decode(&codec, buf, size, nil, 0) != VPX_CODEC_OK) {
const char* detail = vpx_codec_error_detail(&codec);
hsAssert(false, detail ? detail : "unspecified decode error");
return nullptr;
return nil;
}
vpx_codec_iter_t iter = nullptr;
vpx_codec_iter_t iter = nil;
// ASSUMPTION: only one image per frame
// if this proves false, move decoder function into IProcessVideoFrame
return vpx_codec_get_frame(&codec, &iter);
@ -132,7 +132,7 @@ protected:
Int32 fStatus;
public:
TrackMgr(const mkvparser::Track* track) : fTrack(track), fCurrentBlock(nullptr), fStatus(0) { }
TrackMgr(const mkvparser::Track* track) : fTrack(track), fCurrentBlock(nil), fStatus(0) { }
const mkvparser::Track* GetTrack() { return fTrack; }
@ -169,15 +169,15 @@ public:
// =====================================================
plMoviePlayer::plMoviePlayer()
: fPlate(nullptr),
fTexture(nullptr),
fReader(nullptr),
: fPlate(nil),
fTexture(nil),
fReader(nil),
fMovieTime(0),
fLastFrameTime(0),
fPosition(hsPoint2()),
fPlaying(false),
fPaused(false),
fMoviePath(nullptr)
fMoviePath(nil)
{
fScale.Set(1.0f, 1.0f);
}
@ -309,7 +309,7 @@ bool plMoviePlayer::ICheckLanguage(const mkvparser::Track* track)
void plMoviePlayer::IProcessVideoFrame(const std::vector<blkbuf_t>& frames)
{
#ifdef PLASMA_USE_WEBM
vpx_image_t* img = nullptr;
vpx_image_t* img = nil;
// 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++) {
@ -417,7 +417,7 @@ bool plMoviePlayer::NextFrame()
fMovieTime += frameTimeDelta;
std::vector<blkbuf_t> video;
if (fVideoTrack.get() == nullptr || !fVideoTrack->GetFrames(fReader, fMovieTime * 1000000, video)) {
if (fVideoTrack.get() == nil || !fVideoTrack->GetFrames(fReader, fMovieTime * 1000000, video)) {
Stop();
return false;
}
@ -452,7 +452,7 @@ bool plMoviePlayer::Pause(bool on)
bool plMoviePlayer::Stop()
{
fPlaying = false;
if (fAudioSound.get() != nullptr)
if (fAudioSound.get() != nil)
fAudioSound->Stop();
if (fPlate)
fPlate->SetVisible(false);

View File

@ -99,7 +99,7 @@ public:
void AddCallback(plMessage* msg) { hsRefCnt_SafeRef(msg); fCallbacks.push_back(msg); }
UInt32 GetNumCallbacks() const { return 0; }
plMessage* GetCallback(int i) const { return nullptr; }
plMessage* GetCallback(int i) const { return nil; }
const char *GetFileName() const { return fMoviePath; }
void SetFileName(const char* filename)