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

Addresses crash issue #3340 and build standalone app via Xcode #3397

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -64,3 +64,5 @@ gmon.out
.dirstamp
result
*.sgm
osx/pioneer.xcworkspace/xcuserdata
._*
15 changes: 11 additions & 4 deletions COMPILING.txt
Expand Up @@ -122,7 +122,6 @@ irc.freenode.net.
freetype
libsdl2
libsdl2_image
libsdl2_sound
libsigcxx2
libvorbis
autoconf
Expand Down Expand Up @@ -152,8 +151,15 @@ Note: Compiling from source this way isn't recommended as it doesn't allow you
1.5 OSX - XCode 4
-----------------

* The XCode project isn't as up to date as the 'autotools' method and may
be broken.
1. You will need the following libraries installed. The best method I found
was to install macports (http://www.macports.org/) and install the
following ports (sudo port install xxxx):

assimp
freetype
libsigcxx2

Alternatively you can also run the script in the ./osx folder install_ports.sh

The latest XCode project files are located in ./osx. Simply build the
aplication bundle. The XCode project uses the mac port libraries that you
Expand Down Expand Up @@ -221,7 +227,8 @@ To get it, clone git://github.com/pioneerspacesim/pioneer-thirdparty.git.
2.4 OSX
-------

- pioneer-thirdparty currently not required.
1. After cloning the repo, move it to a folder called "pioneer-thirdparty"
alongside your "pioneer" folder.



Expand Down
2 changes: 1 addition & 1 deletion contrib/miniz/miniz.h
Expand Up @@ -2790,7 +2790,7 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
*pLen_out = out_buf.m_size-41;
{
mz_uint8 pnghdr[41]={0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,
0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8,"\0\0\04\02\06"[num_chans],0,0,0,0,0,0,0,
0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8,static_cast<mz_uint8>("\0\0\04\02\06"[num_chans]),0,0,0,0,0,0,0,
(mz_uint8)(*pLen_out>>24),(mz_uint8)(*pLen_out>>16),(mz_uint8)(*pLen_out>>8),(mz_uint8)*pLen_out,0x49,0x44,0x41,0x54};
c=(mz_uint32)mz_crc32(MZ_CRC32_INIT,pnghdr+12,17); for (i=0; i<4; ++i, c<<=8) ((mz_uint8*)(pnghdr+29))[i]=(mz_uint8)(c>>24);
memcpy(out_buf.m_pBuf, pnghdr, 41);
Expand Down
4 changes: 0 additions & 4 deletions osx/SDLMain.h
Expand Up @@ -13,7 +13,3 @@
- (IBAction)openAboutPanel:(id)sender;

@end

@interface SDLApplication : NSApplication

@end
15 changes: 1 addition & 14 deletions osx/SDLMain.m
Expand Up @@ -5,26 +5,13 @@
// Objective-C cocoa wrapper for pioneer

#include "buildopts.h"
#import <SDL/SDL.h>
#import <SDL2/SDL.h>
#import "SDLMain.h"
#import <unistd.h>

static int gArgc;
static char **gArgv;

@implementation SDLApplication

// Invoked from the Quit menu item
- (void)terminate:(id)sender
{
// Posts a SDL_QUIT event so SDL shutsdown
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
[super terminate:sender];
}
@end

@implementation SDLMain

// Called when the internal event loop has just started running
Expand Down
7 changes: 7 additions & 0 deletions osx/install_ports.sh
@@ -0,0 +1,7 @@
#!/bin/sh
port install autoconf
port install automake
port install pkgconfig
port install assimp
port install freetype
port install libsigcxx2
953 changes: 548 additions & 405 deletions osx/pioneer.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4AE9706A1436A64000424F91"
BuildableName = "GenGitVersion"
BlueprintName = "GenGitVersion"
ReferencedContainer = "container:pioneer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4AE9706A1436A64000424F91"
BuildableName = "GenGitVersion"
BlueprintName = "GenGitVersion"
ReferencedContainer = "container:pioneer.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4AE9706A1436A64000424F91"
BuildableName = "GenGitVersion"
BlueprintName = "GenGitVersion"
ReferencedContainer = "container:pioneer.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
146 changes: 146 additions & 0 deletions osx/pioneer.xcodeproj/xcshareddata/xcschemes/pioneer.xcscheme
@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D07F2BC0486CC7A007CD1D0"
BuildableName = "Ogg.framework"
BlueprintName = "Ogg"
ReferencedContainer = "container:../../pioneer-thirdparty/source/libogg/macosx/Ogg.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BECDF5FE0761BA81005FE872"
BuildableName = "SDL2.framework"
BlueprintName = "Framework"
ReferencedContainer = "container:../../pioneer-thirdparty/source/sdl2/Xcode/SDL/SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BE1FA71807AF4C44004B6283"
BuildableName = "SDL2_image.framework"
BlueprintName = "Framework"
ReferencedContainer = "container:../../pioneer-thirdparty/source/sdl2_image/Xcode/SDL_image.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "730F23A1091827B100AB638C"
BuildableName = "Vorbis.framework"
BlueprintName = "Vorbis"
ReferencedContainer = "container:../../pioneer-thirdparty/source/libvorbis-1.3.3/macosx/Vorbis.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4A20B0DD135319770020F43E"
BuildableName = "pioneer.app"
BlueprintName = "pioneer"
ReferencedContainer = "container:pioneer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4A20B0DD135319770020F43E"
BuildableName = "pioneer.app"
BlueprintName = "pioneer"
ReferencedContainer = "container:pioneer.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "NO"
debugXPCServices = "NO"
allowLocationSimulation = "NO"
viewDebuggingEnabled = "No">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4A20B0DD135319770020F43E"
BuildableName = "pioneer.app"
BlueprintName = "pioneer"
ReferencedContainer = "container:pioneer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4A20B0DD135319770020F43E"
BuildableName = "pioneer.app"
BlueprintName = "pioneer"
ReferencedContainer = "container:pioneer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
19 changes: 19 additions & 0 deletions osx/pioneer.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions osx/pioneer.xcworkspace/xcshareddata/pioneer.xccheckout
@@ -0,0 +1,53 @@
<?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>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>489F6EAB-4599-4922-95BB-10B7BDFCCF8C</string>
<key>IDESourceControlProjectName</key>
<string>pioneer</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>CEB9386F2744B9C86681D599A1A9B6D6ADBFB2A8</key>
<string>github.com:SilkyPantsDan/pioneer.git</string>
<key>DA6F661DD649F78B3D5A22E52AD1F5102743FEDB</key>
<string>github.com:SilkyPantsDan/pioneer-thirdparty.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>osx/pioneer.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>CEB9386F2744B9C86681D599A1A9B6D6ADBFB2A8</key>
<string>../..</string>
<key>DA6F661DD649F78B3D5A22E52AD1F5102743FEDB</key>
<string>../..-thirdparty</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:SilkyPantsDan/pioneer.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>CEB9386F2744B9C86681D599A1A9B6D6ADBFB2A8</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>CEB9386F2744B9C86681D599A1A9B6D6ADBFB2A8</string>
<key>IDESourceControlWCCName</key>
<string>pioneer</string>
</dict>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>DA6F661DD649F78B3D5A22E52AD1F5102743FEDB</string>
<key>IDESourceControlWCCName</key>
<string>pioneer-thirdparty</string>
</dict>
</array>
</dict>
</plist>