- updated to use streflop

This commit is contained in:
Mark Vejvoda 2010-06-28 01:10:23 +00:00
parent 4e72831919
commit 94e07e442b
2 changed files with 16 additions and 0 deletions

View File

@ -243,9 +243,20 @@ void ParticleRendererGl::renderSingleModel(AttackParticleSystem *ps, ModelRender
Vec3f flatDirection= Vec3f(direction.x, 0.f, direction.z);
Vec3f rotVector= Vec3f(0.f, 1.f, 0.f).cross(flatDirection);
#ifdef USE_STREFLOP
float angleV= radToDeg(streflop::atan2(flatDirection.length(), direction.y)) - 90.f;
#else
float angleV= radToDeg(atan2(flatDirection.length(), direction.y)) - 90.f;
#endif
glRotatef(angleV, rotVector.x, rotVector.y, rotVector.z);
#ifdef USE_STREFLOP
float angleH= radToDeg(streflop::atan2(direction.x, direction.z));
#else
float angleH= radToDeg(atan2(direction.x, direction.z));
#endif
glRotatef(angleH, 0.f, 1.f, 0.f);
//render

View File

@ -493,7 +493,12 @@ bool SoundPlayerDs8::findStrBuffer(Sound *sound, int *bufferIndex){
// =====================================================
long dsVolume(float floatVolume){
#ifdef USE_STREFLOP
float correctedVol= streflop::log10f(floatVolume*9.f+1.f);
#else
float correctedVol= log10f(floatVolume*9.f+1.f);
#endif
long vol= static_cast<long>(DSBVOLUME_MIN+correctedVol*(DSBVOLUME_MAX-DSBVOLUME_MIN));
return clamp(vol, DSBVOLUME_MIN, DSBVOLUME_MAX);
}