[Scummvm-cvs-logs] SF.net SVN: scummvm:[54845] scummvm/trunk/engines/mohawk

fuzzie at users.sourceforge.net fuzzie at users.sourceforge.net
Thu Dec 9 22:25:05 CET 2010


Revision: 54845
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54845&view=rev
Author:   fuzzie
Date:     2010-12-09 21:25:05 +0000 (Thu, 09 Dec 2010)

Log Message:
-----------
MOHAWK: Implement LBMovieItem

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/livingbooks.cpp
    scummvm/trunk/engines/mohawk/livingbooks.h

Modified: scummvm/trunk/engines/mohawk/livingbooks.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.cpp	2010-12-09 21:24:46 UTC (rev 54844)
+++ scummvm/trunk/engines/mohawk/livingbooks.cpp	2010-12-09 21:25:05 UTC (rev 54845)
@@ -26,6 +26,7 @@
 #include "mohawk/livingbooks.h"
 #include "mohawk/resource.h"
 #include "mohawk/cursors.h"
+#include "mohawk/video.h"
 
 #include "common/events.h"
 #include "common/EventRecorder.h"
@@ -180,6 +181,9 @@
 
 		updatePage();
 
+		if (_video->updateBackgroundMovies())
+			_needsUpdate = true;
+
 		if (_needsUpdate) {
 			_system->updateScreen();
 			_needsUpdate = false;
@@ -245,6 +249,7 @@
 void MohawkEngine_LivingBooks::destroyPage() {
 	_sound->stopSound();
 	_gfx->clearCache();
+	_video->stopVideos();
 
 	_eventQueue.clear();
 
@@ -546,6 +551,9 @@
 		case kLBLiveTextItem:
 			res = new LBLiveTextItem(this, rect);
 			break;
+		case kLBMovieItem:
+			res = new LBMovieItem(this, rect);
+			break;
 		default:
 			warning("Unknown item type %04x", type);
 		case 3: // often used for buttons
@@ -3128,4 +3136,33 @@
 	_anim->draw();
 }
 
+LBMovieItem::LBMovieItem(MohawkEngine_LivingBooks *vm, Common::Rect rect) : LBItem(vm, rect) {
+	debug(3, "new LBMovieItem");
+}
+
+LBMovieItem::~LBMovieItem() {
+}
+
+void LBMovieItem::update() {
+	if (_playing) {
+		VideoHandle videoHandle = _vm->_video->findVideoHandle(_resourceId);
+		if (_vm->_video->endOfVideo(videoHandle))
+			done(true);
+	}
+
+	LBItem::update();
+}
+
+bool LBMovieItem::togglePlaying(bool playing, bool restart) {
+	if (playing) {
+		if ((!_neverEnabled && _enabled && _globalEnabled) || _phase == 0x7FFF) {
+			_vm->_video->playBackgroundMovie(_resourceId, _rect.left, _rect.top);
+
+			return true;
+		}
+	}
+
+	return LBItem::togglePlaying(playing, restart);
+}
+
 } // End of namespace Mohawk

Modified: scummvm/trunk/engines/mohawk/livingbooks.h
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.h	2010-12-09 21:24:46 UTC (rev 54844)
+++ scummvm/trunk/engines/mohawk/livingbooks.h	2010-12-09 21:25:05 UTC (rev 54845)
@@ -63,7 +63,11 @@
 	kLBAnimationItem = 0x40,
 	kLBSoundItem = 0x41,
 	kLBGroupItem = 0x42,
-	kLBPaletteItem = 0x45 // v3
+	kLBMovieItem = 0x43,
+	kLBPaletteAItem = 0x44, // unused?
+	kLBPaletteItem = 0x45,
+	kLBProxyItem = 0x46,
+	kLBXDataFileItem = 0x3e9
 };
 
 enum {
@@ -499,6 +503,15 @@
 	bool _running;
 };
 
+class LBMovieItem : public LBItem {
+public:
+	LBMovieItem(MohawkEngine_LivingBooks *_vm, Common::Rect rect);
+	~LBMovieItem();
+
+	void update();
+	bool togglePlaying(bool playing, bool restart);
+};
+
 struct NotifyEvent {
 	NotifyEvent(uint t, uint p) : type(t), param(p) { }
 	uint type;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list