Re: [DINPUT] get Unreal Tournament 2003 (and maybe Unreal2) starting
lionel, why the IID_IDirectInput8W is considered as an old version of DINPUT ? ;))
Don't ask me, the DInput8 code was done by Transgaming. Anyway, this was on my TODO list to get America's Amry to start with built-in DInput but it seems you beat me to it (a pitty there is no public transportation strike where I live or that I take the bike :-) ). Anyway, I have just one comment :
+/****************************************************************************** + * IDirectInputW_EnumDevices + */ +static HRESULT WINAPI IDirectInputWImpl_EnumDevices( + LPDIRECTINPUT7W iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, + LPVOID pvRef, DWORD dwFlags +) +{ + ICOM_THIS(IDirectInputAImpl,iface); + DIDEVICEINSTANCEA devInstance; + DIDEVICEINSTANCEW newDevInstance; + int i; + + TRACE("(this=%p,0x%04lx,%p,%p,%04lx)\n", This, dwDevType, lpCallback, pvRef, dwFlags); + + for (i = 0; i < nrof_dinput_devices; i++) { + devInstance.dwSize = sizeof(devInstance); + if (dinput_devices[i]->enum_device(dwDevType, dwFlags, &devInstance)) { + newDevInstance.dwSize = sizeof(DIDEVICEINSTANCEW); + newDevInstance.guidInstance = devInstance.guidInstance; + newDevInstance.guidProduct = devInstance.guidProduct; + newDevInstance.dwDevType = devInstance.dwDevType; + MultiByteToWideChar( CP_ACP, 0, devInstance.tszInstanceName, -1, newDevInstance.tszInstanceName, MAX_PATH); + MultiByteToWideChar( CP_ACP, 0, devInstance.tszProductName, -1, newDevInstance.tszProductName, MAX_PATH); + if (lpCallback(&newDevInstance,pvRef) == DIENUM_STOP) + return 0; + } + } + + return 0; +}
Just to be on the pedantic side, it would be better to share this code... For example by calling the DInput8A function with a special callback written in the Wine code that converts the strings from A to W before calling the 'real' callback. Even better would be to have our code work like the rest of Wine : ie having A using the W code and not the reverse :-) Another question, did you investigate this code : SysKeyboardAImpl_EnumObjects ? This returns an 'A' pointer as part of the 'DIDEVICEOBJECTINSTANCEA' structure... If a 'DIDEVICEOBJECTINSTANCEW' is used in the case of the W interface, this needs to be changed too. Lionel -- Lionel Ulmer - http://www.bbrox.org/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le Jeudi 15 Mai 2003 20:25, Lionel Ulmer a écrit :
lionel, why the IID_IDirectInput8W is considered as an old version of DINPUT ? ;))
Don't ask me, the DInput8 code was done by Transgaming.
I know but i know you understand how it works ;)
Anyway, this was on my TODO list to get America's Amry to start with built-in DInput but it seems you beat me to it
It's what they say at work: too fast today ;)
(a pitty there is no public transportation strike where I live or that I take the bike :-) ).
you are lucky, i would like to be able to take my bike ;(
Anyway, I have just one comment : <snip> Just to be on the pedantic side, it would be better to share this code... For example by calling the DInput8A function with a special callback written in the Wine code that converts the strings from A to W before calling the 'real' callback.
Yes, i know but i wanted a fast-patch (only to get the game working) After some DInput expert (you in this case) would be able to "enhance" it ;)
Even better would be to have our code work like the rest of Wine : ie having A using the W code and not the reverse :-)
I started by that but as the only strigs are dinput static strings...
Another question, did you investigate this code : SysKeyboardAImpl_EnumObjects ? This returns an 'A' pointer as part of the 'DIDEVICEOBJECTINSTANCEA' structure... If a 'DIDEVICEOBJECTINSTANCEW' is used in the case of the W interface, this needs to be changed too.
maybe i have forgotten it ;)
Lionel
Regards, Raphael -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+w+kHp7NA3AmQTU4RAv6CAJ9zCRS9DqXFwQS7dsvSXyt2+hK1fACeKYSk 30ctvxoRTm06TPdfuFj84IE= =1BqA -----END PGP SIGNATURE-----
participants (2)
-
Lionel Ulmer -
Raphaël Junqueira