[Scummvm-cvs-logs] CVS: scummvm/scumm/imuse_digi dimuse.cpp,1.15,1.16 dimuse.h,1.11,1.12 dimuse_sndmgr.cpp,1.12,1.13 dimuse_sndmgr.h,1.9,1.10

Max Horn fingolfin at users.sourceforge.net
Thu Jan 8 12:38:03 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm/imuse_digi
In directory sc8-pr-cvs1:/tmp/cvs-serv30933/imuse_digi

Modified Files:
	dimuse.cpp dimuse.h dimuse_sndmgr.cpp dimuse_sndmgr.h 
Log Message:
unify _vm / _scumm usage

Index: dimuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- dimuse.cpp	8 Jan 2004 18:25:30 -0000	1.15
+++ dimuse.cpp	8 Jan 2004 20:37:26 -0000	1.16
@@ -42,15 +42,15 @@
 }
 
 IMuseDigital::IMuseDigital(ScummEngine *scumm)
-	: _scumm(scumm) {
+	: _vm(scumm) {
 	_pause = false;
-	_sound = new ImuseDigiSndMgr(_scumm);
-	_scumm->_timer->installTimerProc(timer_handler, 1000000 / 25, this);
+	_sound = new ImuseDigiSndMgr(_vm);
+	_vm->_timer->installTimerProc(timer_handler, 1000000 / 25, this);
 	_curMusicId = -1;
 }
 
 IMuseDigital::~IMuseDigital() {
-	_scumm->_timer->removeTimerProc(timer_handler);
+	_vm->_timer->removeTimerProc(timer_handler);
 	stopAllSounds();
 	delete _sound;
 }
@@ -58,7 +58,7 @@
 void IMuseDigital::callback() {
 	int l = 0;
 
-	if (_pause || !_scumm)
+	if (_pause || !_vm)
 		return;
 
 	for (l = 0; l < MAX_DIGITAL_TRACKS;l ++) {
@@ -109,14 +109,14 @@
 
 			int pan = (_track[l].pan != 64) ? 2 * _track[l].pan - 127 : 0;
 
-			if (_scumm->_mixer->isReady()) {
+			if (_vm->_mixer->isReady()) {
 				if (_track[l].stream2) {
 					if (!_track[l].started) {
 						_track[l].started = true;
-						_scumm->_mixer->playInputStream(&_track[l].handle, _track[l].stream2, true, _track[l].vol / 1000, _track[l].pan, -1, false);
+						_vm->_mixer->playInputStream(&_track[l].handle, _track[l].stream2, true, _track[l].vol / 1000, _track[l].pan, -1, false);
 					} else {
-						_scumm->_mixer->setChannelVolume(_track[l].handle, _track[l].vol / 1000);
-						_scumm->_mixer->setChannelPan(_track[l].handle, pan);
+						_vm->_mixer->setChannelVolume(_track[l].handle, _track[l].vol / 1000);
+						_vm->_mixer->setChannelPan(_track[l].handle, pan);
 					}
 					continue;
 				}
@@ -164,9 +164,9 @@
 					if (result > mixer_size)
 						result = mixer_size;
 
-					if (_scumm->_mixer->isReady()) {
-						_scumm->_mixer->setChannelVolume(_track[l].handle, _track[l].vol / 1000);
-						_scumm->_mixer->setChannelPan(_track[l].handle, pan);
+					if (_vm->_mixer->isReady()) {
+						_vm->_mixer->setChannelVolume(_track[l].handle, _track[l].vol / 1000);
+						_vm->_mixer->setChannelPan(_track[l].handle, pan);
 						_track[l].stream->append(data, result);
 						_track[l].regionOffset += result;
 						_track[l].trackOffset += result;
@@ -189,7 +189,7 @@
 void IMuseDigital::switchToNextRegion(int track) {
 	int num_regions = _sound->getNumRegions(_track[track].soundHandle);
 	int num_jumps = _sound->getNumJumps(_track[track].soundHandle);
-	if ((_scumm->_gameId == GID_FT) && (num_jumps != 0)) {
+	if ((_vm->_gameId == GID_FT) && (num_jumps != 0)) {
 		_track[track].regionOffset = 0;
 		return;
 	}
@@ -280,7 +280,7 @@
 			} else {
 				_track[l].stream2 = NULL;
 				_track[l].stream = makeAppendableAudioStream(freq, mixerFlags, 100000);
-				_scumm->_mixer->playInputStream(&_track[l].handle, _track[l].stream, true, _track[l].vol / 1000, _track[l].pan, -1);
+				_vm->_mixer->playInputStream(&_track[l].handle, _track[l].stream, true, _track[l].vol / 1000, _track[l].pan, -1);
 			}
 
 			if (soundGroup == IMUSE_MUSIC) {
@@ -315,7 +315,7 @@
 				_track[l].toBeRemoved = true;
 			}
 			else if (_track[l].stream2)
-				_scumm->_mixer->stopHandle(_track[l].handle);
+				_vm->_mixer->stopHandle(_track[l].handle);
 		}
 	}
 }
@@ -327,7 +327,7 @@
 			if (_track[l].stream) {
 				_track[l].toBeRemoved = true;
 			} else if (_track[l].stream2)
-				_scumm->_mixer->stopHandle(_track[l].handle);
+				_vm->_mixer->stopHandle(_track[l].handle);
 		}
 	}
 	_curMusicId = -1;
@@ -347,7 +347,7 @@
 void IMuseDigital::pause(bool p) {
 	for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) {
 		if (_track[l].used) {
-			_scumm->_mixer->pauseHandle(_track[l].handle, p);
+			_vm->_mixer->pauseHandle(_track[l].handle, p);
 		}
 	}
 	_pause = p;
@@ -407,7 +407,7 @@
 		switch (sub_cmd) {
 		case 0x600: // set new volume with fading
 			debug(5, "ImuseFadeParam - fade sample(%d), to volume(%d) with 60hz ticks(%d)", sample, d, e);
-			if ((_scumm->_gameId == GID_DIG) && (_scumm->_features & GF_DEMO)) {
+			if ((_vm->_gameId == GID_DIG) && (_vm->_features & GF_DEMO)) {
 				stopSound(sample);
 				return;
 			}
@@ -432,14 +432,14 @@
 		break;
 	case 0x1000: // ImuseSetState
 		debug(5, "ImuseSetState (%d)", b);
-		if ((_scumm->_gameId == GID_DIG) && (_scumm->_features & GF_DEMO)) {
+		if ((_vm->_gameId == GID_DIG) && (_vm->_features & GF_DEMO)) {
 			if (b == 1)
 				startMusic(1);
 			else {
 				if (getSoundStatus(2) == 0)
 					startMusic(2);
 			}
-		} else if (_scumm->_gameId == GID_DIG) {
+		} else if (_vm->_gameId == GID_DIG) {
 			if (b == 1000) {		// STATE_NULL
 				stopMusic();
 				return;
@@ -454,7 +454,7 @@
 					break;
 				}
 			}
-		} else if ((_scumm->_gameId == GID_CMI) && (_scumm->_features & GF_DEMO)) {
+		} else if ((_vm->_gameId == GID_CMI) && (_vm->_features & GF_DEMO)) {
 			if (b == 2) {
 				startMusic("in1.imx", 2002);
 			} else if (b == 4) {
@@ -466,9 +466,9 @@
 			} else if (b == 16) {
 				startMusic("gun.imx", 2016);
 			} else {
-				warning("imuse digital: set state unknown for cmi demo: %d, room: %d", b, this->_scumm->_currentRoom);
+				warning("imuse digital: set state unknown for cmi demo: %d, room: %d", b, this->_vm->_currentRoom);
 			}
-		} else if (_scumm->_gameId == GID_CMI) {
+		} else if (_vm->_gameId == GID_CMI) {
 			if (b == 1000) {		// STATE_NULL
 				stopMusic();
 				return;
@@ -482,7 +482,7 @@
 					break;
 				}
 			}
-		} else if (_scumm->_gameId == GID_FT) {
+		} else if (_vm->_gameId == GID_FT) {
 			for (l = 0;; l++) {
 				if (_ftStateMusicTable[l].index == -1) {
 					return;
@@ -490,8 +490,8 @@
 				if (_ftStateMusicTable[l].index == b) {
 					debug(5, "Play imuse music: %s, %s", _ftStateMusicTable[l].name, _ftStateMusicTable[l].audioname);
 					if (_ftStateMusicTable[l].audioname[0] != 0) {
-						for (r = 0; r < _scumm->_numAudioNames; r++) {
-							if (strcmp(_ftStateMusicTable[l].audioname, &_scumm->_audioNames[r * 9]) == 0) {
+						for (r = 0; r < _vm->_numAudioNames; r++) {
+							if (strcmp(_ftStateMusicTable[l].audioname, &_vm->_audioNames[r * 9]) == 0) {
 								startMusic(r);
 								parseScriptCmds(12, r, 0x600, _ftStateMusicTable[l].volume, 0, 0, 0, 0);
 							}
@@ -503,7 +503,7 @@
 		break;
 	case 0x1001: // ImuseSetSequence
 		debug(5, "ImuseSetSequence (%d)", b);
-		if (_scumm->_gameId == GID_DIG) {
+		if (_vm->_gameId == GID_DIG) {
 			for (l = 0; _digSeqMusicTable[l].room != -1; l++) {
 				if (_digSeqMusicTable[l].room == b) {
 					debug(5, "Play imuse music: %s, %s, %s", _digSeqMusicTable[l].name, _digSeqMusicTable[l].title, _digSeqMusicTable[l].filename);
@@ -513,7 +513,7 @@
 					break;
 				}
 			}
-		} else if (_scumm->_gameId == GID_CMI) {
+		} else if (_vm->_gameId == GID_CMI) {
 			for (l = 0; _comiSeqMusicTable[l].id != -1; l++) {
 				if (_comiSeqMusicTable[l].id == b) {
 					debug(5, "Play imuse music: %s, %s, %s", _comiSeqMusicTable[l].name, _comiSeqMusicTable[l].title, _comiSeqMusicTable[l].filename);
@@ -523,13 +523,13 @@
 					break;
 				}
 			}
-		} else if (_scumm->_gameId == GID_FT) {
+		} else if (_vm->_gameId == GID_FT) {
 			for (l = 0; _ftSeqMusicTable[l].index != -1; l++) {
 				if (_ftSeqMusicTable[l].index == b) {
 					debug(5, "Play imuse music: %s, %s", _ftSeqMusicTable[l].name, _ftSeqMusicTable[l].audioname);
 					if (_ftSeqMusicTable[l].audioname[0] != 0) {
-						for (r = 0; r < _scumm->_numAudioNames; r++) {
-							if (strcmp(_ftSeqMusicTable[l].audioname, &_scumm->_audioNames[r * 9]) == 0) {
+						for (r = 0; r < _vm->_numAudioNames; r++) {
+							if (strcmp(_ftSeqMusicTable[l].audioname, &_vm->_audioNames[r * 9]) == 0) {
 //								startMusic(r);
 //								parseScriptCmds(12, r, 0x600, _ftSeqMusicTable[l].volume, 0, 0, 0, 0);
 							}
@@ -593,22 +593,22 @@
 
 int32 IMuseDigital::getCurVoiceLipSyncWidth() {
 //	int32 pos = getPosInMs(kTalkSoundID);
-	return _scumm->_rnd.getRandomNumber(255);
+	return _vm->_rnd.getRandomNumber(255);
 }
 
 int32 IMuseDigital::getCurVoiceLipSyncHeight() {
 //	int32 pos = getPosInMs(kTalkSoundID);
-	return _scumm->_rnd.getRandomNumber(255);
+	return _vm->_rnd.getRandomNumber(255);
 }
 
 int32 IMuseDigital::getCurMusicLipSyncWidth(int32 param) {
 //	int32 pos = getPosInMs(_curMusicId);
-	return _scumm->_rnd.getRandomNumber(255);
+	return _vm->_rnd.getRandomNumber(255);
 }
 
 int32 IMuseDigital::getCurMusicLipSyncHeight(int32 param) {
 //	int32 pos = getPosInMs(_curMusicId);
-	return _scumm->_rnd.getRandomNumber(255);
+	return _vm->_rnd.getRandomNumber(255);
 }
 
 } // End of namespace Scumm

Index: dimuse.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- dimuse.h	8 Jan 2004 18:32:29 -0000	1.11
+++ dimuse.h	8 Jan 2004 20:37:26 -0000	1.12
@@ -68,7 +68,7 @@
 
 	Track _track[MAX_DIGITAL_TRACKS];
 
-	ScummEngine *_scumm;
+	ScummEngine *_vm;
 	ImuseDigiSndMgr *_sound;
 	bool _pause;
 	int _curMusicId;

Index: dimuse_sndmgr.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_sndmgr.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- dimuse_sndmgr.cpp	8 Jan 2004 18:25:30 -0000	1.12
+++ dimuse_sndmgr.cpp	8 Jan 2004 20:37:26 -0000	1.13
@@ -30,7 +30,7 @@
 
 ImuseDigiSndMgr::ImuseDigiSndMgr(ScummEngine *scumm) {
 	memset(&_sounds, 0, sizeof(_sounds));
-	_scumm = scumm;
+	_vm = scumm;
 	_mutex = g_system->create_mutex();
 	_disk = 0;
 	_cacheBundleDir = new BundleDirCache();
@@ -145,23 +145,23 @@
 	bool result = false;
 
 	_sounds[slot]._bundle = new BundleMgr(_cacheBundleDir);
-	if (_scumm->_gameId == GID_CMI) {
-		if (_scumm->_features & GF_DEMO) {
-			result = _sounds[slot]._bundle->openFile("music.bun", _scumm->getGameDataPath());
+	if (_vm->_gameId == GID_CMI) {
+		if (_vm->_features & GF_DEMO) {
+			result = _sounds[slot]._bundle->openFile("music.bun", _vm->getGameDataPath());
 		} else {
 			char musicfile[20];
-			sprintf(musicfile, "musdisk%d.bun", _scumm->VAR(_scumm->VAR_CURRENTDISK));
-			if (_disk != _scumm->VAR(_scumm->VAR_CURRENTDISK))
+			sprintf(musicfile, "musdisk%d.bun", _vm->VAR(_vm->VAR_CURRENTDISK));
+			if (_disk != _vm->VAR(_vm->VAR_CURRENTDISK))
 				_sounds[slot]._bundle->closeFile();
 
-			result = _sounds[slot]._bundle->openFile(musicfile, _scumm->getGameDataPath());
+			result = _sounds[slot]._bundle->openFile(musicfile, _vm->getGameDataPath());
 
 			if (result == false)
-				result = _sounds[slot]._bundle->openFile("music.bun", _scumm->getGameDataPath());
-			_disk = (byte)_scumm->VAR(_scumm->VAR_CURRENTDISK);
+				result = _sounds[slot]._bundle->openFile("music.bun", _vm->getGameDataPath());
+			_disk = (byte)_vm->VAR(_vm->VAR_CURRENTDISK);
 		}
-	} else if (_scumm->_gameId == GID_DIG)
-		result = _sounds[slot]._bundle->openFile("digmusic.bun", _scumm->getGameDataPath());
+	} else if (_vm->_gameId == GID_DIG)
+		result = _sounds[slot]._bundle->openFile("digmusic.bun", _vm->getGameDataPath());
 	else
 		error("ImuseDigiSndMgr::openMusicBundle() Don't know which bundle file to load");
 
@@ -172,23 +172,23 @@
 	bool result = false;
 
 	_sounds[slot]._bundle = new BundleMgr(_cacheBundleDir);
-	if (_scumm->_gameId == GID_CMI) {
-		if (_scumm->_features & GF_DEMO) {
-			result = _sounds[slot]._bundle->openFile("voice.bun", _scumm->getGameDataPath());
+	if (_vm->_gameId == GID_CMI) {
+		if (_vm->_features & GF_DEMO) {
+			result = _sounds[slot]._bundle->openFile("voice.bun", _vm->getGameDataPath());
 		} else {
 			char voxfile[20];
-			sprintf(voxfile, "voxdisk%d.bun", _scumm->VAR(_scumm->VAR_CURRENTDISK));
-			if (_disk != _scumm->VAR(_scumm->VAR_CURRENTDISK))
+			sprintf(voxfile, "voxdisk%d.bun", _vm->VAR(_vm->VAR_CURRENTDISK));
+			if (_disk != _vm->VAR(_vm->VAR_CURRENTDISK))
 				_sounds[slot]._bundle->closeFile();
 
-			result = _sounds[slot]._bundle->openFile(voxfile, _scumm->getGameDataPath());
+			result = _sounds[slot]._bundle->openFile(voxfile, _vm->getGameDataPath());
 
 			if (result == false)
-				result = _sounds[slot]._bundle->openFile("voice.bun", _scumm->getGameDataPath());
-			_disk = (byte)_scumm->VAR(_scumm->VAR_CURRENTDISK);
+				result = _sounds[slot]._bundle->openFile("voice.bun", _vm->getGameDataPath());
+			_disk = (byte)_vm->VAR(_vm->VAR_CURRENTDISK);
 		}
-	} else if (_scumm->_gameId == GID_DIG)
-		result = _sounds[slot]._bundle->openFile("digvoice.bun", _scumm->getGameDataPath());
+	} else if (_vm->_gameId == GID_DIG)
+		result = _sounds[slot]._bundle->openFile("digvoice.bun", _vm->getGameDataPath());
 	else
 		error("ImuseDigiSndMgr::openVoiceBundle() Don't know which bundle file to load");
 
@@ -210,7 +210,7 @@
 
 	if (soundName == NULL) {
 		if ((soundType == IMUSE_RESOURCE)) {
-			ptr = _scumm->getResourceAddress(rtSound, soundId);
+			ptr = _vm->getResourceAddress(rtSound, soundId);
 			if (ptr == NULL) {
 				closeSound(&_sounds[slot]);
 				return NULL;

Index: dimuse_sndmgr.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_sndmgr.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- dimuse_sndmgr.h	8 Jan 2004 18:25:30 -0000	1.9
+++ dimuse_sndmgr.h	8 Jan 2004 20:37:26 -0000	1.10
@@ -94,7 +94,7 @@
 	int allocSlot();
 	void prepareSound(byte *ptr, int slot);
 
-	ScummEngine *_scumm;
+	ScummEngine *_vm;
 	OSystem::MutexRef _mutex;
 	byte _disk;
 	BundleDirCache *_cacheBundleDir;





More information about the Scummvm-git-logs mailing list