[Scummvm-cvs-logs] SF.net SVN: scummvm: [29569] scummvm/trunk/engines/agi

sev at users.sourceforge.net sev at users.sourceforge.net
Mon Nov 19 21:34:26 CET 2007


Revision: 29569
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29569&view=rev
Author:   sev
Date:     2007-11-19 12:34:26 -0800 (Mon, 19 Nov 2007)

Log Message:
-----------
Hook PC Speaker to Troll's Tale. Though pitch and duration are wrong

Modified Paths:
--------------
    scummvm/trunk/engines/agi/preagi.cpp
    scummvm/trunk/engines/agi/preagi.h
    scummvm/trunk/engines/agi/preagi_common.cpp
    scummvm/trunk/engines/agi/preagi_troll.cpp

Modified: scummvm/trunk/engines/agi/preagi.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi.cpp	2007-11-19 20:23:01 UTC (rev 29568)
+++ scummvm/trunk/engines/agi/preagi.cpp	2007-11-19 20:34:26 UTC (rev 29569)
@@ -149,7 +149,7 @@
 	}
 
 	_gfx = new GfxMgr(this);
-	_sound = new SoundMgr(this, _mixer);
+	//_sound = new SoundMgr(this, _mixer);
 	_picture = new PictureMgr(this, _gfx);
 	//_sprites = new SpritesMgr(this, _gfx);
 
@@ -171,8 +171,13 @@
 	_game.lineMinPrint = 0; // hardcoded
 
 	_gfx->initVideo();
-	_sound->initSound();
+	//_sound->initSound();
 
+	_speakerStream = new Audio::PCSpeaker(_mixer->getOutputRate());
+	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_speakerHandle,
+							_speakerStream, -1, 255, 0, false, true);
+
+
 	//_timer->installTimerProc(agiTimerFunctionLow, 10 * 1000, NULL);
 
 	_game.ver = -1;		// Don't display the conf file warning
@@ -191,7 +196,7 @@
 }
 
 PreAgiEngine::~PreAgiEngine() {
-
+	delete _speakerStream;
 }
 
 int PreAgiEngine::init() {

Modified: scummvm/trunk/engines/agi/preagi.h
===================================================================
--- scummvm/trunk/engines/agi/preagi.h	2007-11-19 20:23:01 UTC (rev 29568)
+++ scummvm/trunk/engines/agi/preagi.h	2007-11-19 20:34:26 UTC (rev 29569)
@@ -29,6 +29,8 @@
 #include "agi/agi.h"
 #include "agi/preagi_common.h"
 
+#include "sound/softsynth/pcspk.h"
+
 namespace Agi {
 
 class PreAgiEngine : public AgiBase {
@@ -88,8 +90,13 @@
 	// Saved Games
 	Common::SaveFileManager* getSaveFileMan() { return _saveFileMan; }
 
+	void playNote(int16 frequency, int32 length);
+
 private:
 	int _defaultColor;
+
+	Audio::PCSpeaker *_speakerStream;
+	Audio::SoundHandle _speakerHandle;
 };
 
 } // End of namespace Agi

Modified: scummvm/trunk/engines/agi/preagi_common.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_common.cpp	2007-11-19 20:23:01 UTC (rev 29568)
+++ scummvm/trunk/engines/agi/preagi_common.cpp	2007-11-19 20:34:26 UTC (rev 29569)
@@ -190,4 +190,9 @@
 	return 0;
 }
 
+void PreAgiEngine::playNote(int16 frequency, int32 length) {
+	_speakerStream->play(Audio::PCSpeaker::kWaveFormSquare, frequency, length);
+	_vm->_system->delayMillis(duration);
 }
+
+}

Modified: scummvm/trunk/engines/agi/preagi_troll.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_troll.cpp	2007-11-19 20:23:01 UTC (rev 29568)
+++ scummvm/trunk/engines/agi/preagi_troll.cpp	2007-11-19 20:34:26 UTC (rev 29569)
@@ -483,7 +483,7 @@
 		duration = READ_LE_UINT16(_gameData + ptr);
 		ptr += 2;
 
-		// playNote(freq, duration);
+		_vm->playNote(freq, duration);
 	}
 }
 


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