From 81f6cd2074f76f3e976537453be18b6f34f1ab7f Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 29 Mar 2015 23:37:23 +0100 Subject: Correct the screen depth check for setting friend bitmaps. Add some comments because using friend bitmaps in NetSurf causes problems under OS4. --- amiga/plotters.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'amiga') diff --git a/amiga/plotters.c b/amiga/plotters.c index 256f47747..899ec4930 100644 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -121,6 +121,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) gg->tmprasbuf = AllocVecTagList(width * height, NULL); #ifndef __amigaos4__ + /* If you're wondering why this is #ifdeffed, see the note about OS4 friend bitmaps below */ friend = scrn->RastPort.BitMap; #endif @@ -128,7 +129,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) gg->bm = AllocBitMap(width, height, depth, 0, friend); } else { #ifdef __amigaos4__ - if(depth == 32) friend = scrn->RastPort.BitMap; + /* Screen depth is reported as 24 even when it's actually 32-bit. + * We get freezes and other problems on OS4 if we befriend at any + * other depths, hence this check. */ + if(depth >= 24) friend = scrn->RastPort.BitMap; #endif gg->bm = ami_rtg_allocbitmap(width, height, 32, 0, friend, RGBFB_A8R8G8B8); } -- cgit v1.2.3