From 94e07e442b1158b2174d06b979fcd5e2a0c21491 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 28 Jun 2010 01:10:23 +0000 Subject: [PATCH] - updated to use streflop --- .../sources/graphics/gl/particle_renderer_gl.cpp | 11 +++++++++++ .../shared_lib/sources/sound/ds8/sound_player_ds8.cpp | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/source/shared_lib/sources/graphics/gl/particle_renderer_gl.cpp b/source/shared_lib/sources/graphics/gl/particle_renderer_gl.cpp index 3c2674d7f..c16dc79cd 100644 --- a/source/shared_lib/sources/graphics/gl/particle_renderer_gl.cpp +++ b/source/shared_lib/sources/graphics/gl/particle_renderer_gl.cpp @@ -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 diff --git a/source/shared_lib/sources/sound/ds8/sound_player_ds8.cpp b/source/shared_lib/sources/sound/ds8/sound_player_ds8.cpp index 70d7a214b..21d361dd1 100644 --- a/source/shared_lib/sources/sound/ds8/sound_player_ds8.cpp +++ b/source/shared_lib/sources/sound/ds8/sound_player_ds8.cpp @@ -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(DSBVOLUME_MIN+correctedVol*(DSBVOLUME_MAX-DSBVOLUME_MIN)); return clamp(vol, DSBVOLUME_MIN, DSBVOLUME_MAX); }