diff options
author | tron <tron@openttd.org> | 2005-07-22 18:19:06 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-22 18:19:06 +0000 |
commit | a13d515d5ecc320932523a0c469d97686a9f81b9 (patch) | |
tree | cdb8e11f7c61a45d35d3d937e6ff2d0e98af4d4a /w32dm.c | |
parent | c50223526ce416144495b3c5746e1e2de3d5371b (diff) | |
download | openttd-a13d515d5ecc320932523a0c469d97686a9f81b9.tar.xz |
(svn r2682) Static, casts, misc.
Diffstat (limited to 'w32dm.c')
-rw-r--r-- | w32dm.c | 22 |
1 files changed, 8 insertions, 14 deletions
@@ -60,14 +60,11 @@ extern void StopSegment (void); extern bool IsSegmentPlaying (void); extern void SetVolume (long); -bool seeking = false; +static bool seeking = false; static const char * DMusicMidiStart(const char * const *parm) { - if (InitDirectMusic() == true) - return(0); - - return("Unable to initialize DirectMusic"); + return InitDirectMusic() ? NULL : "Unable to initialize DirectMusic"; } static void DMusicMidiStop(void) @@ -85,8 +82,7 @@ static void DMusicMidiPlaySong(const char *filename) ttd_strlcpy(dir, filename, MAX_PATH); pos = strrchr(dir, '\\') + 1; ttd_strlcpy(file, pos, MAX_PATH); - //strchr(file, ' ')[0] = 0; - *pos = 0; + *pos = '\0'; LoadMIDI(dir, file); PlaySegment(); @@ -100,14 +96,12 @@ static void DMusicMidiStopSong(void) static bool DMusicMidiIsSongPlaying(void) { - if ((IsSegmentPlaying() == 0) && (seeking == true)) // Not the nicest code, but there is a - return(true); // short delay before playing actually - // starts. OpenTTD makes no provision for - if (IsSegmentPlaying() == 1) // this. - seeking = false; - + /* Not the nicest code, but there is a short delay before playing actually + * starts. OpenTTD makes no provision for this. */ + if (!IsSegmentPlaying() && seeking) return true; + if (IsSegmentPlaying()) seeking = false; - return(IsSegmentPlaying()); + return IsSegmentPlaying(); } static void DMusicMidiSetVolume(byte vol) |