[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.72,1.73

Max Horn fingolfin at users.sourceforge.net
Wed Nov 13 05:43:02 CET 2002


Update of /cvsroot/scummvm/scummvm/simon
In directory usw-pr-cvs1:/tmp/cvs-serv7350/simon

Modified Files:
	simon.cpp 
Log Message:
cleanup

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- simon.cpp	13 Nov 2002 07:58:26 -0000	1.72
+++ simon.cpp	13 Nov 2002 13:42:16 -0000	1.73
@@ -4674,11 +4674,15 @@
 
 void SimonState::initSound()
 {
+	uint i;
 	/* only read voice file in windows game */
 	if (_game & GAME_TALKIE) {
 		const char *s;
 		const char *e;
 
+		//
+		// Load voice file
+		//
 		_voice_offsets = NULL;
 		_voice_file = new File();
 		_voice_type = FORMAT_NONE;
@@ -4725,6 +4729,10 @@
 	
 			if (_voice_file->read(_voice_offsets, gss->NUM_VOICE_RESOURCES * sizeof(uint32)) != gss->NUM_VOICE_RESOURCES * sizeof(uint32))
 				error("Cannot read voice offsets");
+#ifdef SCUMM_BIG_ENDIAN
+			for (i = 0; i < gss->NUM_VOICE_RESOURCES; i++)
+				_voice_offsets[i] = FROM_LE_32(_voice_offsets[i]);
+#endif
 #ifdef USE_MAD
 			if (_voice_type == FORMAT_MP3) {
 				uint8 buf[2048];
@@ -4740,6 +4748,9 @@
 #endif
 		}
 
+		//
+		// Load effects
+		//
 		_effects_offsets = NULL;
 		_effects_file = new File();
 		_effects_type = FORMAT_VOC;
@@ -4772,6 +4783,10 @@
 
 			if (_effects_file->read(_effects_offsets, gss->NUM_EFFECTS_RESOURCES * sizeof(uint32)) != gss->NUM_EFFECTS_RESOURCES * sizeof(uint32))
 				error("Cannot read effects offsets");
+#ifdef SCUMM_BIG_ENDIAN
+			for (i = 0; i < gss->NUM_EFFECTS_RESOURCES; i++)
+				_effects_offsets[i] = FROM_LE_32(_effects_offsets[i]);
+#endif
 #ifdef USE_MAD
 			if (_effects_type == FORMAT_MP3) {
 				uint8 buf[2048];
@@ -4789,18 +4804,6 @@
 			_effects_type = FORMAT_NONE;
 		}
 
-#if defined(SCUMM_BIG_ENDIAN)
-		uint r;
-		if (_voice_offsets) {
-			for (r = 0; r < gss->NUM_VOICE_RESOURCES; r++)
-				_voice_offsets[r] = FROM_LE_32(_voice_offsets[r]);
-		}
-
-		if (_effects_offsets) {
-			for (r = 0; r < gss->NUM_EFFECTS_RESOURCES; r++)
-				_effects_offsets[r] = FROM_LE_32(_effects_offsets[r]);
-		}
-#endif
 	}
 }
 





More information about the Scummvm-git-logs mailing list