[Scummvm-cvs-logs] scummvm master -> c11ab39e785103766d0f6785728ede7fb2908aae

lordhoto lordhoto at gmail.com
Fri Nov 23 03:05:35 CET 2012


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
138db7f39d KYRA: Get rid of pointless SoundDigital::init method.
5a352da437 KYRA: Rename kReadSaveHeaderError to ReadSaveHeaderError.
10c4baad5f KYRA: Move SoundDigital declaration to its own header.
c11ab39e78 KYRA: Remove unnecessary forward declaration.


Commit: 138db7f39d1ade0a7c0718288e3dc8bb1a88faf8
    https://github.com/scummvm/scummvm/commit/138db7f39d1ade0a7c0718288e3dc8bb1a88faf8
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-11-22T17:54:28-08:00

Commit Message:
KYRA: Get rid of pointless SoundDigital::init method.

Changed paths:
    engines/kyra/kyra_mr.cpp
    engines/kyra/sound.h



diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index baf8881..fa75874 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -213,8 +213,6 @@ Common::Error KyraEngine_MR::init() {
 
 	_soundDigital = new SoundDigital(this, _mixer);
 	assert(_soundDigital);
-	if (!_soundDigital->init())
-		error("_soundDigital->init() failed");
 	KyraEngine_v1::_text = _text = new TextDisplayer_MR(this, _screen);
 	assert(_text);
 	_gui = new GUI_MR(this);
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h
index 057eb48..3a0eee7 100644
--- a/engines/kyra/sound.h
+++ b/engines/kyra/sound.h
@@ -344,8 +344,6 @@ public:
 	SoundDigital(KyraEngine_MR *vm, Audio::Mixer *mixer);
 	~SoundDigital();
 
-	bool init() { return true; }
-
 	/**
 	 * Plays a sound.
 	 *


Commit: 5a352da4378b411ce13e2285cedb6429f2e213af
    https://github.com/scummvm/scummvm/commit/5a352da4378b411ce13e2285cedb6429f2e213af
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-11-22T17:56:26-08:00

Commit Message:
KYRA: Rename kReadSaveHeaderError to ReadSaveHeaderError.

Changed paths:
    engines/kyra/detection.cpp
    engines/kyra/kyra_v1.h
    engines/kyra/saveload.cpp



diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index e422f3e..95c4acc 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -298,7 +298,7 @@ SaveStateDescriptor KyraMetaEngine::querySaveMetaInfos(const char *target, int s
 
 	if (in) {
 		Kyra::KyraEngine_v1::SaveHeader header;
-		Kyra::KyraEngine_v1::kReadSaveHeaderError error;
+		Kyra::KyraEngine_v1::ReadSaveHeaderError error;
 
 		error = Kyra::KyraEngine_v1::readSaveHeader(in, true, header);
 		delete in;
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 79903e6..cd04856 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -408,14 +408,14 @@ protected:
 		Graphics::Surface *thumbnail;
 	};
 
-	enum kReadSaveHeaderError {
+	enum ReadSaveHeaderError {
 		kRSHENoError = 0,
 		kRSHEInvalidType = 1,
 		kRSHEInvalidVersion = 2,
 		kRSHEIoError = 3
 	};
 
-	static kReadSaveHeaderError readSaveHeader(Common::SeekableReadStream *file, bool loadThumbnail, SaveHeader &header);
+	static ReadSaveHeaderError readSaveHeader(Common::SeekableReadStream *file, bool loadThumbnail, SaveHeader &header);
 
 	void loadGameStateCheck(int slot);
 	virtual Common::Error loadGameState(int slot) = 0;
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index 41ba1e5..bacfb62 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -37,7 +37,7 @@
 
 namespace Kyra {
 
-KyraEngine_v1::kReadSaveHeaderError KyraEngine_v1::readSaveHeader(Common::SeekableReadStream *in, bool loadThumbnail, SaveHeader &header) {
+KyraEngine_v1::ReadSaveHeaderError KyraEngine_v1::readSaveHeader(Common::SeekableReadStream *in, bool loadThumbnail, SaveHeader &header) {
 	uint32 type = in->readUint32BE();
 	header.originalSave = false;
 	header.oldHeader = false;
@@ -140,7 +140,7 @@ Common::SeekableReadStream *KyraEngine_v1::openSaveForReading(const char *filena
 	if (!(in = _saveFileMan->openForLoading(filename)))
 		return 0;
 
-	kReadSaveHeaderError errorCode = KyraEngine_v1::readSaveHeader(in, false, header);
+	ReadSaveHeaderError errorCode = KyraEngine_v1::readSaveHeader(in, false, header);
 	if (errorCode != kRSHENoError) {
 		if (errorCode == kRSHEInvalidType)
 			warning("No ScummVM Kyra engine savefile header");


Commit: 10c4baad5f3d6d595d6d957d6d0ccb1509acead3
    https://github.com/scummvm/scummvm/commit/10c4baad5f3d6d595d6d957d6d0ccb1509acead3
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-11-22T18:01:48-08:00

Commit Message:
KYRA: Move SoundDigital declaration to its own header.

Changed paths:
  A engines/kyra/sound_digital.h
    engines/kyra/gui_mr.cpp
    engines/kyra/kyra_mr.cpp
    engines/kyra/scene_mr.cpp
    engines/kyra/sound.h
    engines/kyra/sound_digital.cpp



diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp
index 37526f9..bcbfe27 100644
--- a/engines/kyra/gui_mr.cpp
+++ b/engines/kyra/gui_mr.cpp
@@ -25,7 +25,7 @@
 #include "kyra/text_mr.h"
 #include "kyra/resource.h"
 #include "kyra/timer.h"
-#include "kyra/sound.h"
+#include "kyra/sound_digital.h"
 
 #include "common/system.h"
 
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index fa75874..48ba96e 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -28,7 +28,7 @@
 #include "kyra/debugger.h"
 #include "kyra/gui_mr.h"
 #include "kyra/resource.h"
-#include "kyra/sound.h"
+#include "kyra/sound_digital.h"
 
 #include "common/system.h"
 #include "common/config-manager.h"
diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp
index d6df523..c9486d9 100644
--- a/engines/kyra/scene_mr.cpp
+++ b/engines/kyra/scene_mr.cpp
@@ -22,7 +22,7 @@
 
 #include "kyra/kyra_mr.h"
 #include "kyra/screen_mr.h"
-#include "kyra/sound.h"
+#include "kyra/sound_digital.h"
 #include "kyra/resource.h"
 
 #include "common/system.h"
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h
index 3a0eee7..9119fb4 100644
--- a/engines/kyra/sound.h
+++ b/engines/kyra/sound.h
@@ -329,86 +329,6 @@ private:
 	Sound *_music, *_sfx;
 };
 
-// Digital Audio
-class AUDStream;
-class KyraAudioStream;
-class KyraEngine_MR;
-
-/**
- * Digital audio output device.
- *
- * This is just used for Kyrandia 3.
- */
-class SoundDigital {
-public:
-	SoundDigital(KyraEngine_MR *vm, Audio::Mixer *mixer);
-	~SoundDigital();
-
-	/**
-	 * Plays a sound.
-	 *
-	 * @param filename  file to be played
-	 * @param priority  priority of the sound
-	 * @param type      type
-	 * @param volume    channel volume
-	 * @param loop      true if the sound should loop (endlessly)
-	 * @param channel   tell the sound player to use a specific channel for playback
-	 *
-	 * @return channel playing the sound
-	 */
-	int playSound(const char *filename, uint8 priority, Audio::Mixer::SoundType type, int volume = 255, bool loop = false, int channel = -1);
-
-	/**
-	 * Checks if a given channel is playing a sound.
-	 *
-	 * @param channel channel number to check
-	 * @return true if playing, else false
-	 */
-	bool isPlaying(int channel);
-
-	/**
-	 * Stop the playback of a sound in the given
-	 * channel.
-	 *
-	 * @param channel channel number
-	 */
-	void stopSound(int channel);
-
-	/**
-	 * Stops playback of all sounds.
-	 */
-	void stopAllSounds();
-
-	/**
-	 * Makes the sound in a given channel
-	 * fading out.
-	 *
-	 * @param channel channel number
-	 * @param ticks   fadeout time
-	 */
-	void beginFadeOut(int channel, int ticks);
-private:
-	KyraEngine_MR *_vm;
-	Audio::Mixer *_mixer;
-
-	struct Sound {
-		Audio::SoundHandle handle;
-
-		char filename[16];
-		uint8 priority;
-		KyraAudioStream *stream;
-	} _sounds[4];
-
-	struct AudioCodecs {
-		const char *fileext;
-		Audio::SeekableAudioStream *(*streamFunc)(
-			Common::SeekableReadStream *stream,
-			DisposeAfterUse::Flag disposeAfterUse);
-	};
-
-	static const AudioCodecs _supportedCodecs[];
-};
-
 } // End of namespace Kyra
 
 #endif
diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp
index fe0f1fb..6ff1c3d 100644
--- a/engines/kyra/sound_digital.cpp
+++ b/engines/kyra/sound_digital.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "kyra/sound.h"
+#include "kyra/sound_digital.h"
 #include "kyra/resource.h"
 #include "kyra/kyra_mr.h"
 
diff --git a/engines/kyra/sound_digital.h b/engines/kyra/sound_digital.h
new file mode 100644
index 0000000..8bf68fa
--- /dev/null
+++ b/engines/kyra/sound_digital.h
@@ -0,0 +1,120 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef KYRA_SOUND_DIGITAL_H
+#define KYRA_SOUND_DIGITAL_H
+
+#include "audio/mixer.h"
+
+namespace Common {
+class SeekableReadStream;
+} // End of namespace Common
+
+namespace Audio {
+class SeekableAudioStream;
+} // End of namespace Audio
+
+namespace Kyra {
+
+// Digital Audio
+class AUDStream;
+class KyraAudioStream;
+class KyraEngine_MR;
+
+/**
+ * Digital audio output device.
+ *
+ * This is just used for Kyrandia 3.
+ */
+class SoundDigital {
+public:
+	SoundDigital(KyraEngine_MR *vm, Audio::Mixer *mixer);
+	~SoundDigital();
+
+	/**
+	 * Plays a sound.
+	 *
+	 * @param filename  file to be played
+	 * @param priority  priority of the sound
+	 * @param type      type
+	 * @param volume    channel volume
+	 * @param loop      true if the sound should loop (endlessly)
+	 * @param channel   tell the sound player to use a specific channel for playback
+	 *
+	 * @return channel playing the sound
+	 */
+	int playSound(const char *filename, uint8 priority, Audio::Mixer::SoundType type, int volume = 255, bool loop = false, int channel = -1);
+
+	/**
+	 * Checks if a given channel is playing a sound.
+	 *
+	 * @param channel channel number to check
+	 * @return true if playing, else false
+	 */
+	bool isPlaying(int channel);
+
+	/**
+	 * Stop the playback of a sound in the given
+	 * channel.
+	 *
+	 * @param channel channel number
+	 */
+	void stopSound(int channel);
+
+	/**
+	 * Stops playback of all sounds.
+	 */
+	void stopAllSounds();
+
+	/**
+	 * Makes the sound in a given channel
+	 * fading out.
+	 *
+	 * @param channel channel number
+	 * @param ticks   fadeout time
+	 */
+	void beginFadeOut(int channel, int ticks);
+private:
+	KyraEngine_MR *_vm;
+	Audio::Mixer *_mixer;
+
+	struct Sound {
+		Audio::SoundHandle handle;
+
+		char filename[16];
+		uint8 priority;
+		KyraAudioStream *stream;
+	} _sounds[4];
+
+	struct AudioCodecs {
+		const char *fileext;
+		Audio::SeekableAudioStream *(*streamFunc)(
+			Common::SeekableReadStream *stream,
+			DisposeAfterUse::Flag disposeAfterUse);
+	};
+
+	static const AudioCodecs _supportedCodecs[];
+};
+
+} // End of namespace Kyra
+
+#endif


Commit: c11ab39e785103766d0f6785728ede7fb2908aae
    https://github.com/scummvm/scummvm/commit/c11ab39e785103766d0f6785728ede7fb2908aae
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-11-22T18:03:19-08:00

Commit Message:
KYRA: Remove unnecessary forward declaration.

Changed paths:
    engines/kyra/sound_digital.h



diff --git a/engines/kyra/sound_digital.h b/engines/kyra/sound_digital.h
index 8bf68fa..271dde6 100644
--- a/engines/kyra/sound_digital.h
+++ b/engines/kyra/sound_digital.h
@@ -36,7 +36,6 @@ class SeekableAudioStream;
 namespace Kyra {
 
 // Digital Audio
-class AUDStream;
 class KyraAudioStream;
 class KyraEngine_MR;
 






More information about the Scummvm-git-logs mailing list