Updated main.c with a conditional for Mac. Now the icon in the dock will stay as...
authorjammnrose <jammnrose@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Thu, 13 Sep 2007 00:09:41 +0000 (00:09 +0000)
committerjammnrose <jammnrose@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Thu, 13 Sep 2007 00:09:41 +0000 (00:09 +0000)
Updated xcodeproj with some minor script improvements.

git-svn-id: https://s.snth.net/svn/neverball/trunk@1122 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/main.c
macosx/xcode/neverball.xcodeproj/project.pbxproj

index a297049..73d137a 100644 (file)
@@ -391,6 +391,7 @@ int main(int argc, char *argv[])
     SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,  16);
     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
 
+#ifndef __APPLE__
     /* Set the WM icon */
 
     icon = IMG_Load(config_data("icon/neverball.png"));
@@ -400,6 +401,7 @@ int main(int argc, char *argv[])
         SDL_WM_SetIcon(icon, NULL);
         SDL_FreeSurface(icon);
     }
+#endif // __APPLE__
 
     /* Initialize the video. */
 
index 5a0a720..4a012ed 100755 (executable)
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "# Create a dmg\n# \n# Modified from \"Battle for Wesnoth\" building stuff\n\n# set -x # uncomment for debugging\nset -e # exit on error\n\nSVN_REVISION=`cd ${SRCROOT}/../.. && /usr/local/bin/svn info | grep Rev: | cut -d: -f2`\nSVN_REVISION=`echo ${SVN_REVISION} | sed -e 's/\\ //g'`\necho \"*** SVN REV : ${SVN_REVISION}\"\n\nVERSION=\"1.5.0-r${SVN_REVISION}\"\n# VERSION=\"1.5.0\"\nNAME=\"Neverball-$VERSION\"\n\necho \"*** Building disk image...\"\n\nimage_rw=\"${BUILT_PRODUCTS_DIR}/Neverball-${VERSION}.sparseimage\"\nimage_ro=\"${BUILT_PRODUCTS_DIR}/Neverball-${VERSION}.dmg\"\n\nMOUNTPOINT=\"/Volumes/$NAME\"\ntest -e \"$MOUNTPOINT\" && {\n  echo \"$MOUNTPOINT already mounted. Please, detach it.\" 1>&2\n  exit 1\n}\n\nrm \"$image_rw\" 2>/dev/null || true\nhdiutil create -type SPARSE -fs HFS+ -volname \"$NAME\" \"$image_rw\"\nhdiutil attach \"$image_rw\"\n\nfor app in \"Neverball\" \"Neverputt\"\ndo \n  echo \"+ Copying $app\"\n  cp -Rp \"${BUILT_PRODUCTS_DIR}/${app}.app\" \"$MOUNTPOINT/.\"\n  strip \"$MOUNTPOINT/${app}.app/Contents/MacOS/${app}\"\n  rm -fr \"$MOUNTPOINT/${app}.app/\"Contents/Frameworks/*.framework/Versions/*/Headers\n  rm -fr \"$MOUNTPOINT/${app}.app/\"Contents/Frameworks/*.framework/Headers\ndone\n\necho \"+ Copying data\"\ncp -Rp \"${BUILT_PRODUCTS_DIR}/data\" \"${MOUNTPOINT}/.\"\n\necho \"+ Cleaning image before read-only\"\nrm -f \"${MOUNTPOINT}/data/.ok\"\n\necho \"+ Copying Doc\"\nmkdir \"${MOUNTPOINT}/docs\"\nfor i in \"CHANGES\" \"COPYING\" \"INSTALL\" \"README\" \ndo\ncp \"${SRCROOT}/../../$i\" \"${MOUNTPOINT}/Docs/\"\ndone\nfor i in \"AUTHORS\" \"MANUAL\" \"TRANSLATIONS\" \ndo\ncp \"${SRCROOT}/../../doc/$i\" \"${MOUNTPOINT}/Docs/\"\ndone\n\n#echo \"+ Install disk icon\"\n# iconfile=\"shield.icns\"\n#cp \"$iconfile\" \"$mountpoint/.VolumeIcon.icns\"\n#/Developer/Tools/SetFile -a aVbstclinmedz \"$MOUNTPOINT/.VolumeIcon.icns\"\n\necho \"+ Install background dmg\"\nmkdir -p \"${MOUNTPOINT}/data/osx\"\ncp \"${SRCROOT}/../icons/dmg-background.jpg\" \"${MOUNTPOINT}/data/osx/\"\n\necho \"+ set the presentation\"\n# better to copy this in script editor for change...\nosascript - \"$MOUNTPOINT\" <<!\non run argv\n--\tset dir to \"/Volumes/Wesnoth 0.9.5\"\n\tset dir to item 1 of argv\n\ttell application \"Finder\"\n\t\tset f to POSIX file dir as alias\n\t\topen f\n\n\t\tset w to container window of f\n\n\t\tset current view of w to icon view\n\t\tset toolbar visible of w to false\n\t\tset statusbar visible of w to false\n\t\tset opts to icon view options of w\n\t\tset bgfile to file \"data:osx:dmg-background.jpg\" of folder f\n\t\t\n\t\t--\tset background color of opts to {50000, 50000, 50000}\n\t\tset background picture of opts to bgfile\n\t\tset icon size of opts to 70\n\t\tset text size of opts to 12\n\t\tset label position of opts to bottom\n\t\tset arrangement of opts to not arranged\n\t\tset position of item \"Neverball.app\" of f to {94, 252}\n\t\tset position of item \"data\" of f to {220, 252}\n\t\tset position of item \"docs\" of f to {220, 162}\n\t\tset position of item \"Neverputt.app\" of f to {348, 252}\n\t\tset the bounds of w to {100, 100, 558, 425}\n\t\t-- set the bounds of w to {150, 150, 200, 150}\n\t\tdelay 5\n\tend tell\nend run\n!\n\necho \"+ Detaching '$NAME' image\"\nhdiutil detach \"$MOUNTPOINT\"\n\nopen \"$image_rw\"\n\n#echo \"+ Compressing disk image\"\n#rm \"$image_ro\" 2>/dev/null || true\n#hdiutil convert \"$image_rw\" -imagekey zlib-level=9 -format UDZO -o \"$image_ro\"\n\n#rm \"$image_rw\"\n\n# open the result in Finder\n#open \"$image_ro\"\n";
+                       shellScript = "# Create a dmg\n# \n# Modified from \"Battle for Wesnoth\" building stuff\n\n# set -x # uncomment for debugging\nset -e # exit on error\n\nSVN_REVISION=`cd ${SRCROOT}/../.. && /usr/local/bin/svn info | grep Rev: | cut -d: -f2`\nSVN_REVISION=`echo ${SVN_REVISION} | sed -e 's/\\ //g'`\necho \"*** SVN REV : ${SVN_REVISION}\"\n\nVERSION=\"1.5.0-r${SVN_REVISION}\"\n# VERSION=\"1.5.0\"\nNAME=\"Neverball-$VERSION\"\n\necho \"*** Building disk image...\"\n\nimage_rw=\"${BUILT_PRODUCTS_DIR}/Neverball-${VERSION}.sparseimage\"\nimage_ro=\"${BUILT_PRODUCTS_DIR}/Neverball-${VERSION}.dmg\"\n\nMOUNTPOINT=\"/Volumes/$NAME\"\ntest -e \"$MOUNTPOINT\" && {\n  echo \"$MOUNTPOINT already mounted. Please, detach it.\" 1>&2\n  exit 1\n}\n\nrm \"$image_rw\" 2>/dev/null || true\nhdiutil create -type SPARSE -fs HFS+ -volname \"$NAME\" \"$image_rw\"\nhdiutil attach \"$image_rw\"\n\nfor app in \"Neverball\" \"Neverputt\"\ndo \n  echo \"+ Copying $app\"\n  cp -Rp \"${BUILT_PRODUCTS_DIR}/${app}.app\" \"$MOUNTPOINT/.\"\n  strip \"$MOUNTPOINT/${app}.app/Contents/MacOS/${app}\"\n  rm -fr \"$MOUNTPOINT/${app}.app/\"Contents/Frameworks/*.framework/Versions/*/Headers\n  rm -fr \"$MOUNTPOINT/${app}.app/\"Contents/Frameworks/*.framework/Headers\ndone\n\necho \"+ Copying data\"\ncp -Rp \"${BUILT_PRODUCTS_DIR}/data\" \"${MOUNTPOINT}/.\"\n\necho \"+ Cleaning image before read-only\"\nrm -f \"${MOUNTPOINT}/data/.ok\"\n\necho \"+ Copying Doc\"\nmkdir \"${MOUNTPOINT}/docs\"\nfor i in \"CHANGES\" \"COPYING\" \"INSTALL\" \"README\" \ndo\ncp \"${SRCROOT}/../../$i\" \"${MOUNTPOINT}/Docs/\"\ndone\nfor i in \"AUTHORS\" \"MANUAL\" \"TRANSLATIONS\" \ndo\ncp \"${SRCROOT}/../../doc/$i\" \"${MOUNTPOINT}/Docs/\"\ndone\n\n#echo \"+ Install disk icon\"\n# iconfile=\"shield.icns\"\n#cp \"$iconfile\" \"$mountpoint/.VolumeIcon.icns\"\n#/Developer/Tools/SetFile -a aVbstclinmedz \"$MOUNTPOINT/.VolumeIcon.icns\"\n\necho \"+ Install background dmg\"\nmkdir -p \"${MOUNTPOINT}/data/osx\"\ncp \"${SRCROOT}/../icons/dmg-background.jpg\" \"${MOUNTPOINT}/data/osx/\"\n\necho \"+ set the presentation\"\n# better to copy this in script editor for change...\nosascript - \"$MOUNTPOINT\" <<!\non run argv\n--\tset dir to \"/Volumes/Wesnoth 0.9.5\"\n\tset dir to item 1 of argv\n\ttell application \"Finder\"\n\t\tset f to POSIX file dir as alias\n\t\topen f\n\n\t\tset w to container window of f\n\n\t\tset current view of w to icon view\n\t\tset toolbar visible of w to false\n\t\tset statusbar visible of w to false\n\t\tset opts to icon view options of w\n\t\tset bgfile to file \"data:osx:dmg-background.jpg\" of folder f\n\t\t\n\t\t--\tset background color of opts to {50000, 50000, 50000}\n\t\tset background picture of opts to bgfile\n\t\tset icon size of opts to 70\n\t\tset text size of opts to 12\n\t\tset label position of opts to bottom\n\t\tset arrangement of opts to not arranged\n\t\tset position of item \"Neverball.app\" of f to {94, 252}\n\t\tset position of item \"data\" of f to {220, 252}\n\t\tset position of item \"docs\" of f to {220, 162}\n\t\tset position of item \"Neverputt.app\" of f to {348, 252}\n\t\tset the bounds of w to {100, 100, 558, 425}\n\t\tdelay 5\n\tend tell\nend run\n!\n\necho \"+ Detaching '$NAME' image\"\nhdiutil detach \"$MOUNTPOINT\"\n\n#open \"$image_rw\"\n\n#echo \"+ Compressing disk image\"\n#rm \"$image_ro\" 2>/dev/null || true\n#hdiutil convert \"$image_rw\" -imagekey zlib-level=9 -format UDZO -o \"$image_ro\"\n\n#rm \"$image_rw\"\n\n# open the result in Finder\n#open \"$image_ro\"\n";
                };
                81D0B40A0AEE70300041CE19 /* ShellScript */ = {
                        isa = PBXShellScriptBuildPhase;