diff options
author | Simon Howard | 2009-11-21 01:16:14 +0000 |
---|---|---|
committer | Simon Howard | 2009-11-21 01:16:14 +0000 |
commit | 3cf74a97261b1a0aceb591b495b0857781918edd (patch) | |
tree | 28caae31dc6d338310998b2cd8855ca6a16e9c3d /setup/configfile.c | |
parent | 299e1c5abf804e2e249c4f77b82fb7949a3f9d7b (diff) | |
parent | 892ad7c072a6717e8935053d7837a33974d0d824 (diff) | |
download | chocolate-doom-3cf74a97261b1a0aceb591b495b0857781918edd.tar.gz chocolate-doom-3cf74a97261b1a0aceb591b495b0857781918edd.tar.bz2 chocolate-doom-3cf74a97261b1a0aceb591b495b0857781918edd.zip |
Merge from trunk.
Subversion-branch: /branches/opl-branch
Subversion-revision: 1734
Diffstat (limited to 'setup/configfile.c')
-rw-r--r-- | setup/configfile.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/setup/configfile.c b/setup/configfile.c index fe3c13de..99ec2e03 100644 --- a/setup/configfile.c +++ b/setup/configfile.c @@ -42,6 +42,8 @@ #include <sys/types.h> #endif +#include "SDL_mixer.h" + #include "config.h" #include "doomfeatures.h" @@ -530,7 +532,15 @@ static void LoadDefaultCollection(default_collection_t *collection) intparm = ParseIntParameter(strparm); defaults[i].untranslated = intparm; - intparm = scantokey[intparm]; + + if (intparm >= 0 && intparm < 128) + { + intparm = scantokey[intparm]; + } + else + { + intparm = 0; + } defaults[i].original_translated = intparm; * (int *) def->location = intparm; @@ -721,5 +731,21 @@ void M_ApplyPlatformDefaults(void) #ifdef _WIN32_WCE M_ApplyWindowsCEDefaults(); #endif + + // Before SDL_mixer version 1.2.11, MIDI music caused the game + // to crash when it looped. If this is an old SDL_mixer version, + // disable MIDI. + +#ifdef __MACOSX__ + { + const SDL_version *v = Mix_Linked_Version(); + + if (SDL_VERSIONNUM(v->major, v->minor, v->patch) + < SDL_VERSIONNUM(1, 2, 11)) + { + snd_musicdevice = SNDDEVICE_NONE; + } + } +#endif } |