mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Fix OPENMPT deprecation error, openmpt_module_ctl_set
This commit is contained in:
parent
d2fefb6b9a
commit
a5f7f9a534
1 changed files with 10 additions and 5 deletions
|
@ -880,13 +880,18 @@ boolean I_SetSongSpeed(float speed)
|
|||
#ifdef HAVE_OPENMPT
|
||||
if (openmpt_mhandle)
|
||||
{
|
||||
char modspd[13];
|
||||
|
||||
if (speed > 4.0f)
|
||||
speed = 4.0f; // Limit this to 4x to prevent crashing, stupid fix but... ~SteelT 27/9/19
|
||||
|
||||
sprintf(modspd, "%g", speed);
|
||||
openmpt_module_ctl_set(openmpt_mhandle, "play.tempo_factor", modspd);
|
||||
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR < 5
|
||||
{
|
||||
// deprecated in 0.5.0
|
||||
char modspd[13];
|
||||
sprintf(modspd, "%g", speed);
|
||||
openmpt_module_ctl_set(openmpt_mhandle, "play.tempo_factor", modspd);
|
||||
}
|
||||
#else
|
||||
openmpt_module_ctl_set_floatingpoint(openmpt_mhandle, "play.tempo_factor", (double)speed);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue