fuse-emulator: fix colors on big endian systems with gtk frontend

This commit is contained in:
q66 2020-09-27 20:09:26 +02:00
parent afd0ee0216
commit cb2ef7b604
2 changed files with 30 additions and 1 deletions

View file

@ -0,0 +1,29 @@
From 26a967409d62b16cee5790a5ccb9c87d4dccb06d Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Sun, 27 Sep 2020 20:06:37 +0200
Subject: [PATCH] fix colors on big endian systems
with gtk3, cairo is used, which has a different representation for
their RGB24 format in memory depending on endianness. Since bit
shifts abstract away endianness and work on arithmetic basis, having
separate code for big and little endian has incorrect results.
---
ui/gtk/gtkdisplay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git ui/gtk/gtkdisplay.c ui/gtk/gtkdisplay.c
index b0bf588..fa0dba2 100644
--- ui/gtk/gtkdisplay.c
+++ ui/gtk/gtkdisplay.c
@@ -148,7 +148,7 @@ init_colours( colour_format_t format )
/* Addition of 0.5 is to avoid rounding errors */
grey = ( 0.299 * red + 0.587 * green + 0.114 * blue ) + 0.5;
-#ifdef WORDS_BIGENDIAN
+#if defined(WORDS_BIGENDIAN) && !GTK_CHECK_VERSION( 3, 0, 0 )
switch( format ) {
case FORMAT_x8b8g8r8:
--
2.28.0

View file

@ -1,7 +1,7 @@
# Template file for 'fuse-emulator'
pkgname=fuse-emulator
version=1.5.7
revision=1
revision=2
wrksrc="fuse-${version}"
build_style=gnu-configure
configure_args="--verbose --with-gtk --enable-desktop-integration"