[Scummvm-cvs-logs] SF.net SVN: scummvm:[46194] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Nov 29 14:52:03 CET 2009


Revision: 46194
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46194&view=rev
Author:   lordhoto
Date:     2009-11-29 13:52:02 +0000 (Sun, 29 Nov 2009)

Log Message:
-----------
Cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_hof.cpp
    scummvm/trunk/engines/kyra/kyra_lok.cpp
    scummvm/trunk/engines/kyra/sequences_hof.cpp
    scummvm/trunk/engines/kyra/sound.h
    scummvm/trunk/engines/kyra/sound_intern.h
    scummvm/trunk/engines/kyra/sound_lok.cpp
    scummvm/trunk/engines/kyra/sound_towns.cpp
    scummvm/trunk/engines/kyra/staticres.cpp

Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp	2009-11-29 13:42:14 UTC (rev 46193)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp	2009-11-29 13:52:02 UTC (rev 46194)
@@ -313,7 +313,7 @@
 
 		if (_flags.platform == Common::kPlatformPC98) {
 			_res->loadPakFile("AUDIO.PAK");
-			_sound->loadSoundFile("sound.dat");
+			_sound->loadSoundFile("SOUND.DAT");
 		}
 	}
 

Modified: scummvm/trunk/engines/kyra/kyra_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.cpp	2009-11-29 13:42:14 UTC (rev 46193)
+++ scummvm/trunk/engines/kyra/kyra_lok.cpp	2009-11-29 13:52:02 UTC (rev 46194)
@@ -197,13 +197,7 @@
 	if (!_sound->init())
 		error("Couldn't init sound");
 
-	if (_flags.platform == Common::kPlatformPC98) {
-		int sfxSize;
-		const uint8 *sfxData = _staticres->loadRawData(k1PC98IntroSfx, sfxSize);
-		_sound->loadSoundFile(sfxData, sfxSize);
-	} else {
-		_sound->loadSoundFile(0);
-	}
+	_sound->loadSoundFile(0);
 
 	setupButtonData();
 
@@ -348,7 +342,7 @@
 	
 	_sound->setSoundList(&_soundData[kMusicIngame]);
 	if (_flags.platform == Common::kPlatformPC98)
-		_sound->loadSoundFile("se.dat");
+		_sound->loadSoundFile("SE.DAT");
 	else
 		_sound->loadSoundFile(0);
 

Modified: scummvm/trunk/engines/kyra/sequences_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_hof.cpp	2009-11-29 13:42:14 UTC (rev 46193)
+++ scummvm/trunk/engines/kyra/sequences_hof.cpp	2009-11-29 13:52:02 UTC (rev 46194)
@@ -2772,7 +2772,7 @@
 	_res->loadFileList(_sequencePakList, _sequencePakListSize);
 
 	if (_flags.platform == Common::kPlatformPC98)
-		_sound->loadSoundFile("sound.dat");
+		_sound->loadSoundFile("SOUND.DAT");
 
 	_screen->setFont(_flags.lang == Common::JA_JPN ? Screen::FID_SJIS_FNT : Screen::FID_GOLDFONT_FNT);
 

Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h	2009-11-29 13:42:14 UTC (rev 46193)
+++ scummvm/trunk/engines/kyra/sound.h	2009-11-29 13:52:02 UTC (rev 46194)
@@ -83,14 +83,14 @@
 	 * Sets the soundfiles the output device will use
 	 * when playing a track and/or sound effect.
 	 *
-	 * @param list	soundfile list
+	 * @param list soundfile list
 	 */
 	virtual void setSoundList(const AudioDataStruct *list) { _soundDataList = list; }
 
 	/**
 	 * Checks if a given sound file is present.
 	 *
-	 * @param track	track number
+	 * @param track track number
 	 * @return true if available, false otherwise
 	 */
 	virtual bool hasSoundFile(uint file) { return (fileListEntry(file) != 0); }
@@ -108,12 +108,6 @@
 	virtual void loadSoundFile(Common::String file) = 0;
 
 	/**
-	 * Load static data for playing sound
-	 * effects from.
-	 */
-	virtual void loadSoundFile(const uint8 *soundData, int dataSize) = 0;
-
-	/**
 	 * Load a sound file for playing sound
 	 * effects from.
 	 */
@@ -122,7 +116,7 @@
 	/**
 	 * Plays the specified track.
 	 *
-	 * @param track	track number
+	 * @param track track number
 	 */
 	virtual void playTrack(uint8 track) = 0;
 
@@ -134,7 +128,7 @@
 	/**
 	 * Plays the specified sound effect.
 	 *
-	 * @param track	sound effect id
+	 * @param track sound effect id
 	 */
 	virtual void playSoundEffect(uint8 track) = 0;
 
@@ -274,7 +268,6 @@
 	bool hasSoundFile(uint file) const { return _music->hasSoundFile(file) && _sfx->hasSoundFile(file); }
 	void loadSoundFile(uint file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); }
 	void loadSoundFile(Common::String file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); }
-	void loadSoundFile(const uint8 *soundData, int dataSize) { _sfx->loadSoundFile(soundData, dataSize); }
 	
 	void loadSfxFile(Common::String file) { _sfx->loadSoundFile(file); }
 

Modified: scummvm/trunk/engines/kyra/sound_intern.h
===================================================================
--- scummvm/trunk/engines/kyra/sound_intern.h	2009-11-29 13:42:14 UTC (rev 46193)
+++ scummvm/trunk/engines/kyra/sound_intern.h	2009-11-29 13:52:02 UTC (rev 46194)
@@ -62,7 +62,6 @@
 
 	void loadSoundFile(uint file);
 	void loadSoundFile(Common::String file);
-	void loadSoundFile(const uint8 *soundData, int dataSize) {}
 	void loadSfxFile(Common::String file);
 
 	void playTrack(uint8 track);
@@ -115,7 +114,6 @@
 
 	void loadSoundFile(uint file);
 	void loadSoundFile(Common::String) {}
-	void loadSoundFile(const uint8 *soundData, int dataSize) {}
 
 	void playTrack(uint8 track);
 	void haltTrack();
@@ -172,9 +170,8 @@
 	bool init();
 
 	void process() {}
-	void loadSoundFile(uint file) {}
+	void loadSoundFile(uint file);
 	void loadSoundFile(Common::String file);
-	void loadSoundFile(const uint8 *soundData, int dataSize);
 
 	void playTrack(uint8 track);
 	void haltTrack();
@@ -202,7 +199,6 @@
 
 	void loadSoundFile(uint file) {}
 	void loadSoundFile(Common::String file);
-	void loadSoundFile(const uint8 *soundData, int dataSize) {}
 
 	void playTrack(uint8 track);
 	void haltTrack();
@@ -310,7 +306,6 @@
 	void process() {}
 	void loadSoundFile(uint file);
 	void loadSoundFile(Common::String) {}
-	void loadSoundFile(const uint8 *soundData, int dataSize) {}
 
 	void playTrack(uint8 track);
 	void haltTrack();

Modified: scummvm/trunk/engines/kyra/sound_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_lok.cpp	2009-11-29 13:42:14 UTC (rev 46193)
+++ scummvm/trunk/engines/kyra/sound_lok.cpp	2009-11-29 13:52:02 UTC (rev 46194)
@@ -52,7 +52,7 @@
 		if (command == 1) {
 			_sound->beginFadeOut();
 		} else if (command >= 35 && command <= 38) {
-			snd_playSoundEffect(command-20);
+			snd_playSoundEffect(command - 20);
 		} else if (command >= 2) {
 			if (_lastMusicCommand != command)
 				// the original does -2 here we handle this inside _sound->playTrack()

Modified: scummvm/trunk/engines/kyra/sound_towns.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_towns.cpp	2009-11-29 13:42:14 UTC (rev 46193)
+++ scummvm/trunk/engines/kyra/sound_towns.cpp	2009-11-29 13:52:02 UTC (rev 46194)
@@ -4014,13 +4014,13 @@
 	static const float noteFrq[] = {
 		0004.13f, 0004.40f, 0004.64f, 0004.95f, 0005.16f, 0005.50f, 0005.80f, 0006.19f, 0006.60f, 0006.86f,
 		0007.43f, 0007.73f, 0008.25f, 0008.80f, 0009.28f, 0009.90f, 0010.31f, 0011.00f, 0011.60f, 0012.38f,
-		0013.20f, 0013.75f, 0014.85f, 0015.47f,	0016.50f, 0017.60f, 0018.56f, 0019.80f, 0020.63f, 0022.00f,
+		0013.20f, 0013.75f, 0014.85f, 0015.47f, 0016.50f, 0017.60f, 0018.56f, 0019.80f, 0020.63f, 0022.00f,
 		0023.21f, 0024.75f, 0026.40f, 0027.50f, 0029.70f, 0030.94f, 0033.00f, 0035.20f, 0037.16f, 0039.60f,
 		0041.25f, 0044.00f, 0046.41f, 0049.50f, 0052.80f, 0055.00f, 0059.40f, 0061.88f, 0066.00f, 0070.40f,
 		0074.25f, 0079.20f, 0082.50f, 0088.00f, 0092.83f, 0099.00f, 0105.60f, 0110.00f, 0118.80f, 0123.75f,
 		0132.00f, 0140.80f, 0148.50f, 0158.40f, 0165.00f, 0176.00f, 0185.65f, 0198.00f, 0211.20f, 0220.00f,
 		0237.60f, 0247.50f, 0264.00f, 0281.60f, 0297.00f, 0316.80f, 0330.00f, 0352.00f, 0371.30f, 0396.00f,
-		0422.40f, 0440.00f, 0475.20f, 0495.00f,	0528.00f, 0563.20f, 0594.00f, 0633.60f, 0660.00f, 0704.00f,
+		0422.40f, 0440.00f, 0475.20f, 0495.00f, 0528.00f, 0563.20f, 0594.00f, 0633.60f, 0660.00f, 0704.00f,
 		0742.60f, 0792.00f, 0844.80f, 0880.00f, 0950.40f, 0990.00f, 1056.00f, 1126.40f, 1188.00f, 1267.20f,
 		1320.00f, 1408.00f, 1485.20f, 1584.00f, 1689.60f, 1760.00f, 1900.80f, 1980.00f, 2112.00f, 2252.80f,
 		2376.00f, 2534.40f, 2640.00f, 2816.00f, 2970.40f, 3168.00f, 3379.20f, 3520.00f, 3801.60f, 3960.00f
@@ -4031,7 +4031,7 @@
 	float rateshift = (noteFrq[semiTone] - ((noteFrq[semiTone] -
 		noteFrq[semiTone + d]) * pwModifier * d)) / noteFrq[semiToneRootkey];
 
-	return (float) sampleRate * 10.0f * rateshift / outputRate;
+	return (float)sampleRate * 10.0f * rateshift / outputRate;
 }
 
 SoundPC98::SoundPC98(KyraEngine_v1 *vm, Audio::Mixer *mixer) :
@@ -4049,15 +4049,27 @@
 	return _driver->init();
 }
 
-void SoundPC98::loadSoundFile(Common::String file) {
-	delete[] _sfxTrackData;	
-	_sfxTrackData = _vm->resource()->fileData(file.c_str(), 0);
+void SoundPC98::loadSoundFile(uint file) {
+	if (!scumm_strnicmp(fileListEntry(0), "INTRO", 5)) {
+		delete[] _sfxTrackData;
+		_sfxTrackData = 0;
+
+		int dataSize = 0;
+		const uint8 *tmp = _vm->staticres()->loadRawData(k1PC98IntroSfx, dataSize);
+
+		if (!tmp) {
+			warning("Could not load static intro sound effects data\n");
+			return;
+		}
+
+		_sfxTrackData = new uint8[dataSize];
+		memcpy(_sfxTrackData, tmp, dataSize);
+	}
 }
 
-void SoundPC98::loadSoundFile(const uint8 *soundData, int dataSize) {
+void SoundPC98::loadSoundFile(Common::String file) {
 	delete[] _sfxTrackData;
-	_sfxTrackData = new uint8[dataSize];
-	memcpy(_sfxTrackData, soundData, dataSize);
+	_sfxTrackData = _vm->resource()->fileData(file.c_str(), 0);
 }
 
 void SoundPC98::playTrack(uint8 track) {

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2009-11-29 13:42:14 UTC (rev 46193)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2009-11-29 13:52:02 UTC (rev 46194)
@@ -1024,8 +1024,8 @@
 	}
 
 	// audio data tables
-	static const char *tIntro98[] = { "intro%d.dat" };
-	static const char *tIngame98[] = { "kyram%d.dat" };
+	static const char *tIntro98[] = { "INTRO%d.DAT" };
+	static const char *tIngame98[] = { "KYRAM%d.DAT" };
 
 	// FIXME: It seems Kyra1 MAC CD includes AdLib and MIDI music and sfx, thus we enable
 	// support for those for now. (Based on patch #2767489 "Support for Mac Kyrandia 1 CD" by satz).


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