[Scummvm-cvs-logs] SF.net SVN: scummvm: [24586] scummvm/trunk/engines/scumm

kirben at users.sourceforge.net kirben at users.sourceforge.net
Thu Nov 2 11:01:41 CET 2006


Revision: 24586
          http://svn.sourceforge.net/scummvm/?rev=24586&view=rev
Author:   kirben
Date:     2006-11-02 02:01:32 -0800 (Thu, 02 Nov 2006)

Log Message:
-----------
Add video code for HE100 games

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/animation_he.cpp
    scummvm/trunk/engines/scumm/he/animation_he.h
    scummvm/trunk/engines/scumm/he/script_v100he.cpp
    scummvm/trunk/engines/scumm/scumm.cpp

Modified: scummvm/trunk/engines/scumm/he/animation_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/animation_he.cpp	2006-11-01 23:42:21 UTC (rev 24585)
+++ scummvm/trunk/engines/scumm/he/animation_he.cpp	2006-11-02 10:01:32 UTC (rev 24586)
@@ -26,10 +26,12 @@
 #include "scumm/he/animation_he.h"
 #include "scumm/he/intern_he.h"
 
+#include "sound/audiostream.h"
+
 namespace Scumm {
 
-MoviePlayer::MoviePlayer(ScummEngine_v90he *vm)
-	: DXAPlayer(), _vm(vm) {
+MoviePlayer::MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer)
+	: DXAPlayer(), _vm(vm), _mixer(mixer) {
 
 	_flags = 0;
 	_wizResNum = 0;
@@ -48,12 +50,12 @@
 		closeFile();
 	}
 
+	int baseLen = strlen(filename) - 4;
+	memset(baseName, 0, sizeof(baseName));
+	memcpy(baseName, filename, baseLen);
+
 	// Change file extension to dxa
-	strcpy(videoName, filename);
-	int len = strlen(videoName) - 3;
-	videoName[len++] = 'd';
-	videoName[len++] = 'x';
-	videoName[len++] = 'a';
+	sprintf(videoName, "%s.dxa", baseName);
 	
 	if (!loadFile(videoName)) {
 		warning("Failed to load video file %s", videoName);
@@ -71,6 +73,12 @@
 	_flags = flags;
 	_wizResNum = image;
 
+	_bgSoundStream = Audio::AudioStream::openStreamFile(baseName);
+	if (_bgSoundStream != NULL) {
+		_mixer->stopHandle(_bgSound);
+		_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream);
+	}
+
 	return 0;
 }
 

Modified: scummvm/trunk/engines/scumm/he/animation_he.h
===================================================================
--- scummvm/trunk/engines/scumm/he/animation_he.h	2006-11-01 23:42:21 UTC (rev 24585)
+++ scummvm/trunk/engines/scumm/he/animation_he.h	2006-11-02 10:01:32 UTC (rev 24586)
@@ -25,8 +25,11 @@
 #define ANIMATION_H
 
 #include "common/file.h"
+
 #include "graphics/dxa_player.h"
 
+#include "sound/mixer.h"
+
 namespace Scumm {
 
 class ScummEngine_v90he;
@@ -34,11 +37,17 @@
 class MoviePlayer : public Graphics::DXAPlayer {
 	ScummEngine_v90he *_vm;
 
+	Audio::Mixer *_mixer;
+
+	Audio::SoundHandle _bgSound;
+	Audio::AudioStream *_bgSoundStream;
+
+	char baseName[40];
 	uint32 _flags;
 	uint32 _wizResNum;
 	
 public:
-	MoviePlayer(ScummEngine_v90he *vm);
+	MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer);
 
 	int getImageNum();
 	int load(const char *filename, int flags, int image = 0);

Modified: scummvm/trunk/engines/scumm/he/script_v100he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v100he.cpp	2006-11-01 23:42:21 UTC (rev 24585)
+++ scummvm/trunk/engines/scumm/he/script_v100he.cpp	2006-11-02 10:01:32 UTC (rev 24586)
@@ -2891,29 +2891,31 @@
 	switch (subOp) {
 	case 0:
 		pop();
+		push(_moviePlay->getFrameCount());
 		break;
 	case 13:
 		pop();
+		push(_moviePlay->getHeight());
 		break;
 	case 14:
 		pop();
+		push(_moviePlay->getImageNum());
 		break;
 	case 28:
-		pop();
-		pop();
+		debug(0, "o100_getVideoData: subOp 28 stub (%d, %d)", pop(), pop());
+		push(0);
 		break;
 	case 47:
 		pop();
+		push(_moviePlay->getCurFrame());
 		break;
 	case 58:
 		pop();
+		push(_moviePlay->getWidth());
 		break;
 	default:
 		error("o100_getVideoData: unhandled case %d", subOp);
 	}
-
-	push(-1);
-	debug(1,"o100_getVideoData stub (%d)", subOp);
 }
 
 void ScummEngine_v100he::decodeParseString(int m, int n) {

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2006-11-01 23:42:21 UTC (rev 24585)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2006-11-02 10:01:32 UTC (rev 24586)
@@ -735,7 +735,7 @@
 
 ScummEngine_v90he::ScummEngine_v90he(OSystem *syst, const DetectorResult &dr)
 	: ScummEngine_v80he(syst, dr) {
-	_moviePlay = new MoviePlayer(this);
+	_moviePlay = new MoviePlayer(this, _mixer);
 	_sprite = new Sprite(this);
 
 	memset(_videoParams.filename, 0, sizeof(_videoParams.filename));


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