Skip to content

Commit

Permalink
lix-game: build more variants; build PNG32s on any platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhys-T committed Oct 19, 2024
1 parent 7d047ca commit 7fca789
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 15 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};

Expand Down

0 comments on commit 7fca789

Please sign in to comment.