diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-02-02 00:32:34 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-02-02 00:32:34 +0000 |
commit | 21f142a7fa12cc89420ac9439c83f06af249dc39 (patch) | |
tree | 1965faabb33362a23303c5446914fd18076f293a | |
parent | 0aa30619293309d4bcab3cc0419005fd2e772618 (diff) | |
download | netsurf-21f142a7fa12cc89420ac9439c83f06af249dc39.tar.gz netsurf-21f142a7fa12cc89420ac9439c83f06af249dc39.tar.bz2 |
Friend the screen bitmap for <= 8-bit modes, but only on OS3 as this causes OS4 to freeze
-rw-r--r-- | amiga/bitmap.c | 18 | ||||
-rwxr-xr-x | amiga/plotters.c | 7 | ||||
-rw-r--r-- | amiga/rtg.c | 2 |
3 files changed, 24 insertions, 3 deletions
diff --git a/amiga/bitmap.c b/amiga/bitmap.c index 95b5f71d6..aabb6a3be 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -292,6 +292,16 @@ void ami_bitmap_argb_to_rgba(struct bitmap *bm) data[i] = (data[i] << 8) | (data[i] >> 24); } } + +void ami_bitmap_rgba_to_argb(struct bitmap *bm) +{ + if(bm == NULL) return; + + ULONG *data = (ULONG *)bitmap_get_buffer(bm); + for(int i = 0; i < ((bitmap_get_rowstride(bm) / sizeof(ULONG)) * bitmap_get_height(bm)); i++) { + data[i] = (data[i] >> 8) | (data[i] << 24); + } +} #endif #ifdef BITMAP_DUMP @@ -345,6 +355,14 @@ Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap) IDoMethod(dto, PDTM_WRITEPIXELARRAY, bitmap_get_buffer(bitmap), PBPAFMT_RGBA, bitmap_get_rowstride(bitmap), 0, 0, bitmap_get_width(bitmap), bitmap_get_height(bitmap)); +#if 0 + ami_bitmap_rgba_to_argb(bitmap); + IDoMethod(dto, PDTM_WRITEPIXELARRAY, bitmap_get_buffer(bitmap), + PBPAFMT_ARGB, bitmap_get_rowstride(bitmap), 0, 0, + bitmap_get_width(bitmap), bitmap_get_height(bitmap)); + ami_bitmap_argb_to_rgb(bitmap); +#endif + } return dto; diff --git a/amiga/plotters.c b/amiga/plotters.c index 3c1a09099..88021ee29 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -113,6 +113,8 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) struct BitMap *friend = NULL; depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH); + LOG(("Screen depth = %d", depth)); + #ifdef __amigaos4__ if(depth < 16) { palette_mapped = true; @@ -131,7 +133,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) gg->areabuf = AllocVecTagList(AREA_SIZE, NULL); gg->tmprasbuf = AllocVecTagList(width * height, NULL); - if(palette_mapped == true) { + if(palette_mapped == true) { +#ifndef __amigaos4__ + friend = scrn->RastPort.BitMap; +#endif gg->bm = AllocBitMap(width, height, depth, 0, friend); } else { if(depth == 32) friend = scrn->RastPort.BitMap; diff --git a/amiga/rtg.c b/amiga/rtg.c index fbefd55a1..267bd5d05 100644 --- a/amiga/rtg.c +++ b/amiga/rtg.c @@ -22,8 +22,6 @@ #include "amiga/rtg.h" -/**\todo p96WritePixelArray */ - struct BitMap *ami_rtg_allocbitmap(ULONG width, ULONG height, ULONG depth, ULONG flags, struct BitMap *friend, RGBFTYPE format) { |