30 lines
1013 B
Diff
30 lines
1013 B
Diff
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
|
|
--- a/ui/gtk/gtkdisplay.c
|
|
+++ b/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
|
|
|