diff options
author | Max Horn | 2004-12-14 01:02:55 +0000 |
---|---|---|
committer | Max Horn | 2004-12-14 01:02:55 +0000 |
commit | 59b6a078266ee27d20315899e1b0cf650f01ecef (patch) | |
tree | f9827375acb7f7652ecf25a4df2d9964cb1a7b55 /base | |
parent | a6479b070d721b3ad154c0ec0fb9df5383e00b5e (diff) | |
download | scummvm-rg350-59b6a078266ee27d20315899e1b0cf650f01ecef.tar.gz scummvm-rg350-59b6a078266ee27d20315899e1b0cf650f01ecef.tar.bz2 scummvm-rg350-59b6a078266ee27d20315899e1b0cf650f01ecef.zip |
Evil workaround for bug #1083058
svn-id: r16045
Diffstat (limited to 'base')
-rw-r--r-- | base/main.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/base/main.cpp b/base/main.cpp index a276ec786c..4f5d125e62 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -39,6 +39,7 @@ #include "gui/newgui.h" #include "gui/launcher.h" #include "gui/message.h" +#include "sound/mididrv.h" #ifdef _WIN32_WCE #include "backends/wince/CELauncherDialog.h" @@ -437,3 +438,58 @@ void free_check(void *ptr) { } #endif */ + + +// WORKAROUND bug # 1083058: We put this here and not in sound/mididrv.cpp +// where it belongs to avoid the annoying behavior of some unix linkers (which +// leads to linker errors due to too much code being stripped from the binary. +MidiDriver *MidiDriver::createMidi(int midiDriver) { + switch(midiDriver) { + case MD_NULL: return MidiDriver_NULL_create(); + + // In the case of Adlib, we won't specify anything. + // IMuse is designed to set up its own Adlib driver + // if need be, and we only have to specify a native + // driver. + case MD_ADLIB: return NULL; + +#ifdef USE_MT32EMU + case MD_MT32: return MidiDriver_MT32_create(g_engine->_mixer); +#endif + + case MD_TOWNS: return MidiDriver_YM2612_create(g_engine->_mixer); + + // Right now PC Speaker and PCjr are handled + // outside the MidiDriver architecture, so + // don't create anything for now. + case MD_PCSPK: + case MD_PCJR: return NULL; +#if defined(__PALM_OS__) + case MD_YPA1: return MidiDriver_YamahaPa1_create(); +#ifndef DISABLE_TAPWAVE + case MD_ZODIAC: return MidiDriver_Zodiac_create(); +#endif +#endif +#if defined(WIN32) && !defined(_WIN32_WCE) + case MD_WINDOWS: return MidiDriver_WIN_create(); +#endif +#if defined(__MORPHOS__) + case MD_ETUDE: return MidiDriver_ETUDE_create(); +#endif +#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) + case MD_SEQ: return MidiDriver_SEQ_create(); +#endif +#if (defined(MACOSX) || defined(macintosh)) && !defined(__PALM_OS__) + case MD_QTMUSIC: return MidiDriver_QT_create(); +#endif +#if defined(MACOSX) + case MD_COREAUDIO: return MidiDriver_CORE_create(); +#endif +#if defined(UNIX) && defined(USE_ALSA) + case MD_ALSA: return MidiDriver_ALSA_create(); +#endif + } + + error("Invalid midi driver selected"); + return NULL; +} |