summaryrefslogtreecommitdiff
path: root/atari/bitmap.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2012-07-13 22:19:04 +0200
committerOle Loots <ole@monochrom.net>2012-07-13 22:19:04 +0200
commit37b8c5d83da69a13ce155c040a90cc6a850dc456 (patch)
tree880da99da6f1adf828cca663dcf94d436504a3ac /atari/bitmap.c
parentbc9d29f00ae84ae8fc9963f789358e4953100ea6 (diff)
downloadnetsurf-37b8c5d83da69a13ce155c040a90cc6a850dc456.tar.gz
netsurf-37b8c5d83da69a13ce155c040a90cc6a850dc456.tar.bz2
Plotter refactor: removed one plotter abraction layer.
Diffstat (limited to 'atari/bitmap.c')
-rwxr-xr-xatari/bitmap.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/atari/bitmap.c b/atari/bitmap.c
index 97fa37484..9cfebcaf6 100755
--- a/atari/bitmap.c
+++ b/atari/bitmap.c
@@ -23,11 +23,43 @@
#include "assert.h"
+#include "desktop/options.h"
#include "image/bitmap.h"
#include "atari/bitmap.h"
-#include "atari/plot.h"
+#include "atari/plot/plot.h"
#include "utils/log.h"
+
+/*
+ bpp: bits per pixel,
+
+*/
+int init_mfdb(int bpp, int w, int h, uint32_t flags, MFDB * out )
+{
+ int dststride;
+ dststride = MFDB_STRIDE( w );
+ int size = MFDB_SIZE( bpp, dststride, h );
+ if( bpp > 0 ) {
+ if( (flags & MFDB_FLAG_NOALLOC) == 0 ) {
+ out->fd_addr = malloc( size );
+ if( out->fd_addr == NULL ){
+ return( 0 );
+ }
+ if( (flags & MFDB_FLAG_ZEROMEM) ){
+ memset( out->fd_addr, 0, size );
+ }
+ }
+ out->fd_stand = (flags & MFDB_FLAG_STAND) ? 1 : 0;
+ out->fd_nplanes = (short)bpp;
+ out->fd_r1 = out->fd_r2 = out->fd_r3 = 0;
+ } else {
+ memset( out, 0, sizeof(MFDB) );
+ }
+ out->fd_w = dststride;
+ out->fd_h = h;
+ out->fd_wdwidth = dststride >> 4;
+ return( size );
+}
/**
@@ -327,7 +359,7 @@ bool bitmap_test_opaque(void *bitmap)
LOG(("NULL bitmap!"));
return false;
}
-
+
if( nsoption_int(atari_transparency) == 0 ){
return( true );
}