summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-07-09 22:25:25 +0000
committerrubidium <rubidium@openttd.org>2010-07-09 22:25:25 +0000
commitd4da257ff9b11abcbaaea85743665d4188562856 (patch)
tree68532f786430da90807a14484090d33e8e7386b6
parent58f1470129cc9adc4f41df6ef4068baa7e2cf04e (diff)
downloadopenttd-d4da257ff9b11abcbaaea85743665d4188562856.tar.xz
(svn r20105) -Revert (r20102) [FS#3938]: resetting DirectMusic completely, although working, causes a temporary freeze of OpenTTD. As MCI behaves better than DirectMusic that has become the default music driver; small delay between songs beats wrongly pitched/bad sounding songs
-rw-r--r--known-bugs.txt16
-rw-r--r--src/music/dmusic.cpp4
-rw-r--r--src/music/dmusic.h2
-rw-r--r--src/music/win32_m.h2
4 files changed, 20 insertions, 4 deletions
diff --git a/known-bugs.txt b/known-bugs.txt
index 4af6ddda1..7b48495dd 100644
--- a/known-bugs.txt
+++ b/known-bugs.txt
@@ -66,6 +66,22 @@ No suitable AI can be found
"AI Settings" -> "Select AI" -> "Check Online Content" which is also
accessed via the main menu.
+Long delay between switching songs/music
+ On Windows there is a delay of a (few) second(s) between switching of
+ songs for the "win32" driver. This delay is caused by the fact that
+ opening a MIDI file via MCI is extremely slow.
+
+ DirectMusic, known as "dmusic" in OpenTTD, has a much shorter delay.
+ However, under some circumstances DirectMusic does not reset its
+ state properly causing wrongly pitched/bad sounding songs. This
+ problem is in DirectMusic as it is reproducable with Microsoft's
+ DirectMusic Producer. DirectMusic has been deprecated since 2004
+ and as such has no support for 64 bits OpenTTD.
+
+ As a delay is favourable over bad sounding music the "win32" driver
+ is the default driver for OpenTTD. You can change this default by
+ setting the "musicdriver" in your openttd.cfg to "dmusic".
+
Clipping problems [FS#119]
In some cases sprites are not drawn as one would expect. Examples of
this are aircraft that might be hidden below the runway or trees that
diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp
index 21eb47b44..cb255e7c0 100644
--- a/src/music/dmusic.cpp
+++ b/src/music/dmusic.cpp
@@ -165,8 +165,8 @@ void MusicDriver_DMusic::PlaySong(const char *filename)
/* release the existing segment if we have any */
if (segment != NULL) {
- this->Stop();
- if (this->Start(NULL) != NULL) return;
+ segment->Release();
+ segment = NULL;
}
/* make a new segment */
diff --git a/src/music/dmusic.h b/src/music/dmusic.h
index 74368de23..ed2dcabf1 100644
--- a/src/music/dmusic.h
+++ b/src/music/dmusic.h
@@ -32,7 +32,7 @@ public:
class FMusicDriver_DMusic: public MusicDriverFactory<FMusicDriver_DMusic> {
public:
- static const int priority = 10;
+ static const int priority = 5;
/* virtual */ const char *GetName() { return "dmusic"; }
/* virtual */ const char *GetDescription() { return "DirectMusic MIDI Driver"; }
/* virtual */ Driver *CreateInstance() { return new MusicDriver_DMusic(); }
diff --git a/src/music/win32_m.h b/src/music/win32_m.h
index d596d3a9f..2e991bd9f 100644
--- a/src/music/win32_m.h
+++ b/src/music/win32_m.h
@@ -32,7 +32,7 @@ public:
class FMusicDriver_Win32: public MusicDriverFactory<FMusicDriver_Win32> {
public:
- static const int priority = 5;
+ static const int priority = 10;
/* virtual */ const char *GetName() { return "win32"; }
/* virtual */ const char *GetDescription() { return "Win32 Music Driver"; }
/* virtual */ Driver *CreateInstance() { return new MusicDriver_Win32(); }