summaryrefslogtreecommitdiff
path: root/setup/configfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'setup/configfile.c')
-rw-r--r--setup/configfile.c28
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
}