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:
1 parent
30b961c923
commit
f5b1cc1a79
6 files changed
+13
-8
No files matched your search
@@ -1,4 +1,6 @@
|
|||||||
# Factorio on iPhone
|
<p align="center"><img src="assets/logo-256.png" width="160" alt="Factorio for iPhone logo"></p>
|
||||||
|
|
||||||
|
<h1 align="center">Factorio on iPhone</h1>
|
||||||
|
|
||||||
Play your own copy of **Factorio** on your iPhone. You build the app on your Mac from the
|
Play your own copy of **Factorio** on your iPhone. You build the app on your Mac from the
|
||||||
Factorio you already own on Steam, and install it on your phone with a cable.
|
Factorio you already own on Steam, and install it on your phone with a cable.
|
||||||
@@ -130,6 +132,9 @@ git pull
|
|||||||
- [docs/research/](docs/research/static-translation.md): earlier research (ARM64 → WASM
|
- [docs/research/](docs/research/static-translation.md): earlier research (ARM64 → WASM
|
||||||
translation).
|
translation).
|
||||||
|
|
||||||
|
**Logo:** `assets/logo.png` (transparent, 683 px) and `assets/logo-256.png` are the project's own
|
||||||
|
artwork, also used for the app icon. They are not Factorio's official logo.
|
||||||
|
|
||||||
**Third-party software:** [Wuffs](https://github.com/google/wuffs) (Apache-2.0) is downloaded
|
**Third-party software:** [Wuffs](https://github.com/google/wuffs) (Apache-2.0) is downloaded
|
||||||
during the build to decode PNG images. Factorio itself uses [SDL](https://github.com/libsdl-org/SDL)
|
during the build to decode PNG images. Factorio itself uses [SDL](https://github.com/libsdl-org/SDL)
|
||||||
(zlib). Factorio is a trademark of Wube Software Ltd.; all game code and assets belong to them.
|
(zlib). Factorio is a trademark of Wube Software Ltd.; all game code and assets belong to them.
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 508 KiB |
+1
-1
@@ -66,7 +66,7 @@ only.
|
|||||||
2. **Retarget.** `tools/retarget.py` writes `build/native/Factorio.dylib`, changing only Mach-O
|
2. **Retarget.** `tools/retarget.py` writes `build/native/Factorio.dylib`, changing only Mach-O
|
||||||
header bytes, and records the changes in `build/native/retarget.json`.
|
header bytes, and records the changes in `build/native/retarget.json`.
|
||||||
3. **Shims and host.** The shim libraries and the small host executable are compiled for iOS
|
3. **Shims and host.** The shim libraries and the small host executable are compiled for iOS
|
||||||
with clang; the app icon is generated from the game's own icon.
|
with clang; the app icon is generated from `assets/logo.png`.
|
||||||
4. **Bundle and sign.** `build/native/Factorio.app` is assembled, signed, and installed with
|
4. **Bundle and sign.** `build/native/Factorio.app` is assembled, signed, and installed with
|
||||||
`devicectl`.
|
`devicectl`.
|
||||||
5. **Data.** `--push-data` copies the game's `data/` folder (~1.5 GB) into the app's
|
5. **Data.** `--push-data` copies the game's `data/` folder (~1.5 GB) into the app's
|
||||||
|
|||||||
@@ -96,14 +96,14 @@ def dylib(name, sources, defines=(), reexport=None, link_appkit=True, extra=()):
|
|||||||
|
|
||||||
|
|
||||||
def build_icon():
|
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"
|
work = OUT / "icon"
|
||||||
iconset = work / "Assets.xcassets/AppIcon.appiconset"
|
iconset = work / "Assets.xcassets/AppIcon.appiconset"
|
||||||
iconset.mkdir(parents=True, exist_ok=True)
|
iconset.mkdir(parents=True, exist_ok=True)
|
||||||
tool = work / "make_icon"
|
tool = work / "make_icon"
|
||||||
run(["xcrun", "clang", "-O2", "-fobjc-arc", ROOT / "tools/make_icon.m", "-framework", "Foundation",
|
run(["xcrun", "clang", "-O2", "-fobjc-arc", ROOT / "tools/make_icon.m", "-framework", "Foundation",
|
||||||
"-framework", "CoreGraphics", "-framework", "ImageIO", "-o", tool])
|
"-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",
|
(iconset / "Contents.json").write_text(json.dumps({"images": [{"filename": "AppIcon-1024.png", "idiom": "universal",
|
||||||
"platform": "ios", "size": "1024x1024"}], "info": {"author": "xcode", "version": 1}}))
|
"platform": "ios", "size": "1024x1024"}], "info": {"author": "xcode", "version": 1}}))
|
||||||
(work / "Assets.xcassets/Contents.json").write_text(json.dumps({"info": {"author": "xcode", "version": 1}}))
|
(work / "Assets.xcassets/Contents.json").write_text(json.dumps({"info": {"author": "xcode", "version": 1}}))
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
// Builds the 1024x1024 iOS app icon from the game's own 128 px icon (read from the local install).
|
// Builds the 1024x1024 iOS app icon from the project logo (assets/logo.png, transparent).
|
||||||
// The gear is scaled with high-quality interpolation onto an opaque dark background
|
// The emblem is drawn with high-quality interpolation onto an opaque, full-bleed dark background:
|
||||||
// (iOS app icons must be opaque).
|
// iOS app icons must be opaque and square (the system applies the rounded mask).
|
||||||
// Usage: make_icon SOURCE_PNG OUTPUT_PNG
|
// Usage: make_icon SOURCE_PNG OUTPUT_PNG
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <CoreGraphics/CoreGraphics.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,
|
CGContextDrawRadialGradient(ctx, gradient, CGPointMake(size / 2.0, size * 0.55), 0,
|
||||||
CGPointMake(size / 2.0, size / 2.0), size * 0.75, kCGGradientDrawsAfterEndLocation);
|
CGPointMake(size / 2.0, size / 2.0), size * 0.75, kCGGradientDrawsAfterEndLocation);
|
||||||
CGContextSetInterpolationQuality(ctx, kCGInterpolationHigh);
|
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);
|
CGContextDrawImage(ctx, CGRectMake(inset, inset, size - 2 * inset, size - 2 * inset), gear);
|
||||||
CGImageRef icon = CGBitmapContextCreateImage(ctx);
|
CGImageRef icon = CGBitmapContextCreateImage(ctx);
|
||||||
CGImageDestinationRef dst = CGImageDestinationCreateWithURL((__bridge CFURLRef)[NSURL fileURLWithPath:@(argv[2])],
|
CGImageDestinationRef dst = CGImageDestinationCreateWithURL((__bridge CFURLRef)[NSURL fileURLWithPath:@(argv[2])],
|
||||||
|
|||||||
Reference in new issue
Block a user