Merge remote-tracking branch 'stjr-gl/master' into cmake-adjustments

This commit is contained in:
mazmazz 2020-06-08 11:57:57 -04:00
commit 01ff46326f
2 changed files with 11 additions and 6 deletions

View File

@ -1924,7 +1924,7 @@ EXPORT void HWRAPI(CreateModelVBOs) (model_t *model)
} }
} }
#define BUFFER_OFFSET(i) ((char*)NULL + (i)) #define BUFFER_OFFSET(i) ((void*)(i))
static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 tics, INT32 nextFrameIndex, FTransform *pos, float scale, UINT8 flipped, UINT8 *color) static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 tics, INT32 nextFrameIndex, FTransform *pos, float scale, UINT8 flipped, UINT8 *color)
{ {

View File

@ -880,13 +880,18 @@ boolean I_SetSongSpeed(float speed)
#ifdef HAVE_OPENMPT #ifdef HAVE_OPENMPT
if (openmpt_mhandle) if (openmpt_mhandle)
{ {
char modspd[13];
if (speed > 4.0f) if (speed > 4.0f)
speed = 4.0f; // Limit this to 4x to prevent crashing, stupid fix but... ~SteelT 27/9/19 speed = 4.0f; // Limit this to 4x to prevent crashing, stupid fix but... ~SteelT 27/9/19
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR < 5
sprintf(modspd, "%g", speed); {
openmpt_module_ctl_set(openmpt_mhandle, "play.tempo_factor", modspd); // 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; return true;
} }
#else #else