summaryrefslogtreecommitdiff
path: root/frontends/amiga
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-03-24 18:09:28 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2022-03-24 18:09:28 +0000
commit002c3c1a7c2ae7229afac3f1966892fd42895aec (patch)
treebc9c769b176981296b5e92233fd623b3164a4513 /frontends/amiga
parentc2d72d1e9361b3017872e5aff16cfe9a894f3048 (diff)
downloadnetsurf-002c3c1a7c2ae7229afac3f1966892fd42895aec.tar.gz
netsurf-002c3c1a7c2ae7229afac3f1966892fd42895aec.tar.bz2
Bitmap API: Clean up creation flags.
Diffstat (limited to 'frontends/amiga')
-rw-r--r--frontends/amiga/bitmap.c5
-rwxr-xr-xfrontends/amiga/bitmap.h6
-rw-r--r--frontends/amiga/dt_anim.c2
-rw-r--r--frontends/amiga/dt_picture.c2
-rw-r--r--frontends/amiga/icon.c2
5 files changed, 9 insertions, 8 deletions
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index ec1a90a24..c39f3842c 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -108,7 +108,7 @@ static APTR pool_bitmap = NULL;
static bool guigfx_warned = false;
/* exported function documented in amiga/bitmap.h */
-void *amiga_bitmap_create(int width, int height, unsigned int state)
+void *amiga_bitmap_create(int width, int height, enum gui_bitmap_flags flags)
{
struct bitmap *bitmap;
@@ -139,8 +139,7 @@ void *amiga_bitmap_create(int width, int height, unsigned int state)
bitmap->width = width;
bitmap->height = height;
- if(state & BITMAP_OPAQUE) bitmap->opaque = true;
- else bitmap->opaque = false;
+ bitmap->opaque = (flags & BITMAP_OPAQUE) == BITMAP_OPAQUE;
bitmap->nativebm = NULL;
bitmap->nativebmwidth = 0;
diff --git a/frontends/amiga/bitmap.h b/frontends/amiga/bitmap.h
index aaec26ac2..ae072c0cd 100755
--- a/frontends/amiga/bitmap.h
+++ b/frontends/amiga/bitmap.h
@@ -25,6 +25,8 @@
#include <intuition/classusr.h>
#include <libraries/Picasso96.h>
+#include "netsurf/bitmap.h"
+
#define AMI_BITMAP_FORMAT RGBFB_R8G8B8A8
#define AMI_BITMAP_SCALE_ICON 0xFF
@@ -101,10 +103,10 @@ void ami_bitmap_fini(void);
*
* \param width width of image in pixels
* \param height width of image in pixels
- * \param state a flag word indicating the initial state
+ * \param flags flags for bitmap creation
* \return an opaque struct bitmap, or NULL on memory exhaustion
*/
-void *amiga_bitmap_create(int width, int height, unsigned int state);
+void *amiga_bitmap_create(int width, int height, enum gui_bitmap_flags flags);
/**
* Return a pointer to the pixel data in a bitmap.
diff --git a/frontends/amiga/dt_anim.c b/frontends/amiga/dt_anim.c
index a9fe809cf..1162d7214 100644
--- a/frontends/amiga/dt_anim.c
+++ b/frontends/amiga/dt_anim.c
@@ -173,7 +173,7 @@ bool amiga_dt_anim_convert(struct content *c)
size_t size;
UBYTE *bm_buffer;
struct BitMapHeader *bmh;
- unsigned int bm_flags = BITMAP_NEW | BITMAP_OPAQUE;
+ unsigned int bm_flags = BITMAP_OPAQUE;
struct adtFrame adt_frame;
APTR clut;
diff --git a/frontends/amiga/dt_picture.c b/frontends/amiga/dt_picture.c
index ed1272bc1..f84e0e016 100644
--- a/frontends/amiga/dt_picture.c
+++ b/frontends/amiga/dt_picture.c
@@ -187,7 +187,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
if((dto = amiga_dt_picture_newdtobject(adt)))
{
- bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NEW);
+ bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NONE);
if (!bitmap) {
msg_data.errordata.errorcode = NSERROR_NOMEM;
msg_data.errordata.errormsg = messages_get("NoMemory");
diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c
index 001874c86..2b7f61281 100644
--- a/frontends/amiga/icon.c
+++ b/frontends/amiga/icon.c
@@ -201,7 +201,7 @@ bool amiga_icon_convert(struct content *c)
return false;
}
- icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NEW);
+ icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NONE);
if (!icon_c->bitmap) {
msg_data.errordata.errorcode = NSERROR_NOMEM;
msg_data.errordata.errormsg = messages_get("NoMemory");