[Scummvm-cvs-logs] SF.net SVN: scummvm:[53370] scummvm/trunk/engines/sword25

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Oct 13 01:57:26 CEST 2010


Revision: 53370
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53370&view=rev
Author:   sev
Date:     2010-10-12 23:57:26 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
SWORD25: Put all sound-related debug output under debug flag.

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/sfx/soundengine.cpp
    scummvm/trunk/engines/sword25/sword25.cpp
    scummvm/trunk/engines/sword25/sword25.h

Modified: scummvm/trunk/engines/sword25/sfx/soundengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/sfx/soundengine.cpp	2010-10-12 23:57:05 UTC (rev 53369)
+++ scummvm/trunk/engines/sword25/sfx/soundengine.cpp	2010-10-12 23:57:26 UTC (rev 53370)
@@ -34,6 +34,7 @@
 
 #define BS_LOG_PREFIX "SOUNDENGINE"
 
+#include "sword25/sword25.h"
 #include "sword25/sfx/soundengine.h"
 #include "sword25/package/packagemanager.h"
 #include "sword25/kernel/resource.h"
@@ -46,7 +47,7 @@
 public:
 	SoundResource(const Common::String &fileName) : Resource(fileName, Resource::TYPE_SOUND), _fname(fileName) {}
 	virtual ~SoundResource() {
-		debug(1, "Unloading file %s", _fname.c_str());
+		debugC(1, kDebugSound, "SoundResource: Unloading file %s", _fname.c_str());
 	}
 
 private:
@@ -89,13 +90,13 @@
 }
 
 void SoundEngine::PauseAll() {
-	debug(1, "SoundEngine::PauseAll()");
+	debugC(1, kDebugSound, "SoundEngine::PauseAll()");
 
 	_mixer->pauseAll(true);
 }
 
 void SoundEngine::ResumeAll() {
-	debug(1, "SoundEngine::ResumeAll()");
+	debugC(1, kDebugSound, "SoundEngine::ResumeAll()");
 
 	_mixer->pauseAll(false);
 }
@@ -111,14 +112,14 @@
 SndHandle *SoundEngine::getHandle(uint *id) {
 	for (uint i = 0; i < SOUND_HANDLES; i++) {
 		if (_handles[i].type != kFreeHandle && !_mixer->isSoundHandleActive(_handles[i].handle)) {
-			debug(5, "Handle %d has finished playing", i);
+			debugC(kDebugSound, 5, "Handle %d has finished playing", i);
 			_handles[i].type = kFreeHandle;
 		}
 	}
 
 	for (uint i = 0; i < SOUND_HANDLES; i++) {
 		if (_handles[i].type == kFreeHandle) {
-			debug(5, "Allocated handle %d", i);
+			debugC(kDebugSound, 5, "Allocated handle %d", i);
 			if (id)
 				*id = i;
 			return &_handles[i];
@@ -146,7 +147,7 @@
 }
 
 bool SoundEngine::PlaySound(const Common::String &fileName, SOUND_TYPES type, float volume, float pan, bool loop, int loopStart, int loopEnd, uint layer) {
-	debug(1, "SoundEngine::PlaySound(%s, %d, %f, %f, %d, %d, %d, %d)", fileName.c_str(), type, volume, pan, loop, loopStart, loopEnd, layer);
+	debugC(1, kDebugSound, "SoundEngine::PlaySound(%s, %d, %f, %f, %d, %d, %d, %d)", fileName.c_str(), type, volume, pan, loop, loopStart, loopEnd, layer);
 
 	PlaySoundEx(fileName, type, volume, pan, loop, loopStart, loopEnd, layer);
 
@@ -161,7 +162,7 @@
 
 	Resource *ResourcePtr = Kernel::GetInstance()->GetResourceManager()->RequestResource(fileName);
 
-	debug(1, "SoundEngine::PlaySoundEx(%s, %d, %f, %f, %d, %d, %d, %d)", fileName.c_str(), type, volume, pan, loop, loopStart, loopEnd, layer);
+	debugC(1, kDebugSound, "SoundEngine::PlaySoundEx(%s, %d, %f, %f, %d, %d, %d, %d)", fileName.c_str(), type, volume, pan, loop, loopStart, loopEnd, layer);
 
 	_mixer->playStream(getType(type), &(handle->handle), stream, -1, (byte)(volume * 255), (int8)(pan * 127));
 
@@ -171,7 +172,7 @@
 void SoundEngine::SetSoundVolume(uint handle, float volume) {
 	assert(handle < SOUND_HANDLES);
 
-	debug(1, "SoundEngine::SetSoundVolume(%d, %f)", handle, volume);
+	debugC(1, kDebugSound, "SoundEngine::SetSoundVolume(%d, %f)", handle, volume);
 
 	_mixer->setChannelVolume(_handles[handle].handle, (byte)(volume * 255));
 }
@@ -179,7 +180,7 @@
 void SoundEngine::SetSoundPanning(uint handle, float pan) {
 	assert(handle < SOUND_HANDLES);
 
-	debug(1, "SoundEngine::SetSoundPanning(%d, %f)", handle, pan);
+	debugC(1, kDebugSound, "SoundEngine::SetSoundPanning(%d, %f)", handle, pan);
 
 	_mixer->setChannelBalance(_handles[handle].handle, (int8)(pan * 127));
 }
@@ -187,7 +188,7 @@
 void SoundEngine::PauseSound(uint handle) {
 	assert(handle < SOUND_HANDLES);
 
-	debug(1, "SoundEngine::PauseSound(%d)", handle);
+	debugC(1, kDebugSound, "SoundEngine::PauseSound(%d)", handle);
 
 	_mixer->pauseHandle(_handles[handle].handle, true);
 }
@@ -195,7 +196,7 @@
 void SoundEngine::ResumeSound(uint handle) {
 	assert(handle < SOUND_HANDLES);
 
-	debug(1, "SoundEngine::ResumeSound(%d)", handle);
+	debugC(1, kDebugSound, "SoundEngine::ResumeSound(%d)", handle);
 
 	_mixer->pauseHandle(_handles[handle].handle, false);
 }
@@ -203,7 +204,7 @@
 void SoundEngine::StopSound(uint handle) {
 	assert(handle < SOUND_HANDLES);
 
-	debug(1, "SoundEngine::StopSound(%d)", handle);
+	debugC(1, kDebugSound, "SoundEngine::StopSound(%d)", handle);
 
 	_mixer->stopHandle(_handles[handle].handle);
 }
@@ -217,7 +218,7 @@
 bool SoundEngine::IsSoundPlaying(uint handle) {
 	assert(handle < SOUND_HANDLES);
 
-	debug(1, "SoundEngine::IsSoundPlaying(%d)", handle);
+	debugC(1, kDebugSound, "SoundEngine::IsSoundPlaying(%d)", handle);
 
 	return _mixer->isSoundHandleActive(_handles[handle].handle);
 }
@@ -249,7 +250,7 @@
 bool SoundEngine::CanLoadResource(const Common::String &fileName) {
 	Common::String fname = fileName;
 
-	debug(1, "SoundEngine::CanLoadResource(%s)", fileName.c_str());
+	debugC(1, kDebugSound, "SoundEngine::CanLoadResource(%s)", fileName.c_str());
 
 	fname.toLowercase();
 

Modified: scummvm/trunk/engines/sword25/sword25.cpp
===================================================================
--- scummvm/trunk/engines/sword25/sword25.cpp	2010-10-12 23:57:05 UTC (rev 53369)
+++ scummvm/trunk/engines/sword25/sword25.cpp	2010-10-12 23:57:26 UTC (rev 53370)
@@ -58,6 +58,8 @@
 	_gameDescription(gameDesc) {
 
 	DebugMan.addDebugChannel(kDebugScript, "Script", "Script debug level");
+	DebugMan.addDebugChannel(kDebugScript, "Scripts", "Script debug level");
+	DebugMan.addDebugChannel(kDebugSound, "Sound", "Sound debug level");
 }
 
 Sword25Engine::~Sword25Engine() {

Modified: scummvm/trunk/engines/sword25/sword25.h
===================================================================
--- scummvm/trunk/engines/sword25/sword25.h	2010-10-12 23:57:05 UTC (rev 53369)
+++ scummvm/trunk/engines/sword25/sword25.h	2010-10-12 23:57:26 UTC (rev 53370)
@@ -42,7 +42,8 @@
 };
 
 enum {
-	kDebugScript = 1 << 0
+	kDebugScript = 1 << 0,
+	kDebugSound = 1 << 1
 };
 
 enum GameFlags {


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