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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Dec 30 22:59:51 CET 2007


Revision: 30086
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30086&view=rev
Author:   fingolfin
Date:     2007-12-30 13:59:50 -0800 (Sun, 30 Dec 2007)

Log Message:
-----------
atrib -> attrib; added some FIXME comments

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/imuse_digi/dimuse.h
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_music.cpp
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse.h	2007-12-30 17:58:22 UTC (rev 30085)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse.h	2007-12-30 21:59:50 UTC (rev 30086)
@@ -118,7 +118,7 @@
 
 	bool _pause;			// flag mean that iMuse callback should be idle
 
-	int32 _attributes[188];	// internal atributes for each music file to store and check later
+	int32 _attributes[188];	// internal attributes for each music file to store and check later
 	int32 _nextSeqToPlay;	// id of sequence type of music needed played
 	int32 _curMusicState;	// current or previous id of music
 	int32 _curMusicSeq;		// current or previous id of sequence music
@@ -146,11 +146,11 @@
 
 	void setComiMusicState(int stateId);
 	void setComiMusicSequence(int seqId);
-	void playComiMusic(const char *songName, const imuseComiTable *table, int atribPos, bool sequence);
+	void playComiMusic(const imuseComiTable *table, int attribPos, bool sequence);
 
 	void setDigMusicState(int stateId);
 	void setDigMusicSequence(int seqId);
-	void playDigMusic(const char *songName, const imuseDigTable *table, int atribPos, bool sequence);
+	void playDigMusic(const char *songName, const imuseDigTable *table, int attribPos, bool sequence);
 
 public:
 	IMuseDigital(ScummEngine_v7 *scumm, Audio::Mixer *mixer, int fps);
@@ -196,7 +196,7 @@
 	byte stateIndex1;
 	byte offset;
 	byte stateIndex2;
-	byte atribPos;
+	byte attribPos;
 	byte stateIndex3;
 };
 
@@ -204,7 +204,7 @@
 	byte transitionType;
 	int16 soundId;
 	char name[20];
-	byte atribPos;
+	byte attribPos;
 	byte hookId;
 	char filename[13];
 };
@@ -213,7 +213,7 @@
 	byte transitionType;
 	int16 soundId;
 	char name[20];
-	byte atribPos;
+	byte attribPos;
 	byte hookId;
 	int16 fadeOutDelay;
 	char filename[13];

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_music.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_music.cpp	2007-12-30 17:58:22 UTC (rev 30085)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_music.cpp	2007-12-30 21:59:50 UTC (rev 30086)
@@ -54,7 +54,7 @@
 
 		int offset = _attributes[_digStateMusicMap[num].offset];
 		if (offset == 0) {
-			if (_attributes[_digStateMusicMap[num].atribPos] != 0) {
+			if (_attributes[_digStateMusicMap[num].attribPos] != 0) {
 				num = _digStateMusicMap[num].stateIndex3;
 			} else {
 				num = _digStateMusicMap[num].stateIndex1;
@@ -98,7 +98,7 @@
 		}
 	}
 
-	if (num == -1)
+	if (num == -1)		// FIXME: setDigMusicSequence vs. setComiMusicSequence
 		return;
 
 	if (_curMusicSeq == num)
@@ -108,16 +108,16 @@
 		if (_curMusicSeq &&	(_digSeqMusicTable[_curMusicSeq].transitionType == 4)
 				|| (_digSeqMusicTable[_curMusicSeq].transitionType == 6)) {
 			_nextSeqToPlay = num;
-			return;
+			return;		// FIXME: setDigMusicSequence vs. setComiMusicSequence
 		} else {
 			playDigMusic(_digSeqMusicTable[num].name, &_digSeqMusicTable[num], 0, true);
 			_nextSeqToPlay = 0;
-			_attributes[DIG_SEQ_OFFSET + num] = 1;
+			_attributes[DIG_SEQ_OFFSET + num] = 1;		// FIXME: setDigMusicSequence vs. setComiMusicSequence
 		}
 	} else {
 		if (_nextSeqToPlay != 0) {
 			playDigMusic(_digSeqMusicTable[_nextSeqToPlay].name, &_digSeqMusicTable[_nextSeqToPlay], 0, true);
-			_attributes[DIG_SEQ_OFFSET + _nextSeqToPlay] = 1;
+			_attributes[DIG_SEQ_OFFSET + _nextSeqToPlay] = 1;		// FIXME: setDigMusicSequence vs. setComiMusicSequence
 			num = _nextSeqToPlay;
 			_nextSeqToPlay = 0;
 		} else {
@@ -132,36 +132,36 @@
 	_curMusicSeq = num;
 }
 
-void IMuseDigital::playDigMusic(const char *songName, const imuseDigTable *table, int atribPos, bool sequence) {
+void IMuseDigital::playDigMusic(const char *songName, const imuseDigTable *table, int attribPos, bool sequence) {
 	int hookId = 0;
 
 	if (songName != NULL) {
 		if ((_attributes[DIG_SEQ_OFFSET + 38]) && (!_attributes[DIG_SEQ_OFFSET + 41])) {
-			if ((atribPos == 43) || (atribPos == 44))
+			if ((attribPos == 43) || (attribPos == 44))
 				hookId = 3;
 		}
 
 		if ((_attributes[DIG_SEQ_OFFSET + 46] != 0) && (_attributes[DIG_SEQ_OFFSET + 48] == 0)) {
-			if ((atribPos == 38) || (atribPos == 39))
+			if ((attribPos == 38) || (attribPos == 39))
 				hookId = 3;
 		}
 
 		if ((_attributes[DIG_SEQ_OFFSET + 53] != 0)) {
-			if ((atribPos == 50) || (atribPos == 51))
+			if ((attribPos == 50) || (attribPos == 51))
 				hookId = 3;
 		}
 
-		if ((atribPos != 0) && (hookId == 0)) {
-			if (table->atribPos != 0)
-				atribPos = table->atribPos;
-			hookId = _attributes[DIG_STATE_OFFSET + atribPos];
+		if ((attribPos != 0) && (hookId == 0)) {
+			if (table->attribPos != 0)
+				attribPos = table->attribPos;
+			hookId = _attributes[DIG_STATE_OFFSET + attribPos];
 			if (table->hookId != 0) {
 				if ((hookId != 0) && (table->hookId > 1)) {
-					_attributes[DIG_STATE_OFFSET + atribPos] = 2;
+					_attributes[DIG_STATE_OFFSET + attribPos] = 2;
 				} else {
-					_attributes[DIG_STATE_OFFSET + atribPos] = hookId + 1;
+					_attributes[DIG_STATE_OFFSET + attribPos] = hookId + 1;
 					if (table->hookId < hookId + 1)
-						_attributes[DIG_STATE_OFFSET + atribPos] = 1;
+						_attributes[DIG_STATE_OFFSET + attribPos] = 1;
 				}
 			}
 		}
@@ -179,8 +179,8 @@
 			if (table->filename[0] == 0) {
 				return;
 			}
-			if ((!sequence) && (table->atribPos != 0) &&
-					(table->atribPos == _digStateMusicTable[_curMusicState].atribPos)) {
+			if ((!sequence) && (table->attribPos != 0) &&
+					(table->attribPos == _digStateMusicTable[_curMusicState].attribPos)) {
 				startMusic(table->filename, table->soundId, 0, 127);
 				return;
 			}
@@ -226,6 +226,10 @@
 
 void IMuseDigital::setComiMusicSequence(int seqId) {
 	int l, num = -1;
+	
+	// FIXME: It turns out that setDigMusicSequence and setComiMusicSequence arae
+	// very similiar, with only a few small differences. Question: are those differences
+	// really differences, or just caused by a mistake on our side?
 
 	if (seqId == 0)
 		seqId = 2000;
@@ -237,14 +241,16 @@
 			break;
 		}
 	}
-	assert(num != -1);
+	assert(num != -1);	// FIXME: setDigMusicSequence vs. setComiMusicSequence
 
 	if (_curMusicSeq == num)
 		return;
 
 	if (num != 0) {
-		if (_curMusicSeq && ((_comiSeqMusicTable[_curMusicSeq].transitionType == 4) || (_comiSeqMusicTable[_curMusicSeq].transitionType == 6))) {
+		if (_curMusicSeq && ((_comiSeqMusicTable[_curMusicSeq].transitionType == 4)
+				|| (_comiSeqMusicTable[_curMusicSeq].transitionType == 6))) {
 			_nextSeqToPlay = num;
+			//return;	// FIXME: setDigMusicSequence vs. setComiMusicSequence
 		} else {
 			playComiMusic(_comiSeqMusicTable[num].name, &_comiSeqMusicTable[num], 0, true);
 			_nextSeqToPlay = 0;
@@ -266,20 +272,20 @@
 	_curMusicSeq = num;
 }
 
-void IMuseDigital::playComiMusic(const char *songName, const imuseComiTable *table, int atribPos, bool sequence) {
+void IMuseDigital::playComiMusic(const char *songName, const imuseComiTable *table, int attribPos, bool sequence) {
 	int hookId = 0;
 
-	if ((songName != NULL) && (atribPos != 0)) {
-		if (table->atribPos != 0)
-			atribPos = table->atribPos;
-		hookId = _attributes[COMI_STATE_OFFSET + atribPos];
+	if ((songName != NULL) && (attribPos != 0)) {
+		if (table->attribPos != 0)
+			attribPos = table->attribPos;
+		hookId = _attributes[COMI_STATE_OFFSET + attribPos];
 		if (table->hookId != 0) {
 			if ((hookId != 0) && (table->hookId > 1)) {
-				_attributes[COMI_STATE_OFFSET + atribPos] = 2;
+				_attributes[COMI_STATE_OFFSET + attribPos] = 2;
 			} else {
-				_attributes[COMI_STATE_OFFSET + atribPos] = hookId + 1;
+				_attributes[COMI_STATE_OFFSET + attribPos] = hookId + 1;
 				if (table->hookId < hookId + 1)
-					_attributes[COMI_STATE_OFFSET + atribPos] = 1;
+					_attributes[COMI_STATE_OFFSET + attribPos] = 1;
 			}
 		}
 	}
@@ -317,8 +323,8 @@
 				return;
 			}
 			fadeOutMusic(table->fadeOutDelay);
-			if ((!sequence) && (table->atribPos != 0) &&
-					(table->atribPos == _comiStateMusicTable[_curMusicState].atribPos)) {
+			if ((!sequence) && (table->attribPos != 0) &&
+					(table->attribPos == _comiStateMusicTable[_curMusicState].attribPos)) {
 				startMusic(table->filename, table->soundId, 0, 127);
 				return;
 			}

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp	2007-12-30 17:58:22 UTC (rev 30085)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp	2007-12-30 21:59:50 UTC (rev 30086)
@@ -83,10 +83,10 @@
 		}
 		break;
 	case 25: // ImuseStartStream
-		debug(5, "ImuseStartStream (%d, %d, %d)", soundId, c, d);
+		debug(3, "ImuseStartStream (%d, %d, %d)", soundId, c, d);
 		break;
 	case 26: // ImuseSwitchStream
-		debug(5, "ImuseSwitchStream (%d, %d, %d, %d, %d)", soundId, c, d, e, f);
+		debug(3, "ImuseSwitchStream (%d, %d, %d, %d, %d)", soundId, c, d, e, f);
 		break;
 	case 0x1000: // ImuseSetState
 		debug(5, "ImuseSetState (%d)", b);
@@ -147,15 +147,15 @@
 		}
 		break;
 	case 0x2000: // ImuseSetGroupSfxVolume
-		debug(5, "ImuseSetGroupSFXVolume (%d)", b);
+		debug(3, "ImuseSetGroupSFXVolume (%d)", b);
 //		setGroupSfxVolume(b);
 		break;
 	case 0x2001: // ImuseSetGroupVoiceVolume
-		debug(5, "ImuseSetGroupVoiceVolume (%d)", b);
+		debug(3, "ImuseSetGroupVoiceVolume (%d)", b);
 //		setGroupVoiceVolume(b);
 		break;
 	case 0x2002: // ImuseSetGroupMusicVolume
-		debug(5, "ImuseSetGroupMusicVolume (%d)", b);
+		debug(3, "ImuseSetGroupMusicVolume (%d)", b);
 //		setGroupMusicVolume(b);
 		break;
 	default:


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