mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-01 01:41:18 +00:00
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@354 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
7d1f940fb9
commit
1cf13bd84f
1 changed files with 5 additions and 4 deletions
|
@ -3555,14 +3555,15 @@ static void process_playing(DUMB_IT_SIGRENDERER *sigrenderer, IT_PLAYING *playin
|
|||
playing->sample_vibrato_time += playing->sample->vibrato_speed;
|
||||
}
|
||||
|
||||
#if !defined(_WIN32) || !defined(__GNUC__)
|
||||
static double log2(double x) {return log(x)/log(2.0f);}
|
||||
#endif
|
||||
// Apparently some GCCs have problems here so renaming the function sounds like a better idea.
|
||||
//#if !defined(_WIN32) || !defined(__GNUC__)
|
||||
static double mylog2(double x) {return log(x)/log(2.0f);}
|
||||
//#endif
|
||||
|
||||
static int delta_to_note(float delta, int base)
|
||||
{
|
||||
double note;
|
||||
note = log2(delta * 65536.f / (float)base)*12.0f+60.5f;
|
||||
note = mylog2(delta * 65536.f / (float)base)*12.0f+60.5f;
|
||||
if (note > 119) note = 119;
|
||||
else if (note < 0) note = 0;
|
||||
return (int)note;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue