From 7d4a0be284d72a3cf15c2a7dec38590f7fe474e4 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Sun, 4 Dec 2011 12:53:03 +0000 Subject: Fixed header, made different font plotters optional. svn path=/trunk/netsurf/; revision=13230 --- atari/plot/plotter_vdi.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'atari/plot/plotter_vdi.c') 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; -- cgit v1.2.3