summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2015-03-29 23:37:23 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2015-03-29 23:37:23 +0100
commit81f6cd2074f76f3e976537453be18b6f34f1ab7f (patch)
tree997caf164dc8cff6c9de6d52d07d94b78e2fbd38 /amiga
parentc0469ca905ef699fef36b02c058a21fed821d564 (diff)
downloadnetsurf-81f6cd2074f76f3e976537453be18b6f34f1ab7f.tar.gz
netsurf-81f6cd2074f76f3e976537453be18b6f34f1ab7f.tar.bz2
Correct the screen depth check for setting friend bitmaps.
Add some comments because using friend bitmaps in NetSurf causes problems under OS4.
Diffstat (limited to 'amiga')
-rw-r--r--amiga/plotters.c6
1 files changed, 5 insertions, 1 deletions
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);
}