summaryrefslogtreecommitdiff
path: root/atari/plot/plotter_vdi.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-12-04 12:53:03 +0000
committerOle Loots <ole@monochrom.net>2011-12-04 12:53:03 +0000
commit7d4a0be284d72a3cf15c2a7dec38590f7fe474e4 (patch)
tree986b0a6dbed6fe7cdd40e3563a14ee77bdcf7352 /atari/plot/plotter_vdi.c
parent905b3c26410e0232e063cd0e8a7a17ad830e3d80 (diff)
downloadnetsurf-7d4a0be284d72a3cf15c2a7dec38590f7fe474e4.tar.gz
netsurf-7d4a0be284d72a3cf15c2a7dec38590f7fe474e4.tar.bz2
Fixed header, made different font plotters optional.
svn path=/trunk/netsurf/; revision=13230
Diffstat (limited to 'atari/plot/plotter_vdi.c')
-rwxr-xr-xatari/plot/plotter_vdi.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/atari/plot/plotter_vdi.c b/atari/plot/plotter_vdi.c
index 652fa7434..bb599084f 100755
--- a/atari/plot/plotter_vdi.c
+++ b/atari/plot/plotter_vdi.c
@@ -27,7 +27,6 @@
#include "atari/plot/eddi.h"
#include "atari/plot/plotter.h"
#include "atari/plot/plotter_vdi.h"
-#include "atari/plot/font_vdi.h"
/* assign vdi line style to dst ( netsurf type ) */
#define NSLT2VDI(dst, src) \
@@ -67,18 +66,20 @@ static int bitmap( GEM_PLOTTER self, struct bitmap * bmp, int x, int y,
unsigned long bg, unsigned long flags );
static int plot_mfdb( GEM_PLOTTER self, GRECT * where, MFDB * mfdb, uint32_t flags);
static int text(GEM_PLOTTER self, int x, int y, const char *text,size_t length, const plot_font_style_t *fstyle);
-
+
+#ifdef WITH_8BPP_SUPPORT
static unsigned short sys_pal[256][3]; /*RGB*/
static unsigned short pal[256][3]; /*RGB*/
-
-extern unsigned char rgb_web_pal[126][3];
-extern unsigned short vdi_web_pal[126][3];
+extern unsigned char rgb_web_pal[126][3];
+extern unsigned short vdi_web_pal[126][3];
+int32 * hermes_pal_p;
+#endif
extern struct s_vdi_sysinfo vdi_sysinfo;
static HermesHandle hermes_pal_h; /* hermes palette handle */
static HermesHandle hermes_cnv_h; /* hermes converter instance handle */
static HermesHandle hermes_res_h;
-int32 * hermes_pal_p;
+
static inline void vsl_rgbcolor( short vdih, uint32_t cin )
{
@@ -168,7 +169,8 @@ int ctor_plotter_vdi(GEM_PLOTTER self )
clip.x1 = FIRSTFB(self).w;
clip.y1 = FIRSTFB(self).h;
self->clip( self, &clip );
- /* store system palette & setup the new (web) palette: */
+ /* store system palette & setup the new (web) palette: */
+#ifdef WITH_8BPP_SUPPORT
i = 0;
if( app.nplanes <= 8 ){
for( i=0; i<=255; i++ ) {
@@ -191,7 +193,8 @@ int ctor_plotter_vdi(GEM_PLOTTER self )
}
} else {
/* no need to change the palette - its application specific */
- }
+ }
+#endif
unsigned char * col;
assert( Hermes_Init() );
@@ -252,17 +255,21 @@ static int dtor( GEM_PLOTTER self )
if( self->fbuf[i].mem != NULL )
free( self->fbuf[i].mem );
}
+
+ /* close Hermes stuff: */
+ Hermes_ConverterReturn( hermes_cnv_h );
+
+#ifdef WITH_8BPP_SUPPORT
if( app.nplanes <= 8 ){
/* restore system palette */
for( i=0; i<=255; i++ ) {
vs_color( self->vdi_handle, i, &sys_pal[i][0] );
}
- }
+ }
+ Hermes_PaletteReturn( hermes_pal_h );
+#endif
- /* close Hermes stuff: */
- Hermes_ConverterReturn( hermes_cnv_h );
- /* Hermes_PaletteReturn( hermes_pal_h ); */
Hermes_Done();
if( self->priv_data != NULL ){
@@ -279,9 +286,9 @@ static int resize( GEM_PLOTTER self, int w, int h )
{
if( w == CURFB(self).w && h == CURFB(self).h )
return( 1 );
- int newsize = calc_chunked_buffer_size( w, h, w, self->bpp_virt );
- LOG(("%s: %s, oldsize: %d\n", (char*)__FILE__, __FUNCTION__, CURFB(self).size ));
/* todo: needed when using offscreen buffers...
+ int newsize = calc_chunked_buffer_size( w, h, w, self->bpp_virt );
+ LOG(("%s: %s, oldsize: %d\n", (char*)__FILE__, __FUNCTION__, CURFB(self).size ));
if( newsize > self->screen_buffer_size ) {
self->screen_buffer_size = newsize;
self->screen_buffer =realloc( self->screen_buffer , self->screen_buffer_size );
@@ -1064,7 +1071,6 @@ static int plot_mfdb (GEM_PLOTTER self, GRECT * loc, MFDB * insrc, uint32_t flag
MFDB screen, tran;
MFDB * src;
short pxy[8];
- short pxyclip[4];
short c[2] = {OFFSET_CUSTOM_COLOR, WHITE};
GRECT off;