[Scummvm-git-logs] scummvm master -> 63c3df22f01d80f383ceb5376be3ffac4838d4eb

dreammaster dreammaster at scummvm.org
Wed Jan 18 04:41:05 CET 2017


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

Summary:
63c3df22f0 TITANIC: Handle -1 frameNumber in AVISurface::addEvent like original


Commit: 63c3df22f01d80f383ceb5376be3ffac4838d4eb
    https://github.com/scummvm/scummvm/commit/63c3df22f01d80f383ceb5376be3ffac4838d4eb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-01-17T22:40:57-05:00

Commit Message:
TITANIC: Handle -1 frameNumber in AVISurface::addEvent like original

Changed paths:
    engines/titanic/npcs/parrot.cpp
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/movie.cpp


diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index b89d5c7..becd13b 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -642,8 +642,9 @@ bool CParrot::FrameMsg(CFrameMsg *msg) {
 			break;
 		}
 
-		if (action < 280266) {
+		if (action != 280266) {
 			if (pt.x < 75) {
+				warning("***********************");
 				_npcFlags |= NPCFLAG_1000000;
 				playClip("Walk Left Intro", MOVIE_STOP_PREVIOUS);
 				playClip("Walk Left Loop", MOVIE_NOTIFY_OBJECT);
@@ -684,7 +685,7 @@ bool CParrot::MovieFrameMsg(CMovieFrameMsg *msg) {
 
 		_npcFlags &= ~NPCFLAG_800000;
 	}
-
+	warning("%d", msg->_frameNumber);//***DEBUG***
 	switch (msg->_frameNumber) {
 	case 244:
 		setPosition(Point(_bounds.left + 45, _bounds.top));
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index f8a6440..d524268 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -406,21 +406,22 @@ bool AVISurface::renderFrame() {
 	return false;
 }
 
-bool AVISurface::addEvent(int frameNumber, CGameObject *obj) {
+bool AVISurface::addEvent(int *frameNumber, CGameObject *obj) {
 	if (!_movieRangeInfo.empty()) {
 		CMovieRangeInfo *tail = _movieRangeInfo.back();
-		if (frameNumber == -1)
-			frameNumber = tail->_startFrame;
+		assert(frameNumber);
+		if (*frameNumber == -1)
+			*frameNumber = tail->_startFrame;
 
 		CMovieEvent *me = new CMovieEvent();
 		me->_type = MET_FRAME;
 		me->_startFrame = 0;
 		me->_endFrame = 0;
-		me->_initialFrame = frameNumber;
+		me->_initialFrame = *frameNumber;
 		me->_gameObject = obj;
 		tail->addEvent(me);
 
-		return _movieRangeInfo.size() == 1 && frameNumber == getFrame();
+		return _movieRangeInfo.size() == 1 && *frameNumber == getFrame();
 	}
 
 	return false;
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 099a257..f45db35 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -181,7 +181,7 @@ public:
 	/**
 	 * Add a movie event
 	 */
-	bool addEvent(int frameNumber, CGameObject *obj);
+	bool addEvent(int *frameNumber, CGameObject *obj);
 
 	/**
 	 * Set the frame rate
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 8863e94..3095715 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -140,7 +140,7 @@ void OSMovie::stop() {
 }
 
 void OSMovie::addEvent(int frameNumber, CGameObject *obj) {
-	if (_aviSurface.addEvent(frameNumber, obj)) {
+	if (_aviSurface.addEvent(&frameNumber, obj)) {
 		CMovieFrameMsg frameMsg(frameNumber, 0);
 		frameMsg.execute(obj);
 	}





More information about the Scummvm-git-logs mailing list