git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@354 b0f79afe-0144-0410-b225-9a4edf0717df

This commit is contained in:
Christoph Oelckers 2009-06-22 08:10:39 +00:00
parent 7d1f940fb9
commit 1cf13bd84f

View file

@ -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;