Add project logo and use it for the app icon

- assets/logo.png (transparent) and assets/logo-256.png for the site
  and README
- tools/make_icon.m builds the full-bleed iOS icon from the logo
This commit is contained in:
SashaGoncharov19 committed 2026-10-23 16:35:48 +04:00
1 parent 30b961c923
commit f5b1cc1a79
6 files changed
+13 -8

No files matched your search

+2 -2
View File
@@ -96,14 +96,14 @@ def dylib(name, sources, defines=(), reexport=None, link_appkit=True, extra=()):
def build_icon():
"""Compile an asset catalog with the app icon, made from the game's own icon; returns plist keys."""
"""Compile an asset catalog with the app icon, made from assets/logo.png; returns plist keys."""
work = OUT / "icon"
iconset = work / "Assets.xcassets/AppIcon.appiconset"
iconset.mkdir(parents=True, exist_ok=True)
tool = work / "make_icon"
run(["xcrun", "clang", "-O2", "-fobjc-arc", ROOT / "tools/make_icon.m", "-framework", "Foundation",
"-framework", "CoreGraphics", "-framework", "ImageIO", "-o", tool])
run([tool, GAME / "data/core/graphics/factorio-icon@2x.png", iconset / "AppIcon-1024.png"])
run([tool, ROOT / "assets/logo.png", iconset / "AppIcon-1024.png"])
(iconset / "Contents.json").write_text(json.dumps({"images": [{"filename": "AppIcon-1024.png", "idiom": "universal",
"platform": "ios", "size": "1024x1024"}], "info": {"author": "xcode", "version": 1}}))
(work / "Assets.xcassets/Contents.json").write_text(json.dumps({"info": {"author": "xcode", "version": 1}}))
+4 -4
View File
@@ -1,6 +1,6 @@
// Builds the 1024x1024 iOS app icon from the game's own 128 px icon (read from the local install).
// The gear is scaled with high-quality interpolation onto an opaque dark background
// (iOS app icons must be opaque).
// Builds the 1024x1024 iOS app icon from the project logo (assets/logo.png, transparent).
// The emblem is drawn with high-quality interpolation onto an opaque, full-bleed dark background:
// iOS app icons must be opaque and square (the system applies the rounded mask).
// Usage: make_icon SOURCE_PNG OUTPUT_PNG
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
@@ -21,7 +21,7 @@ int main(int argc, char **argv) {
CGContextDrawRadialGradient(ctx, gradient, CGPointMake(size / 2.0, size * 0.55), 0,
CGPointMake(size / 2.0, size / 2.0), size * 0.75, kCGGradientDrawsAfterEndLocation);
CGContextSetInterpolationQuality(ctx, kCGInterpolationHigh);
CGFloat inset = size * 0.12;
CGFloat inset = size * 0.14; // keep the emblem clear of the mask's corners
CGContextDrawImage(ctx, CGRectMake(inset, inset, size - 2 * inset, size - 2 * inset), gear);
CGImageRef icon = CGBitmapContextCreateImage(ctx);
CGImageDestinationRef dst = CGImageDestinationCreateWithURL((__bridge CFURLRef)[NSURL fileURLWithPath:@(argv[2])],