mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-12-02 09:12:54 +00:00
Merge branch 'public-musicplus-core' into public-musicplus-feature-endoflevel
This commit is contained in:
commit
be5555d393
2 changed files with 8 additions and 7 deletions
|
@ -1437,6 +1437,8 @@ static void S_ChangeMusicToQueue(void)
|
||||||
|
|
||||||
void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 position, UINT32 prefadems, UINT32 fadeinms)
|
void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 position, UINT32 prefadems, UINT32 fadeinms)
|
||||||
{
|
{
|
||||||
|
char newmusic[7];
|
||||||
|
|
||||||
#if defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)
|
#if defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)
|
||||||
S_ClearSfx();
|
S_ClearSfx();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1444,7 +1446,6 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
||||||
if (S_MusicDisabled())
|
if (S_MusicDisabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char newmusic[7];
|
|
||||||
strncpy(newmusic, mmusic, 7);
|
strncpy(newmusic, mmusic, 7);
|
||||||
#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS)
|
#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS)
|
||||||
if(LUAh_MusicChange(music_name, newmusic, &mflags, &looping, &position, &prefadems, &fadeinms))
|
if(LUAh_MusicChange(music_name, newmusic, &mflags, &looping, &position, &prefadems, &fadeinms))
|
||||||
|
|
|
@ -506,7 +506,7 @@ static UINT32 get_adjusted_position(UINT32 position)
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_fading_callback()
|
static void do_fading_callback(void)
|
||||||
{
|
{
|
||||||
if (fading_callback)
|
if (fading_callback)
|
||||||
(*fading_callback)();
|
(*fading_callback)();
|
||||||
|
@ -565,11 +565,11 @@ static UINT32 music_fade(UINT32 interval, void *param)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UINT8 delta = abs(fading_target - fading_source);
|
UINT8 delta = abs(fading_target - fading_source);
|
||||||
double factor = (double)(fading_duration - fading_timer) / (double)fading_duration;
|
fixed_t factor = FixedDiv(fading_duration - fading_timer, fading_duration);
|
||||||
if (fading_target < fading_source)
|
if (fading_target < fading_source)
|
||||||
internal_volume = max(min(internal_volume, fading_source - (UINT8)round(delta * factor)), fading_target);
|
internal_volume = max(min(internal_volume, fading_source - FixedMul(delta, factor)), fading_target);
|
||||||
else if (fading_target > fading_source)
|
else if (fading_target > fading_source)
|
||||||
internal_volume = min(max(internal_volume, fading_source + (UINT8)round(delta * factor)), fading_target);
|
internal_volume = min(max(internal_volume, fading_source + FixedMul(delta, factor)), fading_target);
|
||||||
Mix_VolumeMusic(get_real_volume(music_volume));
|
Mix_VolumeMusic(get_real_volume(music_volume));
|
||||||
return interval;
|
return interval;
|
||||||
}
|
}
|
||||||
|
@ -1170,7 +1170,7 @@ void I_StopSong(void)
|
||||||
var_cleanup();
|
var_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_PauseSong()
|
void I_PauseSong(void)
|
||||||
{
|
{
|
||||||
if(I_SongType() == MU_MID) // really, SDL Mixer? why can't you pause MIDI???
|
if(I_SongType() == MU_MID) // really, SDL Mixer? why can't you pause MIDI???
|
||||||
return;
|
return;
|
||||||
|
@ -1182,7 +1182,7 @@ void I_PauseSong()
|
||||||
songpaused = true;
|
songpaused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_ResumeSong()
|
void I_ResumeSong(void)
|
||||||
{
|
{
|
||||||
if (I_SongType() == MU_MID)
|
if (I_SongType() == MU_MID)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue