[Scummvm-cvs-logs] CVS: scummvm/scumm dialogs.cpp,1.100,1.101 dialogs.h,1.36,1.37 player_v1.cpp,1.19,1.20 player_v2.cpp,2.45,2.46 player_v2.h,2.26,2.27 player_v2a.cpp,2.19,2.20 player_v2a.h,2.8,2.9 player_v3a.cpp,1.18,1.19 player_v3a.h,1.17,1.18 script.cpp,1.142,1.143 scumm.h,1.352,1.353 scummvm.cpp,2.537,2.538 sound.cpp,1.310,1.311 sound.h,1.61,1.62

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


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

Modified Files:
	dialogs.cpp dialogs.h player_v1.cpp player_v2.cpp player_v2.h 
	player_v2a.cpp player_v2a.h player_v3a.cpp player_v3a.h 
	script.cpp scumm.h scummvm.cpp sound.cpp sound.h 
Log Message:
unify _vm / _scumm usage

Index: dialogs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- dialogs.cpp	6 Jan 2004 12:45:30 -0000	1.100
+++ dialogs.cpp	8 Jan 2004 20:37:25 -0000	1.101
@@ -152,19 +152,19 @@
 	if (stringno == 0)
 		return String();
 
-	if (_scumm->_version >= 7)
-		result = _scumm->getStringAddressVar(string_map_table_v7[stringno - 1].num);
-	else if (_scumm->_version == 6)
-		result = _scumm->getStringAddressVar(string_map_table_v6[stringno - 1].num);
-	else if (_scumm->_version == 5)
-		result = _scumm->getStringAddress(string_map_table_v5[stringno - 1].num);
+	if (_vm->_version >= 7)
+		result = _vm->getStringAddressVar(string_map_table_v7[stringno - 1].num);
+	else if (_vm->_version == 6)
+		result = _vm->getStringAddressVar(string_map_table_v6[stringno - 1].num);
+	else if (_vm->_version == 5)
+		result = _vm->getStringAddress(string_map_table_v5[stringno - 1].num);
 	else
 		// TODO: For V8 games, maybe grab the strings from the language file?
 		return string_map_table_v5[stringno - 1].string;
 
 	if (result && *result == '/') {
 		byte tmp[256];
-		_scumm->translateText(result, tmp);
+		_vm->translateText(result, tmp);
 		
 		// FIXME: AARGH! We shouldn't just strcpy into the data we got from getStringAddress
 		strcpy((char *)result, (char *)tmp);
@@ -344,7 +344,7 @@
 		close();
 		break;
 	case kOptionsCmd:
-		_scumm->optionsDialog();
+		_vm->optionsDialog();
 		break;
 	case kAboutCmd:
 		_aboutDialog->runModal();
@@ -355,7 +355,7 @@
 		break;
 #endif
 	case kQuitCmd:
-		_scumm->_quit = true;
+		_vm->_quit = true;
 		close();
 		break;
 	default:
@@ -373,7 +373,7 @@
 
 void MainMenuDialog::save() {
 	int idx;
-	_saveDialog->setList(generateSavegameList(_scumm, true));
+	_saveDialog->setList(generateSavegameList(_vm, true));
 	idx = _saveDialog->runModal();
 	if (idx >= 0) {
 		const String &result = _saveDialog->getResultString();
@@ -385,17 +385,17 @@
 			str = buffer;
 		} else
 			str = result.c_str();
-		_scumm->requestSave(idx + 1, str);
+		_vm->requestSave(idx + 1, str);
 		close();
 	}
 }
 
 void MainMenuDialog::load() {
 	int idx;
-	_loadDialog->setList(generateSavegameList(_scumm, false));
+	_loadDialog->setList(generateSavegameList(_vm, false));
 	idx = _loadDialog->runModal();
 	if (idx >= 0) {
-		_scumm->requestLoad(idx);
+		_vm->requestLoad(idx);
 		close();
 	}
 }
@@ -412,10 +412,10 @@
 
 #ifndef _WIN32_WCE
 ConfigDialog::ConfigDialog(ScummEngine *scumm)
-	: GUI::OptionsDialog("", 40, 30, 240, 124), _scumm(scumm) {
+	: GUI::OptionsDialog("", 40, 30, 240, 124), _vm(scumm) {
 #else
 ConfigDialog::ConfigDialog(ScummEngine *scumm)
-	: GUI::OptionsDialog("", 40, 30, 240, 124 + 4), _scumm(scumm) {
+	: GUI::OptionsDialog("", 40, 30, 240, 124 + 4), _vm(scumm) {
 #endif
 	//
 	// Add the buttons
@@ -475,15 +475,15 @@
 	int soundVolumeMusic = ConfMan.getInt("music_volume");
 	int soundVolumeSfx = ConfMan.getInt("sfx_volume");
 
-	if (_scumm->_imuse) {
-		_scumm->_imuse->set_music_volume(soundVolumeMusic);
+	if (_vm->_imuse) {
+		_vm->_imuse->set_music_volume(soundVolumeMusic);
 	}
-	if (_scumm->_musicEngine) {
-		_scumm->_musicEngine->setMasterVolume(soundVolumeMaster);
+	if (_vm->_musicEngine) {
+		_vm->_musicEngine->setMasterVolume(soundVolumeMaster);
 	}
 
-	_scumm->_mixer->setVolume(soundVolumeSfx * soundVolumeMaster / 255);
-	_scumm->_mixer->setMusicVolume(soundVolumeMusic);
+	_vm->_mixer->setVolume(soundVolumeSfx * soundVolumeMaster / 255);
+	_vm->_mixer->setMusicVolume(soundVolumeMusic);
 }
 
 
@@ -532,7 +532,7 @@
 
 	String titleStr, *keyStr, *dscStr;
 
-	ScummHelp::updateStrings(_scumm->_gameId, _scumm->_version, _page, titleStr, keyStr, dscStr);
+	ScummHelp::updateStrings(_vm->_gameId, _vm->_version, _page, titleStr, keyStr, dscStr);
 
 	_title->setLabel(titleStr);
 	for (int i = 0; i < HELP_NUM_LINES; i++) {
@@ -591,7 +591,7 @@
 void InfoDialog::setInfoText(const String& message) {
 	int width = g_gui.getStringWidth(message) + 16;
 
-	_x = (_scumm->_screenWidth - width) >> 1;
+	_x = (_vm->_screenWidth - width) >> 1;
 	_w = width;
 
 	new StaticTextWidget(this, 4, 4, _w - 8, _h, message, kTextAlignCenter);

Index: dialogs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- dialogs.h	6 Jan 2004 12:45:30 -0000	1.36
+++ dialogs.h	8 Jan 2004 20:37:25 -0000	1.37
@@ -43,12 +43,12 @@
 class ScummDialog : public GUI::Dialog {
 public:
 	ScummDialog(ScummEngine *scumm, int x, int y, int w, int h)
-		: GUI::Dialog(x, y, w, h), _scumm(scumm) {}
+		: GUI::Dialog(x, y, w, h), _vm(scumm) {}
 	
 protected:
 	typedef Common::String String;
 
-	ScummEngine *_scumm;
+	ScummEngine *_vm;
 
 	// Query a string from the resources
 	const String queryResString(int stringno);
@@ -103,7 +103,7 @@
 
 class ConfigDialog : public GUI::OptionsDialog {
 protected:
-	ScummEngine *_scumm;
+	ScummEngine *_vm;
 #ifdef _WIN32_WCE
 	GUI::Dialog		*_keysDialog;
 #endif

Index: player_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v1.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- player_v1.cpp	8 Jan 2004 13:36:26 -0000	1.19
+++ player_v1.cpp	8 Jan 2004 20:37:25 -0000	1.20
@@ -64,7 +64,7 @@
 }
 
 void Player_V1::startSound(int nr) {
-	byte *data = _scumm->getResourceAddress(rtSound, nr);
+	byte *data = _vm->getResourceAddress(rtSound, nr);
 	assert(data);
 
 	mutex_up();

Index: player_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2.cpp,v
retrieving revision 2.45
retrieving revision 2.46
diff -u -d -r2.45 -r2.46
--- player_v2.cpp	8 Jan 2004 13:36:26 -0000	2.45
+++ player_v2.cpp	8 Jan 2004 20:37:25 -0000	2.46
@@ -345,7 +345,7 @@
 	int i;
 
 	_isV3Game = (scumm->_version >= 3);
-	_scumm = scumm;
+	_vm = scumm;
 	_system = scumm->_system;
 	_mixer = scumm->_mixer;
 	_sample_rate = _system->property(OSystem::PROP_GET_SAMPLE_RATE, 0);
@@ -491,7 +491,7 @@
 }
 
 void Player_V2::startSound(int nr) {
-	byte *data = _scumm->getResourceAddress(rtSound, nr);
+	byte *data = _vm->getResourceAddress(rtSound, nr);
 	assert(data);
 
 	mutex_up();

Index: player_v2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2.h,v
retrieving revision 2.26
retrieving revision 2.27
diff -u -d -r2.26 -r2.27
--- player_v2.h	8 Jan 2004 13:36:26 -0000	2.26
+++ player_v2.h	8 Jan 2004 20:37:25 -0000	2.27
@@ -88,7 +88,7 @@
 	bool _isV3Game;
 	SoundMixer *_mixer;
 	OSystem *_system;
-	ScummEngine *_scumm;
+	ScummEngine *_vm;
 
 	bool _pcjr;
 	int _header_len;

Index: player_v2a.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2a.cpp,v
retrieving revision 2.19
retrieving revision 2.20
diff -u -d -r2.19 -r2.20
--- player_v2a.cpp	8 Jan 2004 13:36:26 -0000	2.19
+++ player_v2a.cpp	8 Jan 2004 20:37:25 -0000	2.20
@@ -1154,7 +1154,7 @@
 
 Player_V2A::Player_V2A(ScummEngine *scumm) {
 	int i;
-	_scumm = scumm;
+	_vm = scumm;
 	_system = scumm->_system;
 
 #ifdef __PALM_OS__
@@ -1221,8 +1221,8 @@
 }
 
 void Player_V2A::startSound(int nr) {
-	assert(_scumm);
-	byte *data = _scumm->getResourceAddress(rtSound, nr);
+	assert(_vm);
+	byte *data = _vm->getResourceAddress(rtSound, nr);
 	assert(data);
 	uint32 crc = GetCRC(data + 0x0A, READ_BE_UINT16(data + 0x08));
 	V2A_Sound *snd = findSound(crc);

Index: player_v2a.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2a.h,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -d -r2.8 -r2.9
--- player_v2a.h	6 Jan 2004 12:45:30 -0000	2.8
+++ player_v2a.h	8 Jan 2004 20:37:25 -0000	2.9
@@ -61,7 +61,7 @@
 	};
 
 	OSystem *_system;
-	ScummEngine *_scumm;
+	ScummEngine *_vm;
 	Player_MOD *_mod;
 	soundSlot _slot[V2A_MAXSLOTS];
 

Index: player_v3a.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v3a.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- player_v3a.cpp	6 Jan 2004 12:45:30 -0000	1.18
+++ player_v3a.cpp	8 Jan 2004 20:37:25 -0000	1.19
@@ -36,7 +36,7 @@
 
 Player_V3A::Player_V3A(ScummEngine *scumm) {
 	int i;
-	_scumm = scumm;
+	_vm = scumm;
 	_system = scumm->_system;
 	for (i = 0; i < V3A_MAXMUS; i++) {
 		_mus[i].id = 0;
@@ -154,11 +154,11 @@
 }
 
 void Player_V3A::startSound(int nr) {
-	assert(_scumm);
-	byte *data = _scumm->getResourceAddress(rtSound, nr);
+	assert(_vm);
+	byte *data = _vm->getResourceAddress(rtSound, nr);
 	assert(data);
 
-	if ((_scumm->_gameId != GID_INDY3) && (_scumm->_gameId != GID_LOOM))
+	if ((_vm->_gameId != GID_INDY3) && (_vm->_gameId != GID_LOOM))
 		error("player_v3a - unknown game!");
 
 	if (!_isinit) {
@@ -167,11 +167,11 @@
 		int offset = 4;
 		int numInstruments;
 
-		if (_scumm->_gameId == GID_INDY3) {
-			ptr = _scumm->getResourceAddress(rtSound, 83);
+		if (_vm->_gameId == GID_INDY3) {
+			ptr = _vm->getResourceAddress(rtSound, 83);
 			numInstruments = 12;
 		} else {
-			ptr = _scumm->getResourceAddress(rtSound, 79);
+			ptr = _vm->getResourceAddress(rtSound, 79);
 			numInstruments = 9;
 		}
 		assert(ptr);
@@ -195,7 +195,7 @@
 				_wavetable[i]->_oct[j] = READ_BE_UINT16(ptr + offset + 8);
 				offset += 10;
 			}
-			if (_scumm->_gameId == GID_INDY3) {
+			if (_vm->_gameId == GID_INDY3) {
 				_wavetable[i]->_pitadjust = 0;
 				offset += 2;
 			} else {
@@ -239,7 +239,7 @@
 		}
 		_sfx[i].id = nr;
 		_sfx[i].dur = looped ? -1 : (1 + 60 * size / rate);
-		if ((_scumm->_gameId == GID_INDY3) && (nr == 60))
+		if ((_vm->_gameId == GID_INDY3) && (nr == 60))
 			_sfx[i].dur = 240;
 		_mod->startChannel(nr | 0x100, sound, size, rate, vol, loopStart, loopEnd);
 	}

Index: player_v3a.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v3a.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- player_v3a.h	6 Jan 2004 12:45:30 -0000	1.17
+++ player_v3a.h	8 Jan 2004 20:37:25 -0000	1.18
@@ -76,7 +76,7 @@
 	};
 
 	OSystem *_system;
-	ScummEngine *_scumm;
+	ScummEngine *_vm;
 	Player_MOD *_mod;
 
 	musChan _mus[V3A_MAXMUS];

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- script.cpp	6 Jan 2004 15:56:27 -0000	1.142
+++ script.cpp	8 Jan 2004 20:37:25 -0000	1.143
@@ -399,7 +399,7 @@
 		if (_showStack == 1) {
 			printf("Stack:");
 			for (c=0; c < _scummStackPos; c++) {
-				printf(" %d", _scummStack[c]); 
+				printf(" %d", _vmStack[c]); 
 			}
 			printf("\n");
 		}
@@ -617,16 +617,16 @@
 }
 
 void ScummEngine::push(int a) {
-	assert(_scummStackPos >= 0 && _scummStackPos < ARRAYSIZE(_scummStack));
-	_scummStack[_scummStackPos++] = a;
+	assert(_scummStackPos >= 0 && _scummStackPos < ARRAYSIZE(_vmStack));
+	_vmStack[_scummStackPos++] = a;
 }
 
 int ScummEngine::pop() {
-	if (_scummStackPos < 1 || _scummStackPos > ARRAYSIZE(_scummStack)) {
+	if (_scummStackPos < 1 || _scummStackPos > ARRAYSIZE(_vmStack)) {
 		error("No items on stack to pop() for %s (0x%X) at [%d-%d]", getOpcodeDesc(_opcode), _opcode, _roomResource, vm.slot[_currentScript].number);
 	}
 
-	return _scummStack[--_scummStackPos];
+	return _vmStack[--_scummStackPos];
 }
 
 void ScummEngine::stopObjectCode() {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.352
retrieving revision 1.353
diff -u -d -r1.352 -r1.353
--- scumm.h	8 Jan 2004 17:41:11 -0000	1.352
+++ scumm.h	8 Jan 2004 20:37:25 -0000	1.353
@@ -473,7 +473,7 @@
 	uint16 _curExecScript;
 	byte **_lastCodePtr;
 	int _resultVarNumber, _scummStackPos;
-	int _scummStack[150];
+	int _vmStack[150];
 	int _keyScriptKey, _keyScriptNo;
 	
 	virtual void setupOpcodes() = 0;

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.537
retrieving revision 2.538
diff -u -d -r2.537 -r2.538
--- scummvm.cpp	8 Jan 2004 17:41:11 -0000	2.537
+++ scummvm.cpp	8 Jan 2004 20:37:25 -0000	2.538
@@ -388,7 +388,7 @@
 	_lastCodePtr = NULL;
 	_resultVarNumber = 0;
 	_scummStackPos = 0;
-	memset(_scummStack, 0, sizeof(_scummStack));
+	memset(_vmStack, 0, sizeof(_vmStack));
 	_keyScriptKey = 0;
 	_keyScriptNo = 0;
 	_fileOffset = 0;

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.310
retrieving revision 1.311
diff -u -d -r1.310 -r1.311
--- sound.cpp	8 Jan 2004 08:47:08 -0000	1.310
+++ sound.cpp	8 Jan 2004 20:37:25 -0000	1.311
@@ -52,7 +52,7 @@
 Sound::Sound(ScummEngine *parent) {
 	memset(this,0,sizeof(Sound));	// palmos
 	
-	_scumm = parent;
+	_vm = parent;
 	_currentCDSound = 0;
 
 	_sfxFile = 0;
@@ -64,8 +64,8 @@
 }
 
 void Sound::addSoundToQueue(int sound) {
-	_scumm->VAR(_scumm->VAR_LAST_SOUND) = sound;
-	_scumm->ensureResourceLoaded(rtSound, sound);
+	_vm->VAR(_vm->VAR_LAST_SOUND) = sound;
+	_vm->ensureResourceLoaded(rtSound, sound);
 	addSoundToQueue2(sound);
 }
 
@@ -80,7 +80,7 @@
 
 	processSfxQueues();
 
-	if (_scumm->_features & GF_DIGI_IMUSE)
+	if (_vm->_features & GF_DIGI_IMUSE)
 		return;
 
 	while (_soundQue2Pos) {
@@ -105,8 +105,8 @@
 						data[0] >> 8, data[0] & 0xFF,
 						data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
 
-			if (_scumm->_imuse) {
-				_scumm->VAR(_scumm->VAR_SOUNDRESULT) = (short)_scumm->_imuse->doCommand (num, data);
+			if (_vm->_imuse) {
+				_vm->VAR(_vm->VAR_SOUNDRESULT) = (short)_vm->_imuse->doCommand (num, data);
 			}
 		}
 	}
@@ -120,8 +120,8 @@
 	int rate;
 	byte flags = SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE;
 	
-	debug(3, "playSound #%d (room %d)", soundID, _scumm->getResourceRoomNr(rtSound, soundID));
-	ptr = _scumm->getResourceAddress(rtSound, soundID);
+	debug(3, "playSound #%d (room %d)", soundID, _vm->getResourceRoomNr(rtSound, soundID));
+	ptr = _vm->getResourceAddress(rtSound, soundID);
 	if (!ptr) {
 		return;
 	}
@@ -141,7 +141,7 @@
 		// Allocate a sound buffer, copy the data into it, and play
 		sound = (char *)malloc(size);
 		memcpy(sound, ptr, size);
-		_scumm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
+		_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
 	}
 	// Support for Putt-Putt sounds - very hackish, too 8-)
 	else if (READ_UINT32(ptr) == MKID('DIGI')) {
@@ -158,7 +158,7 @@
 		// Allocate a sound buffer, copy the data into it, and play
 		sound = (char *)malloc(size);
 		memcpy(sound, ptr + 8, size);
-		_scumm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
+		_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
 	}
 	else if (READ_UINT32(ptr) == MKID('MRAW')) {
 		// pcm music in 3DO humongous games
@@ -174,7 +174,7 @@
 		// Allocate a sound buffer, copy the data into it, and play
 		sound = (char *)malloc(size);
 		memcpy(sound, ptr + 8, size);
-		_scumm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
+		_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
 	}	
 	// Support for sampled sound effects in Monkey Island 1 and 2
 	else if (READ_UINT32(ptr) == MKID('SBL ')) {
@@ -218,7 +218,7 @@
 		// then a semi-sane VOC header is revealed, with
 		// a sampling rate of ~25000 Hz (does that make sense?).
 		// I'll add some code to test that theory for now.
-		if (_scumm->_gameId == GID_MONKEY_SEGA)	{
+		if (_vm->_gameId == GID_MONKEY_SEGA)	{
 			size = READ_BE_UINT32(ptr + 4) - 27;
 			for (int i = 0; i < size; i++)
 				ptr[27 + i] ^= 0x16;
@@ -233,7 +233,7 @@
 		// FIXME: SBL resources are apparently horribly
 		// distorted on segacd even though it shares the same
 		// header etc. So don't try to play them for now.
-		if (_scumm->_gameId == GID_MONKEY_SEGA)	{
+		if (_vm->_gameId == GID_MONKEY_SEGA)	{
 			return;
 		}
 
@@ -248,12 +248,12 @@
 		// Allocate a sound buffer, copy the data into it, and play
 		sound = (char *)malloc(size);
 		memcpy(sound, ptr + 33, size);
-		_scumm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
+		_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
 	}
-	else if ((_scumm->_features & GF_FMTOWNS) || READ_UINT32(ptr) == MKID('SOUN') || READ_UINT32(ptr) == MKID('TOWS')) {
+	else if ((_vm->_features & GF_FMTOWNS) || READ_UINT32(ptr) == MKID('SOUN') || READ_UINT32(ptr) == MKID('TOWS')) {
 
 		bool tows = READ_UINT32(ptr) == MKID('TOWS');
-		if (_scumm->_features & GF_FMTOWNS) {
+		if (_vm->_features & GF_FMTOWNS) {
 			size = READ_LE_UINT32(ptr);
 		} else {
 			size = READ_BE_UINT32(ptr + 4) - 2;
@@ -301,14 +301,14 @@
 				if (loopEnd > 0)
 					flags |= SoundMixer::FLAG_LOOP;
 
-				_scumm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd);
+				_vm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd);
 			}
 			break;
 		case 1:
 		case 255:	// 255 is the type used in Indy3 FMTowns
 			// Music (Euphony format)
-			if (_scumm->_musicEngine)
-				_scumm->_musicEngine->startSound(soundID);
+			if (_vm->_musicEngine)
+				_vm->_musicEngine->startSound(soundID);
 			break;
 		case 2: // CD track resource
 			ptr += 0x16;
@@ -333,7 +333,7 @@
 			break;
 		}
 	}
-	else if ((_scumm->_gameId == GID_LOOM) && (_scumm->_features & GF_MACINTOSH))  {
+	else if ((_vm->_gameId == GID_LOOM) && (_vm->_features & GF_MACINTOSH))  {
 		// Mac version of Loom uses yet another sound format
 		/*
 		playSound #9 (room 70)
@@ -356,19 +356,19 @@
 		000070: 01 18 5a 00  10 00 02 28  5f 00 01 00  00 00 00 00   |..Z....(_.......|
 		*/
 	}
-	else if ((_scumm->_features & GF_MACINTOSH) && (_scumm->_gameId == GID_INDY3) && (ptr[26] == 0)) {
+	else if ((_vm->_features & GF_MACINTOSH) && (_vm->_gameId == GID_INDY3) && (ptr[26] == 0)) {
 		size = READ_BE_UINT16(ptr + 12);
 		rate = 3579545 / READ_BE_UINT16(ptr + 20);
 		sound = (char *)malloc(size);
 		int vol = ptr[24] * 4;
 		memcpy(sound,ptr + READ_BE_UINT16(ptr + 8), size);
-		_scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, soundID, vol, 0);
+		_vm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, soundID, vol, 0);
 	}
 	else {
 		
-		if (_scumm->_gameId == GID_MONKEY_VGA || _scumm->_gameId == GID_MONKEY_EGA) {
+		if (_vm->_gameId == GID_MONKEY_VGA || _vm->_gameId == GID_MONKEY_EGA) {
 			// Sound is currently not supported at all in the amiga versions of these games
-			if (_scumm->_features & GF_AMIGA) {
+			if (_vm->_features & GF_AMIGA) {
 				int track = -1;
 				if (soundID == 50)
 					track = 17;
@@ -390,14 +390,14 @@
 			// the music is never explicitly stopped.
 			// Rather it seems that starting a new music is supposed to
 			// automatically stop the old song.
-			if (_scumm->_imuse) {
+			if (_vm->_imuse) {
 				if (READ_UINT32(ptr) != MKID('ASFX'))
-					_scumm->_imuse->stopAllSounds();
+					_vm->_imuse->stopAllSounds();
 			}
 		}
 	
-		if (_scumm->_musicEngine) {
-			_scumm->_musicEngine->startSound(soundID);
+		if (_vm->_musicEngine) {
+			_vm->_musicEngine->startSound(soundID);
 		}
 	}
 }
@@ -416,17 +416,17 @@
 		_talk_sound_mode = 0;
 	}
 
-	if ((_sfxMode & 2) && _scumm->VAR(_scumm->VAR_TALK_ACTOR)) {
-		act = _scumm->VAR(_scumm->VAR_TALK_ACTOR);
+	if ((_sfxMode & 2) && _vm->VAR(_vm->VAR_TALK_ACTOR)) {
+		act = _vm->VAR(_vm->VAR_TALK_ACTOR);
 
-		if (_scumm->_imuseDigital) {
+		if (_vm->_imuseDigital) {
 			finished = !isSoundRunning(kTalkSoundID);
 		} else {
 			finished = !_talkChannelHandle.isActive();
 		}
 
-		if (act != 0 && (uint) act < 0x80 && !_scumm->_string[0].no_talk_anim) {
-			a = _scumm->derefActor(act, "processSfxQueues");
+		if (act != 0 && (uint) act < 0x80 && !_vm->_string[0].no_talk_anim) {
+			a = _vm->derefActor(act, "processSfxQueues");
 			if (a->isInCurrentRoom() && (finished || !_endOfMouthSync)) {
 				b = finished || isMouthSyncOff(_curSoundPos);
 				if (_mouthSyncMode != b) {
@@ -440,8 +440,8 @@
 			}
 		}
 
-		if (finished && _scumm->_talkDelay == 0) {
-			_scumm->stopTalk();
+		if (finished && _vm->_talkDelay == 0) {
+			_vm->stopTalk();
 		}
 	}
 
@@ -462,7 +462,7 @@
 	byte *sound;
 	int id = -1;
 
-	if ((_scumm->_gameId == GID_DIG) && (_scumm->_features & GF_DEMO)) {
+	if ((_vm->_gameId == GID_DIG) && (_vm->_features & GF_DEMO)) {
 		char filename[30];
 		char roomname[10];
 
@@ -508,13 +508,13 @@
 		// FIXME hack until more is known
 		// the size of the data after the sample isn't known
 		// 64 is just a guess
-		if (_scumm->_features & GF_HUMONGOUS) {
+		if (_vm->_features & GF_HUMONGOUS) {
 			// SKIP TLKB (8) TALK (8) HSHD (24) and SDAT (8)
 			_sfxMode |= mode;
 			_sfxFile->seek(offset + 48, SEEK_SET);
 			sound = (byte *)malloc(b - 64);
 			_sfxFile->read(sound, b - 64);
-			_scumm->_mixer->playRaw(handle, sound, b - 64, 11025, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+			_vm->_mixer->playRaw(handle, sound, b - 64, 11025, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
 			return;
 		}
 
@@ -527,10 +527,10 @@
 		// HACK: Checking for script 99 in Sam & Max is to keep Conroy's song
 		// from being interrupted.
 
-		if (mode == 1 && (_scumm->_gameId == GID_TENTACLE
-			|| (_scumm->_gameId == GID_SAMNMAX && !_scumm->isScriptRunning(99)))) {
+		if (mode == 1 && (_vm->_gameId == GID_TENTACLE
+			|| (_vm->_gameId == GID_SAMNMAX && !_vm->isScriptRunning(99)))) {
 			id = 777777;
-			_scumm->_mixer->stopID(id);
+			_vm->_mixer->stopID(id);
 		}
 
 		if (b > 8) {
@@ -572,16 +572,16 @@
 		_mouthSyncMode = true;
 	}
 
-	if (!_soundsPaused && _scumm->_mixer->isReady())
+	if (!_soundsPaused && _vm->_mixer->isReady())
 		startSfxSound(_sfxFile, size, handle, id);
 }
 
 void Sound::stopTalkSound() {
 	if (_sfxMode & 2) {
-		if (_scumm->_imuseDigital) {
-			_scumm->_imuseDigital->stopSound(kTalkSoundID);
+		if (_vm->_imuseDigital) {
+			_vm->_imuseDigital->stopSound(kTalkSoundID);
 		} else {
-			_scumm->_mixer->stopHandle(_talkChannelHandle);
+			_vm->_mixer->stopHandle(_talkChannelHandle);
 		}
 		_sfxMode &= ~2;
 	}
@@ -607,31 +607,31 @@
 
 int Sound::isSoundRunning(int sound) const {
 
-	if (_scumm->_imuseDigital)
-		return (_scumm->_imuseDigital->getSoundStatus(sound) != 0);
+	if (_vm->_imuseDigital)
+		return (_vm->_imuseDigital->getSoundStatus(sound) != 0);
 
 	if (sound == _currentCDSound)
 		return pollCD();
 
-	if (_scumm->_features & GF_HUMONGOUS) {
+	if (_vm->_features & GF_HUMONGOUS) {
 		if (sound == -2) {
 			return isSfxFinished();
 		} else if (sound == -1) {
 			// getSoundStatus(), with a -1, will return the
 			// ID number of the first active music it finds.
 			// TODO handle MRAW (pcm music) in humongous games
-			return _scumm->_imuse->getSoundStatus(sound);
+			return _vm->_imuse->getSoundStatus(sound);
 		}
 	}
 
 	if (isSoundInQueue(sound))
 		return 1;
 
-	if (!_scumm->isResourceLoaded(rtSound, sound))
+	if (!_vm->isResourceLoaded(rtSound, sound))
 		return 0;
 
-	if (_scumm->_musicEngine)
-		return _scumm->_musicEngine->getSoundStatus(sound);
+	if (_vm->_musicEngine)
+		return _vm->_musicEngine->getSoundStatus(sound);
 
 	return 0;
 }
@@ -649,8 +649,8 @@
  */
 bool Sound::isSoundInUse(int sound) const {
 
-	if (_scumm->_imuseDigital)
-		return (_scumm->_imuseDigital->getSoundStatus(sound) != 0);
+	if (_vm->_imuseDigital)
+		return (_vm->_imuseDigital->getSoundStatus(sound) != 0);
 
 	if (sound == _currentCDSound)
 		return pollCD() != 0;
@@ -658,11 +658,11 @@
 	if (isSoundInQueue(sound))
 		return true;
 
-	if (!_scumm->isResourceLoaded(rtSound, sound))
+	if (!_vm->isResourceLoaded(rtSound, sound))
 		return false;
 
-	if (_scumm->_imuse)
-		return _scumm->_imuse->get_sound_active(sound);
+	if (_vm->_imuse)
+		return _vm->_imuse->get_sound_active(sound);
 
 	return false;
 }
@@ -698,11 +698,11 @@
 		stopCDTimer();
 	}
 
-	if (!(_scumm->_features & GF_DIGI_IMUSE))
-		_scumm->_mixer->stopID(a);
+	if (!(_vm->_features & GF_DIGI_IMUSE))
+		_vm->_mixer->stopID(a);
 
-	if (_scumm->_musicEngine)
-		_scumm->_musicEngine->stopSound(a);
+	if (_vm->_musicEngine)
+		_vm->_musicEngine->stopSound(a);
 
 	for (i = 0; i < ARRAYSIZE(_soundQue2); i++)
 		if (_soundQue2[i] == a)
@@ -720,26 +720,26 @@
 	_soundQue2Pos = 0;
 	memset(_soundQue2, 0, sizeof(_soundQue2));
 
-	if (_scumm->_musicEngine) {
-		_scumm->_musicEngine->stopAllSounds();
+	if (_vm->_musicEngine) {
+		_vm->_musicEngine->stopAllSounds();
 	}
-	if (_scumm->_imuse) {
+	if (_vm->_imuse) {
 		// FIXME: Maybe we could merge this call to clear_queue()
 		// into IMuse::stopAllSounds() ?
-		_scumm->_imuse->clear_queue();
+		_vm->_imuse->clear_queue();
 	}
 
 	// Stop all SFX
-	if (!_scumm->_imuseDigital) {
-		_scumm->_mixer->stopAll();
+	if (!_vm->_imuseDigital) {
+		_vm->_mixer->stopAll();
 	}
 }
 
 void Sound::soundKludge(int *list, int num) {
 	int i;
 
-	if (_scumm->_imuseDigital) {
-		_scumm->_imuseDigital->parseScriptCmds(list[0], list[1], list[2], list[3], list[4],
+	if (_vm->_imuseDigital) {
+		_vm->_imuseDigital->parseScriptCmds(list[0], list[1], list[2], list[3], list[4],
 												list[5], list[6], list[7]);
 		return;
 	}
@@ -781,24 +781,24 @@
 }
 
 void Sound::pauseSounds(bool pause) {
-	if (_scumm->_imuse)
-		_scumm->_imuse->pause(pause);
+	if (_vm->_imuse)
+		_vm->_imuse->pause(pause);
 
 	// Don't pause sounds if the game isn't active
 	// FIXME - this is quite a nasty hack, replace with something cleaner, and w/o
 	// having to access member vars directly!
-	if (!_scumm->_roomResource)
+	if (!_vm->_roomResource)
 		return;
 
 	_soundsPaused = pause;
 
-	_scumm->_mixer->pauseAll(pause);
+	_vm->_mixer->pauseAll(pause);
 
-	if (_scumm->_imuseDigital) {
-		_scumm->_imuseDigital->pause(pause);
+	if (_vm->_imuseDigital) {
+		_vm->_imuseDigital->pause(pause);
 	}
 
-	if ((_scumm->_features & GF_AUDIOTRACKS) && _scumm->VAR(_scumm->VAR_MUSIC_TIMER) > 0) {
+	if ((_vm->_features & GF_AUDIOTRACKS) && _vm->VAR(_vm->VAR_MUSIC_TIMER) > 0) {
 		if (pause)
 			stopCDTimer();
 		else
@@ -824,11 +824,11 @@
 		input = makeVOCStream(_sfxFile);
 	}
 
-	if (_scumm->_imuseDigital) {
-		//_scumm->_imuseDigital->stopSound(kTalkSoundID);
-		_scumm->_imuseDigital->startVoice(kTalkSoundID, input);
+	if (_vm->_imuseDigital) {
+		//_vm->_imuseDigital->stopSound(kTalkSoundID);
+		_vm->_imuseDigital->startVoice(kTalkSoundID, input);
 	} else {
-		_scumm->_mixer->playInputStream(handle, input, false, 255, 0, id);
+		_vm->_mixer->playInputStream(handle, input, false, 255, 0, id);
 	}
 }
 
@@ -842,9 +842,9 @@
 	offset_table = NULL;
 
 #ifdef USE_MAD
-	sprintf(buf, "%s.so3", _scumm->getGameName());
-	if (!file->open(buf, _scumm->getGameDataPath())) {
-		file->open("monster.so3", _scumm->getGameDataPath());
+	sprintf(buf, "%s.so3", _vm->getGameName());
+	if (!file->open(buf, _vm->getGameDataPath())) {
+		file->open("monster.so3", _vm->getGameDataPath());
 	}
 	if (file->isOpen())
 		_vorbis_mode = false;
@@ -852,9 +852,9 @@
 
 #ifdef USE_VORBIS
 	if (!file->isOpen()) {
-		sprintf(buf, "%s.sog", _scumm->getGameName());
-		if (!file->open(buf, _scumm->getGameDataPath()))
-			file->open("monster.sog", _scumm->getGameDataPath());
+		sprintf(buf, "%s.sog", _vm->getGameName());
+		if (!file->open(buf, _vm->getGameDataPath()))
+			file->open("monster.sog", _vm->getGameDataPath());
 		if (file->isOpen())
 			_vorbis_mode = true;
 	}
@@ -894,20 +894,20 @@
 		return file;
 	}
 
-	sprintf(buf, "%s.sou", _scumm->getGameName());
-	if (!file->open(buf, _scumm->getGameDataPath())) {
-		file->open("monster.sou", _scumm->getGameDataPath());
+	sprintf(buf, "%s.sou", _vm->getGameName());
+	if (!file->open(buf, _vm->getGameDataPath())) {
+		file->open("monster.sou", _vm->getGameDataPath());
 	}
 
 	if (!file->isOpen()) {
-		sprintf(buf, "%s.tlk", _scumm->getGameName());
-		file->open(buf, _scumm->getGameDataPath(), File::kFileReadMode, 0x69);
+		sprintf(buf, "%s.tlk", _vm->getGameName());
+		file->open(buf, _vm->getGameDataPath(), File::kFileReadMode, 0x69);
 	}
 	return file;
 }
 
 bool Sound::isSfxFinished() const {
-	return !_scumm->_mixer->hasActiveSFXChannel();
+	return !_vm->_mixer->hasActiveSFXChannel();
 }
 
 // We use a real timer in an attempt to get better sync with CD tracks. This is
@@ -931,22 +931,22 @@
 	// when Chaos first appears, and I have to use 101 for Monkey 1 or the
 	// intro music will be cut short.
 
-	if (_scumm->_gameId == GID_LOOM256)
+	if (_vm->_gameId == GID_LOOM256)
 		timer_interval = 100;
 	else 
 		timer_interval = 101;
 
-	_scumm->_timer->removeTimerProc(&cd_timer_handler);
-	_scumm->_timer->installTimerProc(&cd_timer_handler, 1000 * timer_interval, _scumm);
+	_vm->_timer->removeTimerProc(&cd_timer_handler);
+	_vm->_timer->installTimerProc(&cd_timer_handler, 1000 * timer_interval, _vm);
 }
 
 void Sound::stopCDTimer() {
-	_scumm->_timer->removeTimerProc(&cd_timer_handler);
+	_vm->_timer->removeTimerProc(&cd_timer_handler);
 }
 
 void Sound::playCDTrack(int track, int numLoops, int startFrame, int duration) {
 	// Reset the music timer variable at the start of a new track
-	_scumm->VAR(_scumm->VAR_MUSIC_TIMER) = 0;
+	_vm->VAR(_vm->VAR_MUSIC_TIMER) = 0;
 
 	// Play it
 	if (!_soundsPaused)

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- sound.h	6 Jan 2004 12:45:30 -0000	1.61
+++ sound.h	8 Jan 2004 20:37:25 -0000	1.62
@@ -56,7 +56,7 @@
 
 	int _currentCDSound;
 
-	ScummEngine *_scumm;
+	ScummEngine *_vm;
 
 public:
 	PlayingSoundHandle _talkChannelHandle;	// Handle of mixer channel actor is talking on





More information about the Scummvm-git-logs mailing list