From 7fca7891e800cf3833e429a79f8e39f4094d6896 Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Sat, 19 Oct 2024 17:11:53 -0400 Subject: [PATCH] lix-game: build more variants; build PNG32s on any platform --- README.md | 4 ++-- default.nix | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa71974..f24105f 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,9 @@ On macOS, upstream is affected by a [bug](https://github.com/SimonN/LixD/issues/ However, as far as I know there's no guarantee that NSImage will keep treating true-color images the same way in future macOS versions, meaning this workaround could break eventually - and it doesn't do anything for custom images installed in `${XDG_DATA_HOME:-$HOME/.local/share}/lix`. -Therefore, I also have an alternative workaround implemented. If you set `convertImagesToTrueColor` to `false`, Lix will instead be linked against a custom build of Allegro 5 which has the macOS native image loader disabled, and instead uses the same `libpng`-based method as on Linux and Windows, avoiding the bug. To prevent this as well (for instance, to test out the bug's behavior on a given version of macOS), additionally set `disableNativeImageLoader` to `false`. +Therefore, I also have an alternative workaround implemented. If you set `convertImagesToTrueColor` to `false`, Lix will instead be linked against a custom build of Allegro 5 which has the macOS native image loader disabled, and instead uses the same `libpng`-based method as on Linux and Windows, avoiding the bug. To prevent this as well (for instance, to test out the bug's behavior on a given version of macOS), additionally set `disableNativeImageLoader` to `false` (or just use `lix-game-libpng`). -You can also set `disableNativeImageLoader` to `"CIImage"` to test out @pedro-w's [CIImage-based loader](https://github.com/liballeg/allegro5/issues/1531#issuecomment-1950198051). +You can also set `disableNativeImageLoader` to `"CIImage"` (or use `lix-game-CIImage`) to test out @pedro-w's [CIImage-based loader](https://github.com/liballeg/allegro5/issues/1531#issuecomment-1950198051). #### SimonN/LixD#128 - NaOH's title screen, include hi-res instead of 640x480 diff --git a/default.nix b/default.nix index 80f6e11..b49944e 100644 --- a/default.nix +++ b/default.nix @@ -38,6 +38,21 @@ in { lix-game-packages = callPackage ./pkgs/lix-game {}; lix-game = self.lix-game-packages.game; lix-game-server = self.lix-game-packages.server; + lix-game-libpng = if pkgs.hostPlatform.isDarwin then (self.lix-game-packages.overrideScope (self: super: { + convertImagesToTrueColor = false; + })).game else lix-game; + lix-game-CIImage = if pkgs.hostPlatform.isDarwin then (self.lix-game-packages.overrideScope (self: super: { + convertImagesToTrueColor = false; + disableNativeImageLoader = "CIImage"; + })).game else lix-game; + _ciOnly.lix-game = { + lix-game-assets = (self.lix-game-packages.overrideScope (self: super: { + convertImagesToTrueColor = false; + })).assets; + lix-game-assets-PNG32 = (self.lix-game-packages.overrideScope (self: super: { + convertImagesToTrueColor = true; + })).assets; + }; xscorch = callPackage ./pkgs/xscorch {};