Skip to content

Commit

Permalink
merge 2.4 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
timriker committed Jul 25, 2023
2 parents c915aa8 + f2f8c0b commit ee0cbdd
Show file tree
Hide file tree
Showing 7 changed files with 7,588 additions and 11 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ BZFlag 2.5.x

* Apply colorblindness to your own tank and shots - Kyle Mills

* Cleaned up and updated the Xcode project file - Joshua Bodine
* Fixed yet another SDL2 window management regression on macOS - Joshua Bodine
* Remove non-SDL2 platform code and add SDL2 controller rumble support
- Scott Wichser
* Fix libcurl deprecation warnings - Alfredo Tupone
Expand Down
34 changes: 34 additions & 0 deletions Xcode/BZFlag-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>BZFlag</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>BZFlag</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>BZFlag</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.4.27</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.arcade-games</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) 1993-2023 Tim Riker</string>
</dict>
</plist>
7,530 changes: 7,530 additions & 0 deletions Xcode/BZFlag.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion Xcode/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
SUBDIRS = \
BZFlag.xcodeproj

EXTRA_DIST = \
BZFlag.icns
BZFlag-info.plist \
BZFlag.icns \
config.h

MAINTAINERCLEANFILES = \
Makefile.in
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,7 @@ AC_CONFIG_FILES([
MSVC/Makefile
MSVC/build/Makefile
Xcode/Makefile
Xcode/BZFlag.xcodeproj/Makefile
Makefile
bzflag.spec
data/Makefile
Expand Down
2 changes: 1 addition & 1 deletion src/bzflag/playing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -6748,7 +6748,7 @@ static void setupRoamingCamera(float dt)
else
deltaCamera.theta = ROAM.getZoom() * (float)myTank->getRotation();
if (control)
deltaCamera.phi = -2.0f * ROAM.getZoom() / 3.0f * (float)myTank->getSpeed();
deltaCamera.phi = 2.0f * ROAM.getZoom() / 3.0f * (float)myTank->getSpeed();
if (shift)
deltaCamera.pos[2] = (float)(4 * myTank->getSpeed()) * BZDBCache::tankSpeed;
}
Expand Down
23 changes: 14 additions & 9 deletions src/platform/SDL2Window.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,16 @@ void SDLWindow::swapBuffers()
}

// For some reason, when creating a new fullscreen window on Linux with a different resolution than before, SDL throws
// a resize event with the old window resolution, which is not what we want. This function is called to filter SDL
// window resize events right after the resolution change and adjust the resolution to the correct one.
#ifdef __linux__
// a resize event with the old window resolution, which is not what we want. Additionally, on macOS, sometime after
// version 2.0.14 of SDL we started getting bogus SDL_WINDOWEVENT_RESIZED events during the first toggle from fullscreen
// to windowed mode. This function is called to filter SDL window resize events in either of these scenarios to either
// adjust the resolution to the correct one (in the Linux scenario) or discard the event (in the macOS scenario).
#if defined(__linux__) || defined(__APPLE__)
int SDLWindowEventFilter(void *resolution, SDL_Event *event)
{
if(! resolution)
return 0; // drop the event

if(event->type == SDL_WINDOWEVENT && (event->window.event == SDL_WINDOWEVENT_RESIZED ||
event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED))
{
Expand All @@ -208,7 +213,7 @@ int SDLWindowEventFilter(void *resolution, SDL_Event *event)

return 1; // allow the event
}
#endif // __linux__
#endif // __linux__ || __APPLE__

bool SDLWindow::create(void)
{
Expand Down Expand Up @@ -240,11 +245,11 @@ bool SDLWindow::create(void)
SDL_DestroyWindow(windowId);
}

SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
SDL_GL_SetAttribute(
SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
// Apply filters due to bogus resize event issue on macOS (see the explanation above for SDLWindowEventFilter())
#ifdef __APPLE__
SDL_PumpEvents();
SDL_FilterEvents(&SDLWindowEventFilter, nullptr);
#endif // __APPLE__

// (re)create the window

Expand Down

0 comments on commit ee0cbdd

Please sign in to comment.