From 174b52a0fd055d47aa95cdfbe818203afcf0b75b Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Sat, 25 Feb 2012 15:23:00 +0000 Subject: [PATCH] more #ifdef WITH_8BPP_SUPPORT svn path=/trunk/netsurf/; revision=13467 --- atari/plot/font_freetype.c | 6 +++++- atari/plot/font_internal.c | 8 ++++++-- atari/plot/plotter_vdi.c | 9 ++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/atari/plot/font_freetype.c b/atari/plot/font_freetype.c index 22c404e7c..9eba3b48b 100755 --- a/atari/plot/font_freetype.c +++ b/atari/plot/font_freetype.c @@ -477,15 +477,19 @@ static void draw_glyph1(FONT_PLOTTER self, GRECT * loc, uint8_t * pixdata, int p } } } - if( app.nplanes > 8 ){ +#ifdef WITH_8BPP_SUPPORT + if( app.nplanes > 8 ){ +#endif unsigned short out[4]; rgb_to_vdi1000( (unsigned char*)&colour, (unsigned short*)&out ); vs_color( self->plotter->vdi_handle, OFFSET_CUSTOM_COLOR, (unsigned short*)&out[0] ); self->plotter->plot_mfdb( self->plotter, loc, &tmp, OFFSET_CUSTOM_COLOR, PLOT_FLAG_TRANS ); +#ifdef WITH_8BPP_SUPPORT } else { unsigned char c = RGB_TO_VDI(colour); self->plotter->plot_mfdb( self->plotter, loc, &tmp, c, PLOT_FLAG_TRANS ); } +#endif } diff --git a/atari/plot/font_internal.c b/atari/plot/font_internal.c index 5d70c2645..1f9f1301c 100644 --- a/atari/plot/font_internal.c +++ b/atari/plot/font_internal.c @@ -240,15 +240,19 @@ static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t leng d += rowsize; } } - if( app.nplanes > 8 ){ +#ifdef WITH_8BPP_SUPPORT + if( app.nplanes > 8 ){ +#endif unsigned short out[4]; rgb_to_vdi1000( (unsigned char*)&fstyle->foreground, (unsigned short*)&out ); vs_color( self->plotter->vdi_handle, OFFSET_CUSTOM_COLOR, (unsigned short*)&out[0] ); self->plotter->plot_mfdb( self->plotter, &loc, &tmp, OFFSET_CUSTOM_COLOR, PLOT_FLAG_TRANS ); +#ifdef WITH_8BPP_SUPPORT } else { unsigned char c = RGB_TO_VDI(fstyle->foreground); self->plotter->plot_mfdb( self->plotter, &loc, &tmp, c, PLOT_FLAG_TRANS ); - } + } +#endif } free(buffer); diff --git a/atari/plot/plotter_vdi.c b/atari/plot/plotter_vdi.c index fa7bc3550..33eb8857f 100755 --- a/atari/plot/plotter_vdi.c +++ b/atari/plot/plotter_vdi.c @@ -145,7 +145,11 @@ int ctor_plotter_vdi(GEM_PLOTTER self ) self->path = path; self->bitmap = bitmap; self->bitmap_resize = bitmap_resize; +#ifdef WITH_8BPP_SUPPORT self->bitmap_convert =(app.nplanes > 8) ? bitmap_convert : bitmap_convert_8; +#else + self->bitmap_convert = bitmap_convert; +#endif //self->bitmap_convert =bitmap_convert; self->plot_mfdb = plot_mfdb; self->text = text; @@ -261,10 +265,11 @@ static int dtor( GEM_PLOTTER self ) free( self->fbuf[i].mem ); } +#ifdef WITH_8BPP_SUPPORT for( i=OFFSET_WEB_PAL; ivdi_handle, i, &sys_pal[i][0] ); } - +#endif /* close Hermes stuff: */ Hermes_ConverterReturn( hermes_cnv_h ); @@ -1031,6 +1036,7 @@ inline unsigned char get_stdpx(MFDB * dst, int wdplanesz, int x, int y ) return( ret ); } +#ifdef WITH_8BPP_SUPPORT static int bitmap_convert_8( GEM_PLOTTER self, struct bitmap * img, int x, @@ -1211,6 +1217,7 @@ static int bitmap_convert_8( GEM_PLOTTER self, return(0); } +#endif /* convert bitmap to the virutal (chunked) framebuffer format */ static int bitmap_convert( GEM_PLOTTER self,