winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
834 discussions
Start a n
N
ew thread
Aric Stewart : dinput: Rename Linux-specific joystick functions.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: 922b66e354475f1334c9a69d98b129ff46a2614f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=922b66e354475f1334c9a69d9…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Mar 9 10:07:17 2009 -0500 dinput: Rename Linux-specific joystick functions. --- dlls/dinput/joystick_linux.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 2fb0ff4..67ec02b 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -602,7 +602,7 @@ const struct dinput_device joystick_linux_device = { /****************************************************************************** * Acquire : gets exclusive control of the joystick */ -static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) +static HRESULT WINAPI JoystickLinuxAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) { JoystickImpl *This = (JoystickImpl *)iface; @@ -632,7 +632,7 @@ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) /****************************************************************************** * Unacquire : frees the joystick */ -static HRESULT WINAPI JoystickAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) +static HRESULT WINAPI JoystickLinuxAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) { JoystickImpl *This = (JoystickImpl *)iface; HRESULT res; @@ -735,8 +735,8 @@ static const IDirectInputDevice8AVtbl JoystickAvt = IDirectInputDevice2AImpl_EnumObjects, JoystickAGenericImpl_GetProperty, JoystickAGenericImpl_SetProperty, - JoystickAImpl_Acquire, - JoystickAImpl_Unacquire, + JoystickLinuxAImpl_Acquire, + JoystickLinuxAImpl_Unacquire, JoystickAGenericImpl_GetDeviceState, IDirectInputDevice2AImpl_GetDeviceData, IDirectInputDevice2AImpl_SetDataFormat, @@ -777,8 +777,8 @@ static const IDirectInputDevice8WVtbl JoystickWvt = IDirectInputDevice2WImpl_EnumObjects, XCAST(GetProperty)JoystickAGenericImpl_GetProperty, XCAST(SetProperty)JoystickAGenericImpl_SetProperty, - XCAST(Acquire)JoystickAImpl_Acquire, - XCAST(Unacquire)JoystickAImpl_Unacquire, + XCAST(Acquire)JoystickLinuxAImpl_Acquire, + XCAST(Unacquire)JoystickLinuxAImpl_Unacquire, XCAST(GetDeviceState)JoystickAGenericImpl_GetDeviceState, XCAST(GetDeviceData)IDirectInputDevice2AImpl_GetDeviceData, XCAST(SetDataFormat)IDirectInputDevice2AImpl_SetDataFormat,
1
0
0
0
Aric Stewart : dinput: Move joystick mapping functions to the generic part.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: e90e7e5b7746e4c3b1f8fbd68bbcb65307b4135f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e90e7e5b7746e4c3b1f8fbd68…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Mar 9 10:07:07 2009 -0500 dinput: Move joystick mapping functions to the generic part. --- dlls/dinput/joystick.c | 55 +++++++++++++++++++++++++++++++++++ dlls/dinput/joystick_linuxinput.c | 57 +------------------------------------ dlls/dinput/joystick_private.h | 3 ++ 3 files changed, 59 insertions(+), 56 deletions(-) diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index 006e5be..a19cf27 100644 --- a/dlls/dinput/joystick.c +++ b/dlls/dinput/joystick.c @@ -387,3 +387,58 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceState( return DI_OK; } + +/* + * This maps the read value (from the input event) to a value in the + * 'wanted' range. + * Notes: + * Dead zone is in % multiplied by a 100 (range 0..10000) + */ +LONG joystick_map_axis(ObjProps *props, int val) +{ + LONG ret; + LONG dead_zone = MulDiv( props->lDeadZone, props->lDevMax - props->lDevMin, 10000 ); + LONG dev_range = props->lDevMax - props->lDevMin - dead_zone; + + /* Center input */ + val -= (props->lDevMin + props->lDevMax) / 2; + + /* Remove dead zone */ + if (abs( val ) <= dead_zone / 2) + val = 0; + else + val = val < 0 ? val + dead_zone / 2 : val - dead_zone / 2; + + /* Scale and map the value from the device range into the required range */ + ret = MulDiv( val, props->lMax - props->lMin, dev_range ) + + (props->lMin + props->lMax) / 2; + + /* Clamp in case or rounding errors */ + if (ret > props->lMax) ret = props->lMax; + else if (ret < props->lMin) ret = props->lMin; + + TRACE( "(%d <%d> %d) -> (%d <%d> %d): val=%d ret=%d\n", + props->lDevMin, dead_zone, props->lDevMax, + props->lMin, props->lDeadZone, props->lMax, + val, ret ); + + return ret; +} + +/* + * Maps POV x & y event values to a DX "clock" position: + * 0 + * 31500 4500 + * 27000 -1 9000 + * 22500 13500 + * 18000 + */ +DWORD joystick_map_pov(POINTL *p) +{ + if (p->x > 0) + return p->y < 0 ? 4500 : !p->y ? 9000 : 13500; + else if (p->x < 0) + return p->y < 0 ? 31500 : !p->y ? 27000 : 22500; + else + return p->y < 0 ? 0 : !p->y ? -1 : 18000; +} diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index c24ade9..548f920 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -64,65 +64,10 @@ #include "dinput_private.h" #include "device_private.h" +#include "joystick_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dinput); - -/* - * Maps POV x & y event values to a DX "clock" position: - * 0 - * 31500 4500 - * 27000 -1 9000 - * 22500 13500 - * 18000 - */ -DWORD joystick_map_pov(POINTL *p) -{ - if (p->x > 0) - return p->y < 0 ? 4500 : !p->y ? 9000 : 13500; - else if (p->x < 0) - return p->y < 0 ? 31500 : !p->y ? 27000 : 22500; - else - return p->y < 0 ? 0 : !p->y ? -1 : 18000; -} - -/* - * This maps the read value (from the input event) to a value in the - * 'wanted' range. - * Notes: - * Dead zone is in % multiplied by a 100 (range 0..10000) - */ -LONG joystick_map_axis(ObjProps *props, int val) -{ - LONG ret; - LONG dead_zone = MulDiv( props->lDeadZone, props->lDevMax - props->lDevMin, 10000 ); - LONG dev_range = props->lDevMax - props->lDevMin - dead_zone; - - /* Center input */ - val -= (props->lDevMin + props->lDevMax) / 2; - - /* Remove dead zone */ - if (abs( val ) <= dead_zone / 2) - val = 0; - else - val = val < 0 ? val + dead_zone / 2 : val - dead_zone / 2; - - /* Scale and map the value from the device range into the required range */ - ret = MulDiv( val, props->lMax - props->lMin, dev_range ) + - (props->lMin + props->lMax) / 2; - - /* Clamp in case or rounding errors */ - if (ret > props->lMax) ret = props->lMax; - else if (ret < props->lMin) ret = props->lMin; - - TRACE( "(%d <%d> %d) -> (%d <%d> %d): val=%d ret=%d\n", - props->lDevMin, dead_zone, props->lDevMax, - props->lMin, props->lDeadZone, props->lMax, - val, ret ); - - return ret; -} - #ifdef HAVE_CORRECT_LINUXINPUT_H #define EVDEVPREFIX "/dev/input/event" diff --git a/dlls/dinput/joystick_private.h b/dlls/dinput/joystick_private.h index 3d87c7c..e1709e9 100644 --- a/dlls/dinput/joystick_private.h +++ b/dlls/dinput/joystick_private.h @@ -46,6 +46,9 @@ typedef struct JoystickGenericImpl joy_polldev_handler *joy_polldev; } JoystickGenericImpl; +LONG joystick_map_axis(ObjProps *props, int val); + +DWORD joystick_map_pov(POINTL *p); HRESULT WINAPI JoystickWGenericImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow);
1
0
0
0
Aric Stewart : dinput: Move joystick Polling and Device State to the generic part.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: 94a5e0978d832a488798acd6b9a41afa1299cb07 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=94a5e0978d832a488798acd6b…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Mar 9 10:06:57 2009 -0500 dinput: Move joystick Polling and Device State to the generic part. --- dlls/dinput/joystick.c | 42 +++++++++++++++++++++ dlls/dinput/joystick_linux.c | 78 ++++++++++----------------------------- dlls/dinput/joystick_private.h | 12 ++++++ 3 files changed, 74 insertions(+), 58 deletions(-) diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index d1299cb..006e5be 100644 --- a/dlls/dinput/joystick.c +++ b/dlls/dinput/joystick.c @@ -345,3 +345,45 @@ HRESULT WINAPI JoystickWGenericImpl_GetDeviceInfo( return DI_OK; } + +HRESULT WINAPI JoystickAGenericImpl_Poll(LPDIRECTINPUTDEVICE8A iface) +{ + JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + + TRACE("(%p)\n",This); + + if (!This->base.acquired) { + WARN("not acquired\n"); + return DIERR_NOTACQUIRED; + } + + This->joy_polldev(This); + return DI_OK; +} + +/****************************************************************************** + * GetDeviceState : returns the "state" of the joystick. + * + */ +HRESULT WINAPI JoystickAGenericImpl_GetDeviceState( + LPDIRECTINPUTDEVICE8A iface, + DWORD len, + LPVOID ptr) +{ + JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + + TRACE("(%p,0x%08x,%p)\n", This, len, ptr); + + if (!This->base.acquired) { + WARN("not acquired\n"); + return DIERR_NOTACQUIRED; + } + + /* update joystick state */ + This->joy_polldev(This); + + /* convert and copy data to user supplied buffer */ + fill_DataFormat(ptr, len, &This->js, &This->base.data_format); + + return DI_OK; +} diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index ad9ad02..2fb0ff4 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -87,7 +87,6 @@ struct JoystickImpl /* joystick private */ int joyfd; - DIJOYSTATE2 js; /* wine data */ LONG deadzone; int *axis_map; int axes; @@ -105,6 +104,8 @@ static const GUID DInput_Wine_Joystick_GUID = { /* 9e573ed9-7734-11d2-8d4a-23903 static INT joystick_devices_count = -1; static LPSTR joystick_devices[MAX_JOYSTICKS]; +static void joy_polldev(JoystickGenericImpl *This); + static INT find_joystick_devices(void) { INT i; @@ -379,6 +380,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di } newDevice->generic.guidProduct = DInput_Wine_Joystick_GUID; + newDevice->generic.joy_polldev = joy_polldev; /* get the device name */ #if defined(JSIOCGNAME) @@ -649,9 +651,11 @@ static HRESULT WINAPI JoystickAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface) return DI_NOEFFECT; } -static void joy_polldev(JoystickImpl *This) { +static void joy_polldev(JoystickGenericImpl *This_in) { struct pollfd plfd; struct js_event jse; + JoystickImpl *This = (JoystickImpl*) This_in; + TRACE("(%p)\n", This); if (This->joyfd==-1) { @@ -678,7 +682,7 @@ static void joy_polldev(JoystickImpl *This) { if (jse.number >= This->generic.devcaps.dwButtons) return; inst_id = DIDFT_MAKEINSTANCE(jse.number) | DIDFT_PSHBUTTON; - This->js.rgbButtons[jse.number] = value = jse.value ? 0x80 : 0x00; + This->generic.js.rgbButtons[jse.number] = value = jse.value ? 0x80 : 0x00; } else if (jse.type & JS_EVENT_AXIS) { @@ -691,14 +695,14 @@ static void joy_polldev(JoystickImpl *This) { TRACE("changing axis %d => %d\n", jse.number, number); switch (number) { - case 0: This->js.lX = value; break; - case 1: This->js.lY = value; break; - case 2: This->js.lZ = value; break; - case 3: This->js.lRx = value; break; - case 4: This->js.lRy = value; break; - case 5: This->js.lRz = value; break; - case 6: This->js.rglSlider[0] = value; break; - case 7: This->js.rglSlider[1] = value; break; + case 0: This->generic.js.lX = value; break; + case 1: This->generic.js.lY = value; break; + case 2: This->generic.js.lZ = value; break; + case 3: This->generic.js.lRx = value; break; + case 4: This->generic.js.lRy = value; break; + case 5: This->generic.js.lRz = value; break; + case 6: This->generic.js.rglSlider[0] = value; break; + case 7: This->generic.js.rglSlider[1] = value; break; case 8: case 9: case 10: case 11: { int idx = number - 8; @@ -708,7 +712,7 @@ static void joy_polldev(JoystickImpl *This) { else This->povs[idx].x = jse.value; - This->js.rgdwPOV[idx] = value = joystick_map_pov(&This->povs[idx]); + This->generic.js.rgdwPOV[idx] = value = joystick_map_pov(&This->povs[idx]); break; } default: @@ -722,48 +726,6 @@ static void joy_polldev(JoystickImpl *This) { } } -/****************************************************************************** - * GetDeviceState : returns the "state" of the joystick. - * - */ -static HRESULT WINAPI JoystickAImpl_GetDeviceState( - LPDIRECTINPUTDEVICE8A iface, - DWORD len, - LPVOID ptr) -{ - JoystickImpl *This = (JoystickImpl *)iface; - - TRACE("(%p,0x%08x,%p)\n", This, len, ptr); - - if (!This->generic.base.acquired) { - WARN("not acquired\n"); - return DIERR_NOTACQUIRED; - } - - /* update joystick state */ - joy_polldev(This); - - /* convert and copy data to user supplied buffer */ - fill_DataFormat(ptr, len, &This->js, &This->generic.base.data_format); - - return DI_OK; -} - -static HRESULT WINAPI JoystickAImpl_Poll(LPDIRECTINPUTDEVICE8A iface) -{ - JoystickImpl *This = (JoystickImpl *)iface; - - TRACE("(%p)\n",This); - - if (!This->generic.base.acquired) { - WARN("not acquired\n"); - return DIERR_NOTACQUIRED; - } - - joy_polldev(This); - return DI_OK; -} - static const IDirectInputDevice8AVtbl JoystickAvt = { IDirectInputDevice2AImpl_QueryInterface, @@ -775,7 +737,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt = JoystickAGenericImpl_SetProperty, JoystickAImpl_Acquire, JoystickAImpl_Unacquire, - JoystickAImpl_GetDeviceState, + JoystickAGenericImpl_GetDeviceState, IDirectInputDevice2AImpl_GetDeviceData, IDirectInputDevice2AImpl_SetDataFormat, IDirectInputDevice2AImpl_SetEventNotification, @@ -791,7 +753,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt = IDirectInputDevice2AImpl_SendForceFeedbackCommand, IDirectInputDevice2AImpl_EnumCreatedEffectObjects, IDirectInputDevice2AImpl_Escape, - JoystickAImpl_Poll, + JoystickAGenericImpl_Poll, IDirectInputDevice2AImpl_SendDeviceData, IDirectInputDevice7AImpl_EnumEffectsInFile, IDirectInputDevice7AImpl_WriteEffectToFile, @@ -817,7 +779,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt = XCAST(SetProperty)JoystickAGenericImpl_SetProperty, XCAST(Acquire)JoystickAImpl_Acquire, XCAST(Unacquire)JoystickAImpl_Unacquire, - XCAST(GetDeviceState)JoystickAImpl_GetDeviceState, + XCAST(GetDeviceState)JoystickAGenericImpl_GetDeviceState, XCAST(GetDeviceData)IDirectInputDevice2AImpl_GetDeviceData, XCAST(SetDataFormat)IDirectInputDevice2AImpl_SetDataFormat, XCAST(SetEventNotification)IDirectInputDevice2AImpl_SetEventNotification, @@ -833,7 +795,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt = XCAST(SendForceFeedbackCommand)IDirectInputDevice2AImpl_SendForceFeedbackCommand, XCAST(EnumCreatedEffectObjects)IDirectInputDevice2AImpl_EnumCreatedEffectObjects, XCAST(Escape)IDirectInputDevice2AImpl_Escape, - XCAST(Poll)JoystickAImpl_Poll, + XCAST(Poll)JoystickAGenericImpl_Poll, XCAST(SendDeviceData)IDirectInputDevice2AImpl_SendDeviceData, IDirectInputDevice7WImpl_EnumEffectsInFile, IDirectInputDevice7WImpl_WriteEffectToFile, diff --git a/dlls/dinput/joystick_private.h b/dlls/dinput/joystick_private.h index 36f5b47..3d87c7c 100644 --- a/dlls/dinput/joystick_private.h +++ b/dlls/dinput/joystick_private.h @@ -29,14 +29,21 @@ #include "dinput_private.h" #include "device_private.h" +struct JoystickGenericImpl; + +typedef void joy_polldev_handler(struct JoystickGenericImpl *This); + typedef struct JoystickGenericImpl { struct IDirectInputDevice2AImpl base; ObjProps *props; DIDEVCAPS devcaps; + DIJOYSTATE2 js; /* wine data */ GUID guidProduct; char *name; + + joy_polldev_handler *joy_polldev; } JoystickGenericImpl; @@ -63,4 +70,9 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8A iface, HRESULT WINAPI JoystickWGenericImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi); +HRESULT WINAPI JoystickAGenericImpl_Poll(LPDIRECTINPUTDEVICE8A iface); + +HRESULT WINAPI JoystickAGenericImpl_GetDeviceState( LPDIRECTINPUTDEVICE8A iface, + DWORD len, LPVOID ptr); + #endif /* __WINE_DLLS_DINPUT_JOYSTICK_PRIVATE_H */
1
0
0
0
Aric Stewart : dinput: Move joystick productGuid and Name to the generic part.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: cbd34748e9ce24d19ffa815be17685ed69a26d47 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cbd34748e9ce24d19ffa815be…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Mar 9 10:06:50 2009 -0500 dinput: Move joystick productGuid and Name to the generic part. --- dlls/dinput/joystick.c | 71 ++++++++++++++++++++++++++++++++ dlls/dinput/joystick_linux.c | 89 ++++------------------------------------ dlls/dinput/joystick_private.h | 7 +++ 3 files changed, 87 insertions(+), 80 deletions(-) diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index f6d2271..d1299cb 100644 --- a/dlls/dinput/joystick.c +++ b/dlls/dinput/joystick.c @@ -274,3 +274,74 @@ HRESULT WINAPI JoystickAGenericImpl_GetProperty( return DI_OK; } + +/****************************************************************************** + * GetDeviceInfo : get information about a device's identity + */ +HRESULT WINAPI JoystickAGenericImpl_GetDeviceInfo( + LPDIRECTINPUTDEVICE8A iface, + LPDIDEVICEINSTANCEA pdidi) +{ + JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + + TRACE("(%p,%p)\n", iface, pdidi); + + if (pdidi == NULL) { + WARN("invalid pointer\n"); + return E_POINTER; + } + + if ((pdidi->dwSize != sizeof(DIDEVICEINSTANCE_DX3A)) && + (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA))) { + WARN("invalid parameter: pdidi->dwSize = %d\n", pdidi->dwSize); + return DIERR_INVALIDPARAM; + } + + /* Return joystick */ + pdidi->guidInstance = GUID_Joystick; + pdidi->guidProduct = This->guidProduct; + /* we only support traditional joysticks for now */ + pdidi->dwDevType = This->devcaps.dwDevType; + strcpy(pdidi->tszInstanceName, "Joystick"); + strcpy(pdidi->tszProductName, This->name); + if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3A)) { + pdidi->guidFFDriver = GUID_NULL; + pdidi->wUsagePage = 0; + pdidi->wUsage = 0; + } + + return DI_OK; +} + +/****************************************************************************** + * GetDeviceInfo : get information about a device's identity + */ +HRESULT WINAPI JoystickWGenericImpl_GetDeviceInfo( + LPDIRECTINPUTDEVICE8W iface, + LPDIDEVICEINSTANCEW pdidi) +{ + JoystickGenericImpl *This = (JoystickGenericImpl *)iface; + + TRACE("(%p,%p)\n", iface, pdidi); + + if ((pdidi->dwSize != sizeof(DIDEVICEINSTANCE_DX3W)) && + (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW))) { + WARN("invalid parameter: pdidi->dwSize = %d\n", pdidi->dwSize); + return DIERR_INVALIDPARAM; + } + + /* Return joystick */ + pdidi->guidInstance = GUID_Joystick; + pdidi->guidProduct = This->guidProduct; + /* we only support traditional joysticks for now */ + pdidi->dwDevType = This->devcaps.dwDevType; + MultiByteToWideChar(CP_ACP, 0, "Joystick", -1, pdidi->tszInstanceName, MAX_PATH); + MultiByteToWideChar(CP_ACP, 0, This->name, -1, pdidi->tszProductName, MAX_PATH); + if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3W)) { + pdidi->guidFFDriver = GUID_NULL; + pdidi->wUsagePage = 0; + pdidi->wUsage = 0; + } + + return DI_OK; +} diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index edbdf70..ad9ad02 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -88,7 +88,6 @@ struct JoystickImpl /* joystick private */ int joyfd; DIJOYSTATE2 js; /* wine data */ - char *name; LONG deadzone; int *axis_map; int axes; @@ -264,13 +263,13 @@ static HRESULT setup_dinput_options(JoystickImpl * device) device->axis_map = HeapAlloc(GetProcessHeap(), 0, device->axes * sizeof(int)); if (!device->axis_map) return DIERR_OUTOFMEMORY; - if (!get_config_key( hkey, appkey, device->name, buffer, MAX_PATH )) { + if (!get_config_key( hkey, appkey, device->generic.name, buffer, MAX_PATH )) { static const char *axis_names[] = {"X", "Y", "Z", "Rx", "Ry", "Rz", "Slider1", "Slider2", "POV1", "POV2", "POV3", "POV4"}; const char *delim = ","; char * ptr; - TRACE("\"%s\" = \"%s\"\n", device->name, buffer); + TRACE("\"%s\" = \"%s\"\n", device->generic.name, buffer); if ((ptr = strtok(buffer, delim)) != NULL) { do { @@ -379,6 +378,8 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di return DIERR_DEVICENOTREG; } + newDevice->generic.guidProduct = DInput_Wine_Joystick_GUID; + /* get the device name */ #if defined(JSIOCGNAME) if (ioctl(newDevice->joyfd,JSIOCGNAME(MAX_PATH),name) < 0) { @@ -390,8 +391,8 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di #endif /* copy the device name */ - newDevice->name = HeapAlloc(GetProcessHeap(),0,strlen(name) + 1); - strcpy(newDevice->name, name); + newDevice->generic.name = HeapAlloc(GetProcessHeap(),0,strlen(name) + 1); + strcpy(newDevice->generic.name, name); #ifdef JSIOCGAXES if (ioctl(newDevice->joyfd,JSIOCGAXES,&newDevice->axes) < 0) { @@ -504,7 +505,7 @@ FAILED1: HeapFree(GetProcessHeap(), 0, df); release_DataFormat(&newDevice->generic.base.data_format); HeapFree(GetProcessHeap(),0,newDevice->axis_map); - HeapFree(GetProcessHeap(),0,newDevice->name); + HeapFree(GetProcessHeap(),0,newDevice->generic.name); HeapFree(GetProcessHeap(),0,newDevice->generic.props); HeapFree(GetProcessHeap(),0,newDevice); *pdev = 0; @@ -763,78 +764,6 @@ static HRESULT WINAPI JoystickAImpl_Poll(LPDIRECTINPUTDEVICE8A iface) return DI_OK; } - -/****************************************************************************** - * GetDeviceInfo : get information about a device's identity - */ -static HRESULT WINAPI JoystickAImpl_GetDeviceInfo( - LPDIRECTINPUTDEVICE8A iface, - LPDIDEVICEINSTANCEA pdidi) -{ - JoystickImpl *This = (JoystickImpl *)iface; - - TRACE("(%p,%p)\n", iface, pdidi); - - if (pdidi == NULL) { - WARN("invalid pointer\n"); - return E_POINTER; - } - - if ((pdidi->dwSize != sizeof(DIDEVICEINSTANCE_DX3A)) && - (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA))) { - WARN("invalid parameter: pdidi->dwSize = %d\n", pdidi->dwSize); - return DIERR_INVALIDPARAM; - } - - /* Return joystick */ - pdidi->guidInstance = GUID_Joystick; - pdidi->guidProduct = DInput_Wine_Joystick_GUID; - /* we only support traditional joysticks for now */ - pdidi->dwDevType = This->generic.devcaps.dwDevType; - strcpy(pdidi->tszInstanceName, "Joystick"); - strcpy(pdidi->tszProductName, This->name); - if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3A)) { - pdidi->guidFFDriver = GUID_NULL; - pdidi->wUsagePage = 0; - pdidi->wUsage = 0; - } - - return DI_OK; -} - -/****************************************************************************** - * GetDeviceInfo : get information about a device's identity - */ -static HRESULT WINAPI JoystickWImpl_GetDeviceInfo( - LPDIRECTINPUTDEVICE8W iface, - LPDIDEVICEINSTANCEW pdidi) -{ - JoystickImpl *This = (JoystickImpl *)iface; - - TRACE("(%p,%p)\n", iface, pdidi); - - if ((pdidi->dwSize != sizeof(DIDEVICEINSTANCE_DX3W)) && - (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW))) { - WARN("invalid parameter: pdidi->dwSize = %d\n", pdidi->dwSize); - return DIERR_INVALIDPARAM; - } - - /* Return joystick */ - pdidi->guidInstance = GUID_Joystick; - pdidi->guidProduct = DInput_Wine_Joystick_GUID; - /* we only support traditional joysticks for now */ - pdidi->dwDevType = This->generic.devcaps.dwDevType; - MultiByteToWideChar(CP_ACP, 0, "Joystick", -1, pdidi->tszInstanceName, MAX_PATH); - MultiByteToWideChar(CP_ACP, 0, This->name, -1, pdidi->tszProductName, MAX_PATH); - if (pdidi->dwSize > sizeof(DIDEVICEINSTANCE_DX3W)) { - pdidi->guidFFDriver = GUID_NULL; - pdidi->wUsagePage = 0; - pdidi->wUsage = 0; - } - - return DI_OK; -} - static const IDirectInputDevice8AVtbl JoystickAvt = { IDirectInputDevice2AImpl_QueryInterface, @@ -852,7 +781,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt = IDirectInputDevice2AImpl_SetEventNotification, IDirectInputDevice2AImpl_SetCooperativeLevel, JoystickAGenericImpl_GetObjectInfo, - JoystickAImpl_GetDeviceInfo, + JoystickAGenericImpl_GetDeviceInfo, IDirectInputDevice2AImpl_RunControlPanel, IDirectInputDevice2AImpl_Initialize, IDirectInputDevice2AImpl_CreateEffect, @@ -894,7 +823,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt = XCAST(SetEventNotification)IDirectInputDevice2AImpl_SetEventNotification, XCAST(SetCooperativeLevel)IDirectInputDevice2AImpl_SetCooperativeLevel, JoystickWGenericImpl_GetObjectInfo, - JoystickWImpl_GetDeviceInfo, + JoystickWGenericImpl_GetDeviceInfo, XCAST(RunControlPanel)IDirectInputDevice2AImpl_RunControlPanel, XCAST(Initialize)IDirectInputDevice2AImpl_Initialize, XCAST(CreateEffect)IDirectInputDevice2AImpl_CreateEffect, diff --git a/dlls/dinput/joystick_private.h b/dlls/dinput/joystick_private.h index 40a3336..36f5b47 100644 --- a/dlls/dinput/joystick_private.h +++ b/dlls/dinput/joystick_private.h @@ -35,6 +35,8 @@ typedef struct JoystickGenericImpl ObjProps *props; DIDEVCAPS devcaps; + GUID guidProduct; + char *name; } JoystickGenericImpl; @@ -55,5 +57,10 @@ void _dump_DIDEVCAPS(const DIDEVCAPS *lpDIDevCaps); HRESULT WINAPI JoystickAGenericImpl_SetProperty( LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIPROPHEADER ph); +HRESULT WINAPI JoystickAGenericImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8A iface, + LPDIDEVICEINSTANCEA pdidi); + +HRESULT WINAPI JoystickWGenericImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8W iface, + LPDIDEVICEINSTANCEW pdidi); #endif /* __WINE_DLLS_DINPUT_JOYSTICK_PRIVATE_H */
1
0
0
0
Aric Stewart : dinput: Begin joystick separation into a generic module.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: 620839d24e8cae6c9ce0fbe689ff7043e7b7461d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=620839d24e8cae6c9ce0fbe68…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Mar 9 10:06:41 2009 -0500 dinput: Begin joystick separation into a generic module. --- dlls/dinput/Makefile.in | 1 + dlls/dinput/joystick.c | 276 ++++++++++++++++++++++++++++++ dlls/dinput/joystick_linux.c | 364 +++++++--------------------------------- dlls/dinput/joystick_private.h | 59 +++++++ 4 files changed, 396 insertions(+), 304 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=620839d24e8cae6c9ce0f…
1
0
0
0
Tony Wasserka : d3dx9: Recognize the D3DXSPRITE_DO_NOT_ADDREF_TEXTURE flag.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: 3b9332a41d0d1c847316aa3ca9dd87efbe678164 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3b9332a41d0d1c847316aa3ca…
Author: Tony Wasserka <tony.wasserka(a)freenet.de> Date: Mon Mar 9 17:10:28 2009 +0100 d3dx9: Recognize the D3DXSPRITE_DO_NOT_ADDREF_TEXTURE flag. --- dlls/d3dx9_36/sprite.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx9_36/sprite.c b/dlls/d3dx9_36/sprite.c index afca6cf..ce9938e 100644 --- a/dlls/d3dx9_36/sprite.c +++ b/dlls/d3dx9_36/sprite.c @@ -222,7 +222,6 @@ D3DXSPRITE_OBJECTSPACE: do not change device transforms D3DXSPRITE_SORT_DEPTH_BACKTOFRONT: sort by position D3DXSPRITE_SORT_DEPTH_FRONTTOBACK: sort by position D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often) -D3DXSPRITE_DO_NOT_ADDREF_TEXTURE: don't call AddRef/Release on every Draw/Flush call */ if(This->vdecl==NULL) { static const D3DVERTEXELEMENT9 elements[] = @@ -283,7 +282,8 @@ static HRESULT WINAPI ID3DXSpriteImpl_Draw(LPD3DXSPRITE iface, LPDIRECT3DTEXTURE This->sprites=HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->sprites, This->allocated_sprites*sizeof(SPRITE)); } This->sprites[This->sprite_count].texture=texture; - IUnknown_AddRef(texture); + if(!(This->flags & D3DXSPRITE_DO_NOT_ADDREF_TEXTURE)) + IDirect3DTexture9_AddRef(texture); /* Reuse the texture desc if possible */ if(This->sprite_count) { @@ -381,8 +381,8 @@ static HRESULT WINAPI ID3DXSpriteImpl_Flush(LPD3DXSPRITE iface) } HeapFree(GetProcessHeap(), 0, vertices); - for(i=0;i<This->sprite_count;i++) - if(This->sprites[i].texture) + if(!(This->flags & D3DXSPRITE_DO_NOT_ADDREF_TEXTURE)) + for(i=0;i<This->sprite_count;i++) IDirect3DTexture9_Release(This->sprites[i].texture); This->sprite_count=0;
1
0
0
0
Tony Wasserka : d3dx9: Recognize the D3DXSPRITE_DONOTSAVESTATE flag.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: 02e43a5276feaf345b7506ce1b19b7bba14307ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=02e43a5276feaf345b7506ce1…
Author: Tony Wasserka <tony.wasserka(a)freenet.de> Date: Mon Mar 9 17:06:38 2009 +0100 d3dx9: Recognize the D3DXSPRITE_DONOTSAVESTATE flag. --- dlls/d3dx9_36/sprite.c | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dlls/d3dx9_36/sprite.c b/dlls/d3dx9_36/sprite.c index 41767d8..afca6cf 100644 --- a/dlls/d3dx9_36/sprite.c +++ b/dlls/d3dx9_36/sprite.c @@ -223,7 +223,6 @@ D3DXSPRITE_SORT_DEPTH_BACKTOFRONT: sort by position D3DXSPRITE_SORT_DEPTH_FRONTTOBACK: sort by position D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often) D3DXSPRITE_DO_NOT_ADDREF_TEXTURE: don't call AddRef/Release on every Draw/Flush call -D3DXSPRITE_DONOTSAVESTATE: don't restore the current device state on ID3DXSprite_End */ if(This->vdecl==NULL) { static const D3DVERTEXELEMENT9 elements[] = @@ -236,22 +235,23 @@ D3DXSPRITE_DONOTSAVESTATE: don't restore the current device state on ID3DXSprite IDirect3DDevice9_CreateVertexDeclaration(This->device, elements, &This->vdecl); } - if(This->stateblock==NULL) { - /* Tell our state block what it must store */ - hr=IDirect3DDevice9_BeginStateBlock(This->device); - if(hr!=D3D_OK) return hr; + if(!(flags & D3DXSPRITE_DONOTSAVESTATE)) { + if(This->stateblock==NULL) { + /* Tell our state block what it must store */ + hr=IDirect3DDevice9_BeginStateBlock(This->device); + if(hr!=D3D_OK) return hr; - set_states(This); + set_states(This); - IDirect3DDevice9_SetVertexDeclaration(This->device, This->vdecl); - IDirect3DDevice9_SetStreamSource(This->device, 0, NULL, 0, sizeof(SPRITEVERTEX)); - IDirect3DDevice9_SetIndices(This->device, NULL); - IDirect3DDevice9_SetTexture(This->device, 0, NULL); + IDirect3DDevice9_SetVertexDeclaration(This->device, This->vdecl); + IDirect3DDevice9_SetStreamSource(This->device, 0, NULL, 0, sizeof(SPRITEVERTEX)); + IDirect3DDevice9_SetIndices(This->device, NULL); + IDirect3DDevice9_SetTexture(This->device, 0, NULL); - IDirect3DDevice9_EndStateBlock(This->device, &This->stateblock); + IDirect3DDevice9_EndStateBlock(This->device, &This->stateblock); + } + IDirect3DStateBlock9_Capture(This->stateblock); /* Save current state */ } - /* Save current state */ - IDirect3DStateBlock9_Capture(This->stateblock); /* Apply device state */ set_states(This); @@ -400,7 +400,9 @@ static HRESULT WINAPI ID3DXSpriteImpl_End(LPD3DXSPRITE iface) if(!This->ready) return D3DERR_INVALIDCALL; ID3DXSprite_Flush(iface); - if(This->stateblock) IDirect3DStateBlock9_Apply(This->stateblock); /* Restore old state */ + + if(!(This->flags & D3DXSPRITE_DONOTSAVESTATE)) + if(This->stateblock) IDirect3DStateBlock9_Apply(This->stateblock); /* Restore old state */ This->ready=FALSE;
1
0
0
0
Huw Davies : gdi32/tests: Win9x's GetDIBits() sets biSizeImage to zero for BI_RGB dibs.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: 3d461dbe853db17db8b452471dd47d64de0f81ce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3d461dbe853db17db8b452471…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 9 17:03:40 2009 +0000 gdi32/tests: Win9x's GetDIBits() sets biSizeImage to zero for BI_RGB dibs. --- dlls/gdi32/tests/bitmap.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index f095d6a..ec466dd 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -1564,7 +1564,9 @@ static void test_GetDIBits(void) lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1), "expected 16*4, got %u\n", bi->bmiHeader.biSizeImage); + ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1) || + broken(bi->bmiHeader.biSizeImage == 0), /* win9x */ + "expected 16*4, got %u\n", bi->bmiHeader.biSizeImage); /* the color table consists of black and white */ ok(bi->bmiColors[0].rgbRed == 0 && bi->bmiColors[0].rgbGreen == 0 && @@ -1614,7 +1616,9 @@ static void test_GetDIBits(void) lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24), "expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage); + ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24) || + broken(bi->bmiHeader.biSizeImage == 0), /* win9x */ + "expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage); /* the color table doesn't exist for 24-bit images */ for (i = 0; i < 256; i++) @@ -1675,7 +1679,9 @@ static void test_GetDIBits(void) lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1), "expected 16*4, got %u\n", bi->bmiHeader.biSizeImage); + ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_1) || + broken(bi->bmiHeader.biSizeImage == 0), /* win9x */ + "expected 16*4, got %u\n", bi->bmiHeader.biSizeImage); /* the color table consists of black and white */ ok(bi->bmiColors[0].rgbRed == 0 && bi->bmiColors[0].rgbGreen == 0 && @@ -1726,7 +1732,9 @@ todo_wine lines = GetDIBits(hdc, hbmp, 0, bm.bmHeight, buf, bi, DIB_RGB_COLORS); ok(lines == bm.bmHeight, "GetDIBits copied %d lines of %d, error %u\n", lines, bm.bmHeight, GetLastError()); - ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24), "expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage); + ok(bi->bmiHeader.biSizeImage == sizeof(dib_bits_24) || + broken(bi->bmiHeader.biSizeImage == 0), /* win9x */ + "expected 16*16*3, got %u\n", bi->bmiHeader.biSizeImage); /* the color table doesn't exist for 24-bit images */ for (i = 0; i < 256; i++)
1
0
0
0
Huw Davies : gdi32/tests: Marked another win9x failure as broken.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: f7608053e7ab1d6e0a91720156b68fa81c1047bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f7608053e7ab1d6e0a9172015…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 9 16:55:16 2009 +0000 gdi32/tests: Marked another win9x failure as broken. --- dlls/gdi32/tests/bitmap.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 221c6bd..f095d6a 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -2197,7 +2197,9 @@ static void test_get16dibits(void) info->bmiHeader.biCompression = BI_RGB; ret = GetDIBits(screen_dc, hbmp, 0, 0, NULL, info, 0); - ok(ret != 0, "GetDIBits failed got %d\n", ret); + ok(ret != 0 || + broken(ret == 0), /* win9x */ + "GetDIBits failed got %d\n", ret); for (p = ((BYTE *) info) + sizeof(info->bmiHeader); (p - ((BYTE *) info)) < info_len; p++) if (*p != '!')
1
0
0
0
Huw Davies : gdi32/tests: Fix yet another place where win9x returns bmType equal to 0x5250.
by Alexandre Julliard
10 Mar '09
10 Mar '09
Module: wine Branch: master Commit: bbafe938583b02c7587d8ecdbc448e02d44a1e12 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bbafe938583b02c7587d8ecdb…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Mar 9 16:45:06 2009 +0000 gdi32/tests: Fix yet another place where win9x returns bmType equal to 0x5250. --- dlls/gdi32/tests/bitmap.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 9e2f0c9..221c6bd 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -1642,6 +1642,9 @@ static void test_GetDIBits(void) memset(&bm, 0xAA, sizeof(bm)); bytes = GetObject(hbmp, sizeof(bm), &bm); ok(bytes == sizeof(bm), "GetObject returned %d\n", bytes); + ok(bm.bmType == 0 || + broken(bm.bmType == 21072), /* win9x */ + "wrong bmType %d\n", bm.bmType); ok(bm.bmType == 0, "wrong bmType %d\n", bm.bmType); ok(bm.bmWidth == 16, "wrong bmWidth %d\n", bm.bmWidth); ok(bm.bmHeight == 16, "wrong bmHeight %d\n", bm.bmHeight);
1
0
0
0
← Newer
1
...
49
50
51
52
53
54
55
...
84
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Results per page:
10
25
50
100
200