[Scummvm-cvs-logs] SF.net SVN: scummvm: [31771] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Tue Apr 29 16:22:05 CEST 2008
Revision: 31771
http://scummvm.svn.sourceforge.net/scummvm/?rev=31771&view=rev
Author: lordhoto
Date: 2008-04-29 07:22:04 -0700 (Tue, 29 Apr 2008)
Log Message:
-----------
Prevent analog sound driver to be created for Kyra3.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/detection.cpp
scummvm/trunk/engines/kyra/kyra.cpp
scummvm/trunk/engines/kyra/kyra.h
scummvm/trunk/engines/kyra/kyra_v1.cpp
Modified: scummvm/trunk/engines/kyra/detection.cpp
===================================================================
--- scummvm/trunk/engines/kyra/detection.cpp 2008-04-29 14:08:08 UTC (rev 31770)
+++ scummvm/trunk/engines/kyra/detection.cpp 2008-04-29 14:22:04 UTC (rev 31771)
@@ -41,22 +41,22 @@
namespace {
-#define FLAGS(x, y, z, a, id) { Common::UNK_LANG, Common::kPlatformUnknown, x, y, z, a, id }
+#define FLAGS(x, y, z, a, b, id) { Common::UNK_LANG, Common::kPlatformUnknown, x, y, z, a, b, id }
-#define KYRA1_FLOPPY_FLAGS FLAGS(false, false, false, false, Kyra::GI_KYRA1)
-#define KYRA1_AMIGA_FLAGS FLAGS(false, false, false, false, Kyra::GI_KYRA1)
-#define KYRA1_TOWNS_FLAGS FLAGS(false, true, false, false, Kyra::GI_KYRA1)
-#define KYRA1_TOWNS_SJIS_FLAGS FLAGS(false, true, false, true, Kyra::GI_KYRA1)
-#define KYRA1_CD_FLAGS FLAGS(false, true, true, false, Kyra::GI_KYRA1)
-#define KYRA1_DEMO_FLAGS FLAGS(true, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_FLOPPY_FLAGS FLAGS(false, false, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_AMIGA_FLAGS FLAGS(false, false, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_TOWNS_FLAGS FLAGS(false, true, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_TOWNS_SJIS_FLAGS FLAGS(false, true, false, true, false, Kyra::GI_KYRA1)
+#define KYRA1_CD_FLAGS FLAGS(false, true, true, false, false, Kyra::GI_KYRA1)
+#define KYRA1_DEMO_FLAGS FLAGS(true, false, false, false, false, Kyra::GI_KYRA1)
-#define KYRA2_CD_FLAGS FLAGS(false, false, true, false, Kyra::GI_KYRA2)
-#define KYRA2_CD_DEMO_FLAGS FLAGS(true, false, true, false, Kyra::GI_KYRA2)
-#define KYRA2_DEMO_FLAGS FLAGS(true, false, false, false, Kyra::GI_KYRA2)
-#define KYRA2_TOWNS_FLAGS FLAGS(false, false, false, false, Kyra::GI_KYRA2)
-#define KYRA2_TOWNS_SJIS_FLAGS FLAGS(false, false, false, true, Kyra::GI_KYRA2)
+#define KYRA2_CD_FLAGS FLAGS(false, false, true, false, false, Kyra::GI_KYRA2)
+#define KYRA2_CD_DEMO_FLAGS FLAGS(true, false, true, false, false, Kyra::GI_KYRA2)
+#define KYRA2_DEMO_FLAGS FLAGS(true, false, false, false, false, Kyra::GI_KYRA2)
+#define KYRA2_TOWNS_FLAGS FLAGS(false, false, false, false, false, Kyra::GI_KYRA2)
+#define KYRA2_TOWNS_SJIS_FLAGS FLAGS(false, false, false, true, false, Kyra::GI_KYRA2)
-#define KYRA3_CD_FLAGS FLAGS(false, false, true, false, Kyra::GI_KYRA3)
+#define KYRA3_CD_FLAGS FLAGS(false, false, true, false, true, Kyra::GI_KYRA3)
const KYRAGameDescription adGameDescs[] = {
{
@@ -435,7 +435,7 @@
KYRA3_CD_FLAGS
},
- { AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0) }
+ { AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0, 0) }
};
const PlainGameDescriptor gameList[] = {
Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp 2008-04-29 14:08:08 UTC (rev 31770)
+++ scummvm/trunk/engines/kyra/kyra.cpp 2008-04-29 14:22:04 UTC (rev 31771)
@@ -39,7 +39,7 @@
namespace Kyra {
KyraEngine::KyraEngine(OSystem *system, const GameFlags &flags)
- : Engine(system) {
+ : Engine(system), _flags(flags) {
_res = 0;
_sound = 0;
_text = 0;
@@ -47,7 +47,6 @@
_timer = 0;
_scriptInterpreter = 0;
- _flags = flags;
_gameSpeed = 60;
_tickLength = (uint8)(1000.0 / _gameSpeed);
@@ -87,50 +86,53 @@
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
- // We prefer AdLib over native MIDI, since our AdLib playback code is much
- // more mature than our MIDI player. For example we are missing MT-32 support
- // and it seems our MIDI playback code has threading issues (see bug #1506583
- // "KYRA1: Crash on exceeded polyphony" for more information).
- int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB/* | MDT_PREFER_MIDI*/);
+ if (!_flags.useDigSound) {
+ // We prefer AdLib over native MIDI, since our AdLib playback code is much
+ // more mature than our MIDI player. For example we are missing MT-32 support
+ // and it seems our MIDI playback code has threading issues (see bug #1506583
+ // "KYRA1: Crash on exceeded polyphony" for more information).
+ int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB/* | MDT_PREFER_MIDI*/);
- if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
- // TODO: currently we don't support the PC98 sound data,
- // but since it has the FM-Towns data files, we just use the
- // FM-Towns driver
- if (_flags.gameID == GI_KYRA1)
- _sound = new SoundTowns(this, _mixer);
- else
- _sound = new SoundTowns_v2(this, _mixer);
- } else if (midiDriver == MD_ADLIB) {
- _sound = new SoundAdlibPC(this, _mixer);
- assert(_sound);
- } else {
- bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
+ // TODO: currently we don't support the PC98 sound data,
+ // but since it has the FM-Towns data files, we just use the
+ // FM-Towns driver
+ if (_flags.gameID == GI_KYRA1)
+ _sound = new SoundTowns(this, _mixer);
+ else
+ _sound = new SoundTowns_v2(this, _mixer);
+ } else if (midiDriver == MD_ADLIB) {
+ _sound = new SoundAdlibPC(this, _mixer);
+ assert(_sound);
+ } else {
+ bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
- MidiDriver *driver = MidiDriver::createMidi(midiDriver);
- assert(driver);
- if (native_mt32)
- driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
+ MidiDriver *driver = MidiDriver::createMidi(midiDriver);
+ assert(driver);
+ if (native_mt32)
+ driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
- SoundMidiPC *soundMidiPc = new SoundMidiPC(this, _mixer, driver);
- _sound = soundMidiPc;
- assert(_sound);
- soundMidiPc->hasNativeMT32(native_mt32);
+ SoundMidiPC *soundMidiPc = new SoundMidiPC(this, _mixer, driver);
+ _sound = soundMidiPc;
+ assert(_sound);
+ soundMidiPc->hasNativeMT32(native_mt32);
- // Unlike some SCUMM games, it's not that the MIDI sounds are
- // missing. It's just that at least at the time of writing they
- // are decidedly inferior to the Adlib ones.
- if (ConfMan.getBool("multi_midi")) {
- SoundAdlibPC *adlib = new SoundAdlibPC(this, _mixer);
- assert(adlib);
+ // Unlike some SCUMM games, it's not that the MIDI sounds are
+ // missing. It's just that at least at the time of writing they
+ // are decidedly inferior to the Adlib ones.
+ if (ConfMan.getBool("multi_midi")) {
+ SoundAdlibPC *adlib = new SoundAdlibPC(this, _mixer);
+ assert(adlib);
- _sound = new MixedSoundDriver(this, _mixer, soundMidiPc, adlib);
- assert(_sound);
+ _sound = new MixedSoundDriver(this, _mixer, soundMidiPc, adlib);
+ assert(_sound);
+ }
}
}
if (_sound)
_sound->updateVolumeSettings();
+
_res = new Resource(this);
assert(_res);
_res->reset();
Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h 2008-04-29 14:08:08 UTC (rev 31770)
+++ scummvm/trunk/engines/kyra/kyra.h 2008-04-29 14:22:04 UTC (rev 31771)
@@ -47,10 +47,13 @@
struct GameFlags {
Common::Language lang;
Common::Platform platform;
- bool isDemo;
- bool useAltShapeHeader; // alternative shape header (uses 2 bytes more, those are unused though)
- bool isTalkie;
- bool useHiResOverlay;
+
+ bool isDemo : 1;
+ bool useAltShapeHeader : 1; // alternative shape header (uses 2 bytes more, those are unused though)
+ bool isTalkie : 1;
+ bool useHiResOverlay : 1;
+ bool useDigSound : 1;
+
byte gameID;
};
Modified: scummvm/trunk/engines/kyra/kyra_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.cpp 2008-04-29 14:08:08 UTC (rev 31770)
+++ scummvm/trunk/engines/kyra/kyra_v1.cpp 2008-04-29 14:22:04 UTC (rev 31771)
@@ -49,7 +49,6 @@
KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
: KyraEngine(system, flags) {
_skipFlag = false;
- _flags = flags;
_seq_Forest = _seq_KallakWriting = _seq_KyrandiaLogo = _seq_KallakMalcolm =
_seq_MalcolmTree = _seq_WestwoodLogo = _seq_Demo1 = _seq_Demo2 = _seq_Demo3 =
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