[Scummvm-cvs-logs] scummvm master -> f50fd3b7f93a8425f1a22e85b2012bca933252db

bluegr md5 at scummvm.org
Tue Dec 6 01:38:52 CET 2011


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:
f50fd3b7f9 DREAMWEB: 'foghornsound' and 'liftnoise' ported to C++


Commit: f50fd3b7f93a8425f1a22e85b2012bca933252db
    https://github.com/scummvm/scummvm/commit/f50fd3b7f93a8425f1a22e85b2012bca933252db
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-05T16:37:12-08:00

Commit Message:
DREAMWEB: 'foghornsound' and 'liftnoise' ported to C++

Changed paths:
    devtools/tasmrecover/tasm-recover
    engines/dreamweb/dreamgen.cpp
    engines/dreamweb/dreamgen.h
    engines/dreamweb/people.cpp
    engines/dreamweb/sprite.cpp
    engines/dreamweb/stubs.h



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 9a0b397..9ff1f26 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -278,6 +278,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'finishedwalking',
 	'folderexit',
 	'folderhints',
+	'foghornsound',
 	'frameoutbh',
 	'frameoutfx',
 	'frameoutnm',
@@ -331,6 +332,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'isitworn',
 	'kernchars',
 	'lastfolder',
+	'liftnoise',
 	'liftsprite',
 	'loadcart',
 	'loadfolder',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 595a869..c1a4a41 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -44,16 +44,6 @@ nobark:
 	es.word(bx+3) = ax;
 }
 
-void DreamGenContext::foghornSound() {
-	STACK_CHECK;
-	randomNumber();
-	_cmp(al, 198);
-	if (!flags.z())
-		return /* (nofog) */;
-	al = 13;
-	playChannel1();
-}
-
 void DreamGenContext::receptionist() {
 	STACK_CHECK;
 	checkSpeed();
@@ -1654,21 +1644,6 @@ forgotone:
 	setupTimedUse();
 }
 
-void DreamGenContext::liftNoise() {
-	STACK_CHECK;
-	_cmp(data.byte(kReallocation), 5);
-	if (flags.z())
-		goto hissnoise;
-	_cmp(data.byte(kReallocation), 21);
-	if (flags.z())
-		goto hissnoise;
-	playChannel1();
-	return;
-hissnoise:
-	al = 13;
-	playChannel1();
-}
-
 void DreamGenContext::delEverything() {
 	STACK_CHECK;
 	al = data.byte(kMapysize);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 18732cf..a70133f 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -770,8 +770,6 @@ public:
 	void fillOpen();
 	void signOn();
 	void deleteExText();
-	void foghornSound();
-	void liftNoise();
 	void showGun();
 	void louisChair();
 	void locationPic();
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 1bf46d3..93a9e91 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -51,7 +51,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
 	&DreamGenContext::monkAndRyan, &DreamGenContext::endGameSeq,
 	&DreamGenContext::priest, NULL,
 	NULL, &DreamGenContext::alleyBarkSound,
-	&DreamGenContext::foghornSound, NULL,
+	NULL, NULL,
 	NULL, NULL,
 	NULL
 };
@@ -83,7 +83,7 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
 	/*&DreamGenContext::monkAndRyan*/NULL, /*&DreamGenContext::endGameSeq*/NULL,
 	/*&DreamGenContext::priest*/NULL, &DreamGenContext::madman,
 	&DreamGenContext::madmansTelly, /*&DreamGenContext::alleyBarkSound*/NULL,
-	/*&DreamGenContext::foghornSound*/NULL, &DreamGenContext::carParkDrip,
+	&DreamGenContext::foghornSound, &DreamGenContext::carParkDrip,
 	&DreamGenContext::carParkDrip, &DreamGenContext::carParkDrip,
 	&DreamGenContext::carParkDrip
 };
@@ -455,5 +455,10 @@ void DreamGenContext::carParkDrip(ReelRoutine &routine) {
 	playChannel1(14);
 }
 
+void DreamGenContext::foghornSound(ReelRoutine &routine) {
+	if (engine->randomNumber() == 198)
+		playChannel1(13);
+}
+
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 7628a91..28b1ce8 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -440,8 +440,7 @@ void DreamGenContext::liftSprite(Sprite *sprite, SetObject *objData) {
 		}
 		++sprite->animFrame;
 		if (sprite->animFrame == 1) {
-			al = 2;
-			liftNoise();
+			liftNoise(2);
 		}
 		sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
 	} else { //closeLift
@@ -452,8 +451,7 @@ void DreamGenContext::liftSprite(Sprite *sprite, SetObject *objData) {
 		}
 		--sprite->animFrame;
 		if (sprite->animFrame == 11) {
-			al = 3;
-			liftNoise();
+			liftNoise(3);
 		}
 		sprite->frameNumber = objData->index = objData->frames[sprite->animFrame];
 	}
@@ -1172,5 +1170,12 @@ void DreamGenContext::getRidOfReels() {
 	deallocateMem(data.word(kReel3));
 }
 
+void DreamGenContext::liftNoise(uint8 index) {
+	if (data.byte(kReallocation) == 5 || data.byte(kReallocation) == 21)
+		playChannel1(13);	// hiss noise
+	else
+		playChannel1(index);
+}
+
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 87b41e0..03b796a 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -421,6 +421,7 @@
 	void louis(ReelRoutine &routine);
 	void handClap(ReelRoutine &routine);
 	void carParkDrip(ReelRoutine &routine);
+	void foghornSound(ReelRoutine &routine);
 	void singleKey(uint8 key, uint16 x, uint16 y);
 	void loadSaveBox();
 	void loadKeypad();
@@ -480,5 +481,6 @@
 	void clearReels();
 	void getRidOfReels();
 	void setMode();
+	void liftNoise(uint8 index);
 
 #endif






More information about the Scummvm-git-logs mailing list