[Scummvm-git-logs] scummvm master -> 5ec3815106ff644727255a510e402ae95e697e36

sev- sev at scummvm.org
Tue Aug 18 11:09:13 UTC 2020


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6afb2159c6 DIRECTOR: Remove obsolete video.*
5ec3815106 DIRECTOR: Update digital video independently from the frame tempo


Commit: 6afb2159c6041b26765901a1e518feb0bf6b91aa
    https://github.com/scummvm/scummvm/commit/6afb2159c6041b26765901a1e518feb0bf6b91aa
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-18T13:08:52+02:00

Commit Message:
DIRECTOR: Remove obsolete video.*

Changed paths:
  R engines/director/video.cpp
  R engines/director/video.h
    engines/director/module.mk


diff --git a/engines/director/module.mk b/engines/director/module.mk
index 5bba39a0b0..3371974932 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -21,7 +21,6 @@ MODULE_OBJS = \
 	tests.o \
 	transitions.o \
 	util.o \
-	video.o \
 	window.o \
 	lingo/lingo.o \
 	lingo/lingo-builtins.o \
diff --git a/engines/director/video.cpp b/engines/director/video.cpp
deleted file mode 100644
index 736129eccf..0000000000
--- a/engines/director/video.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * 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.
- *
- */
-
-#include "common/system.h"
-#include "graphics/managed_surface.h"
-#include "video/qt_decoder.h"
-
-#include "director/util.h"
-#include "director/video.h"
-
-namespace Director {
-
-DigitalVideo::DigitalVideo(Common::String fileName, DirectorEngine *vm) {
-	_vm = vm;
-	_currentVideo = new Video::QuickTimeDecoder();
-	if (!_currentVideo->loadFile(fileName)) {
-		warning("Can not open file %s", fileName.c_str());
-		return;
-	}
-}
-
-void DigitalVideo::play(Common::Point dest) {
-
-	_currentVideo->start();
-
-	uint16 width = _currentVideo->getWidth();
-	uint16 height = _currentVideo->getHeight();
-
-	while (!_currentVideo->endOfVideo()) {
-		if (_currentVideo->needsUpdate()) {
-			const Graphics::Surface *frame = _currentVideo->decodeNextFrame();
-			g_system->copyRectToScreen(frame->getPixels(), frame->pitch, dest.x, dest.y, width, height); // video playback
-			g_system->updateScreen();
-		}
-		g_system->delayMillis(10);
-		processQuitEvent();
-	}
-}
-
-void DigitalVideo::stop() {
-	_currentVideo->stop();
-}
-
-DigitalVideo::~DigitalVideo() {
-	delete _currentVideo;
-}
-
-} // End of namespace Director
diff --git a/engines/director/video.h b/engines/director/video.h
deleted file mode 100644
index 8a7f35aca2..0000000000
--- a/engines/director/video.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * 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.
- *
- */
-
-#ifndef DIRECTOR_MOVIE_H
-#define DIRECTOR_MOVIE_H
-
-namespace Video {
-class VideoDecoder;
-}
-
-namespace Director {
-
-class DirectorEngine;
-
-class DigitalVideo {
-public:
-	DigitalVideo(Common::String fileName, DirectorEngine *vm);
-	~DigitalVideo();
-	void play(Common::Point dest);
-	void stop();
-
-private:
-	Video::VideoDecoder *_currentVideo;
-	DirectorEngine *_vm;
-};
-
-} // End of namespace Director
-
-#endif


Commit: 5ec3815106ff644727255a510e402ae95e697e36
    https://github.com/scummvm/scummvm/commit/5ec3815106ff644727255a510e402ae95e697e36
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-18T13:08:52+02:00

Commit Message:
DIRECTOR: Update digital video independently from the frame tempo

Changed paths:
    engines/director/castmember.cpp
    engines/director/channel.cpp
    engines/director/channel.h
    engines/director/movie.cpp
    engines/director/movie.h
    engines/director/score.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 1751a55c26..e142b067ab 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -315,6 +315,7 @@ Graphics::MacWidget *DigitalVideoCastMember::createWidget(Common::Rect &bbox, Ch
 	// FIXME: HACK: We need to understand when really start the video
 	if (!_video->isPlaying()) {
 		_video->start();
+		debugC(2, kDebugImages, "STARTING VIDEO");
 
 		if (_channel->_stopTime == 0)
 			_channel->_stopTime = getMovieTotalTime();
@@ -323,6 +324,7 @@ Graphics::MacWidget *DigitalVideoCastMember::createWidget(Common::Rect &bbox, Ch
 	const Graphics::Surface *frame = _video->decodeNextFrame();
 
 	_channel->_movieTime = getMovieCurrentTime();
+	debugC(2, kDebugImages, "Video time: %d", _channel->_movieTime);
 
 	if (frame) {
 		if (g_director->_pixelformat.bytesPerPixel == 1) {
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 779ca503de..4e42ae6b01 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -243,6 +243,15 @@ bool Channel::isMatteWithin(Channel *channel) {
 	return false;
 }
 
+bool Channel::isActiveVideo() {
+	if (!_sprite->_cast || _sprite->_cast->_type != kCastDigitalVideo)
+		return false;
+
+	// TODO: Check that the video is not paused
+
+	return true;
+}
+
 Common::Rect Channel::getBbox(bool unstretched) {
 	Common::Rect result(unstretched ? _sprite->_width : _width,
 											unstretched ? _sprite->_height : _height);
diff --git a/engines/director/channel.h b/engines/director/channel.h
index fedb36691c..dbcf2c8e56 100644
--- a/engines/director/channel.h
+++ b/engines/director/channel.h
@@ -50,6 +50,7 @@ public:
 	bool isMouseIn(const Common::Point &pos);
 	bool isMatteIntersect(Channel *channel);
 	bool isMatteWithin(Channel *channel);
+	bool isActiveVideo();
 
 	void setWidth(int w);
 	void setHeight(int h);
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index 8ea8bf4352..02d337804c 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -55,6 +55,8 @@ Movie::Movie(Window *window) {
 	_lastTimerReset = _lastEventTime;
 	_nextEventId = 0;
 
+	_videoPlayback = false;
+
 	_key = 0;
 	_keyCode = 0;
 	_keyFlags = 0;
diff --git a/engines/director/movie.h b/engines/director/movie.h
index 3995a9c1ed..4545923ca3 100644
--- a/engines/director/movie.h
+++ b/engines/director/movie.h
@@ -144,6 +144,8 @@ public:
 	Cast *_sharedCast;
 	bool _allowOutdatedLingo;
 
+	bool _videoPlayback;
+
 	int _nextEventId;
 	Common::Queue<LingoEvent> _eventQueue;
 
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 3ce762cc0b..83eeb4f990 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -303,6 +303,10 @@ void Score::update() {
 			_activeFade = 0;
 	}
 
+	if (_movie->_videoPlayback) {
+		renderFrame(_currentFrame);
+	}
+
 	if (!debugChannelSet(-1, kDebugFast)) {
 		if (_waitForChannel) {
 			if (_soundManager->isChannelActive(_waitForChannel))
@@ -475,6 +479,8 @@ void Score::renderSprites(uint16 frameId, RenderMode mode) {
 	if (_window->_newMovieStarted)
 		mode = kRenderForceUpdate;
 
+	_movie->_videoPlayback = false;
+
 	for (uint16 i = 0; i < _channels.size(); i++) {
 		Channel *channel = _channels[i];
 		Sprite *currentSprite = channel->_sprite;
@@ -487,6 +493,9 @@ void Score::renderSprites(uint16 frameId, RenderMode mode) {
 		if (channel->isActiveText())
 			_movie->_currentEditableTextChannel = i;
 
+		if (channel->isActiveVideo())
+			_movie->_videoPlayback = true;
+
 		if (channel->isDirty(nextSprite) || widgetRedrawn || mode == kRenderForceUpdate) {
 			if (!currentSprite->_trails)
 				_window->addDirtyRect(channel->getBbox());




More information about the Scummvm-git-logs mailing list