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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Apr 23 14:57:01 CEST 2006


Revision: 22118
Author:   fingolfin
Date:     2006-04-23 14:56:09 -0700 (Sun, 23 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22118&view=rev

Log Message:
-----------
Fix access to .he3/.he4 files

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/resource_he.cpp
    scummvm/trunk/engines/scumm/he/sound_he.cpp
    scummvm/trunk/engines/scumm/plugin.cpp
Modified: scummvm/trunk/engines/scumm/he/resource_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/resource_he.cpp	2006-04-23 20:02:33 UTC (rev 22117)
+++ scummvm/trunk/engines/scumm/he/resource_he.cpp	2006-04-23 21:56:09 UTC (rev 22118)
@@ -159,7 +159,7 @@
 	fi.file = new Common::File;
 
 	if (_fileName.empty()) { // We are running for the first time
-		_fileName = _vm->generateFilename(3);
+		_fileName = _vm->generateFilename(-3);
 	}
 
 
@@ -1282,7 +1282,7 @@
 	int size;
 
 	if (_fileName.empty()) { // We are running for the first time
-		_fileName = _vm->generateFilename(3);
+		_fileName = _vm->generateFilename(-3);
 
 		// Some programs write it as .bin. Try that too
 		if (!in.exists(_fileName)) {
@@ -1637,6 +1637,8 @@
 void ScummEngine_v70he::readGlobalObjects() {
 	int num = _fileHandle->readUint16LE();
 	assert(num == _numGlobalObjects);
+	assert(_objectStateTable);
+	assert(_objectOwnerTable);
 
 	_fileHandle->read(_objectStateTable, num);
 	_fileHandle->read(_objectOwnerTable, num);

Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-04-23 20:02:33 UTC (rev 22117)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-04-23 21:56:09 UTC (rev 22118)
@@ -282,7 +282,7 @@
 void SoundHE::setupHEMusicFile() {
 	int i, total_size;
 	Common::File musicFile;
-	Common::String buf(_vm->generateFilename(4));
+	Common::String buf(_vm->generateFilename(-4));
 
 	if (musicFile.open(buf) == true) {
 		musicFile.seek(4, SEEK_SET);
@@ -475,7 +475,7 @@
 	if (soundID > _vm->_numSounds) {
 		int music_offs;
 		Common::File musicFile;
-		Common::String buf(_vm->generateFilename(4));
+		Common::String buf(_vm->generateFilename(-4));
 
 		if (musicFile.open(buf) == false) {
 			warning("playHESound: Can't open music file %s", buf.c_str());
@@ -634,6 +634,7 @@
 	if (ConfMan.getBool("speech_mute"))
 		return;
 
+	assert(_sfxFile);
 	if (!_sfxFile->isOpen()) {
 		error("startHETalkSound: Speech file is not open");
 		return;

Modified: scummvm/trunk/engines/scumm/plugin.cpp
===================================================================
--- scummvm/trunk/engines/scumm/plugin.cpp	2006-04-23 20:02:33 UTC (rev 22117)
+++ scummvm/trunk/engines/scumm/plugin.cpp	2006-04-23 21:56:09 UTC (rev 22118)
@@ -760,7 +760,7 @@
 }
 
 Common::String ScummEngine::generateFilename(const int room) const {
-	const int diskNumber = room ? res.roomno[rtRoom][room] : 0;
+	const int diskNumber = (room > 0) ? res.roomno[rtRoom][room] : 0;
 	char buf[128];
 
 	if (_game.version == 4) {
@@ -784,8 +784,9 @@
 		case kGenHEMac:
 		case kGenHEMacNoParens:
 		case kGenHEPC:
-			// FIXME: Not sure if the following HE section is quite correct...
-			if (_game.heversion >= 98) {
+			if (room < 0) {
+				id = '0' - room;
+			} else if (_game.heversion >= 98) {
 				int disk = 0;
 				if (_heV7DiskOffsets)
 					disk = _heV7DiskOffsets[room];


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