From dad8065f0a0f9a572983444b3f51d4cddca69ecc Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 4 Aug 2012 18:05:26 +0100 Subject: [PATCH] move text colour settings into plotters.c, and use palette-map capable function --- amiga/font.c | 2 -- amiga/plotters.c | 23 ++++++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/amiga/font.c b/amiga/font.c index 8be407612..19d6dd1f0 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -712,8 +712,6 @@ ULONG ami_unicode_text(struct RastPort *rp,const char *string,ULONG length,const outf16 = utf16; if(!(ofont = ami_open_outline_font(fstyle, 0))) return 0; - if(rp) SetRPAttrs(rp,RPTAG_APenColor,p96EncodeColor(RGBFB_A8B8G8R8,fstyle->foreground),TAG_DONE); - while(*utf16 != 0) { if (*utf16 < 0xD800 || 0xDFFF < *utf16) diff --git a/amiga/plotters.c b/amiga/plotters.c index 6881de939..7a8e6ccff 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -19,24 +19,29 @@ #include "amiga/plotters.h" #include "amiga/bitmap.h" #include "amiga/font.h" +#include "amiga/gui.h" +#include "amiga/utf8.h" + +#include "desktop/options.h" +#include "utils/utils.h" +#include "utils/log.h" + #include +#include +#include + #include #include #include #include -#include "amiga/utf8.h" -#include "desktop/options.h" + #ifdef __amigaos4__ #include #include #endif -#include "utils/log.h" + #include #include -#include -#include -#include "amiga/gui.h" -#include "utils/utils.h" static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct BackFillMessage *bfmsg); @@ -231,6 +236,8 @@ void ami_plot_setapen(ULONG colour) (colour & 0x00ff0000) << 8, NULL); + if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colour)); + SetAPen(glob->rp, pen); } } @@ -499,7 +506,9 @@ bool ami_text(int x, int y, const char *text, size_t length, LOG(("[ami_plotter] Entered ami_text()")); #endif + ami_plot_setapen(fstyle->foreground); ami_unicode_text(glob->rp,text,length,fstyle,x,y); + return true; }