aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/video
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/video')
-rw-r--r--engines/wintermute/video/video_player.cpp26
-rw-r--r--engines/wintermute/video/video_player.h10
-rw-r--r--engines/wintermute/video/video_theora_player.cpp72
-rw-r--r--engines/wintermute/video/video_theora_player.h20
4 files changed, 64 insertions, 64 deletions
diff --git a/engines/wintermute/video/video_player.cpp b/engines/wintermute/video/video_player.cpp
index 49d1c6c50f..2806dbe516 100644
--- a/engines/wintermute/video/video_player.cpp
+++ b/engines/wintermute/video/video_player.cpp
@@ -39,13 +39,13 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
-CVidPlayer::CVidPlayer(CBGame *inGame): CBBase(inGame) {
+VideoPlayer::VideoPlayer(BaseGame *inGame): BaseClass(inGame) {
SetDefaults();
}
//////////////////////////////////////////////////////////////////////////
-bool CVidPlayer::SetDefaults() {
+bool VideoPlayer::SetDefaults() {
_playing = false;
/* _aviFile = NULL;
@@ -85,13 +85,13 @@ bool CVidPlayer::SetDefaults() {
//////////////////////////////////////////////////////////////////////////
-CVidPlayer::~CVidPlayer() {
+VideoPlayer::~VideoPlayer() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-bool CVidPlayer::cleanup() {
+bool VideoPlayer::cleanup() {
#if 0
if (_sound) _sound->Stop();
if (_videoPGF) AVIStreamGetFrameClose(_videoPGF);
@@ -124,7 +124,7 @@ bool CVidPlayer::cleanup() {
//////////////////////////////////////////////////////////////////////////
-bool CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) {
+bool VideoPlayer::initialize(const char *inFilename, const char *SubtitleFile) {
#if 0
cleanup();
@@ -186,7 +186,7 @@ bool CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) {
bool res;
if (_soundAvailable) {
- _sound = new CBSoundAVI(_gameRef);
+ _sound = new BaseSoundAVI(_gameRef);
if (DID_FAIL(res = _sound->InitializeBuffer(_audioStream))) {
SAFE_DELETE(_sound);
_soundAvailable = false;
@@ -204,7 +204,7 @@ bool CVidPlayer::initialize(const char *inFilename, const char *SubtitleFile) {
//////////////////////////////////////////////////////////////////////////
-bool CVidPlayer::update() {
+bool VideoPlayer::update() {
#if 0
if (!m_Playing) return STATUS_OK;
@@ -274,7 +274,7 @@ bool CVidPlayer::update() {
//////////////////////////////////////////////////////////////////////////
-bool CVidPlayer::display() {
+bool VideoPlayer::display() {
#if 0
if (!m_Playing) return STATUS_OK;
@@ -284,7 +284,7 @@ bool CVidPlayer::display() {
// display subtitle
if (m_ShowSubtitle) {
- CBFont *font = _gameRef->_videoFont ? _gameRef->_videoFont : _gameRef->_systemFont;
+ BaseFont *font = _gameRef->_videoFont ? _gameRef->_videoFont : _gameRef->_systemFont;
int Height = font->GetTextHeight((BYTE *)m_Subtitles[_currentSubtitle]->_text, _gameRef->_renderer->_width);
font->drawText((byte *)_subtitles[m_CurrentSubtitle]->_text, 0, _gameRef->_renderer->_height - Height - 5, _gameRef->_renderer->_width, TAL_CENTER);
}
@@ -298,7 +298,7 @@ bool CVidPlayer::display() {
//////////////////////////////////////////////////////////////////////////
-bool CVidPlayer::play(TVideoPlayback Type, int X, int Y, bool FreezeMusic) {
+bool VideoPlayer::play(TVideoPlayback Type, int X, int Y, bool FreezeMusic) {
#if 0
if (!_videoStream || !_vidRenderer) return STATUS_FAILED;
@@ -359,7 +359,7 @@ bool CVidPlayer::play(TVideoPlayback Type, int X, int Y, bool FreezeMusic) {
//////////////////////////////////////////////////////////////////////////
-bool CVidPlayer::stop() {
+bool VideoPlayer::stop() {
#if 0
if (!_playing) return STATUS_OK;
@@ -372,13 +372,13 @@ bool CVidPlayer::stop() {
//////////////////////////////////////////////////////////////////////////
-bool CVidPlayer::isPlaying() {
+bool VideoPlayer::isPlaying() {
return _playing;
}
//////////////////////////////////////////////////////////////////////////
-bool CVidPlayer::loadSubtitles(const char *filename, const char *SubtitleFile) {
+bool VideoPlayer::loadSubtitles(const char *filename, const char *SubtitleFile) {
#if 0
if (!Filename) return STATUS_OK;
diff --git a/engines/wintermute/video/video_player.h b/engines/wintermute/video/video_player.h
index 8dda93b43e..8e82a44076 100644
--- a/engines/wintermute/video/video_player.h
+++ b/engines/wintermute/video/video_player.h
@@ -38,7 +38,7 @@
namespace WinterMute {
-class CVidPlayer : public CBBase {
+class VideoPlayer : public BaseClass {
public:
bool _showSubtitle;
int _currentSubtitle;
@@ -51,7 +51,7 @@ public:
uint32 _totalVideoTime;
uint32 _startTime;
//CVidRenderer *_vidRenderer;
- //CBSoundAVI *_sound;
+ //BaseSoundAVI *_sound;
bool _soundAvailable;
bool SetDefaults();
bool _playing;
@@ -59,8 +59,8 @@ public:
bool update();
bool initialize(const char *inFilename, const char *SubtitleFile = NULL);
bool cleanup();
- CVidPlayer(CBGame *inGame);
- virtual ~CVidPlayer();
+ VideoPlayer(BaseGame *inGame);
+ virtual ~VideoPlayer();
/*PAVIFILE _aviFile;
@@ -81,7 +81,7 @@ public:
/* LPBITMAPV4HEADER _targetFormat;
- CBArray<CVidSubtitle *, CVidSubtitle *> _subtitles;*/
+ BaseArray<CVidSubtitle *, CVidSubtitle *> _subtitles;*/
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp
index e3c120ff86..91161cbd3b 100644
--- a/engines/wintermute/video/video_theora_player.cpp
+++ b/engines/wintermute/video/video_theora_player.cpp
@@ -43,15 +43,15 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CVidTheoraPlayer, false)
+IMPLEMENT_PERSISTENT(VideoTheoraPlayer, false)
//////////////////////////////////////////////////////////////////////////
-CVidTheoraPlayer::CVidTheoraPlayer(CBGame *inGame): CBBase(inGame) {
+VideoTheoraPlayer::VideoTheoraPlayer(BaseGame *inGame): BaseClass(inGame) {
SetDefaults();
}
//////////////////////////////////////////////////////////////////////////
-void CVidTheoraPlayer::SetDefaults() {
+void VideoTheoraPlayer::SetDefaults() {
_file = NULL;
_filename = "";
@@ -97,7 +97,7 @@ void CVidTheoraPlayer::SetDefaults() {
}
//////////////////////////////////////////////////////////////////////////
-CVidTheoraPlayer::~CVidTheoraPlayer(void) {
+VideoTheoraPlayer::~VideoTheoraPlayer(void) {
cleanup();
/* SAFE_DELETE_ARRAY(_filename);
@@ -108,7 +108,7 @@ CVidTheoraPlayer::~CVidTheoraPlayer(void) {
}
//////////////////////////////////////////////////////////////////////////
-void CVidTheoraPlayer::cleanup() {
+void VideoTheoraPlayer::cleanup() {
if (_file) {
_gameRef->_fileManager->closeFile(_file);
_file = NULL;
@@ -134,14 +134,14 @@ void CVidTheoraPlayer::cleanup() {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::initialize(const Common::String &filename, const Common::String &subtitleFile) {
+bool VideoTheoraPlayer::initialize(const Common::String &filename, const Common::String &subtitleFile) {
cleanup();
_filename = filename;
_file = _gameRef->_fileManager->openFile(filename, true, false);
if (!_file) return STATUS_FAILED;
- //if (Filename != _filename) CBUtils::setString(&_filename, filename);
+ //if (Filename != _filename) BaseUtils::setString(&_filename, filename);
#if defined (USE_THEORADEC)
_theoraDecoder = new TheoraDecoder();
#else
@@ -156,7 +156,7 @@ bool CVidTheoraPlayer::initialize(const Common::String &filename, const Common::
// Additional setup.
_surface.create(_theoraDecoder->getWidth(), _theoraDecoder->getHeight(), _theoraDecoder->getPixelFormat());
- _texture = new CBSurfaceOSystem(_gameRef);
+ _texture = new BaseSurfaceOSystem(_gameRef);
_texture->create(_theoraDecoder->getWidth(), _theoraDecoder->getHeight());
_state = THEORA_STATE_PLAYING;
_playZoom = 100;
@@ -168,7 +168,7 @@ bool CVidTheoraPlayer::initialize(const Common::String &filename, const Common::
_file = _gameRef->_fileManager->openFile(filename);
if (!_file) return STATUS_FAILED;
- if (Filename != _filename) CBUtils::setString(&_filename, filename);
+ if (Filename != _filename) BaseUtils::setString(&_filename, filename);
// start up Ogg stream synchronization layer
ogg_sync_init(&m_OggSyncState);
@@ -299,7 +299,7 @@ bool CVidTheoraPlayer::initialize(const Common::String &filename, const Common::
// create sound buffer
if (m_VorbisStreams && _gameRef->m_SoundMgr->m_SoundAvailable) {
- m_Sound = new CBSoundTheora(_gameRef);
+ m_Sound = new BaseSoundTheora(_gameRef);
_gameRef->m_SoundMgr->AddSound(m_Sound);
if (DID_FAIL(Res = m_Sound->InitializeBuffer(this))) {
_gameRef->m_SoundMgr->RemoveSound(m_Sound);
@@ -315,9 +315,9 @@ bool CVidTheoraPlayer::initialize(const Common::String &filename, const Common::
// create texture
if (m_TheoraStreams && !m_Texture) {
if (_gameRef->m_UseD3D)
- m_Texture = new CBSurfaceD3D(_gameRef);
+ m_Texture = new BaseSurfaceD3D(_gameRef);
else
- m_Texture = new CBSurfaceDD(_gameRef);
+ m_Texture = new BaseSurfaceDD(_gameRef);
if (!m_Texture || DID_FAIL(Res = m_Texture->Create(m_TheoraInfo.width, m_TheoraInfo.height))) {
SAFE_DELETE(m_Texture);
@@ -335,7 +335,7 @@ bool CVidTheoraPlayer::initialize(const Common::String &filename, const Common::
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::resetStream() {
+bool VideoTheoraPlayer::resetStream() {
warning("VidTheoraPlayer::resetStream - stubbed");
#if 0
if (_sound) _sound->Stop();
@@ -348,7 +348,7 @@ bool CVidTheoraPlayer::resetStream() {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGame, bool freezeMusic, bool looping, uint32 startTime, float forceZoom, int volume) {
+bool VideoTheoraPlayer::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)
@@ -452,7 +452,7 @@ bool CVidTheoraPlayer::play(TVideoPlayback type, int x, int y, bool freezeGame,
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::stop() {
+bool VideoTheoraPlayer::stop() {
_theoraDecoder->close();
_state = THEORA_STATE_FINISHED;
if (_freezeGame) {
@@ -467,7 +467,7 @@ bool CVidTheoraPlayer::stop() {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::update() {
+bool VideoTheoraPlayer::update() {
_currentTime = _freezeGame ? _gameRef->_liveTimer : _gameRef->_timer;
if (!isPlaying()) return STATUS_OK;
@@ -590,7 +590,7 @@ bool CVidTheoraPlayer::update() {
}
//////////////////////////////////////////////////////////////////////////
-uint32 CVidTheoraPlayer::getMovieTime() {
+uint32 VideoTheoraPlayer::getMovieTime() {
if (!_playbackStarted) {
return 0;
} else {
@@ -600,7 +600,7 @@ uint32 CVidTheoraPlayer::getMovieTime() {
//////////////////////////////////////////////////////////////////////////
-uint32 CVidTheoraPlayer::getMovieFrame() {
+uint32 VideoTheoraPlayer::getMovieFrame() {
#if 0
if (!m_TheoraStreams) return 0;
float Time = GetMovieTime();
@@ -615,7 +615,7 @@ uint32 CVidTheoraPlayer::getMovieFrame() {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::WriteVideo() {
+bool VideoTheoraPlayer::WriteVideo() {
if (!_texture) return STATUS_FAILED;
_texture->startPixelOp();
@@ -634,7 +634,7 @@ bool CVidTheoraPlayer::WriteVideo() {
return STATUS_OK;
}
-void CVidTheoraPlayer::writeAlpha() {
+void VideoTheoraPlayer::writeAlpha() {
if (_alphaImage && _surface.w == _alphaImage->getSurface()->w && _surface.h == _alphaImage->getSurface()->h) {
assert(_alphaImage->getSurface()->format.bytesPerPixel == 4);
assert(_surface.format.bytesPerPixel == 4);
@@ -652,12 +652,12 @@ void CVidTheoraPlayer::writeAlpha() {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::display(uint32 alpha) {
+bool VideoTheoraPlayer::display(uint32 alpha) {
Rect32 rc;
bool res;
if (_texture && _videoFrameReady) {
- CBPlatform::setRect(&rc, 0, 0, _texture->getWidth(), _texture->getHeight());
+ BasePlatform::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 = STATUS_FAILED;
@@ -668,11 +668,11 @@ bool CVidTheoraPlayer::display(uint32 alpha) {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::setAlphaImage(const Common::String &filename) {
- warning("CVidTheoraPlayer::SetAlphaImage(%s) - Not implemented", filename.c_str());
+bool VideoTheoraPlayer::setAlphaImage(const Common::String &filename) {
+ warning("VideoTheoraPlayer::SetAlphaImage(%s) - Not implemented", filename.c_str());
delete _alphaImage;
- _alphaImage = new CBImage(_gameRef);
+ _alphaImage = new BaseImage(_gameRef);
if (!_alphaImage || DID_FAIL(_alphaImage->loadFile(filename))) {
delete _alphaImage;
_alphaImage = NULL;
@@ -686,20 +686,20 @@ bool CVidTheoraPlayer::setAlphaImage(const Common::String &filename) {
//TODO: Conversion.
#if 0
SAFE_DELETE(m_AlphaImage);
- m_AlphaImage = new CBImage(_gameRef);
+ m_AlphaImage = new BaseImage(_gameRef);
if (!m_AlphaImage || DID_FAIL(m_AlphaImage->loadFile(filename))) {
SAFE_DELETE(m_AlphaImage);
SAFE_DELETE_ARRAY(m_AlphaFilename);
return STATUS_FAILED;
}
- if (m_AlphaFilename != Filename) CBUtils::setString(&m_AlphaFilename, filename);
+ if (m_AlphaFilename != Filename) BaseUtils::setString(&m_AlphaFilename, filename);
m_AlphaImage->Convert(IMG_TRUECOLOR);
#endif
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-byte CVidTheoraPlayer::getAlphaAt(int x, int y) {
+byte VideoTheoraPlayer::getAlphaAt(int x, int y) {
if (_alphaImage) return _alphaImage->getAlphaAt(x, y);
else return 0xFF;
}
@@ -717,8 +717,8 @@ inline int intlog(int num) {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::SeekToTime(uint32 time) {
- warning("CVidTheoraPlayer::SeekToTime(%d) - not supported", time);
+bool VideoTheoraPlayer::SeekToTime(uint32 time) {
+ warning("VideoTheoraPlayer::SeekToTime(%d) - not supported", time);
#if 0
if (!m_TheoraStreams) return STATUS_FAILED;
@@ -781,7 +781,7 @@ finish:
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::pause() {
+bool VideoTheoraPlayer::pause() {
if (_state == THEORA_STATE_PLAYING) {
_state = THEORA_STATE_PAUSED;
_theoraDecoder->pauseVideo(true);
@@ -792,7 +792,7 @@ bool CVidTheoraPlayer::pause() {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::resume() {
+bool VideoTheoraPlayer::resume() {
if (_state == THEORA_STATE_PAUSED) {
_state = THEORA_STATE_PLAYING;
_theoraDecoder->pauseVideo(false);
@@ -803,8 +803,8 @@ bool CVidTheoraPlayer::resume() {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::persist(CBPersistMgr *persistMgr) {
- //CBBase::persist(persistMgr);
+bool VideoTheoraPlayer::persist(BasePersistenceManager *persistMgr) {
+ //BaseClass::persist(persistMgr);
if (persistMgr->_saving) {
_savedPos = getMovieTime() * 1000;
@@ -833,7 +833,7 @@ bool CVidTheoraPlayer::persist(CBPersistMgr *persistMgr) {
}
//////////////////////////////////////////////////////////////////////////
-bool CVidTheoraPlayer::initializeSimple() {
+bool VideoTheoraPlayer::initializeSimple() {
if (DID_SUCCEED(initialize(_filename))) {
if (_alphaFilename != "") setAlphaImage(_alphaFilename);
play(_playbackType, _posX, _posY, false, false, _looping, _savedPos, _playZoom);
@@ -843,7 +843,7 @@ bool CVidTheoraPlayer::initializeSimple() {
}
//////////////////////////////////////////////////////////////////////////
-CBSurface *CVidTheoraPlayer::getTexture() {
+BaseSurface *VideoTheoraPlayer::getTexture() {
return _texture;
}
diff --git a/engines/wintermute/video/video_theora_player.h b/engines/wintermute/video/video_theora_player.h
index 5bf8e165c7..6e0e4b3152 100644
--- a/engines/wintermute/video/video_theora_player.h
+++ b/engines/wintermute/video/video_theora_player.h
@@ -37,9 +37,9 @@
#include "graphics/surface.h"
namespace WinterMute {
-class CBSurface;
-class CBImage;
-class CVidTheoraPlayer : public CBBase {
+class BaseSurface;
+class BaseImage;
+class VideoTheoraPlayer : public BaseClass {
private:
enum {
THEORA_STATE_NONE = 0,
@@ -50,16 +50,16 @@ private:
Video::RewindableVideoDecoder *_theoraDecoder;
Graphics::Surface _surface;
public:
- DECLARE_PERSISTENT(CVidTheoraPlayer, CBBase)
+ DECLARE_PERSISTENT(VideoTheoraPlayer, BaseClass)
- CVidTheoraPlayer(CBGame *inGame);
- virtual ~CVidTheoraPlayer(void);
+ VideoTheoraPlayer(BaseGame *inGame);
+ virtual ~VideoTheoraPlayer(void);
// external objects
Common::SeekableReadStream *_file;
Common::String _filename;
- CBSurface *_texture;
+ BaseSurface *_texture;
//CVidSubtitler *_subtitler;
// control methods
@@ -69,7 +69,7 @@ public:
bool 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);
bool stop();
bool display(uint32 alpha = 0xFFFFFFFF);
- //bool RenderFrame(CBSurface *Texture, yuv_buffer *yuv);
+ //bool RenderFrame(BaseSurface *Texture, yuv_buffer *yuv);
bool pause();
bool resume();
@@ -87,7 +87,7 @@ public:
uint32 getMovieTime();
uint32 getMovieFrame();
- CBSurface *getTexture();
+ BaseSurface *getTexture();
int _state;
uint32 _startTime;
@@ -97,7 +97,7 @@ public:
// alpha related
- CBImage *_alphaImage;
+ BaseImage *_alphaImage;
Common::String _alphaFilename;
bool setAlphaImage(const Common::String &filename);
__inline byte getAlphaAt(int x, int y);