mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-14 10:37:17 -07:00
Add Support for macOS (#441)
* Fixed soh filters * add more makefile changes * almost ready * more updates * update * update * Update Makefiles to handle both platforms * Allow for overriding the CXX and CC executables * Restore original structure while supporting custom CXX flags * Remove some platform specific libs * Dynamic target name * Make X11 paths package-agnostic * Remove changes to `gfx_opengl.cpp` * Use OpenGL2 on MacOS instead of OpenGL3 * make it actually render something * render at least the first texture, still need to figure out the second one * Let’s use OpenGL 3 again * maybe this works to get the right texture? link's eyes still look off a bit * did this work? * set the platform to macos * actual numbers are right, but logic is ugly XXX/TODO, i know * add zlib to ldflags for ZAPDUtils * A bit of cleanup * Revert unneeded changes * Remove GL_CHECK * Fix issues with z64 branch * use an std::map instead of a giant array * three point filter fix (#2) * Fix mac compilation * fix audio for 64 bit * revert audio heap size, keep bigger pools * Add more Apple specific checks to our modifications * Add building instructions for macOS * Remove unecessary step from building instructions * Add missing SDL2 & GLEW to Linux LDLIBS * Update BUILDING.md Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Update soh/.gitignore to include other arch binaries Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Use right platform name for debugging window Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Fix stormlib on macos (arm64) * Simplify some of the ifdef checks * Revert an older no longer necessary fix * Remove remaining unecessary deviations * Update building instructions after StormLib changes * Feature: Use OpenGL 4.1 (#1) * Further tweak the BUILDING * Tidy up * reword -j message * Add Jenkins CI Support (#2) * Fix type issues * add target <appbundle> and <filledappbundle> add makefile targets to create an .app `filledappbundle` creates the target with the .otr included this should perhaps be moved to Application Support though * pull gcc's rpath from otool output * move make target to the end so it's not default * Add Jenkins and make exe in par with other platforms * Actually save build artefacts * Fix artefact path * Remove x11 mentions and linking (not used) * Update building instructions for generating app * use appsupport directory * Add new app icon * Update target to match macOS types * Update more audio types * fix null deref in Audio_PlayFanfare * Remove old import from z64 * address final nit with apple ifdefs Co-authored-by: KiritoDev <36680385+KiritoDv@users.noreply.github.com> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com>
This commit is contained in:
parent
77e7080a8c
commit
e42b18cf71
32 changed files with 441 additions and 69 deletions
35
soh/macosx/Info.plist
Normal file
35
soh/macosx/Info.plist
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Ship of Harkinian</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>launcher.sh</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>2.0.0</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>soh.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.shipofharkinian.ShipOfHarkinian</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
</array>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>ZOoT</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.0.0</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright 2022 HarbourMasters.</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.3</string>
|
||||
</dict>
|
||||
</plist>
|
1
soh/macosx/PkgInfo
Normal file
1
soh/macosx/PkgInfo
Normal file
|
@ -0,0 +1 @@
|
|||
APPLZOoT
|
26
soh/macosx/appsupport.m
Normal file
26
soh/macosx/appsupport.m
Normal file
|
@ -0,0 +1,26 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
int main(void) {
|
||||
NSString *appSupportDir = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject];
|
||||
//If there isn't an App Support Directory yet ...
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:appSupportDir isDirectory:NULL]) {
|
||||
NSError *error = nil;
|
||||
//Create one
|
||||
if (![[NSFileManager defaultManager] createDirectoryAtPath:appSupportDir withIntermediateDirectories:YES attributes:nil error:&error]) {
|
||||
NSLog(@"%@", error.localizedDescription);
|
||||
}
|
||||
else {
|
||||
// *** OPTIONAL *** Mark the directory as excluded from iCloud backups
|
||||
NSURL *url = [NSURL fileURLWithPath:appSupportDir];
|
||||
if (![url setResourceValue:@YES
|
||||
forKey:NSURLIsExcludedFromBackupKey
|
||||
error:&error])
|
||||
{
|
||||
NSLog(@"Error excluding %@ from backup %@", url.lastPathComponent, error.localizedDescription);
|
||||
}
|
||||
else {
|
||||
NSLog(@"Yay");
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s\n", [appSupportDir UTF8String]);
|
||||
}
|
9
soh/macosx/launcher.sh
Executable file
9
soh/macosx/launcher.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
APPPATH="${0%/*}"
|
||||
cd "${APPPATH}"
|
||||
APPPATH=$(pwd)
|
||||
APPSUPPORT=$(./appsupport)
|
||||
mkdir -p "${APPSUPPORT}/com.shipofharkinian.soh"
|
||||
cd "${APPSUPPORT}/com.shipofharkinian.soh"
|
||||
cp "${APPPATH}/oot.otr" .
|
||||
${APPPATH}/soh
|
BIN
soh/macosx/sohIcon.png
Normal file
BIN
soh/macosx/sohIcon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 139 KiB |
Loading…
Add table
Add a link
Reference in a new issue