[Scummvm-cvs-logs] CVS: scummvm/scumm bundle.cpp,1.37,1.38 bundle.h,1.14,1.15 resource.cpp,1.81,1.82 sound.cpp,1.117,1.118

Max Horn fingolfin at users.sourceforge.net
Tue May 20 04:57:06 CEST 2003


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

Modified Files:
	bundle.cpp bundle.h resource.cpp sound.cpp 
Log Message:
init all Bundle members properly; make _voiceFile/_musicFile protected

Index: bundle.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/bundle.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- bundle.cpp	18 May 2003 21:14:47 -0000	1.37
+++ bundle.cpp	20 May 2003 11:56:36 -0000	1.38
@@ -93,11 +93,17 @@
 };
 
 Bundle::Bundle() {
-	_lastSong = -1;
-	_initializedImcTables = false;
+	_compVoiceTable = NULL;
+	_compMusicTable = NULL;
 
 	_bundleVoiceTable = NULL;
 	_bundleMusicTable = NULL;
+	
+	_numVoiceFiles = 0;
+	_numMusicFiles = 0;
+
+	_lastSong = -1;
+	_initializedImcTables = false;
 }
 
 Bundle::~Bundle() {

Index: bundle.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/bundle.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- bundle.h	7 Mar 2003 07:49:10 -0000	1.14
+++ bundle.h	20 May 2003 11:56:36 -0000	1.15
@@ -28,20 +28,18 @@
 
 private:
 
-struct CompTable {
-	int32 offset;
-	int32 size;
-	int32 codec;
-};
-
-struct BundleAudioTable {
-	char filename[13];
-	int32 size;
-	int32 offset;
-};
-
-	int32 compDecode(byte *src, byte *dst);
-	int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 size);
+	struct CompTable {
+		int32 offset;
+		int32 size;
+		int32 codec;
+	};
+	
+	struct BundleAudioTable {
+		char filename[13];
+		int32 size;
+		int32 offset;
+	};
+	
 	CompTable *_compVoiceTable;
 	CompTable *_compMusicTable;
 	BundleAudioTable *_bundleVoiceTable;
@@ -54,15 +52,21 @@
 	byte _destImcTable[93];
 	uint32 _destImcTable2[5697];
 
+	File _voiceFile;
+	File _musicFile;
+
+	int32 compDecode(byte *src, byte *dst);
+	int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 size);
+
 public:
-	  Bundle();
-	 ~Bundle();
+	Bundle();
+	~Bundle();
 
-	File _musicFile;
-	File _voiceFile;
 	void initializeImcTables();
 	bool openVoiceFile(const char *filename, const char *directory);
 	bool openMusicFile(const char *filename, const char *directory);
+	void closeVoiceFile() { _voiceFile.close(); }
+	void closeMusicFile() { _musicFile.close(); }
 	int32 decompressVoiceSampleByName(char *name, byte **comp_final);
 	int32 decompressVoiceSampleByIndex(int32 index, byte **comp_final);
 	int32 decompressMusicSampleByName(char *name, int32 number, byte *comp_final);

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- resource.cpp	19 May 2003 08:42:10 -0000	1.81
+++ resource.cpp	20 May 2003 11:56:36 -0000	1.82
@@ -225,8 +225,8 @@
 	if (_features & GF_AFTER_V8) {
 		char result;
 
-		_bundle->_voiceFile.close();
-		_bundle->_musicFile.close();
+		_bundle->closeVoiceFile();
+		_bundle->closeMusicFile();
 
 		sprintf(buf, "Cannot find file: '%s'\nInsert disc %d into drive %s\nHit Ok to retry, Cancel to exit", filename, disknum, getGameDataPath());
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- sound.cpp	19 May 2003 18:49:16 -0000	1.117
+++ sound.cpp	20 May 2003 11:56:36 -0000	1.118
@@ -1041,7 +1041,7 @@
 			char bunfile[20];
 			sprintf(bunfile, "musdisk%d.bun", _scumm->VAR(_scumm->VAR_CURRENTDISK));
 			if (_musicDisk != _scumm->VAR(_scumm->VAR_CURRENTDISK)) 
-				_scumm->_bundle->_musicFile.close();
+				_scumm->_bundle->closeMusicFile();
 
 			if (_scumm->_bundle->openMusicFile(bunfile, _scumm->getGameDataPath()) == false) {
 				if (_scumm->_bundle->openMusicFile("music.bun", _scumm->getGameDataPath()) == false) {
@@ -1226,7 +1226,7 @@
 		char voxfile[20];
 		sprintf(voxfile, "voxdisk%d.bun", _scumm->VAR(_scumm->VAR_CURRENTDISK));
 		if (_voiceDisk != _scumm->VAR(_scumm->VAR_CURRENTDISK))
-			_scumm->_bundle->_voiceFile.close();
+			_scumm->_bundle->closeVoiceFile();
 
 		result = _scumm->_bundle->openVoiceFile(voxfile, _scumm->getGameDataPath());
 





More information about the Scummvm-git-logs mailing list