summaryrefslogtreecommitdiff
path: root/frontends/amiga/plotters.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-02-13 17:46:20 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2017-02-13 17:46:20 +0000
commit075e9c0258bd75307a90b3e6bd576742bf212b08 (patch)
treed915cc2b8788b585e8123e9715ff623eed0f1717 /frontends/amiga/plotters.c
parentedaa9c29f22a550ddc7c8e1f02ff6d9dedf9a5b1 (diff)
downloadnetsurf-075e9c0258bd75307a90b3e6bd576742bf212b08.tar.gz
netsurf-075e9c0258bd75307a90b3e6bd576742bf212b08.tar.bz2
Alloc gui_global structure when initialising
Diffstat (limited to 'frontends/amiga/plotters.c')
-rw-r--r--frontends/amiga/plotters.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index 0eea2ed48..1911b7d17 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -102,15 +102,14 @@ static bool palette_mapped = true; /* palette-mapped state for the screen */
/* Define the below to get additional debug */
#undef AMI_PLOTTER_DEBUG
-void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool force32bit)
+struct gui_globals *ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit)
{
- /* init shared bitmaps *
- * Height is set to screen width to give enough space for thumbnails *
- * Also applies to the further gfx/layers functions and memory below */
-
- int depth = 32;
+ /* init shared bitmaps */
+ int depth = 32;
struct BitMap *friend = NULL;
+ struct gui_globals *gg = malloc(sizeof(struct gui_globals));
+
if(force32bit == false) depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH);
LOG("Screen depth = %d", depth);
@@ -214,9 +213,11 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool for
init_layers_count++;
LOG("Layer initialised (total: %d)", init_layers_count);
+
+ return gg;
}
-void ami_free_layers(struct gui_globals *gg)
+void ami_plot_ra_free(struct gui_globals *gg)
{
init_layers_count--;
@@ -240,6 +241,13 @@ void ami_free_layers(struct gui_globals *gg)
} else {
if(gg->bm) FreeBitMap(gg->bm);
}
+
+ free(gg);
+}
+
+struct BitMap *ami_plot_ra_get_bitmap(struct gui_globals *gg)
+{
+ return gg->bm;
}
void ami_clearclipreg(struct gui_globals *gg)