From 4952d1c760eec45add83cee0540f10b4799e91d7 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 10 Nov 2019 00:25:13 +0100 Subject: GUI: Fix colors in About. Now it works on Amiga --- gui/about.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gui') diff --git a/gui/about.cpp b/gui/about.cpp index d6571c7671..eaafadba08 100644 --- a/gui/about.cpp +++ b/gui/about.cpp @@ -1380,7 +1380,10 @@ void EE::genSprites() { pixels >>= 1; - *((uint16 *)_sp[kSpB1 + s].getBasePtr(posx, posy)) = (uint16)palette[color + 8]; + if (_back.format.bytesPerPixel == 2) + *((uint16 *)_sp[kSpB1 + s].getBasePtr(posx, posy)) = (uint16)palette[color + 8]; + else if (_back.format.bytesPerPixel == 4) + *((uint32 *)_sp[kSpB1 + s].getBasePtr(posx, posy)) = palette[color + 8]; } } } @@ -1403,7 +1406,10 @@ void EE::genSprites() { if (x == 15) pixels = *ptr; - *((uint16 *)_sp[kSpL1 + s].getBasePtr(posx, y)) = (uint16)palette[color + 4 * (s / 3)]; + if (_back.format.bytesPerPixel == 2) + *((uint16 *)_sp[kSpL1 + s].getBasePtr(posx, y)) = (uint16)palette[color + 4 * (s / 3)]; + else if (_back.format.bytesPerPixel == 4) + *((uint32 *)_sp[kSpL1 + s].getBasePtr(posx, y)) = palette[color + 4 * (s / 3)]; } } } -- cgit v1.2.3