From 28916b65cf8d23ae92edcbcd3f0b764ed434f051 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Wed, 7 Feb 2018 14:19:30 +0100 Subject: [PATCH] Load_IFF() Fix ILBM 24bit swapped R & B components --- src/fileformats.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fileformats.c b/src/fileformats.c index f1998fdc..82dc59ba 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -427,8 +427,11 @@ static void Draw_IFF_line(T_IO_Context *context, const byte * buffer, short y_po { for (x_pos=0; x_posWidth; x_pos++) { + // Default standard deep ILBM bit ordering: + // saved first -----------------------------------------------> saved last + // R0 R1 R2 R3 R4 R5 R6 R7 G0 G1 G2 G3 G4 G5 G6 G7 B0 B1 B2 B3 B4 B5 B6 B7 dword rgb = Get_IFF_color(buffer, x_pos,real_line_size, bitplanes); - Set_pixel_24b(context, x_pos,y_pos, rgb >> 16, rgb >> 8, rgb); + Set_pixel_24b(context, x_pos,y_pos, rgb, rgb >> 8, rgb >> 16); // R is 8 LSB, etc. } } else for (x_pos=0; x_posWidth; x_pos++)