- Fixed spurious warnings on 32-bit VC++ debug builds.
- Made the subsong (order) number a proper parameter to MusInfo::Play() instead of requiring a separate SetPosition() call to do it. SVN r1104 (trunk)
This commit is contained in:
parent
8d3e67ac88
commit
9f21b22cc5
16 changed files with 133 additions and 93 deletions
|
|
@ -78,7 +78,7 @@
|
|||
struct MusPlayingInfo
|
||||
{
|
||||
FString name;
|
||||
void *handle;
|
||||
MusInfo *handle;
|
||||
int baseorder;
|
||||
bool loop;
|
||||
};
|
||||
|
|
@ -1838,8 +1838,10 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
{
|
||||
if (order != mus_playing.baseorder)
|
||||
{
|
||||
mus_playing.baseorder =
|
||||
(I_SetSongPosition (mus_playing.handle, order) ? order : 0);
|
||||
if (mus_playing.handle->SetSubsong(order))
|
||||
{
|
||||
mus_playing.baseorder = order;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1862,7 +1864,7 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
int lumpnum = -1;
|
||||
int offset = 0, length = 0;
|
||||
int device = MDEV_DEFAULT;
|
||||
void *handle = NULL;
|
||||
MusInfo *handle = NULL;
|
||||
|
||||
int *devp = MidiDevices.CheckKey(FName(musicname));
|
||||
if (devp != NULL) device = *devp;
|
||||
|
|
@ -1932,7 +1934,7 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
{
|
||||
mus_playing.loop = looping;
|
||||
mus_playing.name = "";
|
||||
mus_playing.baseorder = 0;
|
||||
mus_playing.baseorder = order;
|
||||
LastSong = musicname;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1956,13 +1958,13 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
|
|||
|
||||
mus_playing.loop = looping;
|
||||
mus_playing.name = musicname;
|
||||
mus_playing.baseorder = 0;
|
||||
LastSong = "";
|
||||
|
||||
if (mus_playing.handle != 0)
|
||||
{ // play it
|
||||
I_PlaySong (mus_playing.handle, looping, S_GetMusicVolume (musicname));
|
||||
mus_playing.baseorder =
|
||||
(I_SetSongPosition (mus_playing.handle, order) ? order : 0);
|
||||
I_PlaySong (mus_playing.handle, looping, S_GetMusicVolume (musicname), order);
|
||||
mus_playing.baseorder = order;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue