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

macOS universal binary #42

Open
wants to merge 41 commits into
base: urt
Choose a base branch
from
Open

Commits on Oct 29, 2023

  1. Configuration menu
    Copy the full SHA
    316bfb2 View commit details
    Browse the repository at this point in the history
  2. Upgrades to Xcode project and Apple Silicon support

    - Reorganized Xcode project
    - Added missionpack support to Xcode project
    - Incorporated changes from MaddTheSane for Apple Silicon support https://github.com/maddthesane/ioq3
    - Built SDL 2.0.14 for Apple Siicon, added to existing SDL dylib
    - Built SDLMain for Apple Silicon, added to existing libSDL2main.a
    
    # Conflicts:
    #	make-macosx-app.sh
    #	make-macosx.sh
    #	misc/xcode/botlib.xcodeproj/project.pbxproj
    #	misc/xcode/cgame.xcodeproj/project.pbxproj
    #	misc/xcode/game.xcodeproj/project.pbxproj
    #	misc/xcode/ioquake3-Info.plist
    #	misc/xcode/ioquake3.xcodeproj/project.pbxproj
    #	misc/xcode/ioquake3.xcworkspace/contents.xcworkspacedata
    #	misc/xcode/ioquake3.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
    #	misc/xcode/ioquake3.xcworkspace/xcshareddata/xcschemes/all game.xcscheme
    #	misc/xcode/ioquake3.xcworkspace/xcshareddata/xcschemes/all ioquake3.xcscheme
    #	misc/xcode/jpeg8.xcodeproj/project.pbxproj
    #	misc/xcode/opus.xcodeproj/project.pbxproj
    #	misc/xcode/renderer_opengl1.xcodeproj/project.pbxproj
    #	misc/xcode/renderer_opengl2.xcodeproj/project.pbxproj
    #	misc/xcode/ui.xcodeproj/project.pbxproj
    #	misc/xcode/xcode-readme.txt
    danielepantaleone-octo authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    a64ea92 View commit details
    Browse the repository at this point in the history
  3. Update SDL2 to 2.0.14

    # Conflicts:
    #	code/libs/win32/SDL2.lib
    #	code/libs/win32/SDL2main.lib
    #	code/libs/win64/SDL264.lib
    #	code/libs/win64/SDL264main.lib
    #	external/SDL2/include/SDL_config_macosx.h.orig
    #	external/SDL2/include/SDL_locale.h
    #	external/SDL2/include/SDL_metal.h
    #	external/SDL2/include/SDL_misc.h
    #	external/SDL2/include/SDL_sensor.h
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    111ae59 View commit details
    Browse the repository at this point in the history
  4. Update SDL2 to 2.0.14

    # Conflicts:
    #	code/SDL2/include/SDL_config.h
    #	code/SDL2/include/SDL_cpuinfo.h
    #	code/SDL2/include/SDL_revision.h
    #	external/SDL2/include/SDL_config.h.cmake
    #	external/SDL2/include/SDL_config.h.in
    #	external/SDL2/include/SDL_config_android.h
    #	external/SDL2/include/SDL_config_iphoneos.h
    #	external/SDL2/include/SDL_config_macosx.h
    #	external/SDL2/include/SDL_config_minimal.h
    #	external/SDL2/include/SDL_config_os2.h
    #	external/SDL2/include/SDL_config_pandora.h
    #	external/SDL2/include/SDL_config_psp.h
    #	external/SDL2/include/SDL_config_windows.h
    #	external/SDL2/include/SDL_config_winrt.h
    #	external/SDL2/include/SDL_config_wiz.h
    #	external/SDL2/include/SDL_locale.h
    #	external/SDL2/include/SDL_metal.h
    #	external/SDL2/include/SDL_misc.h
    #	external/SDL2/include/SDL_sensor.h
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    4465e09 View commit details
    Browse the repository at this point in the history
  5. Updated SDL2 include files to fix Mac build in GitHub Actions

    # Conflicts:
    #	external/SDL2/include/SDL_config_macosx.h.orig
    #	external/SDL2/include/SDL_config_os2.h
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    0b89415 View commit details
    Browse the repository at this point in the history
  6. Added another mention of arm64 to command line help

    Another one caught by MaddTheSane
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    de0cfaf View commit details
    Browse the repository at this point in the history
  7. Restored original opus sse files, excluded from Xcode

    Also added line break in script for consistency, thanks @zturtleman
    
    # Conflicts:
    #	misc/xcode/ioquake3.xcodeproj/project.pbxproj
    #	misc/xcode/opus.xcodeproj/project.pbxproj
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    ab5cf81 View commit details
    Browse the repository at this point in the history
  8. Added shell script to compile Universal 2 binary (x86_64+arm64)

    # Conflicts:
    #	make-macosx.sh
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    ec6b856 View commit details
    Browse the repository at this point in the history
  9. Reverting alert style to deprecated methods

    Until I can find a way to branch around this in a way Xcode 3 is cool with we'll just have to use the deprecated version
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    b848ccf View commit details
    Browse the repository at this point in the history
  10. Add r_parallaxMapOffset.

    SmileTheory authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    235e458 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e6bd729 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f4e98cc View commit details
    Browse the repository at this point in the history
  13. spaces > tabs

    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    3a078bd View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    fc37a76 View commit details
    Browse the repository at this point in the history
  15. Fix compiling against SDL 2.0.17

    KMOD_RESERVED was replaced with KMOD_SCROLL.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    f34e19e View commit details
    Browse the repository at this point in the history
  16. UB2 now signs and notarizes, upgraded to SDL 2.0.16

    Also works on Apple Silicon. Specific signing values are in a non-committed file, and the ub2 script only notarizes if a "notarize" flag is passed in on the command line.
    
    NOTE: the SDL dylib currently only has x86_64 and arm64, will need extra work to graft those back in and keep the Notary service happy.
    
    # Conflicts:
    #	external/SDL2/include/SDL_mutex.h
    #	external/SDL2/include/SDL_platform.h
    #	misc/xcode/ioquake3.xcodeproj/project.pbxproj
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    23a2b3a View commit details
    Browse the repository at this point in the history
  17. Architectures in libSDL2 restored for ppc and i386

    The ppc arch is the 2.0.1 that was there originaly.
    The i386 arch is 2.0.16, now compiled with an SDK later than 10.9 so the Notarization process is cool with it.
    So now all post-ppc SDL libraries are 2.0.16.
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    7472cd8 View commit details
    Browse the repository at this point in the history
  18. Update SDL2 to 2.0.16

    # Conflicts:
    #	code/SDL2/include/SDL_audio.h
    #	code/SDL2/include/SDL_cpuinfo.h
    #	code/SDL2/include/SDL_gamecontroller.h
    #	code/SDL2/include/SDL_joystick.h
    #	code/SDL2/include/SDL_mutex.h
    #	code/SDL2/include/SDL_render.h
    #	code/SDL2/include/SDL_revision.h
    #	code/SDL2/include/SDL_surface.h
    #	code/SDL2/include/SDL_system.h
    #	code/SDL2/include/SDL_thread.h
    #	code/SDL2/include/SDL_version.h
    #	code/SDL2/include/SDL_video.h
    #	external/SDL2/include/SDL_config.h.cmake
    #	external/SDL2/include/SDL_config.h.in
    #	external/SDL2/include/SDL_config_android.h
    #	external/SDL2/include/SDL_config_iphoneos.h
    #	external/SDL2/include/SDL_config_macosx.h
    #	external/SDL2/include/SDL_config_pandora.h
    #	external/SDL2/include/SDL_config_windows.h
    #	external/SDL2/include/SDL_config_winrt.h
    #	external/SDL2/include/SDL_config_wiz.h
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    9e555de View commit details
    Browse the repository at this point in the history
  19. Updated SDL 2.0.16 headers and Mac version of libraries to fix GitHub…

    … actions
    
    # Conflicts:
    #	code/libs/macosx/libSDL2-2.0.0.dylib
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    af698cf View commit details
    Browse the repository at this point in the history
  20. Addressed PR suggestions

    # Conflicts:
    #	make-macosx.sh
    #	misc/xcode/xcode-readme.txt
    tomkidd authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    bf218ba View commit details
    Browse the repository at this point in the history
  21. OpenGL2: Fix r_grayscale 1 making everything solid black

    Using LUMINANCE with OpenGL 3.2 Core contex results in all images being
    solid black (in the menu, world, and the console). In the end the whole
    screen was solid black except the intro video.
    
    Store images in RGB and RGBA instead. This doesn't affect r_grayscale
    visually. If there is issues with it now possibly using compressed
    formats, then it would already be an issue for r_grayscale 0.9.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    7bb3000 View commit details
    Browse the repository at this point in the history
  22. Print full GL_EXTENSIONS list for OpenGL contexts before 3.0

    Printing GL_EXTENSIONS list might be cut off for OpenGL contexts
    before 3.0 due to glConfig.extensions_string being a limited length.
    Instead get the full extensions list directly.
    
    This was already fixed for OpenGL 3.0 and later contexts.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    40b77f2 View commit details
    Browse the repository at this point in the history
  23. OpenGL2: GL_DEPTH_TEXTURE_MODE was removed from OpenGL 3.0/Core

    GL_DEPTH_TEXTURE_MODE defaults to GL_LUMINANCE. Code sets it here as
    part of a workaround old nvidia drivers (apparently? the URL in comment
    is dead). GL_DEPTH_TEXTURE_MODE was removed in OpenGL 3.0 / 3.2 Core
    contexts and may be treated as an error.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    31fbadd View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    101c891 View commit details
    Browse the repository at this point in the history
  25. Fix error when cross-compiling for macOS arm64 using Makefile

    Fix "Architecture arm64 is not supported when cross compiling" and
    also be more be more flexible for manually specifying CC or the
    osxcross darwin version (which corresponds with a macOS SDK version
    to build against).
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    d72af5b View commit details
    Browse the repository at this point in the history
  26. Fix passing arguments to VM dylib on Apple M1

    The engine function pointer to vmMain used variadic arguments but
    the vmMain function in the dylib has explicit arguments. Evidently
    the arguments are stored on the stack and/or registers differently.
    
    Found by fretn.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    cf9536c View commit details
    Browse the repository at this point in the history
  27. Fix compiling on older macOS

    ranlib errors on older macOS because of arm64 arch in code/libs/macosx/-
    libSDL2main.a. Use lipo to extract the library for the specific arch
    that is being linked.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    464e709 View commit details
    Browse the repository at this point in the history
  28. Fix hex digit

    mjunix authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    8abac6e View commit details
    Browse the repository at this point in the history
  29. Fix uninitialized variable

    mjunix authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    ea8a65e View commit details
    Browse the repository at this point in the history
  30. More predictable mesh normals generation

    Eugene authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    48e1e68 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    1791175 View commit details
    Browse the repository at this point in the history
  32. Add keys for SDL 2.0.14's new gamepad buttons

    This fixes the additional buttons triggering binds for ioq3 left
    and right joystick direction keys.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    d312437 View commit details
    Browse the repository at this point in the history
  33. Fix in_availableJoysticks cvar not updating

    When in_restart is called or SDL controller added/remove event is
    received, IN_InitJoystick() tried to update the list but instead
    of updating the cvar Cvar_Get() just printed a developer message:
    
      Warning: cvar "in_availableJoysticks" given initial values:
      "first joystick
      ", "first joystick
      second joystick
      "
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    333ce91 View commit details
    Browse the repository at this point in the history
  34. Fix (disabled) Wavelet sound decompression

    The first chunk of Wavelet sound was decoded as ADPCM and then
    following chunks were decoded as Wavelet. It played as static
    noise.
    
    Using Wavelet compression requires engine code changes to enable.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    1af4187 View commit details
    Browse the repository at this point in the history
  35. Update to SDL 2.24.0 and add separate macOS UB2 dylib

    Update mingw and macOS SDL libraries to 2.24.0. (MSVC .lib files and
    Xcode project haven't been updated.)
    
    There is now a separate SDL dylib for macOS Universal Binary 1 and 2
    because SDL 2.24.0 dropped support for macOS 10.6 (which is last to
    support x86). Documentation says SDL 2.24.0 also dropped macOS 10.7
    and 10.8 too. So UB2 is now 10.9 or later while 10.5 to 10.8 live in
    UB1.
    
    Compiled using osxcross with macOS 11.3 SDK. Ran "strip -x" on Windows
    and macOS libraries. Ad-hoc signed dylib using PyOxidizer rcodesign to
    fix digest checksums after strip.
    
    # Conflicts:
    #	README.md
    #	code/SDL2/include-2.0.16/SDL_config_psp.h
    #	code/SDL2/include-2.0.16/SDL_config_wiz.h
    #	code/SDL2/include/SDL_config_psp.h
    #	code/SDL2/include/SDL_config_wiz.h
    #	code/libs/macosx-ub/libSDL2main.a
    #	code/libs/macosx/libSDL2main.a
    #	external/SDL2/include/SDL_config_emscripten.h
    #	external/SDL2/include/SDL_config_ngage.h
    #	external/SDL2/include/SDL_config_psp.h
    #	external/SDL2/include/SDL_config_wingdk.h
    #	external/SDL2/include/SDL_config_wiz.h
    #	external/SDL2/include/SDL_config_xbox.h
    #	external/SDL2/include/SDL_guid.h
    #	external/SDL2/include/SDL_hidapi.h
    #	external/SDL2/include/SDL_revision.h.cmake
    #	libs/macosx/libSDL2main.a
    #	make-macosx-app.sh
    #	make-macosx.sh
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    b35b710 View commit details
    Browse the repository at this point in the history
  36. Update macOS UB1 to SDL 2.0.22

    Fix crash when scrolling using touchpad on macOS 10.6 (I fixed it
    in SDL 2.0.18) and fix failing to start on x86 due to ioq3 SDL dylib
    having absolute path instead of "@executable_path/libSDL2-2.0.0.dylib".
    
    SDL 2.24.0 removed macOS 10.6 support (last with x86). Offically at
    least, they also dropped x86_64 on macOS 10.7 and 10.8. So ioq3 UB1
    is limited to SDL 2.0.22.
    
    - Update x86 and x86_64 to SDL 2.0.22. Compiled with 10.13 SDK as
      10.14 SDK dropped running on older than macOS 10.9 and I ran
      "strip -x" on the libraries. Ad-hoc signed with PyOxidizer rcodesign.
    - PPC is still MAN-AT-ARMS' SDL 2.0.1 build but I ran "strip -x"
      on it to reduce the file size.
    - ARM64 build was removed from UB1 as UB2 with SDL 2.24.0 should
      be used instead.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    e888c7a View commit details
    Browse the repository at this point in the history
  37. Fix running make-macosx{,-ub2}.sh on Linux

    osxcross doesn't support ppc so it's not possible to compile Universal
    Binary 1.
    
    # Conflicts:
    #	make-macosx-ub.sh
    #	make-macosx.sh
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    2a51faa View commit details
    Browse the repository at this point in the history
  38. Fix macOS client/server failing to start from terminal

    The macOS client and server were completely unusable when run from a
    terminal. They blocked forever in `[NSApp run];` which was called by
    Sys_InitProtocolHandler(). `applicationDidFinishLaunching` was never
    called to exit the NSApp run loop.
    
    Use SDL's SDL_DROPFILE event to receive URLs to handle on macOS instead.
    This also handles URLs while the game is running (connect to new server)
    instead of nothing happening when clicking a link while the game is
    running.
    
    # Conflicts:
    #	code/sys/sys_local.h
    #	code/sys/sys_main.c
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    32efd50 View commit details
    Browse the repository at this point in the history
  39. Don't list mod directories at Windows drive root

    The mod list on Windows would search the root of the drive if
    fs_basepath, fs_homepath, fs_steampath, or fs_gogpath are blank ("")
    (which is usually the case).
    
    The issue is in the low-level Sys_ListFiles() but it only affects the
    mod menu, on Windows. It cannot be abused by console commands to
    list system files outside of the virtual filesystem.
    
    ---
    
    If a directory at the root of the drive of the working directory
    contained a pk3 file, the directory was listed in the mods menu. The
    virtual filesystem doesn't add blank directory names to the search path
    so it cannot load mods from the drive root. (Unless of course you set a
    fs_*path cvar to "C:\".)
    
    Sys_ListFiles() with blank directory caused Windows to use "\*" for the
    search path and "\" prefix means root of drive. Unix opendir("") failed
    so nothing was listed for blank directory.
    
    Sys_ListFilteredFiles() with blank directory _and_ specifying subdirs
    could access any directory (on Windows and Unix-like) but no code uses
    this or makes it accessible.
    
    These functions are only used for initializing the virtual filesystem
    and listing mods. They are not accessible by anything else such as a
    console command. Only the mods menu, on Windows, is affected.
    zturtleman authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    c5c8e6f View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    642a10a View commit details
    Browse the repository at this point in the history
  41. Revert "Simplify glsl -> C stringification"

    This reverts commit 1118ec3.
    danielepantaleone-octo authored and danielepantaleone committed Oct 29, 2023
    Configuration menu
    Copy the full SHA
    5a0a39b View commit details
    Browse the repository at this point in the history