diff options
author | Marisa-Chan | 2014-06-13 21:43:04 +0700 |
---|---|---|
committer | Marisa-Chan | 2014-06-13 21:43:04 +0700 |
commit | 45589950c0fb1a449351e6a00ef10d42290d8bae (patch) | |
tree | 44e4eedcb7e69d5fc386155b000ed038af07251d /engines/wintermute/video | |
parent | 48360645dcd5f8fddb135b6e31ae5cae4be8d77f (diff) | |
parent | 5c005ad3a3f1df0bc968c85c1cf0fc48e36ab0b2 (diff) | |
download | scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.gz scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.bz2 scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.zip |
Merge remote-tracking branch 'upstream/master' into zvision
Conflicts:
engines/zvision/animation/rlf_animation.cpp
engines/zvision/animation_control.h
engines/zvision/core/console.cpp
engines/zvision/core/events.cpp
engines/zvision/cursors/cursor.cpp
engines/zvision/cursors/cursor_manager.cpp
engines/zvision/cursors/cursor_manager.h
engines/zvision/fonts/truetype_font.cpp
engines/zvision/graphics/render_manager.cpp
engines/zvision/graphics/render_manager.h
engines/zvision/inventory/inventory_manager.h
engines/zvision/inventory_manager.h
engines/zvision/meta_animation.h
engines/zvision/module.mk
engines/zvision/scripting/actions.cpp
engines/zvision/scripting/control.h
engines/zvision/scripting/controls/animation_control.cpp
engines/zvision/scripting/controls/animation_control.h
engines/zvision/scripting/controls/input_control.cpp
engines/zvision/scripting/controls/lever_control.cpp
engines/zvision/scripting/controls/timer_node.cpp
engines/zvision/scripting/controls/timer_node.h
engines/zvision/scripting/puzzle.h
engines/zvision/scripting/scr_file_handling.cpp
engines/zvision/scripting/script_manager.cpp
engines/zvision/scripting/script_manager.h
engines/zvision/sidefx.cpp
engines/zvision/sound/zork_raw.cpp
engines/zvision/sound/zork_raw.h
engines/zvision/video/video.cpp
engines/zvision/video/zork_avi_decoder.h
engines/zvision/zvision.cpp
engines/zvision/zvision.h
Diffstat (limited to 'engines/wintermute/video')
-rw-r--r-- | engines/wintermute/video/video_player.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/video/video_player.h | 4 | ||||
-rw-r--r-- | engines/wintermute/video/video_theora_player.cpp | 37 | ||||
-rw-r--r-- | engines/wintermute/video/video_theora_player.h | 6 |
4 files changed, 29 insertions, 22 deletions
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 f3317684b5..e1553580ec 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. @@ -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" @@ -128,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); @@ -306,8 +306,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->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); + } else { + _surface.free(); + _surface.copyFrom(*decodedFrame); + } + if (_texture) { writeVideo(); } @@ -396,7 +403,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 { @@ -492,16 +499,16 @@ bool VideoTheoraPlayer::persist(BasePersistenceManager *persistMgr) { } persistMgr->transferPtr(TMEMBER_PTR(_gameRef)); - persistMgr->transfer(TMEMBER(_savedPos)); - persistMgr->transfer(TMEMBER(_savedState)); - persistMgr->transfer(TMEMBER(_filename)); - persistMgr->transfer(TMEMBER(_alphaFilename)); - persistMgr->transfer(TMEMBER(_posX)); - persistMgr->transfer(TMEMBER(_posY)); + persistMgr->transferUint32(TMEMBER(_savedPos)); + persistMgr->transferSint32(TMEMBER(_savedState)); + persistMgr->transferString(TMEMBER(_filename)); + persistMgr->transferString(TMEMBER(_alphaFilename)); + persistMgr->transferSint32(TMEMBER(_posX)); + persistMgr->transferSint32(TMEMBER(_posY)); persistMgr->transferFloat(TMEMBER(_playZoom)); - persistMgr->transfer(TMEMBER_INT(_playbackType)); - persistMgr->transfer(TMEMBER(_looping)); - persistMgr->transfer(TMEMBER(_volume)); + persistMgr->transferSint32(TMEMBER_INT(_playbackType)); + persistMgr->transferBool(TMEMBER(_looping)); + persistMgr->transferSint32(TMEMBER(_volume)); if (!persistMgr->getIsSaving() && (_savedState != THEORA_STATE_NONE)) { initializeSimple(); diff --git a/engines/wintermute/video/video_theora_player.h b/engines/wintermute/video/video_theora_player.h index a4f1b9edd6..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. @@ -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); |