diff --git a/INSTALL.md b/INSTALL.md
index 0e5420d..fb905f1 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -10,7 +10,7 @@ See [README.md](README.md) for download links if you just want to play the game.
| **Linux** | CMake | Proton SDK cloned inside project, uses SDL2 + SDL2_mixer for audio |
| **iOS** | Xcode | Proton SDK sibling layout, uses FMOD for audio |
| **Android** | Gradle + CMake | Proton SDK sibling layout, uses FMOD for audio |
-| **macOS** | Xcode | Broken/unmaintained |
+| **macOS** | Xcode | Universal binary (Intel + Apple Silicon), uses SDL2 + SDL2_mixer for audio (see [macOS section](#macos)) |
| **HTML5** | Emscripten | See [Proton HTML5 setup](https://www.rtsoft.com/wiki/doku.php?id=proton:html5_setup) |
All platforms require the **Dink Smallwood game data** (`dink/` directory) to play. See [README.md](README.md#just-want-to-play) for how to obtain it.
@@ -92,23 +92,79 @@ proton/
---
-## macOS (broken/unmaintained)
+## macOS
-> **Note:** The macOS build has not been maintained for a long time and likely does not build without fixes. It is left here for reference.
+The macOS build uses the Xcode project at `OSX/RTDink.xcodeproj`.
-The Xcode project is at the repo root (`RTDink.xcodeproj`). Same sibling layout as Windows:
+- **Supported architectures:** Universal binary — runs natively on both **Intel (x86_64)** and **Apple Silicon (ARM64 / M1+)**.
+- **Audio:** Uses **SDL2** + **SDL2_mixer** — no FMOD required.
+- **SDL2 frameworks are bundled inside the `.app`** — no SDL2 installation required to run the game.
+
+### Directory layout
+
+Clone both repos as **siblings**:
```
-proton/
- shared/ <-- Proton SDK
- RTDink/
- RTDink.xcodeproj
+some_folder/
+ proton/ <-- Proton SDK (cloned here)
+ shared/
+ RTDink/ <-- this repo (cloned here)
+ OSX/
+ RTDink.xcodeproj
```
-1. Clone [Proton SDK](https://github.com/SethRobinson/proton)
-2. Clone this repo inside the Proton directory
-3. Open `RTDink.xcodeproj` in Xcode
-4. Build and run (may require fixes)
+The Xcode project references `../../shared/` (relative to `OSX/`) to find the Proton SDK.
+
+### Steps
+
+1. Clone the Proton SDK and this repo as siblings:
+
+```bash
+git clone https://github.com/SethRobinson/proton.git
+git clone https://github.com/SethRobinson/RTDink.git
+```
+
+2. Install **SDL2** and **SDL2_mixer** frameworks:
+
+ **Option A — DMG frameworks** (recommended, works on all Macs, required for universal binary):
+ ```bash
+ # SDL2 framework
+ curl -L -o ~/SDL2.dmg "https://github.com/libsdl-org/SDL/releases/download/release-2.30.9/SDL2-2.30.9.dmg"
+ hdiutil attach ~/SDL2.dmg
+ mkdir -p ~/Library/Frameworks
+ cp -r /Volumes/SDL2/SDL2.framework ~/Library/Frameworks/
+ hdiutil detach /Volumes/SDL2
+
+ # SDL2_mixer framework
+ curl -L -o ~/SDL2_mixer.dmg "https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.0/SDL2_mixer-2.8.0.dmg"
+ hdiutil attach ~/SDL2_mixer.dmg
+ cp -r "/Volumes/SDL2_mixer/SDL2_mixer.framework" ~/Library/Frameworks/
+ hdiutil detach /Volumes/SDL2_mixer
+ ```
+ The Xcode project looks for both frameworks in `~/Library/Frameworks/` automatically. These are universal frameworks (arm64 + x86_64) so the resulting `.app` runs on both Intel and Apple Silicon Macs.
+
+ **Option B — Homebrew** (native arch only, not suitable for universal binary):
+ ```bash
+ brew install sdl2 sdl2_mixer
+ ```
+ > **Note:** Homebrew on Apple Silicon only provides arm64 libraries. Use Option A if you need a universal binary.
+
+3. Generate the required libpng config header:
+
+```bash
+LIBPNG=proton/shared/Irrlicht/source/Irrlicht/libpng
+cp "$LIBPNG/pnglibconf.h.prebuilt" "$LIBPNG/pnglibconf.h"
+```
+
+4. Open the Xcode project:
+
+```bash
+open RTDink/OSX/RTDink.xcodeproj
+```
+
+5. Select the **Release** configuration and build (`⌘B`).
+
+> **Note:** The SDL2 frameworks are automatically embedded into the `.app` bundle at build time, so the final app is self-contained and does not require SDL2 to be installed on the target machine.
---
diff --git a/OSX/English.lproj/InfoPlist.strings b/OSX/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..b918fdb
--- /dev/null
+++ b/OSX/English.lproj/InfoPlist.strings
@@ -0,0 +1,4 @@
+/* Localized versions of Info.plist keys */
+
+CFBundleGetInfoString = "Dink Smallwood HD v2.08, Copyright © 2024 Robinson Technologies";
+NSHumanReadableCopyright = "Copyright © 2024, Robinson Technologies";
diff --git a/OSX/English.lproj/MainMenu.xib b/OSX/English.lproj/MainMenu.xib
new file mode 100644
index 0000000..b57cc83
--- /dev/null
+++ b/OSX/English.lproj/MainMenu.xib
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OSX/RTDink.xcodeproj/project.pbxproj b/OSX/RTDink.xcodeproj/project.pbxproj
index ac8abd5..70c8df0 100644
--- a/OSX/RTDink.xcodeproj/project.pbxproj
+++ b/OSX/RTDink.xcodeproj/project.pbxproj
@@ -8,12 +8,14 @@
/* Begin PBXBuildFile section */
5D21B9E11FA6C31D00B12CB3 /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9CE1FA6C31B00B12CB3 /* png.c */; };
+ AA000009000000000000AA01 /* GamepadProviderGCController.mm in Sources */ = {isa = PBXBuildFile; fileRef = AA00000A000000000000AA01 /* GamepadProviderGCController.mm */; };
+ AA00000B000000000000AA01 /* GamepadGCController.mm in Sources */ = {isa = PBXBuildFile; fileRef = AA00000C000000000000AA01 /* GamepadGCController.mm */; };
+ AA00000D000000000000AA01 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA00000E000000000000AA01 /* GameController.framework */; };
5D21B9E21FA6C31D00B12CB3 /* pngerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9CF1FA6C31B00B12CB3 /* pngerror.c */; };
5D21B9E31FA6C31D00B12CB3 /* pngtrans.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9D01FA6C31B00B12CB3 /* pngtrans.c */; };
5D21B9E41FA6C31D00B12CB3 /* pngrutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9D11FA6C31B00B12CB3 /* pngrutil.c */; };
5D21B9E51FA6C31D00B12CB3 /* pngwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9D21FA6C31B00B12CB3 /* pngwrite.c */; };
5D21B9E61FA6C31D00B12CB3 /* pngget.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9D31FA6C31B00B12CB3 /* pngget.c */; };
- 5D21B9E71FA6C31D00B12CB3 /* pnggccrd.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9D41FA6C31B00B12CB3 /* pnggccrd.c */; };
5D21B9E81FA6C31D00B12CB3 /* pngrio.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9D51FA6C31B00B12CB3 /* pngrio.c */; };
5D21B9E91FA6C31D00B12CB3 /* pngwtran.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9D61FA6C31C00B12CB3 /* pngwtran.c */; };
5D21B9EA1FA6C31D00B12CB3 /* pngpread.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9D71FA6C31C00B12CB3 /* pngpread.c */; };
@@ -21,14 +23,25 @@
5D21B9EC1FA6C31D00B12CB3 /* pngwio.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9D91FA6C31C00B12CB3 /* pngwio.c */; };
5D21B9ED1FA6C31D00B12CB3 /* pngmem.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9DA1FA6C31C00B12CB3 /* pngmem.c */; };
5D21B9EE1FA6C31D00B12CB3 /* pngwutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9DB1FA6C31C00B12CB3 /* pngwutil.c */; };
- 5D21B9EF1FA6C31D00B12CB3 /* pngvcrd.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9DE1FA6C31D00B12CB3 /* pngvcrd.c */; };
5D21B9F01FA6C31D00B12CB3 /* pngread.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9DF1FA6C31D00B12CB3 /* pngread.c */; };
5D21B9F11FA6C31D00B12CB3 /* pngrtran.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9E01FA6C31D00B12CB3 /* pngrtran.c */; };
5D21B9F91FA6C34500B12CB3 /* GamepadProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9F41FA6C34500B12CB3 /* GamepadProvider.cpp */; };
5D21B9FA1FA6C34500B12CB3 /* GamepadManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9F61FA6C34500B12CB3 /* GamepadManager.cpp */; };
5D21B9FB1FA6C34500B12CB3 /* Gamepad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9F81FA6C34500B12CB3 /* Gamepad.cpp */; };
5D21B9FE1FA6C37E00B12CB3 /* AudioManagerFMODStudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21B9FD1FA6C37E00B12CB3 /* AudioManagerFMODStudio.cpp */; };
+ AA000004000000000000AA01 /* AudioManagerSDL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA000003000000000000AA01 /* AudioManagerSDL.cpp */; };
+ AA000005000000000000AA01 /* GamepadProviderSDL2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA000006000000000000AA01 /* GamepadProviderSDL2.cpp */; };
+ AA000007000000000000AA01 /* GamepadSDL2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA000008000000000000AA01 /* GamepadSDL2.cpp */; };
+
+
5D21BA051FA6C3DD00B12CB3 /* AdProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21BA021FA6C3DD00B12CB3 /* AdProvider.cpp */; };
+ AA000001000000000000AA01 /* EmulatedPointerComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA000002000000000000AA01 /* EmulatedPointerComponent.cpp */; };
+ AA000001000000000000AA06 /* TouchDragComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA000002000000000000AA06 /* TouchDragComponent.cpp */; };
+
+ AA000001000000000000AA02 /* LogDisplayComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA000002000000000000AA02 /* LogDisplayComponent.cpp */; };
+ AA000001000000000000AA03 /* arm_init.c in Sources */ = {isa = PBXBuildFile; fileRef = AA000002000000000000AA03 /* arm_init.c */; };
+ AA000001000000000000AA04 /* filter_neon_intrinsics.c in Sources */ = {isa = PBXBuildFile; fileRef = AA000002000000000000AA04 /* filter_neon_intrinsics.c */; };
+ AA000001000000000000AA05 /* palette_neon_intrinsics.c in Sources */ = {isa = PBXBuildFile; fileRef = AA000002000000000000AA05 /* palette_neon_intrinsics.c */; };
5D21BA071FA6C3DD00B12CB3 /* GamepadiCade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21BA041FA6C3DD00B12CB3 /* GamepadiCade.cpp */; };
5D21BA0B1FA6C47F00B12CB3 /* JPGSurfaceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21BA091FA6C47E00B12CB3 /* JPGSurfaceLoader.cpp */; };
5D21BA0E1FA6C6BF00B12CB3 /* RenderScissorComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D21BA0C1FA6C6BE00B12CB3 /* RenderScissorComponent.cpp */; };
@@ -84,7 +97,7 @@
5D70B62612B5FED300A1AB17 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D70B61E12B5FED300A1AB17 /* main.m */; };
5D70B62712B5FED300A1AB17 /* MainController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D70B62012B5FED300A1AB17 /* MainController.mm */; };
5D70B62812B5FED300A1AB17 /* MyApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D70B62212B5FED300A1AB17 /* MyApplication.mm */; };
- 5D70B62912B5FED300A1AB17 /* MyOpenGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D70B62412B5FED300A1AB17 /* MyOpenGLView.mm */; };
+ 5D70B62912B5FED300A1AB17 /* MyOpenGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D70B62412B5FED300A1AB17 /* MyOpenGLView.mm */; settings = {COMPILER_FLAGS = "-Wno-int-to-pointer-cast -Wno-pointer-to-int-cast -Wno-error=int-to-pointer-cast"; }; };
5D70B81112B606DC00A1AB17 /* PlatformSetup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70B79C12B606DC00A1AB17 /* PlatformSetup.cpp */; };
5D70B81212B606DC00A1AB17 /* PlatformPrecomp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70B79E12B606DC00A1AB17 /* PlatformPrecomp.cpp */; };
5D70B81312B606DC00A1AB17 /* BaseApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70B79F12B606DC00A1AB17 /* BaseApp.cpp */; };
@@ -172,11 +185,6 @@
5D70C10612B72BE700A1AB17 /* TextScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C09D12B72BE700A1AB17 /* TextScanner.cpp */; };
5D70C10712B72BE700A1AB17 /* MathUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C09F12B72BE700A1AB17 /* MathUtils.cpp */; };
5D70C10812B72BE700A1AB17 /* Variant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C0A112B72BE700A1AB17 /* Variant.cpp */; };
- 5D70C10912B72BE700A1AB17 /* connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C0A512B72BE700A1AB17 /* connection.cpp */; };
- 5D70C10A12B72BE700A1AB17 /* named_slot_map.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C0A612B72BE700A1AB17 /* named_slot_map.cpp */; };
- 5D70C10B12B72BE700A1AB17 /* signal_base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C0A712B72BE700A1AB17 /* signal_base.cpp */; };
- 5D70C10C12B72BE700A1AB17 /* slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C0A812B72BE700A1AB17 /* slot.cpp */; };
- 5D70C10D12B72BE700A1AB17 /* trackable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C0A912B72BE700A1AB17 /* trackable.cpp */; };
5D70C10E12B72BE700A1AB17 /* GLESUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C0AA12B72BE700A1AB17 /* GLESUtils.cpp */; };
5D70C10F12B72BE700A1AB17 /* ResourceUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C0AC12B72BE700A1AB17 /* ResourceUtils.cpp */; };
5D70C11012B72BE700A1AB17 /* MiscUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C0AF12B72BE700A1AB17 /* MiscUtils.cpp */; };
@@ -210,7 +218,6 @@
5D70C16912B72C0900A1AB17 /* DebugMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C14B12B72C0900A1AB17 /* DebugMenu.cpp */; };
5D70C16A12B72C0900A1AB17 /* MainMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D70C14D12B72C0900A1AB17 /* MainMenu.cpp */; };
5D8FA3AC12DA754700E9B3B8 /* interface in Resources */ = {isa = PBXBuildFile; fileRef = 5D8FA3AB12DA754700E9B3B8 /* interface */; };
- 5D8FA49F12DBFA1100E9B3B8 /* game in Resources */ = {isa = PBXBuildFile; fileRef = 5D8FA49D12DBFA1100E9B3B8 /* game */; };
5D8FA52212DBFA3100E9B3B8 /* dink in Resources */ = {isa = PBXBuildFile; fileRef = 5D8FA4A012DBFA3000E9B3B8 /* dink */; };
5D8FA52312DBFA3100E9B3B8 /* audio in Resources */ = {isa = PBXBuildFile; fileRef = 5D8FA51512DBFA3100E9B3B8 /* audio */; };
5DBEA04C1FA6C94C0081C341 /* jcsample.c in Sources */ = {isa = PBXBuildFile; fileRef = 5DBEA04B1FA6C94C0081C341 /* jcsample.c */; };
@@ -234,7 +241,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
- 5DBEA04D1FA6CE360081C341 /* libfmod.dylib in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -246,10 +252,22 @@
256AC3F00F4B6AF500CF3369 /* RTDink_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTDink_Prefix.pch; sourceTree = ""; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; };
+ AA00000A000000000000AA01 /* GamepadProviderGCController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GamepadProviderGCController.mm; path = ../../shared/Gamepad/GamepadProviderGCController.mm; sourceTree = SOURCE_ROOT; };
+ AA00000F000000000000AA01 /* GamepadProviderGCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GamepadProviderGCController.h; path = ../../shared/Gamepad/GamepadProviderGCController.h; sourceTree = SOURCE_ROOT; };
+ AA00000C000000000000AA01 /* GamepadGCController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GamepadGCController.mm; path = ../../shared/Gamepad/GamepadGCController.mm; sourceTree = SOURCE_ROOT; };
+ AA000010000000000000AA01 /* GamepadGCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GamepadGCController.h; path = ../../shared/Gamepad/GamepadGCController.h; sourceTree = SOURCE_ROOT; };
+ AA00000E000000000000AA01 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = /System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
5D21B9CE1FA6C31B00B12CB3 /* png.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = png.c; path = ../../../shared/Irrlicht/source/Irrlicht/libpng/png.c; sourceTree = ""; };
5D21B9CF1FA6C31B00B12CB3 /* pngerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pngerror.c; path = ../../../shared/Irrlicht/source/Irrlicht/libpng/pngerror.c; sourceTree = ""; };
5D21B9D01FA6C31B00B12CB3 /* pngtrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pngtrans.c; path = ../../../shared/Irrlicht/source/Irrlicht/libpng/pngtrans.c; sourceTree = ""; };
5D21B9D11FA6C31B00B12CB3 /* pngrutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pngrutil.c; path = ../../../shared/Irrlicht/source/Irrlicht/libpng/pngrutil.c; sourceTree = ""; };
+ AA000002000000000000AA01 /* EmulatedPointerComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EmulatedPointerComponent.cpp; path = ../source/Component/EmulatedPointerComponent.cpp; sourceTree = SOURCE_ROOT; };
+ AA000002000000000000AA02 /* LogDisplayComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LogDisplayComponent.cpp; path = ../../shared/Entity/LogDisplayComponent.cpp; sourceTree = SOURCE_ROOT; };
+ AA000002000000000000AA06 /* TouchDragComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TouchDragComponent.cpp; path = ../../shared/Entity/TouchDragComponent.cpp; sourceTree = SOURCE_ROOT; };
+
+ AA000002000000000000AA03 /* arm_init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = arm_init.c; path = ../../shared/Irrlicht/source/Irrlicht/libpng/arm/arm_init.c; sourceTree = SOURCE_ROOT; };
+ AA000002000000000000AA04 /* filter_neon_intrinsics.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = filter_neon_intrinsics.c; path = ../../shared/Irrlicht/source/Irrlicht/libpng/arm/filter_neon_intrinsics.c; sourceTree = SOURCE_ROOT; };
+ AA000002000000000000AA05 /* palette_neon_intrinsics.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = palette_neon_intrinsics.c; path = ../../shared/Irrlicht/source/Irrlicht/libpng/arm/palette_neon_intrinsics.c; sourceTree = SOURCE_ROOT; };
5D21B9D21FA6C31B00B12CB3 /* pngwrite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pngwrite.c; path = ../../../shared/Irrlicht/source/Irrlicht/libpng/pngwrite.c; sourceTree = ""; };
5D21B9D31FA6C31B00B12CB3 /* pngget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pngget.c; path = ../../../shared/Irrlicht/source/Irrlicht/libpng/pngget.c; sourceTree = ""; };
5D21B9D41FA6C31B00B12CB3 /* pnggccrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pnggccrd.c; path = ../../../shared/Irrlicht/source/Irrlicht/libpng/pnggccrd.c; sourceTree = ""; };
@@ -273,6 +291,8 @@
5D21B9F81FA6C34500B12CB3 /* Gamepad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Gamepad.cpp; path = ../../shared/Gamepad/Gamepad.cpp; sourceTree = ""; };
5D21B9FC1FA6C37E00B12CB3 /* AudioManagerFMODStudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioManagerFMODStudio.h; path = ../../shared/Audio/AudioManagerFMODStudio.h; sourceTree = ""; };
5D21B9FD1FA6C37E00B12CB3 /* AudioManagerFMODStudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AudioManagerFMODStudio.cpp; path = ../../shared/Audio/AudioManagerFMODStudio.cpp; sourceTree = ""; };
+ AA000003000000000000AA01 /* AudioManagerSDL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AudioManagerSDL.cpp; path = ../../shared/Audio/AudioManagerSDL.cpp; sourceTree = ""; };
+ AA000003000000000000AA02 /* AudioManagerSDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioManagerSDL.h; path = ../../shared/Audio/AudioManagerSDL.h; sourceTree = ""; };
5D21B9FF1FA6C3DC00B12CB3 /* AdProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AdProvider.h; path = ../../shared/Ad/AdProvider.h; sourceTree = ""; };
5D21BA001FA6C3DC00B12CB3 /* GamepadiCade.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GamepadiCade.h; path = ../../shared/Gamepad/GamepadiCade.h; sourceTree = ""; };
5D21BA021FA6C3DD00B12CB3 /* AdProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AdProvider.cpp; path = ../../shared/Ad/AdProvider.cpp; sourceTree = ""; };
@@ -282,6 +302,10 @@
5D21BA0C1FA6C6BE00B12CB3 /* RenderScissorComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderScissorComponent.cpp; path = ../../shared/Entity/RenderScissorComponent.cpp; sourceTree = ""; };
5D21BA0D1FA6C6BE00B12CB3 /* RenderScissorComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderScissorComponent.h; path = ../../shared/Entity/RenderScissorComponent.h; sourceTree = ""; };
5D21BA0F1FA6C6EE00B12CB3 /* GamepadProvideriCade.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GamepadProvideriCade.cpp; path = ../../shared/Gamepad/GamepadProvideriCade.cpp; sourceTree = ""; };
+ AA000006000000000000AA01 /* GamepadProviderSDL2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GamepadProviderSDL2.cpp; path = ../../shared/Gamepad/GamepadProviderSDL2.cpp; sourceTree = ""; };
+ AA000008000000000000AA01 /* GamepadSDL2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GamepadSDL2.cpp; path = ../../shared/Gamepad/GamepadSDL2.cpp; sourceTree = ""; };
+
+
5D21BA101FA6C6EE00B12CB3 /* GamepadProvideriCade.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GamepadProvideriCade.h; path = ../../shared/Gamepad/GamepadProvideriCade.h; sourceTree = ""; };
5D21BA131FA6C76500B12CB3 /* jdatadst.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jdatadst.c; path = ../../../shared/Irrlicht/source/Irrlicht/jpeglib/jdatadst.c; sourceTree = ""; };
5D21BA141FA6C76500B12CB3 /* jdatasrc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jdatasrc.c; path = ../../../shared/Irrlicht/source/Irrlicht/jpeglib/jdatasrc.c; sourceTree = ""; };
@@ -547,8 +571,8 @@
5D70C12712B72C0900A1AB17 /* CursorComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CursorComponent.h; path = ../source/Component/CursorComponent.h; sourceTree = SOURCE_ROOT; };
5D70C12812B72C0900A1AB17 /* FPSControlComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FPSControlComponent.cpp; path = ../source/Component/FPSControlComponent.cpp; sourceTree = SOURCE_ROOT; };
5D70C12912B72C0900A1AB17 /* FPSControlComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FPSControlComponent.h; path = ../source/Component/FPSControlComponent.h; sourceTree = SOURCE_ROOT; };
- 5D70C12A12B72C0900A1AB17 /* ParticleTestComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ParticleTestComponent.cpp; path = ../source/Component/ParticleTestComponent.cpp; sourceTree = SOURCE_ROOT; };
- 5D70C12B12B72C0900A1AB17 /* ParticleTestComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ParticleTestComponent.h; path = ../source/Component/ParticleTestComponent.h; sourceTree = SOURCE_ROOT; };
+ 5D70C12A12B72C0900A1AB17 /* ParticleTestComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ParticleTestComponent.cpp; path = ../../proton/RTSimpleApp/source/Component/ParticleTestComponent.cpp; sourceTree = SOURCE_ROOT; };
+ 5D70C12B12B72C0900A1AB17 /* ParticleTestComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ParticleTestComponent.h; path = ../../proton/RTSimpleApp/source/Component/ParticleTestComponent.h; sourceTree = SOURCE_ROOT; };
5D70C12D12B72C0900A1AB17 /* ExpiredMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExpiredMenu.h; path = ../source/GUI/ExpiredMenu.h; sourceTree = SOURCE_ROOT; };
5D70C12E12B72C0900A1AB17 /* ExpiredMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpiredMenu.cpp; path = ../source/GUI/ExpiredMenu.cpp; sourceTree = SOURCE_ROOT; };
5D70C12F12B72C0900A1AB17 /* ReadTextMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ReadTextMenu.h; path = ../source/GUI/ReadTextMenu.h; sourceTree = SOURCE_ROOT; };
@@ -584,7 +608,6 @@
5D70C14D12B72C0900A1AB17 /* MainMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MainMenu.cpp; path = ../source/GUI/MainMenu.cpp; sourceTree = SOURCE_ROOT; };
5D70C14E12B72C0900A1AB17 /* MainMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MainMenu.h; path = ../source/GUI/MainMenu.h; sourceTree = SOURCE_ROOT; };
5D8FA3AB12DA754700E9B3B8 /* interface */ = {isa = PBXFileReference; lastKnownFileType = folder; name = interface; path = ../bin/interface; sourceTree = ""; };
- 5D8FA49D12DBFA1100E9B3B8 /* game */ = {isa = PBXFileReference; lastKnownFileType = folder; name = game; path = ../bin/game; sourceTree = ""; };
5D8FA4A012DBFA3000E9B3B8 /* dink */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dink; path = ../bin/dink; sourceTree = ""; };
5D8FA51512DBFA3100E9B3B8 /* audio */ = {isa = PBXFileReference; lastKnownFileType = folder; name = audio; path = ../bin/audio; sourceTree = ""; };
5DBEA04B1FA6C94C0081C341 /* jcsample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jcsample.c; path = ../../../shared/Irrlicht/source/Irrlicht/jpeglib/jcsample.c; sourceTree = ""; };
@@ -606,11 +629,11 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 5D4E96E81FA6B7D7001AAECE /* libfmod.dylib in Frameworks */,
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
AFD4D88A113C504F00C2DE76 /* OpenGL.framework in Frameworks */,
AF9DBBC6113C611C00D05754 /* QuartzCore.framework in Frameworks */,
5DDE02A012B4F50D000C5CC0 /* libz.dylib in Frameworks */,
+ AA00000D000000000000AA01 /* GameController.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -624,6 +647,7 @@
AFD4D889113C504F00C2DE76 /* OpenGL.framework */,
AF9DBBC5113C611C00D05754 /* QuartzCore.framework */,
5DDE029F12B4F50D000C5CC0 /* libz.dylib */,
+ AA00000E000000000000AA01 /* GameController.framework */,
);
name = "Linked Frameworks";
sourceTree = "";
@@ -700,6 +724,10 @@
children = (
5D21BA0F1FA6C6EE00B12CB3 /* GamepadProvideriCade.cpp */,
5D21BA101FA6C6EE00B12CB3 /* GamepadProvideriCade.h */,
+ AA00000A000000000000AA01 /* GamepadProviderGCController.mm */,
+ AA00000F000000000000AA01 /* GamepadProviderGCController.h */,
+ AA00000C000000000000AA01 /* GamepadGCController.mm */,
+ AA000010000000000000AA01 /* GamepadGCController.h */,
5D21BA041FA6C3DD00B12CB3 /* GamepadiCade.cpp */,
5D21BA001FA6C3DC00B12CB3 /* GamepadiCade.h */,
5D21B9F81FA6C34500B12CB3 /* Gamepad.cpp */,
@@ -891,6 +919,8 @@
children = (
5D21B9FD1FA6C37E00B12CB3 /* AudioManagerFMODStudio.cpp */,
5D21B9FC1FA6C37E00B12CB3 /* AudioManagerFMODStudio.h */,
+ AA000003000000000000AA01 /* AudioManagerSDL.cpp */,
+ AA000003000000000000AA02 /* AudioManagerSDL.h */,
5D70C01512B72BE700A1AB17 /* AudioManager.cpp */,
5D70C01612B72BE700A1AB17 /* AudioManager.h */,
);
@@ -1273,6 +1303,7 @@
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "RTDink" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
+ AF0000001000000000000001 /* Generate pnglibconf.h */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
5D70BB2712B7208900A1AB17 /* CopyFiles */,
@@ -1326,8 +1357,7 @@
5DFB850A12BAEDB500337543 /* app.icns in Resources */,
5DD32A5A12CAE4340009B0F3 /* Info.plist in Resources */,
5D8FA3AC12DA754700E9B3B8 /* interface in Resources */,
- 5D8FA49F12DBFA1100E9B3B8 /* game in Resources */,
- 5D8FA52212DBFA3100E9B3B8 /* dink in Resources */,
+ 5D8FA52212DBFA3100E9B3B8 /* dink in Resources */,
5D8FA52312DBFA3100E9B3B8 /* audio in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1337,21 +1367,22 @@
/* Begin PBXShellScriptBuildPhase section */
5D8CE30414C6570D009EB534 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "",
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
- shellPath = "/bin/sh -x";
- shellScript = "install_name_tool -change @rpath/libfmod.dylib @loader_path/../Frameworks/libfmod.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\"\notool -L \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\"";
+ shellPath = /bin/sh;
+ shellScript = "if [ -f \"$PROJECT_DIR/libfmod.dylib\" ]; then\n install_name_tool -change @rpath/libfmod.dylib @loader_path/../Frameworks/libfmod.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\"\nfi\nif [ -f \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\" ]; then\n otool -L \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\"\nfi\n";
};
5DBEA04E1FA6D2CF0081C341 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -1365,6 +1396,7 @@
};
5DBEA0501FA6DBE30081C341 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
buildActionMask = 12;
files = (
);
@@ -1376,6 +1408,21 @@
shellPath = /bin/sh;
shellScript = "echo Disabled, run PackageDinkOSX.command instead, that way this signs it for us first\nexit\n\nif [ \"${CONFIGURATION}\" = 'Release' ]; then\n[ \"$ACTION\" = build ] || exit 0\n[ \"$BUILD_VARIANTS\" = \"normal\" ] || exit 0\n\n\nAPPNAME=\"Dink Smallwood HD\"\n\nCODESIGN=\"Mac Developer: Seth Robinson\"\n#CODESIGN=\"3rd Party Mac Developer Application: Robinson Technologies\"\n\nINSTALLSIGN=\"3rd Party Mac Developer Installer: Robinson Technologies\"\n\n#codesign -vvvv -f -s \"$CODESIGN\" \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmod.dylib\"\n#codesign -vvvv -f -s \"$CODESIGN\" \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app\"\n#codesign -vvvv \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app\"\nfi\n";
};
+ AF0000001000000000000001 /* Generate pnglibconf.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Generate pnglibconf.h";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Create symlinks if proton is cloned inside the repo (MacInCloud layout)\n# This makes ../../shared and ../../proton work from OSX/ dir\nPROTON_INSIDE=\"$SRCROOT/../proton\"\nSHARED_SIBLING=\"$SRCROOT/../../shared\"\nPROTON_SIBLING=\"$SRCROOT/../../proton\"\n\nif [ -d \"$PROTON_INSIDE\" ]; then\n if [ ! -d \"$SHARED_SIBLING\" ]; then\n echo \"Creating shared symlink: $SHARED_SIBLING -> $PROTON_INSIDE/shared\"\n ln -sf \"$PROTON_INSIDE/shared\" \"$SHARED_SIBLING\"\n fi\n if [ ! -d \"$PROTON_SIBLING\" ]; then\n echo \"Creating proton symlink: $PROTON_SIBLING -> $PROTON_INSIDE\"\n ln -sf \"$PROTON_INSIDE\" \"$PROTON_SIBLING\"\n fi\nfi\n\n\n# Create SDL2/SDL_mixer.h compatibility symlink for SDL2_mixer.framework\nSDL2_MIXER_HEADERS=\"$HOME/Library/Frameworks/SDL2_mixer.framework/Headers\"\nSDL2_HEADERS=\"$HOME/Library/Frameworks/SDL2.framework/Headers\"\nif [ -d \"$SDL2_MIXER_HEADERS\" ] && [ -d \"$SDL2_HEADERS\" ]; then\n if [ ! -f \"$SDL2_HEADERS/SDL_mixer.h\" ]; then\n ln -sf \"$SDL2_MIXER_HEADERS/SDL_mixer.h\" \"$SDL2_HEADERS/SDL_mixer.h\"\n echo \"Created SDL_mixer.h symlink in SDL2.framework/Headers\"\n fi\nfi\n\n# Generate pnglibconf.h\nLIBPNG=\"$SRCROOT/../../shared/Irrlicht/source/Irrlicht/libpng\"\nif [ -d \"$LIBPNG\" ] && [ ! -f \"$LIBPNG/pnglibconf.h\" ] && [ -f \"$LIBPNG/pnglibconf.h.prebuilt\" ]; then\n cp \"$LIBPNG/pnglibconf.h.prebuilt\" \"$LIBPNG/pnglibconf.h\"\n echo \"Copied pnglibconf.h from $LIBPNG\"\nfi\n";
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -1449,13 +1496,18 @@
5D70C0D612B72BE700A1AB17 /* ScrollBarRenderComponent.cpp in Sources */,
5D70C0D712B72BE700A1AB17 /* ScrollComponent.cpp in Sources */,
5D21BA111FA6C6EE00B12CB3 /* GamepadProvideriCade.cpp in Sources */,
+ AA000005000000000000AA01 /* GamepadProviderSDL2.cpp in Sources */,
+ AA000007000000000000AA01 /* GamepadSDL2.cpp in Sources */,
+ AA000009000000000000AA01 /* GamepadProviderGCController.mm in Sources */,
+ AA00000B000000000000AA01 /* GamepadGCController.mm in Sources */,
+ AA000004000000000000AA01 /* AudioManagerSDL.cpp in Sources */,
+
5D70C0D812B72BE700A1AB17 /* TextBoxRenderComponent.cpp in Sources */,
5D21B9EB1FA6C31D00B12CB3 /* pngset.c in Sources */,
5D70C0D912B72BE700A1AB17 /* HTTPComponent.cpp in Sources */,
5D70C0DA12B72BE700A1AB17 /* TyperComponent.cpp in Sources */,
5D70C0DB12B72BE700A1AB17 /* ProgressBarComponent.cpp in Sources */,
5D70C0DC12B72BE700A1AB17 /* TapSequenceDetectComponent.cpp in Sources */,
- 5D21B9FE1FA6C37E00B12CB3 /* AudioManagerFMODStudio.cpp in Sources */,
5D21B9F11FA6C31D00B12CB3 /* pngrtran.c in Sources */,
5D70C0DD12B72BE700A1AB17 /* UnderlineRenderComponent.cpp in Sources */,
5D70C0DE12B72BE700A1AB17 /* FocusInputComponent.cpp in Sources */,
@@ -1466,7 +1518,6 @@
5D70C0E212B72BE700A1AB17 /* TextRenderComponent.cpp in Sources */,
5D70C0E312B72BE700A1AB17 /* Button2DComponent.cpp in Sources */,
5D21BA671FA6C76C00B12CB3 /* jcinit.c in Sources */,
- 5D21B9EF1FA6C31D00B12CB3 /* pngvcrd.c in Sources */,
5D21B9E41FA6C31D00B12CB3 /* pngrutil.c in Sources */,
5D70C0E412B72BE700A1AB17 /* TouchHandlerComponent.cpp in Sources */,
5D70C0E512B72BE700A1AB17 /* OverlayRenderComponent.cpp in Sources */,
@@ -1485,7 +1536,6 @@
5D70C0EB12B72BE700A1AB17 /* SoftSurface.cpp in Sources */,
5D21B9E51FA6C31D00B12CB3 /* pngwrite.c in Sources */,
5D70C0EC12B72BE700A1AB17 /* RenderBatcher.cpp in Sources */,
- 5D21B9E71FA6C31D00B12CB3 /* pnggccrd.c in Sources */,
5D70C0ED12B72BE700A1AB17 /* L_Defination.cpp in Sources */,
5D70C0EE12B72BE700A1AB17 /* L_DroppingEffect.cpp in Sources */,
5D70C0EF12B72BE700A1AB17 /* L_EffectEmitter.cpp in Sources */,
@@ -1531,12 +1581,7 @@
5D70C10712B72BE700A1AB17 /* MathUtils.cpp in Sources */,
5D70C10812B72BE700A1AB17 /* Variant.cpp in Sources */,
5D21BA591FA6C76C00B12CB3 /* jcparam.c in Sources */,
- 5D70C10912B72BE700A1AB17 /* connection.cpp in Sources */,
- 5D70C10A12B72BE700A1AB17 /* named_slot_map.cpp in Sources */,
- 5D70C10B12B72BE700A1AB17 /* signal_base.cpp in Sources */,
- 5D70C10C12B72BE700A1AB17 /* slot.cpp in Sources */,
5D21B9E11FA6C31D00B12CB3 /* png.c in Sources */,
- 5D70C10D12B72BE700A1AB17 /* trackable.cpp in Sources */,
5D21BA4F1FA6C76C00B12CB3 /* jmemnobs.c in Sources */,
5D21BA4E1FA6C76C00B12CB3 /* jmemmgr.c in Sources */,
5D21B9FB1FA6C34500B12CB3 /* Gamepad.cpp in Sources */,
@@ -1561,6 +1606,13 @@
5D70C15712B72C0900A1AB17 /* CursorComponent.cpp in Sources */,
5D70C15812B72C0900A1AB17 /* FPSControlComponent.cpp in Sources */,
5D70C15912B72C0900A1AB17 /* ParticleTestComponent.cpp in Sources */,
+ AA000001000000000000AA01 /* EmulatedPointerComponent.cpp in Sources */,
+ AA000001000000000000AA06 /* TouchDragComponent.cpp in Sources */,
+
+ AA000001000000000000AA02 /* LogDisplayComponent.cpp in Sources */,
+ AA000001000000000000AA03 /* arm_init.c in Sources */,
+ AA000001000000000000AA04 /* filter_neon_intrinsics.c in Sources */,
+ AA000001000000000000AA05 /* palette_neon_intrinsics.c in Sources */,
5D21BA4A1FA6C76C00B12CB3 /* jidctred.c in Sources */,
5D21BA5F1FA6C76C00B12CB3 /* jdcolor.c in Sources */,
5D70C15A12B72C0900A1AB17 /* ExpiredMenu.cpp in Sources */,
@@ -1615,8 +1667,8 @@
5D8CE30214C655CE009EB534 /* Dist */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application";
+ ARCHS = "$(ARCHS_STANDARD)";
+ CODE_SIGN_IDENTITY = "-";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = c11;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1624,7 +1676,8 @@
GCC_PREPROCESSOR_DEFINITIONS = (
BOOST_ALL_NO_LIB,
NDEBUG,
- C_GL_MODE,
+C_GL_MODE,
+ PLATFORM_OSX,
);
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -1636,12 +1689,20 @@
../../shared/FliteTTS/include,
../../shared/OSX,
/Users/Seth/dev/rtsvn/projects/proton/locallibs,
+ ../../proton/RTSimpleApp/source,
+ ../proton/RTSimpleApp/source,
+ /opt/homebrew/include,
+ /usr/local/include,
+ "$(HOME)/Library/Frameworks/SDL2.framework/Headers",
+ "$(HOME)/Library/Frameworks/SDL2_mixer.framework/Headers",
+ /opt/homebrew/opt/sdl2_mixer/include/SDL2,
+ /usr/local/opt/sdl2_mixer/include/SDL2,
);
- MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MACOSX_DEPLOYMENT_TARGET = 11.0;
PREBINDING = NO;
PROVISIONING_PROFILE = "";
SDKROOT = macosx;
- VALID_ARCHS = "i386 x86_64";
+ VALID_ARCHS = "arm64 x86_64";
};
name = Dist;
};
@@ -1649,10 +1710,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
- CODE_SIGN_IDENTITY = "Mac Developer";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEVELOPMENT_TEAM = MK4EZB35P7;
+ DEVELOPMENT_TEAM = "";
GCC_MODEL_TUNING = G5;
GCC_PREPROCESSOR_DEFINITIONS = (
BOOST_ALL_NO_LIB,
@@ -1661,16 +1722,32 @@
RT_PNG_SUPPORT,
RT_IPV6,
RT_JPG_SUPPORT,
- C_GL_MODE,
+C_GL_MODE,
+ PLATFORM_OSX,
+ RT_USE_SDL_AUDIO,
);
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(HOME)/Library/Frameworks",
+ /opt/homebrew/opt/sdl2/Frameworks,
+ /usr/local/opt/sdl2/Frameworks,
+ /opt/homebrew/opt/sdl2_mixer/Frameworks,
+ /usr/local/opt/sdl2_mixer/Frameworks,
+ );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
+ /opt/homebrew/lib,
+ /usr/local/lib,
);
+ OTHER_CFLAGS = "-w -Wno-error -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast";
+ OTHER_LDFLAGS = "-framework SDL2 -framework SDL2_mixer -rpath $(HOME)/Library/Frameworks -rpath /opt/homebrew/lib -rpath /usr/local/lib";
PRODUCT_NAME = "Dink Smallwood HD";
PROVISIONING_PROFILE_SPECIFIER = "";
+ CODE_SIGNING_REQUIRED = NO;
+ CODE_SIGNING_ALLOWED = NO;
};
name = Dist;
};
@@ -1678,11 +1755,11 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
- CODE_SIGN_IDENTITY = "Mac Developer";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEVELOPMENT_TEAM = MK4EZB35P7;
+ DEVELOPMENT_TEAM = "";
GCC_DEBUGGING_SYMBOLS = full;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
@@ -1690,10 +1767,22 @@
GCC_OPTIMIZATION_LEVEL = 0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(HOME)/Library/Frameworks",
+ /opt/homebrew/opt/sdl2/Frameworks,
+ /usr/local/opt/sdl2/Frameworks,
+ /opt/homebrew/opt/sdl2_mixer/Frameworks,
+ /usr/local/opt/sdl2_mixer/Frameworks,
+ );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
+ /opt/homebrew/lib,
+ /usr/local/lib,
);
+ OTHER_CFLAGS = "-w -Wno-error -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast";
+ OTHER_LDFLAGS = "-framework SDL2 -framework SDL2_mixer -rpath $(HOME)/Library/Frameworks -rpath /opt/homebrew/lib -rpath /usr/local/lib";
PRODUCT_NAME = "Dink Smallwood HD";
PROVISIONING_PROFILE_SPECIFIER = "";
};
@@ -1703,17 +1792,30 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
- CODE_SIGN_IDENTITY = "Developer ID Application";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "-";
+ CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEVELOPMENT_TEAM = MK4EZB35P7;
+ DEVELOPMENT_TEAM = "";
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
+ "EXCLUDED_SOURCE_FILE_NAMES[arch=x86_64]" = "arm_init.c filter_neon_intrinsics.c palette_neon_intrinsics.c filter_neon.S";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(HOME)/Library/Frameworks",
+ /opt/homebrew/opt/sdl2/Frameworks,
+ /usr/local/opt/sdl2/Frameworks,
+ /opt/homebrew/opt/sdl2_mixer/Frameworks,
+ /usr/local/opt/sdl2_mixer/Frameworks,
+ );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
+ /opt/homebrew/lib,
+ /usr/local/lib,
);
+ OTHER_CFLAGS = "-w -Wno-error -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast";
+ OTHER_LDFLAGS = "-framework SDL2 -framework SDL2_mixer -rpath $(HOME)/Library/Frameworks -rpath /opt/homebrew/lib -rpath /usr/local/lib";
PRODUCT_NAME = "Dink Smallwood HD";
PROVISIONING_PROFILE_SPECIFIER = "";
};
@@ -1722,7 +1824,7 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ ARCHS = "$(ARCHS_STANDARD)";
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -1734,11 +1836,13 @@
GCC_PREPROCESSOR_DEFINITIONS = (
_DEBUG,
BOOST_ALL_NO_LIB,
- C_GL_MODE,
+C_GL_MODE,
+ PLATFORM_OSX,
RT_JPG_SUPPORT,
RT_IPV6,
RT_PNG_SUPPORT,
RT_CUSTOM_LOGMSG,
+ RT_USE_SDL_AUDIO,
);
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -1750,8 +1854,16 @@
../../shared/FliteTTS/include,
../../shared/OSX,
/Users/Seth/dev/rtsvn/projects/proton/locallibs,
+ ../../proton/RTSimpleApp/source,
+ ../proton/RTSimpleApp/source,
+ /opt/homebrew/include,
+ /usr/local/include,
+ "$(HOME)/Library/Frameworks/SDL2.framework/Headers",
+ "$(HOME)/Library/Frameworks/SDL2_mixer.framework/Headers",
+ /opt/homebrew/opt/sdl2_mixer/include/SDL2,
+ /usr/local/opt/sdl2_mixer/include/SDL2,
);
- MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MACOSX_DEPLOYMENT_TARGET = 11.0;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx;
@@ -1761,7 +1873,7 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ ARCHS = "$(ARCHS_STANDARD)";
CODE_SIGN_IDENTITY = "";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = c11;
@@ -1770,11 +1882,13 @@
GCC_PREPROCESSOR_DEFINITIONS = (
BOOST_ALL_NO_LIB,
NDEBUG,
- C_GL_MODE,
+C_GL_MODE,
+ PLATFORM_OSX,
RT_CUSTOM_LOGMSG,
RT_JPG_SUPPORT,
RT_IPV6,
RT_PNG_SUPPORT,
+ RT_USE_SDL_AUDIO,
);
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -1786,11 +1900,19 @@
../../shared/FliteTTS/include,
../../shared/OSX,
/Users/Seth/dev/rtsvn/projects/proton/locallibs,
+ ../../proton/RTSimpleApp/source,
+ ../proton/RTSimpleApp/source,
+ /opt/homebrew/include,
+ /usr/local/include,
+ "$(HOME)/Library/Frameworks/SDL2.framework/Headers",
+ "$(HOME)/Library/Frameworks/SDL2_mixer.framework/Headers",
+ /opt/homebrew/opt/sdl2_mixer/include/SDL2,
+ /usr/local/opt/sdl2_mixer/include/SDL2,
);
- MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MACOSX_DEPLOYMENT_TARGET = 11.0;
PREBINDING = NO;
SDKROOT = macosx;
- VALID_ARCHS = "i386 x86_64";
+ VALID_ARCHS = "arm64 x86_64";
};
name = Release;
};
diff --git a/README.md b/README.md
index 863529e..48d15bb 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ RTDink can be built for multiple platforms. Each uses the [Proton SDK](https://g
|----------|-------------|-------------|
| **Windows** | Visual Studio 2017+ | See [detailed Windows instructions](#windows) below |
| **Linux** | CMake + SDL2 | `git clone ... && ./linux_setup.sh` ([details](INSTALL.md#linux)) |
-| **macOS** | Xcode | Broken/unmaintained -- see [INSTALL.md](INSTALL.md#macos) |
+| **macOS** | Xcode | Universal binary (Intel + Apple Silicon), uses SDL2 + SDL2_mixer -- see [INSTALL.md](INSTALL.md#macos) |
| **HTML5** | Emscripten | See [Proton HTML5 setup](https://www.rtsoft.com/wiki/doku.php?id=proton:html5_setup) |
| **iOS** | Xcode | Proton SDK sibling layout, open `RTDink.xcodeproj` ([more info](INSTALL.md#ios)) |
| **Android** | Gradle + CMake | Proton SDK sibling layout, open `AndroidGradle/` in Android Studio ([more info](INSTALL.md#android)) |
@@ -131,7 +131,7 @@ The original **Dink Smallwood** (1997) was created by **Seth A. Robinson**, **Ju
* **yeoldtoast** Editors and a bunch of other Dink stuff
* **RobJ** -- DinkC command fixes and compatibility improvements
* **SimonK** -- DMOD stress testing and limit increase requests
-* **Mateus Sales Bentes** -- Linux port work
+* **Mateus Sales Bentes** -- Linux port work, macOS universal binary (Intel + Apple Silicon)
Special thanks to the entire [dinknetwork.com](https://www.dinknetwork.com/) community for their Dink creations and support over the years!
diff --git a/RTDink.xcodeproj/project.pbxproj b/RTDink.xcodeproj/project.pbxproj
index 874f310..5036037 100644
--- a/RTDink.xcodeproj/project.pbxproj
+++ b/RTDink.xcodeproj/project.pbxproj
@@ -636,6 +636,8 @@
5D9F6FDA28A8EFB800D3F15D /* GamepadiCade.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GamepadiCade.h; path = Gamepad/GamepadiCade.h; sourceTree = ""; };
5D9F6FDB28A8EFB800D3F15D /* GamepadProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GamepadProvider.cpp; path = Gamepad/GamepadProvider.cpp; sourceTree = ""; };
5D9F6FDC28A8EFB800D3F15D /* GamepadProvideriCade.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GamepadProvideriCade.cpp; path = Gamepad/GamepadProvideriCade.cpp; sourceTree = ""; };
+ 5DAE00082DA5F10000AE0008 /* GamepadProviderSDL2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GamepadProviderSDL2.cpp; path = Gamepad/GamepadProviderSDL2.cpp; sourceTree = ""; };
+ 5DAE000A2DA5F10000AE000A /* GamepadSDL2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GamepadSDL2.cpp; path = Gamepad/GamepadSDL2.cpp; sourceTree = ""; };
5D9F6FE528A8F01800D3F15D /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
5DA1FCF60F01EEFD001E9C1B /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
5DA1FD020F01EF07001E9C1B /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
@@ -941,6 +943,8 @@
5D9F6FD228A8EFB700D3F15D /* GamepadProvider.h */,
5D9F6FDC28A8EFB800D3F15D /* GamepadProvideriCade.cpp */,
5D9F6FD828A8EFB800D3F15D /* GamepadProvideriCade.h */,
+ 5DAE00082DA5F10000AE0008 /* GamepadProviderSDL2.cpp */,
+ 5DAE000A2DA5F10000AE000A /* GamepadSDL2.cpp */,
5D9F6FCD28A8EFB600D3F15D /* GamepadProviderIOS.h */,
5D9F6FCF28A8EFB700D3F15D /* GamepadProviderIOS.mm */,
5D9F6FD428A8EFB700D3F15D /* GamepadProviderIOSNative.h */,
diff --git a/source/App.cpp b/source/App.cpp
index 05de2cd..1122628 100644
--- a/source/App.cpp
+++ b/source/App.cpp
@@ -6,6 +6,9 @@
*/
#include "PlatformPrecomp.h"
#include "App.h"
+#ifndef _WIN32
+#include
+#endif
#include "GUI/MainMenu.h"
#include "Entity/EntityUtils.h"//create the classes that our globally library expects to exist somewhere.
#include "dink/dink.h"
@@ -42,7 +45,11 @@ void AddText(const char *tex, const char *filename);
#include "StackWalker/StackUtils.h"
#endif
+#ifdef PLATFORM_OSX
+bool g_bIsFullScreen = false;
+#else
extern bool g_bIsFullScreen;
+#endif
extern bool g_script_debug_mode;
extern Surface g_transitionSurf;
@@ -85,8 +92,50 @@ GamepadManager * GetGamepadManager() {return &g_gamepadManager;}
AudioManagerFMOD g_audioManager;
#else
//it's being compiled as a native OSX app
-#include "Audio/AudioManagerFMODStudio.h"
- AudioManagerFMOD g_audioManager; //dummy with no sound
+#include "Audio/AudioManagerSDL.h"
+#include "Gamepad/GamepadProviderSDL2.h"
+#include
+ AudioManagerSDL g_audioManager;
+
+ // g_sig_SDLEvent is defined in SDL2Main.cpp for SDL-main builds (Linux/Win).
+ // For the OSX Cocoa build which doesn't use SDL2Main.cpp, define it here.
+ boost::signals2::signal g_sig_SDLEvent;
+
+// Returns the path containing dink/ game data.
+// Checks inside the bundle first, then falls back to the folder next to the .app
+// so users can place GOG/Steam data alongside the app without modifying the bundle.
+#include
+#include
+static string GetGameDataPath()
+{
+ string bundlePath = GetBaseAppPath();
+
+ struct stat st;
+ if (stat((bundlePath + "dink").c_str(), &st) == 0 && S_ISDIR(st.st_mode))
+ {
+ LogMsg("Game data found in bundle: %s", bundlePath.c_str());
+ return bundlePath;
+ }
+
+ // Fall back to the directory containing the .app
+ CFBundleRef mainBundle = CFBundleGetMainBundle();
+ CFURLRef bundleURL = CFBundleCopyBundleURL(mainBundle);
+ CFURLRef parentURL = CFURLCreateCopyDeletingLastPathComponent(NULL, bundleURL);
+ char parentPath[PATH_MAX];
+ CFURLGetFileSystemRepresentation(parentURL, TRUE, (UInt8 *)parentPath, PATH_MAX);
+ CFRelease(bundleURL);
+ CFRelease(parentURL);
+
+ string externalPath = string(parentPath) + "/";
+ if (stat((externalPath + "dink").c_str(), &st) == 0 && S_ISDIR(st.st_mode))
+ {
+ LogMsg("Game data found next to .app: %s", externalPath.c_str());
+ return externalPath;
+ }
+
+ LogMsg("Warning: dink/ not found in bundle or next to .app, defaulting to bundle path");
+ return bundlePath;
+}
//in theory, CocosDenshion should work for the Mac builds, but right now it seems to want a big chunk of
//Cocos2d included so I'm not fiddling with it for now
@@ -195,6 +244,8 @@ const char * GetAppName()
#if defined(RTLINUX) || defined(PLATFORM_LINUX) || defined(PLATFORM_OSX)
+#include
+
SDL_Window* GetSDLWindow() {
SDL_Window* window = SDL_GL_GetCurrentWindow();
if (!window) {
@@ -213,12 +264,10 @@ void UpdateViewport(int width, int height) {
glLoadIdentity();
if (windowAspect > gameAspect) {
- // Window wider than game: add horizontal margins (letterbox)
float scaledHeight = width / gameAspect;
float offsetY = (scaledHeight - height) / 2.0f;
glOrtho(0, width, height + offsetY, -offsetY, -1.0, 1.0);
} else {
- // Window taller than game: add vertical margins (pillarbox)
float scaledWidth = height * gameAspect;
float offsetX = (scaledWidth - width) / 2.0f;
glOrtho(-offsetX, width + offsetX, height, 0, -1.0, 1.0);
@@ -228,6 +277,9 @@ void UpdateViewport(int width, int height) {
glLoadIdentity();
}
+
+#if defined(RTLINUX) || defined(PLATFORM_LINUX)
+// Linux: SDL owns the window - use SDL fullscreen toggle
void OnFullscreenToggleRequestMultiplatform() {
SDL_Window* window = GetSDLWindow();
if (!window) return;
@@ -255,13 +307,35 @@ void OnFullscreenToggleRequestMultiplatform() {
SetupFakePrimaryScreenSize(1024, 768);
UpdateViewport(width, height);
}
-
+#endif // RTLINUX || PLATFORM_LINUX
#endif // RTLINUX || PLATFORM_LINUX || PLATFORM_OSX
+#if defined(PLATFORM_OSX)
+
+// macOS: Cocoa owns the window - implemented in OSXUtils.mm (Objective-C++ required)
+void OSXToggleFullscreen();
+
+// dink.cpp calls OnFullscreenToggleRequestMultiplatform() on all desktop platforms
+void OnFullscreenToggleRequestMultiplatform() {
+ OSXToggleFullscreen();
+}
+
+#else
+
+// Windows and other platforms: BaseApp handles fullscreen via OS messages.
+// dink.cpp calls this so we need a stub that routes correctly.
+void OnFullscreenToggleRequestMultiplatform() {
+ if (GetApp()) GetApp()->OnFullscreenToggleRequest();
+}
+
+#endif // platform fullscreen
+
void App::OnFullscreenToggleRequest()
{
-#if defined(RTLINUX) || defined(PLATFORM_LINUX) || defined(PLATFORM_OSX)
+#if defined(RTLINUX) || defined(PLATFORM_LINUX)
OnFullscreenToggleRequestMultiplatform();
+#elif defined(PLATFORM_OSX)
+ OSXToggleFullscreen();
#else
BaseApp::OnFullscreenToggleRequest();
#endif
@@ -649,10 +723,19 @@ bool App::Init()
GetGamepadManager()->AddProvider(pTempDirectX); //use directx joysticks
#endif
-#if defined(RTLINUX) || defined(PLATFORM_LINUX)
- GetGamepadManager()->AddProvider(new GamepadProviderSDL2());
+#if defined(RTLINUX) || defined(PLATFORM_LINUX) || defined(PLATFORM_OSX)
+{
+ // On macOS Cocoa builds SDL video is not used.
+ // Initialize SDL with events + joystick + gamecontroller upfront so the
+ // IOKit HID manager is set up before GamepadProviderSDL2::Init() runs.
+ // SDL_InitSubSystem inside GamepadProviderSDL2 will be a no-op for already
+ // initialized subsystems, so this is safe.
+ #ifdef PLATFORM_OSX
+ SDL_Init(SDL_INIT_EVENTS | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER);
+ #endif
+ GetGamepadManager()->AddProvider(new GamepadProviderSDL2());
+}
#endif
-
if (GetVar("check_icade")->GetUINT32() != 0)
{
AddIcadeProvider();
@@ -715,7 +798,11 @@ bool App::Init()
GetAudioManager()->SetMidiMusicModVol(0.3f);
GetAudioManager()->Preload("audio/click.wav");
+#ifdef PLATFORM_OSX
+ InitDinkPaths(GetGameDataPath(), "dink", "");
+#else
InitDinkPaths(GetBaseAppPath(), "dink", "");
+#endif
GetBaseApp()->m_sig_pre_enterbackground.connect(1, boost::bind(&App::OnPreEnterBackground, this, _1));
GetBaseApp()->m_sig_loadSurfaces.connect(1, boost::bind(&App::OnLoadSurfaces, this));
@@ -776,8 +863,8 @@ bool App::Init()
*/
}
-#elif defined(RTLINUX) || defined(PLATFORM_LINUX) || defined(PLATFORM_OSX)
- // Linux/macOS video settings
+#elif defined(RTLINUX) || defined(PLATFORM_LINUX)
+ // Linux video settings
int fullscreen = GetApp()->GetVarWithDefault("fullscreen", uint32(0))->GetUINT32();
if (DoesCommandLineParmExist("--help"))
@@ -817,6 +904,39 @@ bool App::Init()
OnFullscreenToggleRequestMultiplatform();
}
+#elif defined(PLATFORM_OSX)
+{
+ // macOS video settings — read saved resolution and fullscreen preference
+ int videox = GetApp()->GetVarWithDefault("video_x", uint32(1024))->GetUINT32();
+ int videoy = GetApp()->GetVarWithDefault("video_y", uint32(768))->GetUINT32();
+ int fullscreen = GetApp()->GetVarWithDefault("fullscreen", uint32(0))->GetUINT32();
+
+ if (DoesCommandLineParmExist("-window") || DoesCommandLineParmExist("-windowed"))
+ {
+ fullscreen = false;
+ GetApp()->GetVar("fullscreen")->Set(uint32(0));
+ }
+ if (DoesCommandLineParmExist("-skip"))
+ {
+ SetSkipMode(true);
+ }
+ if (DoesCommandLineParmExist("-debug"))
+ {
+ GetApp()->SetCheatsEnabled(true);
+ g_script_debug_mode = true;
+ }
+
+ // Apply saved window size (sends MESSAGE_SET_VIDEO_MODE to MyOpenGLView)
+ SetVideoMode(videox, videoy, false, 0);
+
+ if (fullscreen)
+ {
+ LogMsg("Setting fullscreen...");
+ g_bIsFullScreen = false; //because we're using toggle..
+ OnFullscreenToggleRequestMultiplatform();
+ }
+}
+
#endif
return true;
@@ -920,6 +1040,37 @@ void App::Update()
{
BaseApp::Update();
m_adManager.Update();
+
+#if defined(RTLINUX) || defined(PLATFORM_LINUX)
+{
+ // Linux: SDL owns the window, pump all events
+ SDL_Event ev;
+ while (SDL_PollEvent(&ev))
+ {
+ VariantList v;
+ v.Get(0).Set((Entity*)&ev);
+ g_sig_SDLEvent(&v);
+ }
+}
+#elif defined(PLATFORM_OSX)
+{
+ // macOS Cocoa: SDL does not own the window, but we still need to pump
+ // SDL joystick/gamepad events. SDL_PumpEvents() processes the SDL event
+ // queue without touching the Cocoa window or event loop.
+ SDL_PumpEvents();
+ SDL_Event ev;
+ // Drain all joystick/gamepad events in one pass (SDL_JOYAXISMOTION=0x600
+ // through SDL_CONTROLLERDEVICEREMAPPED=0x657 covers all pad events)
+ while (SDL_PeepEvents(&ev, 1, SDL_GETEVENT,
+ SDL_JOYAXISMOTION, SDL_CONTROLLERDEVICEREMAPPED) > 0)
+ {
+ VariantList v;
+ v.Get(0).Set((Entity*)&ev);
+ g_sig_SDLEvent(&v);
+ }
+}
+#endif
+
g_gamepadManager.Update();
if (!m_bDidPostInit)
@@ -1032,15 +1183,15 @@ void App::OnScreenSizeChange()
if (GetPrimaryGLX() != 0)
{
#if defined(RTLINUX) || defined(PLATFORM_LINUX) || defined(PLATFORM_OSX)
- UpdateViewport(GetPrimaryGLX(), GetPrimaryGLY());
+ UpdateViewport(GetPrimaryGLX(), GetPrimaryGLY());
#endif
- SetupOrtho();
- DinkOnForeground(); //rebuild lost surfaces
- g_dglo.m_bForceControlsRebuild = true;
- if (GetDinkGameState() != DINK_GAME_STATE_PLAYING)
- {
- PrepareForGL();
- }
+ SetupOrtho();
+ DinkOnForeground(); //rebuild lost surfaces
+ g_dglo.m_bForceControlsRebuild = true;
+ if (GetDinkGameState() != DINK_GAME_STATE_PLAYING)
+ {
+ PrepareForGL();
+ }
}
UpdateTitleBar();
@@ -1049,12 +1200,17 @@ void App::OnScreenSizeChange()
GetApp()->GetVar("fullscreen")->Set(uint32(g_bIsFullScreen));
GetApp()->GetVar("videox")->Set(uint32(GetPrimaryGLX()));
GetApp()->GetVar("videoy")->Set(uint32(GetPrimaryGLY()));
- //GetApp()->GetVarWithDefault("borderless_fullscreen", uint32(g_bUseBorderlessFullscreenOnWindows))->Set(uint32(0));
+#ifdef _DEBUG
+ LogMsg("Got OnScreenSizeChange: Setting to %d, %d", uint32(GetPrimaryGLX()), uint32(GetPrimaryGLY()));
+#endif
+#elif defined(PLATFORM_OSX)
+ GetApp()->GetVar("fullscreen")->Set(uint32(g_bIsFullScreen));
+ GetApp()->GetVar("video_x")->Set(uint32(GetPrimaryGLX()));
+ GetApp()->GetVar("video_y")->Set(uint32(GetPrimaryGLY()));
#ifdef _DEBUG
LogMsg("Got OnScreenSizeChange: Setting to %d, %d", uint32(GetPrimaryGLX()), uint32(GetPrimaryGLY()));
#endif
#endif
-
}
void App::GetServerInfo( string &server, uint32 &port )
@@ -1309,7 +1465,11 @@ void ImportSaveState(string physicalFname)
SlideScreen(pNewMenu, false);
GetMessageManager()->CallEntityFunction(pNewMenu, 500, "OnDelete", NULL);
+#ifdef PLATFORM_OSX
+ InitDinkPaths(GetGameDataPath(), "dink", RemoveTrailingBackslash(newDMODDir));
+#else
InitDinkPaths(GetBaseAppPath(), "dink", RemoveTrailingBackslash(newDMODDir));
+#endif
GameCreate(pNewMenu->GetParent(), 0, physicalFname);
GetBaseApp()->SetGameTickPause(false);
}
@@ -1415,12 +1575,25 @@ void App::AddTextToLog(const char *tex, const char *filename)
if (m_logFileHandle == NULL)
{
-
//open 'er up
m_logFileHandle = fopen(filename, "ab");
if (!m_logFileHandle)
{
- assert(!"huh?");
+ // Save path may not exist yet, try to create it
+ string savePath = GetSavePath();
+ if (!savePath.empty())
+ {
+#ifdef _WIN32
+ _mkdir(savePath.c_str());
+#else
+ mkdir(savePath.c_str(), 0755);
+#endif
+ m_logFileHandle = fopen(filename, "ab");
+ }
+ if (!m_logFileHandle)
+ {
+ return; // silently fail, don't crash
+ }
}
return;
}
@@ -1519,3 +1692,4 @@ bool TouchesHaveBeenReceived()
#endif
return false;
}
+