Add a cataclysm-dda patch

This commit is contained in:
Malte Tammena 2021-08-16 16:17:37 +02:00
parent 3fd352bd83
commit f30c15ade4
4 changed files with 33 additions and 12 deletions

View file

@ -116,6 +116,7 @@
# Some program adjustments
(import ./overlays/mosh.nix)
(import ./overlays/logisim.nix)
(import ./overlays/cataclysm-dda.nix)
];
};

View file

@ -27,17 +27,6 @@ let
wrapProgram $out/bin/${name} --add-flags "--enable-features=UseOzonePlatform --ozone-platform=wayland"
'';
lockfile = builtins.fromJSON (builtins.readFile ../flake.lock);
my-cataclysm-dda-git = (pkgs.bleeding.cataclysm-dda-git.override {
useXdgDir = true;
version = lockfile.nodes.cataclysm-dda.locked.rev;
rev = lockfile.nodes.cataclysm-dda.locked.rev;
sha256 = lockfile.nodes.cataclysm-dda.locked.narHash;
}).overrideAttrs (_: {
enableParallelBuilding = true;
});
in {
imports = [
@ -115,7 +104,7 @@ in {
xdg_utils
xournalpp
youtube-dl
my-cataclysm-dda-git
cataclysm-dda-git
] ++ (if config.useLegacyX11 then
[
# X11-only

View file

@ -0,0 +1,14 @@
self: super:
let lock = builtins.fromJSON (builtins.readFile ../flake.lock);
in {
cataclysm-dda-git = (super.bleeding.cataclysm-dda-git.override {
useXdgDir = true;
version = lock.nodes.cataclysm-dda.locked.rev;
rev = lock.nodes.cataclysm-dda.locked.rev;
sha256 = lock.nodes.cataclysm-dda.locked.narHash;
}).overrideAttrs (old: {
enableParallelBuilding = true;
patches = (old.patches or []) ++ [ ../patches/cdda-wayland-sdl-fix.patch ];
});
}

View file

@ -0,0 +1,17 @@
diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp
index d7a68d65d0..eef7bef83e 100644
--- a/src/sdltiles.cpp
+++ b/src/sdltiles.cpp
@@ -545,11 +545,11 @@ void refresh_display()
// Select default target (the window), copy rendered buffer
// there, present it, select the buffer as target again.
SetRenderTarget( renderer, nullptr );
+ RenderClear( renderer );
#if defined(__ANDROID__)
SDL_Rect dstrect = get_android_render_rect( TERMINAL_WIDTH * fontwidth,
TERMINAL_HEIGHT * fontheight );
SetRenderDrawColor( renderer, 0, 0, 0, 255 );
- RenderClear( renderer );
RenderCopy( renderer, display_buffer, NULL, &dstrect );
#else
RenderCopy( renderer, display_buffer, nullptr, nullptr );