mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 19:52:25 +01:00
- updated to use streflop
This commit is contained in:
parent
4e72831919
commit
94e07e442b
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user