Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non-SDL2 platform code and add controller rumble support #318

Merged
merged 9 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions MSVC/build/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@
#define BZ_PLUGINS 1

// Use SDL2
#define HAVE_SDL 1
#define HAVE_SDL2 1
#define HAVE_SDL2_SDL_H 1

#define HAVE_STD__MIN 1
Expand Down
208 changes: 7 additions & 201 deletions MSVC/build/platform.vcxproj

Large diffs are not rendered by default.

79 changes: 8 additions & 71 deletions MSVC/build/platform.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
<ClCompile Include="..\..\src\platform\BzfWindow.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\DXJoystick.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\PlatformFactory.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\SDL2Display.cxx">
<Filter>Source Files</Filter>
</ClCompile>
Expand All @@ -31,38 +25,17 @@
<ClCompile Include="..\..\src\platform\SDL2Window.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\WinPlatformFactory.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\WinMedia.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\wave.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\WinWindow.cxx">
<Filter>Source Files\Unused Platform Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\WinVisual.cxx">
<Filter>Source Files\Unused Platform Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\WinJoystick.cxx">
<Filter>Source Files\Unused Platform Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\WinDisplay.cxx">
<Filter>Source Files\Unused Platform Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\SDLPlatformFactory.cxx">
<Filter>Source Files\Unused Platform Files</Filter>
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\SDLMedia.cxx">
<Filter>Source Files\Unused Platform Files</Filter>
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\SDLJoystick.cxx">
<Filter>Source Files\Unused Platform Files</Filter>
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\platform\EvdevJoystick.cxx">
<Filter>Source Files\Unused Platform Files</Filter>
<ClCompile Include="..\..\src\platform\PlatformFactory.cxx">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
Expand All @@ -84,15 +57,9 @@
<ClInclude Include="..\..\include\BzfWindow.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\DXJoystick.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\ErrorHandler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\EvdevJoystick.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\OpenGLGState.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -117,38 +84,14 @@
<ClInclude Include="..\..\include\TimeKeeper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\wave.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\WinMedia.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\WinPlatformFactory.h">
<ClInclude Include="..\..\src\platform\SDLPlatformFactory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\XIJoystick.h">
<ClInclude Include="..\..\src\platform\SDLMedia.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\SDLJoystick.h">
<Filter>Header Files\Unused Platform Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\SDLMedia.h">
<Filter>Header Files\Unused Platform Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\SDLPlatformFactory.h">
<Filter>Header Files\Unused Platform Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\WinDisplay.h">
<Filter>Header Files\Unused Platform Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\WinJoystick.h">
<Filter>Header Files\Unused Platform Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\WinVisual.h">
<Filter>Header Files\Unused Platform Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\platform\WinWindow.h">
<Filter>Header Files\Unused Platform Files</Filter>
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
Expand All @@ -158,11 +101,5 @@
<Filter Include="Source Files">
<UniqueIdentifier>{8e467fdb-5d5f-40d8-96fc-0301b81acab7}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\Unused Platform Files">
<UniqueIdentifier>{81837eea-ad25-4848-a785-75dd692d6faf}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Unused Platform Files">
<UniqueIdentifier>{2235379f-89b6-496e-8a3b-37883685b7d6}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
14 changes: 0 additions & 14 deletions Xcode/BZFlag.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@
0357A8BA1670B7E40056C938 /* SDLJoystick.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 0357A8A11670B7670056C938 /* SDLJoystick.cxx */; };
0357A8BB1670B7E40056C938 /* SDLMedia.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 0357A8A31670B7670056C938 /* SDLMedia.cxx */; };
0357A8BC1670B7E40056C938 /* SDLPlatformFactory.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 0357A8A51670B7670056C938 /* SDLPlatformFactory.cxx */; };
0357A8BD1670B7E40056C938 /* wave.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 0357A8A71670B7670056C938 /* wave.cxx */; };
0357A8C81670B9050056C938 /* AudioFile.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 035544BA166C846F008806E9 /* AudioFile.cxx */; };
0357A8C91670B9050056C938 /* ImageFile.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 035544BC166C846F008806E9 /* ImageFile.cxx */; };
0357A8CA1670B9050056C938 /* MediaFile.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 035544BF166C846F008806E9 /* MediaFile.cxx */; };
Expand Down Expand Up @@ -1640,8 +1639,6 @@
0357A8A41670B7670056C938 /* SDLMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLMedia.h; sourceTree = "<group>"; };
0357A8A51670B7670056C938 /* SDLPlatformFactory.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SDLPlatformFactory.cxx; sourceTree = "<group>"; };
0357A8A61670B7670056C938 /* SDLPlatformFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLPlatformFactory.h; sourceTree = "<group>"; };
0357A8A71670B7670056C938 /* wave.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wave.cxx; sourceTree = "<group>"; };
0357A8A81670B7670056C938 /* wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wave.h; sourceTree = "<group>"; };
0357A8AD1670B79E0056C938 /* libplatform.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libplatform.a; sourceTree = BUILT_PRODUCTS_DIR; };
0357A8C41670B8DE0056C938 /* libmediafile.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libmediafile.a; sourceTree = BUILT_PRODUCTS_DIR; };
0357A8D51670B9930056C938 /* libdate.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libdate.a; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -1776,8 +1773,6 @@
0394E91C167B293E007F4035 /* timedctf.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = timedctf.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
0394E927167B29CC007F4035 /* TimeLimit.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = TimeLimit.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
0394E93D167B2A9E007F4035 /* wwzones.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = wwzones.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
0397089F1DD7991D00C9215C /* SDLDisplay.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SDLDisplay.cxx; sourceTree = "<group>"; };
039708A01DD7991D00C9215C /* SDLDisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLDisplay.h; sourceTree = "<group>"; };
039708A11DD7991D00C9215C /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = "<group>"; };
039708A21DD7991D00C9215C /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = "<group>"; };
03C338C51AFB59FF00E8F655 /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = /Library/Frameworks/SDL2.framework; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3013,8 +3008,6 @@
0357A89D1670B7670056C938 /* BzfWindow.cxx */,
0336ED7A1B7042E40090899C /* MacDataPath.cxx */,
0357A89E1670B7670056C938 /* PlatformFactory.cxx */,
0397089F1DD7991D00C9215C /* SDLDisplay.cxx */,
039708A01DD7991D00C9215C /* SDLDisplay.h */,
0357A8A11670B7670056C938 /* SDLJoystick.cxx */,
0357A8A21670B7670056C938 /* SDLJoystick.h */,
039708A11DD7991D00C9215C /* SDLMain.h */,
Expand All @@ -3029,8 +3022,6 @@
03C338CA1AFB5AFC00E8F655 /* SDL2Visual.h */,
03C338CB1AFB5AFC00E8F655 /* SDL2Window.cxx */,
03C338CC1AFB5AFC00E8F655 /* SDL2Window.h */,
0357A8A71670B7670056C938 /* wave.cxx */,
0357A8A81670B7670056C938 /* wave.h */,
03554B07166C8470008806E9 /* README */,
);
path = platform;
Expand Down Expand Up @@ -5191,7 +5182,6 @@
0357A8BB1670B7E40056C938 /* SDLMedia.cxx in Sources */,
0342A7031DD79C5100D04E4C /* SDL2Window.cxx in Sources */,
0357A8BC1670B7E40056C938 /* SDLPlatformFactory.cxx in Sources */,
0357A8BD1670B7E40056C938 /* wave.cxx in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -7308,8 +7298,6 @@
"INSTALL_DATA_DIR=\\\"/usr/local/share/bzflag\\\"",
"BZ_BUILD_XCODE_VERSION_STR=\\\"$(BZFLAG_XCODE_VERSION)\\\"",
BZ_PLUGINS,
HAVE_SDL,
HAVE_SDL2,
HAVE_SDL2_SDL_H,
"DEBUG=1",
);
Expand Down Expand Up @@ -7364,8 +7352,6 @@
"INSTALL_DATA_DIR=\\\"/usr/local/share/bzflag\\\"",
"BZ_BUILD_XCODE_VERSION_STR=\\\"$(BZFLAG_XCODE_VERSION)\\\"",
BZ_PLUGINS,
HAVE_SDL,
HAVE_SDL2,
HAVE_SDL2_SDL_H,
);
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
Expand Down
94 changes: 11 additions & 83 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ BZ_CONFIGURE_STAGE([arguments], [1 of 9])
# provide a with-curses option, test for curses
MP_WITH_CURSES

# check for SDL option (enabled by default now)
AC_ARG_WITH(SDL, AS_HELP_STRING([--without-SDL | --with-SDL={1,2}],[Do not use Simple DirectMedia Layer or force using a specific version (by default requires SDL2]), sdl_version="$withval", sdl_version="2")

# build the server?
AC_ARG_ENABLE(server, AS_HELP_STRING([--disable-server],[do not compile server]))

Expand Down Expand Up @@ -422,7 +419,6 @@ AC_CHECK_HEADERS( \
)
AC_LANG(C)
AC_CHECK_HEADERS( \
SDL/SDL.h \
SDL2/SDL.h \
bstring.h \
dlfcn.h \
Expand Down Expand Up @@ -550,33 +546,6 @@ case $host_os in
;;
esac


# avoid using X11 in BeOS and Mac OS X
case $host_os in
beos*)
;;
darwin*)
;;
*)
if test x$with_SDL != xyes; then
CONF_CPPFLAGS="$CONF_CPPFLAGS $X_CFLAGS"
if test x$no_x = x; then
GLIBS="$X_PRE_LIBS -lX11 $EXTRA_LIBS $GLIBS"
fi

AC_CHECK_LIB(Xext, XextAddDisplay, [GLIBS="-lXext $GLIBS"], [], $GLIBS)

AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
[AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
[ AC_DEFINE(XF86VIDMODE_EXT, 1, [XFree86 Video Mode Extension])
GLIBS="-lXxf86vm $GLIBS"
],,
)],,[#include <X11/Xlib.h>]
)
fi
;;
esac

case $host_os in
darwin*)
AC_CHECK_HEADER([OpenGL/gl.h], [ac_cv_search_glBegin="none required"], [have_gl=no ; ac_cv_search_glBegin=no])
Expand Down Expand Up @@ -662,49 +631,20 @@ AC_DEFINE_UNQUOTED(BZFLAG_DATA, "$BZFLAG_DATA", [Data file directory])
savedLIBS=$LIBS
LIBS="$GLIBS $LIBS"
AC_LANG(C)
if test "x$enable_client" != xno -a "x$with_SDL" != xno; then
if test "x$sdl_version" != "x1" -a "x$sdl_version" != "xdetect"; then
sdl_version="2"
fi

if test "x$sdl_version" = "x2"; then
# Test for SDL 2
AM_PATH_SDL2(2.0.3, with_SDL=2, with_SDL=no)

if test "x$with_SDL" != "x2"; then
AC_MSG_WARN(
[Client build is enabled, but SDL2 does not seem to be fully available ... disabling BZFlag client])
AM_CONDITIONAL(CLIENT_INCLUDED, false)
enable_client=no
fi
fi

if test "x$sdl_version" = "x1"; then
# Test for SDL 1.2
AM_PATH_SDL(1.2.10, with_SDL=1, with_SDL=no)

if test "x$with_SDL" != "x1"; then
AC_MSG_WARN(
[Client build is enabled, but SDL1 does not seem to be fully available ... disabling BZFlag client])
AM_CONDITIONAL(CLIENT_INCLUDED, false)
enable_client=no
fi
if test "x$enable_client" != xno; then
# Test for SDL 2
AM_PATH_SDL2(2.0.9, with_SDL2=yes, with_SDL2=no)

if test "x$with_SDL2" != "xyes"; then
AC_MSG_WARN(
[Client build is enabled, but SDL2 does not seem to be fully available ... disabling BZFlag client])
AM_CONDITIONAL(CLIENT_INCLUDED, false)
enable_client=no
fi
fi
AC_LANG(C++)
LIBS=$savedLIBS

if test "x$with_SDL" != "xno"; then
AC_DEFINE(HAVE_SDL, 1, [Using SDL])
fi
if test "x$with_SDL" = "x2"; then
AC_DEFINE(HAVE_SDL2, 1, [Using SDL2])
fi

AM_CONDITIONAL(HAVE_SDL, test x$with_SDL = x1 -o x$with_SDL = x2)
AM_CONDITIONAL(HAVE_SDL2, test x$with_SDL = x2)


# dumb temp hacks to add missing linkage stuff
case $host_os in
irix)
Expand Down Expand Up @@ -1133,23 +1073,11 @@ if test "x$enable_client" = "xno"; then
fi
fi

if test "x$sdl_version" = "x2" -a "x$with_SDL" != "x2" ; then
if test "x$with_SDL2" != "xyes" ; then
build_bzflag="$build_bzflag (missing SDL2)"
fi

if test "x$sdl_version" = "x1" -a "x$with_SDL" != "x1" ; then
build_bzflag="$build_bzflag (missing SDL1)"
fi
else
if test x$with_SDL != xno; then
if test x$with_SDL = x2; then
build_bzflag="yes (with SDL2)"
else
build_bzflag="yes (with SDL1)"
fi
else
build_bzflag="yes"
fi
build_bzflag="yes"
fi
if test "x$enable_server" != xno ; then
if test "x$enable_plugins" != xno ; then
Expand Down
10 changes: 2 additions & 8 deletions data/l10n/bzflag_es.po
Original file line number Diff line number Diff line change
Expand Up @@ -1479,14 +1479,8 @@ msgstr "Joystick:"
msgid "Active input device:"
msgstr "Dispositivo de entrada activo:"

msgid "Force feedback:"
msgstr "Force feedback:"

msgid "Rumble"
msgstr "Barullo"

msgid "Directional"
msgstr "Direccional"
msgid "Rumble:"
msgstr "Barullo:"

msgid "Joystick X Axis:"
msgstr "Eje X del joystick:"
Expand Down
10 changes: 2 additions & 8 deletions data/l10n/bzflag_ru.po
Original file line number Diff line number Diff line change
Expand Up @@ -1785,14 +1785,8 @@ msgstr "Joystik:"
msgid "Active input device:"
msgstr "Aktivnye ustrojstva vvoda:"

msgid "Force feedback:"
msgstr "Otdacha joyjstika:"

msgid "Rumble"
msgstr "Shumy"

msgid "Directional"
msgstr "Napravlennij"
msgid "Rumble:"
msgstr "Shumy:"

msgid "Joystick X Axis:"
msgstr "Os' X joyjstika:"
Expand Down
10 changes: 2 additions & 8 deletions data/l10n/bzflag_sk.po
Original file line number Diff line number Diff line change
Expand Up @@ -1753,14 +1753,8 @@ msgstr "Zariadenie joysticku:"
msgid "Active input device:"
msgstr "Aktivne vstupne zariadenie:"

msgid "Force feedback:"
msgstr "Force feedback:"

msgid "Rumble"
msgstr "Rumble"

msgid "Directional"
msgstr "Smerovy"
#msgid "Rumble:"
#msgstr ""

msgid "Joystick X Axis:"
msgstr "X os joysticku:"
Expand Down
Loading