diff options
author | Chris Robinson <[email protected]> | 2011-09-28 22:02:36 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-28 22:02:36 -0700 |
commit | 53572da7de8d2cf22ed996dec4b992ca378f371c (patch) | |
tree | 689bae49e09a50dddc145ff087035312b40ca42a /OpenAL32/alState.c | |
parent | 8a0e0265bc5675fe810aae8ee2bbcdd7a29d82c1 (diff) |
Set toward-zero rounding when updating in alDeferUpdatesSOFT
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r-- | OpenAL32/alState.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index 3920adf0..1cb52689 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -585,8 +585,19 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) ALboolean UpdateSources; ALsource **src, **src_end; ALeffectslot **slot, **slot_end; + int fpuState; LockContext(Context); +#if defined(HAVE_FESETROUND) + fpuState = fegetround(); + fesetround(FE_TOWARDZERO); +#elif defined(HAVE__CONTROLFP) + fpuState = _controlfp(0, 0); + (void)_controlfp(_RC_CHOP, _MCW_RC); +#else + (void)fpuState; +#endif + Context->DeferUpdates = AL_TRUE; /* Make sure all pending updates are performed */ @@ -619,6 +630,11 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) } UnlockContext(Context); +#if defined(HAVE_FESETROUND) + fesetround(fpuState); +#elif defined(HAVE__CONTROLFP) + _controlfp(fpuState, _MCW_RC); +#endif } ALCcontext_DecRef(Context); |