Module: wine Branch: master Commit: 15a33ab209987606bb1e6e2ee3961245b1cb9ebe URL: http://source.winehq.org/git/wine.git/?a=commit;h=15a33ab209987606bb1e6e2ee3...
Author: Vincent Pelletier plr.vincent@gmail.com Date: Sat Jan 24 00:59:48 2009 +0100
dinput: Fix gain-related bugs.
---
dlls/dinput/effect_linuxinput.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c index f225a65..7302d7f 100644 --- a/dlls/dinput/effect_linuxinput.c +++ b/dlls/dinput/effect_linuxinput.c @@ -380,7 +380,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetParameters( }
if (dwFlags & DIEP_GAIN) { - peff->dwGain = This->gain; + peff->dwGain = This->gain * 10000 / 0xFFFF; }
if (dwFlags & DIEP_SAMPLEPERIOD) { @@ -628,7 +628,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters( /* Gain and Sample Period settings are not supported by the linux * event system */ if (dwFlags & DIEP_GAIN) - This->gain = 0xFFFF * peff->dwGain / 1000; + This->gain = 0xFFFF * peff->dwGain / 10000;
if (dwFlags & DIEP_SAMPLEPERIOD) TRACE("Sample period requested but no sample period functionality present.\n"); @@ -792,6 +792,7 @@ HRESULT linuxinput_create_effect( newEffect->ref = 1; newEffect->guid = *rguid; newEffect->fd = fd; + newEffect->gain = 0xFFFF;
/* set the type. this cannot be changed over the effect's life. */ switch (type) {