diff options
author | Einar Johan Trøan Sømåen | 2012-07-09 03:27:21 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-09 03:27:21 +0200 |
commit | 1eea9ad1a3ae577195363abe475cfbbee33d153b (patch) | |
tree | 3df20e3a1443f12a39167f047bb49d4d8e57521b /engines/wintermute/video | |
parent | 932bd45da5600c0a3f8b36d407fde38f60039432 (diff) | |
download | scummvm-rg350-1eea9ad1a3ae577195363abe475cfbbee33d153b.tar.gz scummvm-rg350-1eea9ad1a3ae577195363abe475cfbbee33d153b.tar.bz2 scummvm-rg350-1eea9ad1a3ae577195363abe475cfbbee33d153b.zip |
WINTERMUTE: Remove most of the wintype-definitions.
Diffstat (limited to 'engines/wintermute/video')
-rw-r--r-- | engines/wintermute/video/VidPlayer.cpp | 68 | ||||
-rw-r--r-- | engines/wintermute/video/VidPlayer.h | 16 | ||||
-rw-r--r-- | engines/wintermute/video/VidTheoraPlayer.cpp | 120 | ||||
-rw-r--r-- | engines/wintermute/video/VidTheoraPlayer.h | 26 |
4 files changed, 115 insertions, 115 deletions
diff --git a/engines/wintermute/video/VidPlayer.cpp b/engines/wintermute/video/VidPlayer.cpp index 1e4b25e143..51453fb34b 100644 --- a/engines/wintermute/video/VidPlayer.cpp +++ b/engines/wintermute/video/VidPlayer.cpp @@ -45,7 +45,7 @@ CVidPlayer::CVidPlayer(CBGame *inGame): CBBase(inGame) { ////////////////////////////////////////////////////////////////////////// -HRESULT CVidPlayer::SetDefaults() { +ERRORCODE CVidPlayer::SetDefaults() { _playing = false; /* _aviFile = NULL; @@ -80,7 +80,7 @@ HRESULT CVidPlayer::SetDefaults() { _currentSubtitle = 0; _showSubtitle = false; - return S_OK; + return STATUS_OK; } @@ -91,7 +91,7 @@ CVidPlayer::~CVidPlayer() { ////////////////////////////////////////////////////////////////////////// -HRESULT CVidPlayer::cleanup() { +ERRORCODE CVidPlayer::cleanup() { #if 0 if (_sound) _sound->Stop(); if (_videoPGF) AVIStreamGetFrameClose(_videoPGF); @@ -124,7 +124,7 @@ HRESULT CVidPlayer::cleanup() { ////////////////////////////////////////////////////////////////////////// -HRESULT CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) { +ERRORCODE CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) { #if 0 cleanup(); @@ -134,13 +134,13 @@ HRESULT CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) // open file if (AVIFileOpen(&_aviFile, Filename, OF_READ, NULL) != 0) { Game->LOG(0, "Error opening AVI file '%s'", filename); - return E_FAIL; + return STATUS_FAILED; } // get video stream if (AVIFileGetStream(_aviFile, &_videoStream, streamtypeVIDEO, 0) != 0) { Game->LOG(0, "Error finding video stream in AVI file '%s'", filename); - return E_FAIL; + return STATUS_FAILED; } _totalVideoTime = AVIStreamEndTime(_videoStream); @@ -156,7 +156,7 @@ HRESULT CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) // get video format if (AVIStreamReadFormat(m_VideoStream, 0, NULL, &Size)) { Game->LOG(0, "Error obtaining video stream format in AVI file '%s'", filename); - return E_FAIL; + return STATUS_FAILED; } _videoFormat = (LPBITMAPINFO)new BYTE[Size]; AVIStreamReadFormat(m_VideoStream, 0, m_VideoFormat, &Size); @@ -175,19 +175,19 @@ HRESULT CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) else m_VidRenderer = new CVidRendererDD(Game); - if (!m_VidRenderer || FAILED(m_VidRenderer->Initialize(m_VideoFormat, m_TargetFormat))) { + if (!m_VidRenderer || DID_FAIL(m_VidRenderer->Initialize(m_VideoFormat, m_TargetFormat))) { Game->LOG(0, "Error initializing video renderer for AVI file '%s'", filename); SAFE_DELETE(m_VidRenderer); - return E_FAIL; + return STATUS_FAILED; } // create sound buffer - HRESULT res; + ERRORCODE res; if (_soundAvailable) { _sound = new CBSoundAVI(Game); - if (FAILED(res = _sound->InitializeBuffer(_audioStream))) { + if (DID_FAIL(res = _sound->InitializeBuffer(_audioStream))) { SAFE_DELETE(_sound); _soundAvailable = false; Game->LOG(res, "Error initializing sound buffer for AVI file '%s'", filename); @@ -199,20 +199,20 @@ HRESULT CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) _filename = new char[strlen(filename) + 1]; if (_filename) strcpy(_filename, filename); #endif - return S_OK; + return STATUS_OK; } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidPlayer::update() { +ERRORCODE CVidPlayer::update() { #if 0 - if (!m_Playing) return S_OK; + if (!m_Playing) return STATUS_OK; - HRESULT res; + ERRORCODE res; if (_soundAvailable && m_Sound) { res = _sound->update(); - if (FAILED(res)) return res; + if (DID_FAIL(res)) return res; } @@ -231,7 +231,7 @@ HRESULT CVidPlayer::update() { if (CurrentTime >= _totalVideoTime) { Stop(); - return S_OK; + return STATUS_OK; } @@ -266,21 +266,21 @@ HRESULT CVidPlayer::update() { if (FrameData) { if (_slowRendering) return _vidRenderer->ProcessFrameSlow(FrameData); else return _vidRenderer->ProcessFrame(FrameData); - } else return E_FAIL; - } else return S_OK; + } else return STATUS_FAILED; + } else return STATUS_OK; #endif return 0; } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidPlayer::display() { +ERRORCODE CVidPlayer::display() { #if 0 - if (!m_Playing) return S_OK; + if (!m_Playing) return STATUS_OK; - HRESULT res; + ERRORCODE res; if (_vidRenderer) res = _vidRenderer->display(m_PlayPosX, m_PlayPosY, m_PlayZoom); - else res = E_FAIL; + else res = STATUS_FAILED; // display subtitle if (m_ShowSubtitle) { @@ -298,9 +298,9 @@ HRESULT CVidPlayer::display() { ////////////////////////////////////////////////////////////////////////// -HRESULT CVidPlayer::play(TVideoPlayback Type, int X, int Y, bool FreezeMusic) { +ERRORCODE CVidPlayer::play(TVideoPlayback Type, int X, int Y, bool FreezeMusic) { #if 0 - if (!_videoStream || !_vidRenderer) return E_FAIL; + if (!_videoStream || !_vidRenderer) return STATUS_FAILED; switch (Type) { case VID_PLAY_POS: @@ -335,7 +335,7 @@ HRESULT CVidPlayer::play(TVideoPlayback Type, int X, int Y, bool FreezeMusic) { if (!_videoPGF) { Game->LOG(0, "Error: Unsupported AVI format (file '%s')", m_Filename); cleanup(); - return E_FAIL; + return STATUS_FAILED; } else { Game->LOG(0, "Performance warning: non-optimal AVI format, using generic (i.e. slow) rendering routines (file '%s')", m_Filename); _slowRendering = true; @@ -354,20 +354,20 @@ HRESULT CVidPlayer::play(TVideoPlayback Type, int X, int Y, bool FreezeMusic) { if (_sound) _sound->Play(); _startTime = timeGetTime(); #endif - return S_OK; + return STATUS_OK; } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidPlayer::stop() { +ERRORCODE CVidPlayer::stop() { #if 0 - if (!_playing) return S_OK; + if (!_playing) return STATUS_OK; cleanup(); Game->Unfreeze(); #endif - return S_OK; + return STATUS_OK; } @@ -378,9 +378,9 @@ bool CVidPlayer::isPlaying() { ////////////////////////////////////////////////////////////////////////// -HRESULT CVidPlayer::loadSubtitles(const char *filename, const char *SubtitleFile) { +ERRORCODE CVidPlayer::loadSubtitles(const char *filename, const char *SubtitleFile) { #if 0 - if (!Filename) return S_OK; + if (!Filename) return STATUS_OK; char NewFile[MAX_PATH]; char drive[_MAX_DRIVE]; @@ -396,7 +396,7 @@ HRESULT CVidPlayer::loadSubtitles(const char *filename, const char *SubtitleFile DWORD Size; BYTE *Buffer = Game->m_FileManager->readWholeFile(NewFile, &Size, false); - if (Buffer == NULL) return S_OK; // no subtitles + if (Buffer == NULL) return STATUS_OK; // no subtitles LONG Start, End; @@ -464,7 +464,7 @@ HRESULT CVidPlayer::loadSubtitles(const char *filename, const char *SubtitleFile delete [] Buffer; #endif - return S_OK; + return STATUS_OK; } } // end of namespace WinterMute diff --git a/engines/wintermute/video/VidPlayer.h b/engines/wintermute/video/VidPlayer.h index b1afa080bd..6b729cac20 100644 --- a/engines/wintermute/video/VidPlayer.h +++ b/engines/wintermute/video/VidPlayer.h @@ -46,23 +46,23 @@ class CVidPlayer : public CBBase { public: bool _showSubtitle; int _currentSubtitle; - HRESULT loadSubtitles(const char *filename, const char *SubtitleFile); + ERRORCODE loadSubtitles(const char *filename, const char *SubtitleFile); bool _slowRendering; bool isPlaying(); char *_filename; - HRESULT stop(); - HRESULT play(TVideoPlayback Type = VID_PLAY_CENTER, int X = 0, int Y = 0, bool FreezeMusic = true); + ERRORCODE stop(); + ERRORCODE play(TVideoPlayback Type = VID_PLAY_CENTER, int X = 0, int Y = 0, bool FreezeMusic = true); uint32 _totalVideoTime; uint32 _startTime; //CVidRenderer *_vidRenderer; //CBSoundAVI *_sound; bool _soundAvailable; - HRESULT SetDefaults(); + ERRORCODE SetDefaults(); bool _playing; - HRESULT display(); - HRESULT update(); - HRESULT initialize(const char *inFilename, const char *SubtitleFile = NULL); - HRESULT cleanup(); + ERRORCODE display(); + ERRORCODE update(); + ERRORCODE initialize(const char *inFilename, const char *SubtitleFile = NULL); + ERRORCODE cleanup(); CVidPlayer(CBGame *inGame); virtual ~CVidPlayer(); diff --git a/engines/wintermute/video/VidTheoraPlayer.cpp b/engines/wintermute/video/VidTheoraPlayer.cpp index f1c3de9283..6b71c2a2fd 100644 --- a/engines/wintermute/video/VidTheoraPlayer.cpp +++ b/engines/wintermute/video/VidTheoraPlayer.cpp @@ -133,23 +133,23 @@ void CVidTheoraPlayer::cleanup() { } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Common::String &subtitleFile) { +ERRORCODE CVidTheoraPlayer::initialize(const Common::String &filename, const Common::String &subtitleFile) { cleanup(); _filename = filename; _file = Game->_fileManager->openFile(filename, true, false); - if (!_file) return E_FAIL; + if (!_file) return STATUS_FAILED; //if (Filename != _filename) CBUtils::setString(&_filename, filename); #if defined (USE_THEORADEC) _theoraDecoder = new TheoraDecoder(); #else - return E_FAIL; + return STATUS_FAILED; #endif _theoraDecoder->loadStream(_file); if (!_theoraDecoder->isVideoLoaded()) - return E_FAIL; + return STATUS_FAILED; _state = THEORA_STATE_PAUSED; @@ -160,12 +160,12 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo _state = THEORA_STATE_PLAYING; _playZoom = 100; - return S_OK; + return STATUS_OK; #if 0 cleanup(); _file = Game->_fileManager->openFile(filename); - if (!_file) return E_FAIL; + if (!_file) return STATUS_FAILED; if (Filename != _filename) CBUtils::setString(&_filename, filename); @@ -233,11 +233,11 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo while (m_TheoraStreams && (m_TheoraStreams < 3) && (Ret = ogg_stream_packetout(&m_TheoraStreamState, &TempOggPacket))) { if (Ret < 0) { Game->LOG(0, "Error parsing Theora stream headers; corrupt stream?"); - return E_FAIL; + return STATUS_FAILED; } if (theora_decode_header(&m_TheoraInfo, &m_TheoraComment, &TempOggPacket)) { Game->LOG(0, "Error parsing Theora stream headers; corrupt stream?"); - return E_FAIL; + return STATUS_FAILED; } m_TheoraStreams++; if (m_TheoraStreams == 3) break; @@ -247,11 +247,11 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo while (m_VorbisStreams && (m_VorbisStreams < 3) && (Ret = ogg_stream_packetout(&m_VorbisStreamState, &TempOggPacket))) { if (Ret < 0) { Game->LOG(0, "Error parsing Vorbis stream headers; corrupt stream?"); - return E_FAIL; + return STATUS_FAILED; } if (vorbis_synthesis_headerin(&m_VorbisInfo, &m_VorbisComment, &TempOggPacket)) { Game->LOG(0, "Error parsing Vorbis stream headers; corrupt stream?"); - return E_FAIL; + return STATUS_FAILED; } m_VorbisStreams++; if (m_VorbisStreams == 3) break; @@ -268,7 +268,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo int Ret = BufferData(&m_OggSyncState); // someone needs more data if (Ret == 0) { Game->LOG(0, "End of file while searching for codec headers"); - return E_FAIL; + return STATUS_FAILED; } } } @@ -294,13 +294,13 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo vorbis_comment_clear(&m_VorbisComment); } - HRESULT Res = S_OK; + ERRORCODE Res = STATUS_OK; // create sound buffer if (m_VorbisStreams && Game->m_SoundMgr->m_SoundAvailable) { m_Sound = new CBSoundTheora(Game); Game->m_SoundMgr->AddSound(m_Sound); - if (FAILED(Res = m_Sound->InitializeBuffer(this))) { + if (DID_FAIL(Res = m_Sound->InitializeBuffer(this))) { Game->m_SoundMgr->RemoveSound(m_Sound); m_Sound = NULL; Game->LOG(Res, "Error initializing sound buffer for Theora file '%s'", filename); @@ -318,7 +318,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo else m_Texture = new CBSurfaceDD(Game); - if (!m_Texture || FAILED(Res = m_Texture->Create(m_TheoraInfo.width, m_TheoraInfo.height))) { + if (!m_Texture || DID_FAIL(Res = m_Texture->Create(m_TheoraInfo.width, m_TheoraInfo.height))) { SAFE_DELETE(m_Texture); } } @@ -329,12 +329,12 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo return Res; #endif - return E_FAIL; + return STATUS_FAILED; } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::resetStream() { +ERRORCODE CVidTheoraPlayer::resetStream() { warning("VidTheoraPlayer::resetStream - stubbed"); #if 0 if (_sound) _sound->Stop(); @@ -343,11 +343,11 @@ HRESULT CVidTheoraPlayer::resetStream() { Initialize(m_Filename); Play(m_PlaybackType, m_PosX, m_PosY, false, false, m_Looping, 0, m_PlayZoom); #endif - return S_OK; + return STATUS_OK; } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGame, bool freezeMusic, bool looping, uint32 startTime, float forceZoom, int volume) { +ERRORCODE CVidTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGame, bool freezeMusic, bool looping, uint32 startTime, float forceZoom, int volume) { if (forceZoom < 0.0f) forceZoom = 100.0f; if (volume < 0) @@ -402,7 +402,7 @@ HRESULT CVidTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGam _posY = (int)((Game->_renderer->_height - height) / 2); break; } - return S_OK; + return STATUS_OK; #if 0 m_State = THEORA_STATE_PLAYING; @@ -447,11 +447,11 @@ HRESULT CVidTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGam Update(); #endif - return E_FAIL; + return STATUS_FAILED; } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::stop() { +ERRORCODE CVidTheoraPlayer::stop() { _theoraDecoder->close(); _state = THEORA_STATE_FINISHED; if (_freezeGame) { @@ -462,18 +462,18 @@ HRESULT CVidTheoraPlayer::stop() { m_State = THEORA_STATE_FINISHED; if (m_FreezeGame) Game->Unfreeze(); #endif - return S_OK; + return STATUS_OK; } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::update() { +ERRORCODE CVidTheoraPlayer::update() { _currentTime = _freezeGame ? Game->_liveTimer : Game->_timer; - if (!isPlaying()) return S_OK; + if (!isPlaying()) return STATUS_OK; - if (_playbackStarted /*&& m_Sound && !m_Sound->IsPlaying()*/) return S_OK; + if (_playbackStarted /*&& m_Sound && !m_Sound->IsPlaying()*/) return STATUS_OK; - if (_playbackStarted && !_freezeGame && Game->_state == GAME_FROZEN) return S_OK; + if (_playbackStarted && !_freezeGame && Game->_state == GAME_FROZEN) return STATUS_OK; if (_theoraDecoder) { if (_theoraDecoder->endOfVideo() && _looping) { @@ -492,7 +492,7 @@ HRESULT CVidTheoraPlayer::update() { WriteVideo(); } } - return S_OK; + return STATUS_OK; } } // Skip the busy-loop? @@ -501,21 +501,21 @@ HRESULT CVidTheoraPlayer::update() { if (!_looping) { _state = THEORA_STATE_FINISHED; if (_freezeGame) Game->unfreeze(); - return S_OK; + return STATUS_OK; } else { resetStream(); - return S_OK; + return STATUS_OK; } } #if 0 m_CurrentTime = m_FreezeGame ? Game->m_LiveTimer : Game->m_Timer; - if (!IsPlaying()) return S_OK; + if (!IsPlaying()) return STATUS_OK; - if (m_PlaybackStarted && m_Sound && !m_Sound->IsPlaying()) return S_OK; + if (m_PlaybackStarted && m_Sound && !m_Sound->IsPlaying()) return STATUS_OK; - if (m_PlaybackStarted && !m_FreezeGame && Game->m_State == GAME_FROZEN) return S_OK; + if (m_PlaybackStarted && !m_FreezeGame && Game->m_State == GAME_FROZEN) return STATUS_OK; int Counter = 0; while (true) { @@ -534,7 +534,7 @@ HRESULT CVidTheoraPlayer::update() { break; } else { ResetStream(); - return S_OK; + return STATUS_OK; } } @@ -585,7 +585,7 @@ HRESULT CVidTheoraPlayer::update() { if (m_Subtitler && Game->m_VideoSubtitles) m_Subtitler->update(GetMovieFrame()); #endif - return S_OK; + return STATUS_OK; } ////////////////////////////////////////////////////////////////////////// @@ -614,8 +614,8 @@ uint32 CVidTheoraPlayer::getMovieFrame() { } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::WriteVideo() { - if (!_texture) return E_FAIL; +ERRORCODE CVidTheoraPlayer::WriteVideo() { + if (!_texture) return STATUS_FAILED; _texture->startPixelOp(); @@ -630,7 +630,7 @@ HRESULT CVidTheoraPlayer::WriteVideo() { _texture->endPixelOp(); _videoFrameReady = true; - return S_OK; + return STATUS_OK; } void CVidTheoraPlayer::writeAlpha() { @@ -651,15 +651,15 @@ void CVidTheoraPlayer::writeAlpha() { } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::display(uint32 alpha) { +ERRORCODE CVidTheoraPlayer::display(uint32 alpha) { RECT rc; - HRESULT res; + ERRORCODE res; if (_texture && _videoFrameReady) { CBPlatform::setRect(&rc, 0, 0, _texture->getWidth(), _texture->getHeight()); if (_playZoom == 100.0f) res = _texture->displayTrans(_posX, _posY, rc, alpha); else res = _texture->displayTransZoom(_posX, _posY, rc, _playZoom, _playZoom, alpha); - } else res = E_FAIL; + } else res = STATUS_FAILED; #if 0 if (m_Subtitler && Game->m_VideoSubtitles) m_Subtitler->display(); #endif @@ -667,16 +667,16 @@ HRESULT CVidTheoraPlayer::display(uint32 alpha) { } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::setAlphaImage(const Common::String &filename) { +ERRORCODE CVidTheoraPlayer::setAlphaImage(const Common::String &filename) { warning("CVidTheoraPlayer::SetAlphaImage(%s) - Not implemented", filename.c_str()); delete _alphaImage; _alphaImage = new CBImage(Game); - if (!_alphaImage || FAILED(_alphaImage->loadFile(filename))) { + if (!_alphaImage || DID_FAIL(_alphaImage->loadFile(filename))) { delete _alphaImage; _alphaImage = NULL; _alphaFilename = ""; - return E_FAIL; + return STATUS_FAILED; } if (_alphaFilename != filename) { @@ -686,15 +686,15 @@ HRESULT CVidTheoraPlayer::setAlphaImage(const Common::String &filename) { #if 0 SAFE_DELETE(m_AlphaImage); m_AlphaImage = new CBImage(Game); - if (!m_AlphaImage || FAILED(m_AlphaImage->loadFile(filename))) { + if (!m_AlphaImage || DID_FAIL(m_AlphaImage->loadFile(filename))) { SAFE_DELETE(m_AlphaImage); SAFE_DELETE_ARRAY(m_AlphaFilename); - return E_FAIL; + return STATUS_FAILED; } if (m_AlphaFilename != Filename) CBUtils::setString(&m_AlphaFilename, filename); m_AlphaImage->Convert(IMG_TRUECOLOR); #endif - return S_OK; + return STATUS_OK; } ////////////////////////////////////////////////////////////////////////// @@ -716,10 +716,10 @@ inline int intlog(int num) { } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::SeekToTime(uint32 time) { +ERRORCODE CVidTheoraPlayer::SeekToTime(uint32 time) { warning("CVidTheoraPlayer::SeekToTime(%d) - not supported", time); #if 0 - if (!m_TheoraStreams) return E_FAIL; + if (!m_TheoraStreams) return STATUS_FAILED; float TargetTime = Time / 1000.0f; @@ -776,33 +776,33 @@ finish: //theora_packet_iskeyframe #endif - return S_OK; + return STATUS_OK; } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::pause() { +ERRORCODE CVidTheoraPlayer::pause() { if (_state == THEORA_STATE_PLAYING) { _state = THEORA_STATE_PAUSED; _theoraDecoder->pauseVideo(true); - return S_OK; + return STATUS_OK; } else { - return E_FAIL; + return STATUS_FAILED; } } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::resume() { +ERRORCODE CVidTheoraPlayer::resume() { if (_state == THEORA_STATE_PAUSED) { _state = THEORA_STATE_PLAYING; _theoraDecoder->pauseVideo(false); - return S_OK; + return STATUS_OK; } else { - return E_FAIL; + return STATUS_FAILED; } } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::persist(CBPersistMgr *persistMgr) { +ERRORCODE CVidTheoraPlayer::persist(CBPersistMgr *persistMgr) { //CBBase::persist(persistMgr); if (persistMgr->_saving) { @@ -828,17 +828,17 @@ HRESULT CVidTheoraPlayer::persist(CBPersistMgr *persistMgr) { initializeSimple(); } - return S_OK; + return STATUS_OK; } ////////////////////////////////////////////////////////////////////////// -HRESULT CVidTheoraPlayer::initializeSimple() { - if (SUCCEEDED(initialize(_filename))) { +ERRORCODE CVidTheoraPlayer::initializeSimple() { + if (DID_SUCCEED(initialize(_filename))) { if (_alphaFilename != "") setAlphaImage(_alphaFilename); play(_playbackType, _posX, _posY, false, false, _looping, _savedPos, _playZoom); } else _state = THEORA_STATE_FINISHED; - return S_OK; + return STATUS_OK; } ////////////////////////////////////////////////////////////////////////// diff --git a/engines/wintermute/video/VidTheoraPlayer.h b/engines/wintermute/video/VidTheoraPlayer.h index 437a72db67..6061ad3199 100644 --- a/engines/wintermute/video/VidTheoraPlayer.h +++ b/engines/wintermute/video/VidTheoraPlayer.h @@ -63,16 +63,16 @@ public: //CVidSubtitler *_subtitler; // control methods - HRESULT initialize(const Common::String &filename, const Common::String &subtitleFile = NULL); - HRESULT initializeSimple(); - HRESULT update(); - HRESULT play(TVideoPlayback type = VID_PLAY_CENTER, int x = 0, int y = 0, bool freezeGame = false, bool freezeMusic = true, bool Looping = false, uint32 startTime = 0, float forceZoom = -1.0f, int volume = -1); - HRESULT stop(); - HRESULT display(uint32 alpha = 0xFFFFFFFF); - //HRESULT RenderFrame(CBSurface *Texture, yuv_buffer *yuv); + ERRORCODE initialize(const Common::String &filename, const Common::String &subtitleFile = NULL); + ERRORCODE initializeSimple(); + ERRORCODE update(); + ERRORCODE play(TVideoPlayback type = VID_PLAY_CENTER, int x = 0, int y = 0, bool freezeGame = false, bool freezeMusic = true, bool Looping = false, uint32 startTime = 0, float forceZoom = -1.0f, int volume = -1); + ERRORCODE stop(); + ERRORCODE display(uint32 alpha = 0xFFFFFFFF); + //ERRORCODE RenderFrame(CBSurface *Texture, yuv_buffer *yuv); - HRESULT pause(); - HRESULT resume(); + ERRORCODE pause(); + ERRORCODE resume(); bool isPlaying() { return _state == THEORA_STATE_PLAYING; @@ -99,15 +99,15 @@ public: // alpha related CBImage *_alphaImage; Common::String _alphaFilename; - HRESULT setAlphaImage(const Common::String &filename); + ERRORCODE setAlphaImage(const Common::String &filename); __inline byte getAlphaAt(int x, int y); void writeAlpha(); - HRESULT SeekToTime(uint32 Time); + ERRORCODE SeekToTime(uint32 Time); void cleanup(); - HRESULT resetStream(); + ERRORCODE resetStream(); // video properties TVideoPlayback _playbackType; @@ -137,7 +137,7 @@ private: bool _videoFrameReady; float _videobufTime; - HRESULT WriteVideo(); + ERRORCODE WriteVideo(); bool _playbackStarted; |