From ad586412425e66e0e678f0cfd7b8c78c58a8a855 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Mon, 28 Oct 2013 18:23:05 +0100 Subject: WINTERMUTE: Fix compile errors in XCode 5 caused by nullptr-issues. --- engines/wintermute/video/video_theora_player.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.h b/engines/wintermute/video/video_theora_player.h index a4f1b9edd6..7b28a71e17 100644 --- a/engines/wintermute/video/video_theora_player.h +++ b/engines/wintermute/video/video_theora_player.h @@ -62,7 +62,7 @@ public: //CVidSubtitler *_subtitler; // control methods - bool initialize(const Common::String &filename, const Common::String &subtitleFile = nullptr); + bool initialize(const Common::String &filename, const Common::String &subtitleFile = Common::String()); bool initializeSimple(); bool update(); 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); -- cgit v1.2.3 From 6b4adab654461646a3873b7ad39a283feeb29037 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Mon, 28 Oct 2013 19:19:12 +0100 Subject: WINTERMUTE: Transfer booleans explicitly when saving/loading. --- engines/wintermute/video/video_theora_player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index f3317684b5..6b2037aa4f 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -500,7 +500,7 @@ bool VideoTheoraPlayer::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_posY)); persistMgr->transferFloat(TMEMBER(_playZoom)); persistMgr->transfer(TMEMBER_INT(_playbackType)); - persistMgr->transfer(TMEMBER(_looping)); + persistMgr->transferBool(TMEMBER(_looping)); persistMgr->transfer(TMEMBER(_volume)); if (!persistMgr->getIsSaving() && (_savedState != THEORA_STATE_NONE)) { -- cgit v1.2.3 From d6b9d7de8f4bc8be34ef7456a89ee144172ca5b0 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Tue, 29 Oct 2013 02:55:31 +0100 Subject: WINTERMUTE: Remove BasePlatform::setRect (replace with member-call) --- engines/wintermute/video/video_theora_player.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index 6b2037aa4f..5dbb301374 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -34,7 +34,6 @@ #include "engines/wintermute/base/gfx/base_image.h" #include "engines/wintermute/base/gfx/base_renderer.h" #include "engines/wintermute/base/sound/base_sound_manager.h" -#include "engines/wintermute/platform_osystem.h" #include "video/theora_decoder.h" #include "engines/wintermute/wintermute.h" #include "common/system.h" @@ -396,7 +395,7 @@ bool VideoTheoraPlayer::display(uint32 alpha) { bool res; if (_texture && _videoFrameReady) { - BasePlatform::setRect(&rc, 0, 0, _texture->getWidth(), _texture->getHeight()); + rc.setRect(0, 0, _texture->getWidth(), _texture->getHeight()); if (_playZoom == 100.0f) { res = _texture->displayTrans(_posX, _posY, rc, alpha); } else { -- cgit v1.2.3 From 7892188bcf45ec7eaeee9eed1c92b84839c1224b Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Tue, 5 Nov 2013 13:31:13 +0100 Subject: WINTERMUTE: Transfer Uint32s explicitly when saving/loading. --- engines/wintermute/video/video_theora_player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index 5dbb301374..33d10109ab 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -491,7 +491,7 @@ bool VideoTheoraPlayer::persist(BasePersistenceManager *persistMgr) { } persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); - persistMgr->transfer(TMEMBER(_savedPos)); + persistMgr->transferUint32(TMEMBER(_savedPos)); persistMgr->transfer(TMEMBER(_savedState)); persistMgr->transfer(TMEMBER(_filename)); persistMgr->transfer(TMEMBER(_alphaFilename)); -- cgit v1.2.3 From d07409def7cf63296a11f0cdea3bf5b7e1c3427a Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Tue, 5 Nov 2013 13:48:11 +0100 Subject: WINTERMUTE: Transfer Sint32s explicitly when saving/loading. --- engines/wintermute/video/video_theora_player.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index 33d10109ab..d27ca5a1ed 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -492,15 +492,15 @@ bool VideoTheoraPlayer::persist(BasePersistenceManager *persistMgr) { persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transferUint32(TMEMBER(_savedPos)); - persistMgr->transfer(TMEMBER(_savedState)); + persistMgr->transferSint32(TMEMBER(_savedState)); persistMgr->transfer(TMEMBER(_filename)); persistMgr->transfer(TMEMBER(_alphaFilename)); - persistMgr->transfer(TMEMBER(_posX)); - persistMgr->transfer(TMEMBER(_posY)); + persistMgr->transferSint32(TMEMBER(_posX)); + persistMgr->transferSint32(TMEMBER(_posY)); persistMgr->transferFloat(TMEMBER(_playZoom)); - persistMgr->transfer(TMEMBER_INT(_playbackType)); + persistMgr->transferSint32(TMEMBER_INT(_playbackType)); persistMgr->transferBool(TMEMBER(_looping)); - persistMgr->transfer(TMEMBER(_volume)); + persistMgr->transferSint32(TMEMBER(_volume)); if (!persistMgr->getIsSaving() && (_savedState != THEORA_STATE_NONE)) { initializeSimple(); -- cgit v1.2.3 From cc33cf74aee6f024c4f1f4dec95dea4c72b3139d Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Tue, 5 Nov 2013 13:59:55 +0100 Subject: WINTERMUTE: Transfer Common::Strings explicitly when saving/loading. --- engines/wintermute/video/video_theora_player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index d27ca5a1ed..44eecf93a8 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -493,8 +493,8 @@ bool VideoTheoraPlayer::persist(BasePersistenceManager *persistMgr) { persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); persistMgr->transferUint32(TMEMBER(_savedPos)); persistMgr->transferSint32(TMEMBER(_savedState)); - persistMgr->transfer(TMEMBER(_filename)); - persistMgr->transfer(TMEMBER(_alphaFilename)); + persistMgr->transferString(TMEMBER(_filename)); + persistMgr->transferString(TMEMBER(_alphaFilename)); persistMgr->transferSint32(TMEMBER(_posX)); persistMgr->transferSint32(TMEMBER(_posY)); persistMgr->transferFloat(TMEMBER(_playZoom)); -- cgit v1.2.3 From 2dfbad8074dce96af03f3bf2927e9bdffc3a16ec Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Tue, 21 Jan 2014 02:25:18 +0100 Subject: WINTERMUTE: Avoid using Graphics::copyFrom to copy FMV-frames. copyFrom frees and reallocates the surface for every update, as long as the dimensions and format stay the same, we can do with just a memcpy. This gives a tiny improvement in the update-part of the Theora-player (on the order of a bit more than 1 second saved total in the 1:28 long J.U.L.I.A.-intro) --- engines/wintermute/video/video_theora_player.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index 44eecf93a8..aedc9bf025 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -305,8 +305,15 @@ bool VideoTheoraPlayer::update() { if (!_theoraDecoder->endOfVideo() && _theoraDecoder->getTimeToNextFrame() == 0) { const Graphics::Surface *decodedFrame = _theoraDecoder->decodeNextFrame(); if (decodedFrame) { - _surface.free(); - _surface.copyFrom(*decodedFrame); + if (decodedFrame->format == _surface.format && decodedFrame->w == _surface.w && decodedFrame->h == _surface.h) { + const byte *src = (const byte*) decodedFrame->getBasePtr(0, 0); + byte *dst = (byte*) _surface.getBasePtr(0, 0); + memcpy(dst, src, _surface.pitch * _surface.h); + } else { + _surface.free(); + _surface.copyFrom(*decodedFrame); + } + if (_texture) { writeVideo(); } -- cgit v1.2.3 From 1fa74e355cd95c0daec2c8fa0981668aa6446a8b Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 22 Jan 2014 17:33:04 +0100 Subject: WINTERMUTE: Two minor formatting fixes. --- engines/wintermute/video/video_theora_player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index aedc9bf025..299b64f915 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -306,8 +306,8 @@ bool VideoTheoraPlayer::update() { const Graphics::Surface *decodedFrame = _theoraDecoder->decodeNextFrame(); if (decodedFrame) { if (decodedFrame->format == _surface.format && decodedFrame->w == _surface.w && decodedFrame->h == _surface.h) { - const byte *src = (const byte*) decodedFrame->getBasePtr(0, 0); - byte *dst = (byte*) _surface.getBasePtr(0, 0); + const byte *src = (const byte *)decodedFrame->getBasePtr(0, 0); + byte *dst = (byte *)_surface.getBasePtr(0, 0); memcpy(dst, src, _surface.pitch * _surface.h); } else { _surface.free(); -- cgit v1.2.3 From 2ad7625831897d97524891cb88af8b3e48e4facb Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Wed, 5 Feb 2014 17:18:18 +0100 Subject: WINTERMUTE: Change the copyFrom-simplifications to depend on pitch instead of width. (Fix bug #6157) --- engines/wintermute/video/video_theora_player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index 299b64f915..3bce8628b8 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -305,7 +305,7 @@ bool VideoTheoraPlayer::update() { if (!_theoraDecoder->endOfVideo() && _theoraDecoder->getTimeToNextFrame() == 0) { const Graphics::Surface *decodedFrame = _theoraDecoder->decodeNextFrame(); if (decodedFrame) { - if (decodedFrame->format == _surface.format && decodedFrame->w == _surface.w && decodedFrame->h == _surface.h) { + if (decodedFrame->format == _surface.format && decodedFrame->pitch == _surface.pitch && decodedFrame->h == _surface.h) { const byte *src = (const byte *)decodedFrame->getBasePtr(0, 0); byte *dst = (byte *)_surface.getBasePtr(0, 0); memcpy(dst, src, _surface.pitch * _surface.h); -- cgit v1.2.3 From fc5ef58fff6bd1b73732efadab27b124614ecce0 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:27 +0100 Subject: WINTERMUTE: Make GPL headers consistent in themselves. --- engines/wintermute/video/video_player.cpp | 4 ++-- engines/wintermute/video/video_player.h | 4 ++-- engines/wintermute/video/video_theora_player.cpp | 4 ++-- engines/wintermute/video/video_theora_player.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_player.cpp b/engines/wintermute/video/video_player.cpp index f18311c3e1..5a71b04377 100644 --- a/engines/wintermute/video/video_player.cpp +++ b/engines/wintermute/video/video_player.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/wintermute/video/video_player.h b/engines/wintermute/video/video_player.h index 51c6bf41d3..8812e2597b 100644 --- a/engines/wintermute/video/video_player.h +++ b/engines/wintermute/video/video_player.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index 3bce8628b8..b0c469c440 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/wintermute/video/video_theora_player.h b/engines/wintermute/video/video_theora_player.h index 7b28a71e17..8274a1444f 100644 --- a/engines/wintermute/video/video_theora_player.h +++ b/engines/wintermute/video/video_theora_player.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 4904554bb6ddd250de6bcb356b5660c9c57b5a2b Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Thu, 17 Apr 2014 11:21:33 +0200 Subject: WINTERMUTE: Add a warning when trying to play video without Theoradec-support --- engines/wintermute/video/video_theora_player.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/wintermute/video') diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp index b0c469c440..e1553580ec 100644 --- a/engines/wintermute/video/video_theora_player.cpp +++ b/engines/wintermute/video/video_theora_player.cpp @@ -127,6 +127,7 @@ bool VideoTheoraPlayer::initialize(const Common::String &filename, const Common: #if defined (USE_THEORADEC) _theoraDecoder = new Video::TheoraDecoder(); #else + warning("VideoTheoraPlayer::initialize - Theora support not compiled in, video will be skipped: %s", filename.c_str()); return STATUS_FAILED; #endif _theoraDecoder->loadStream(_file); -- cgit v1.2.3