Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
bug 604039 - Windows gamepad backend using DirectInput. r=bas
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 9a4e13dea21f6f57a8ca2bf677ff0a2f0a0dc4eb
  • Loading branch information
Ted Mielczarek committed Aug 3, 2011
1 parent 9189786 commit 1983ec9
Show file tree
Hide file tree
Showing 4 changed files with 671 additions and 3 deletions.
22 changes: 19 additions & 3 deletions configure.in
Expand Up @@ -5888,19 +5888,22 @@ if test -n "$MOZ_WEBGL_DISABLED"; then
MOZ_ANGLE_RENDERER=
fi

if test -n "$MOZ_ANGLE_RENDERER" -a -z "$CROSS_COMPILE"; then
# Locate a DirectX SDK here so we can use it for both ANGLE and
# Joystick support.
if test "$OS_TARGET" = "WINNT" -a -z "$CROSS_COMPILE"; then
# Get the SDK path from the registry.
# First try to get the June 2010 SDK
MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1`
if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then
# Otherwise just take whatever comes first
MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1`
fi
MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/' | sed 's,\\\\,/,g'`
fi

if test -n "$MOZ_ANGLE_RENDERER" -a -z "$CROSS_COMPILE"; then
if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then
AC_MSG_ERROR([Found the February 2010 DirectX SDK. Need the June 2010 DirectX SDK, or newer. Upgrade your SDK or reconfigure with --disable-webgl.])
else
MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/' | sed 's,\\\\,/,g'`
fi

if test -n "$MOZ_DIRECTX_SDK_PATH" &&
Expand Down Expand Up @@ -5952,6 +5955,19 @@ if test "$MOZ_GAMEPAD"; then
Darwin)
MOZ_GAMEPAD_BACKEND=cocoa
;;
WINNT)
if test -n "$MOZ_DIRECTX_SDK_PATH" ; then
if ! test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
MOZ_GAMEPAD=
fi
else
MOZ_GAMEPAD=
fi
if test -z "$MOZ_GAMEPAD"; then
AC_MSG_ERROR([Couldn't find the DirectX SDK, needed for gamepad support. Please install it or, reconfigure with --disable-gamepad to disable gamepad support.])
fi
MOZ_GAMEPAD_BACKEND=windows
;;
*)
;;
esac
Expand Down
3 changes: 3 additions & 0 deletions hal/Makefile.in
Expand Up @@ -48,6 +48,9 @@ endif
ifeq (cocoa,$(MOZ_GAMEPAD_BACKEND))
CPPSRCS += CocoaGamepad.cpp
endif
ifeq (windows,$(MOZ_GAMEPAD_BACKEND))
CPPSRCS += WindowsGamepad.cpp
endif

ifeq (android,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS += \
Expand Down

0 comments on commit 1983ec9

Please sign in to comment.