From 989ed101bc9ff659736354f42ac22dfd23809e92 Mon Sep 17 00:00:00 2001 From: darkvater Date: Sun, 12 Sep 2004 22:03:14 +0000 Subject: (svn r224) -Fix: Music now finally works on WinXP. DirectMusic is now default for an OS >= WinNT4 (WinNT4, Win2k, WinXP), and MIDI driver for lower OS's (Win95, Win98, WinME, etc). --- ttd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ttd.c') diff --git a/ttd.c b/ttd.c index c7d792307..2e760e188 100644 --- a/ttd.c +++ b/ttd.c @@ -52,6 +52,7 @@ extern void HalGameLoop(); uint32 _pixels_redrawn; bool _dbg_screen_rect; bool disable_computer; +static byte _os_version = 0; void CDECL error(const char *s, ...) { va_list va; @@ -192,7 +193,7 @@ static const DriverDesc *ChooseDefaultDriver(const DriverDesc *dd) const DriverDesc *best = NULL; int best_pri = -1; do { - if ((int)(dd->flags&DF_PRIORITY_MASK) > best_pri) { + if ((int)(dd->flags&DF_PRIORITY_MASK) > best_pri && _os_version >= (byte)dd->flags) { best_pri = dd->flags&DF_PRIORITY_MASK; best = dd; } @@ -571,6 +572,7 @@ int ttd_main(int argc, char* argv[]) // Sample catalogue DEBUG(misc, 1) ("Loading sound effects..."); + _os_version = GetOSVersion(); MxInitialize(11025, "sample.cat"); // This must be done early, since functions use the InvalidateWindow* calls -- cgit v1.2.3-54-g00ecf