JoseTomasTocino / freegemas

Freegemas is an open source version of the well known Bejeweled, built in C++ using SDL2
GNU General Public License v2.0
61 stars 18 forks source link

App Icon #40

Open Lewiscowles1986 opened 11 months ago

Lewiscowles1986 commented 11 months ago

I Couldn't find an app icon, so I spun one together from the media assets quickly in GIMP

freegemas-icons.zip

To make the OSX icns I ran the following script

mkdir freegemas.iconset
cd freegemas.iconset
sips -Z 16 ../freegemas.png --out icon_16.png
sips -Z 32 ../freegemas.png --out icon_32.png
sips -Z 48 ../freegemas.png --out icon_48.png
sips -Z 64 ../freegemas.png --out icon_64.png
sips -Z 96 ../freegemas.png --out icon_96.png
sips -Z 128 ../freegemas.png --out icon_128.png
sips -Z 256 ../freegemas.png --out icon_256.png
sips -Z 512 ../freegemas.png --out icon_512.png
cd ..
iconutil -c icns freegemas.iconset -o freegemas.icns

Then I made an Info.plist

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<plist version="1.0">
  <dict>
    <key>CFBundleExecutable</key>
    <string>FreeGemas</string>
    <key>CFBundleGetInfoString</key>
    <string>FreeGemas Git (dd4cd21e553a9a41ec0273dd7cb50a9dbb938493)</string>
    <key>CFBundleVersion</key>
    <string>dev</string>
    <key>CFBundleShortVersionString</key>
    <string>dev</string>
    <key>CFBundleIconFile</key>
    <string>AppIcon</string>
    <key>CFBundleIconName</key>
    <string>AppIcon</string>
</dict>
</plist>

I Also made a .app so I could execute in OSX

mkdir -p /Applications/FreeGemas.app/Contents/MacOS/
mv freegemas /Applications/FreeGemas.app/Contents/MacOS/
chmod +x /Applications/FreeGemas.app/Contents/MacOS/freegemas
mkdir -p /Applications/FreeGemas.app/Contents/Resources
cp -a media /Applications/FreeGemas.app/Contents/Resources/
cp freegemas.icns /Applications/FreeGemas.app/Contents/Resources/AppIcon.icns
cp Info.plist /Applications/FreeGemas.app/Contents/Info.plist

End result:

OSX Applications
Lewiscowles1986 commented 11 months ago

For me on M2 mac air, this was all that was needed to get an icon and create a distributed clickable app for this.

sharkwouter commented 11 months ago

That is cool! Nice work!

Would it be possible for you to create a pull request which applies creates this file in the automated Mac build? I would not be able to do this as I have no way to test the result by myself.