From 206639055572c11bcad0d71b22d325779dc83e95 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Fri, 30 Jan 2015 18:32:44 +0000 Subject: Fix bullet.library usage --- amiga/font.c | 24 ++++++++++++------------ amiga/font_scan.h | 9 +++++++++ amiga/os3support.c | 10 +++++----- amiga/os3support.h | 2 +- 4 files changed, 27 insertions(+), 18 deletions(-) mode change 100755 => 100644 amiga/font.c diff --git a/amiga/font.c b/amiga/font.c old mode 100755 new mode 100644 index 4fbd60ace..435e75992 --- a/amiga/font.c +++ b/amiga/font.c @@ -554,7 +554,7 @@ struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle, struct BulletBase *BulletBase = ofont->BulletBase; #endif - if(ESetInfo(&ofont->olf_EEngine, + if(ESetInfo(AMI_OFONT_ENGINE, OT_DeviceDPI, ami_devicedpi, OT_PointHeight, ysize, OT_EmboldenX, emboldenx, @@ -602,12 +602,12 @@ int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp, #endif } - if(ESetInfo(&ofont->olf_EEngine, + if(ESetInfo(AMI_OFONT_ENGINE, OT_GlyphCode, *char1, OT_GlyphCode2, *char2, TAG_END) == OTERR_Success) { - if(EObtainInfo(&ofont->olf_EEngine, + if(EObtainInfo(AMI_OFONT_ENGINE, glyphmaptag, &glyph, TAG_END) == 0) { @@ -639,17 +639,17 @@ int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPort *rp, kern = 0; - if(*char2) EObtainInfo(&ofont->olf_EEngine, + if(*char2) EObtainInfo(AMI_OFONT_ENGINE, OT_TextKernPair, &kern, TAG_END); char_advance = (ULONG)(((glyph->glm_Width - kern) * emwidth) / 65536); - EReleaseInfo(&ofont->olf_EEngine, + EReleaseInfo(AMI_OFONT_ENGINE, glyphmaptag, glyph, TAG_END); - if(*char2) EReleaseInfo(&ofont->olf_EEngine, + if(*char2) EReleaseInfo(AMI_OFONT_ENGINE, OT_TextKernPair, kern, TAG_END); } @@ -683,12 +683,12 @@ int32 ami_font_width_glyph(struct OutlineFont *ofont, if (*char2 < 0x0020) skip_c2 = true; - if(ESetInfo(&ofont->olf_EEngine, + if(ESetInfo(AMI_OFONT_ENGINE, OT_GlyphCode, *char1, OT_GlyphCode2, *char1, TAG_END) == OTERR_Success) { - if(EObtainInfo(&ofont->olf_EEngine, + if(EObtainInfo(AMI_OFONT_ENGINE, OT_WidthList, &gwlist, TAG_END) == 0) { @@ -698,23 +698,23 @@ int32 ami_font_width_glyph(struct OutlineFont *ofont, kern = 0; if(!skip_c2) { - if(ESetInfo(&ofont->olf_EEngine, + if(ESetInfo(AMI_OFONT_ENGINE, OT_GlyphCode, *char1, OT_GlyphCode2, *char2, TAG_END) == OTERR_Success) { - EObtainInfo(&ofont->olf_EEngine, + EObtainInfo(AMI_OFONT_ENGINE, OT_TextKernPair, &kern, TAG_END); } } char_advance = (ULONG)(((char1w - kern) * emwidth) / 65536); - if(!skip_c2) EReleaseInfo(&ofont->olf_EEngine, + if(!skip_c2) EReleaseInfo(AMI_OFONT_ENGINE, OT_TextKernPair, kern, TAG_END); - EReleaseInfo(&ofont->olf_EEngine, + EReleaseInfo(AMI_OFONT_ENGINE, OT_WidthList, gwlist, TAG_END); } diff --git a/amiga/font_scan.h b/amiga/font_scan.h index 69361557f..7d61e2daa 100755 --- a/amiga/font_scan.h +++ b/amiga/font_scan.h @@ -21,6 +21,14 @@ #include "amiga/os3support.h" #include +/* Compatibliity define used by font.c and font_scan.c + * It's here because this file is included by both. */ +#ifdef __amigaos4__ +#define AMI_OFONT_ENGINE &ofont->olf_EEngine +#else +#define AMI_OFONT_ENGINE ofont->GEngine +#endif + void ami_font_scan_init(const char *filename, bool force_scan, bool save, lwc_string **glypharray); void ami_font_scan_fini(lwc_string **glypharray); @@ -28,3 +36,4 @@ void ami_font_scan_save(const char *filename, lwc_string **glypharray); const char *ami_font_scan_lookup(const uint16 *code, lwc_string **glypharray); #endif + diff --git a/amiga/os3support.c b/amiga/os3support.c index a49534292..b2a7bf887 100644 --- a/amiga/os3support.c +++ b/amiga/os3support.c @@ -52,7 +52,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl STRPTR fname, otagpath; struct BulletBase *BulletBase; struct OutlineFont *of = NULL; - struct GlyphEngine *eengine; + struct GlyphEngine *gengine; otagpath = (STRPTR)ASPrintf("FONTS:%s.otag", fileName); fh = Open(otagpath, MODE_OLDFILE); @@ -116,9 +116,9 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl FreeVec(fname); - eengine = OpenEngine(); + gengine = OpenEngine(); - SetInfo(eengine, + SetInfo(gengine, OT_OTagPath, otagpath, OT_OTagList, buffer, TAG_DONE); @@ -127,7 +127,7 @@ struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG fl if(of == NULL) return NULL; of->BulletBase = BulletBase; - of->olf_EEngine = eengine; + of->GEngine = gengine; of->OTagPath = otagpath; of->olf_OTagList = buffer; @@ -138,7 +138,7 @@ void CloseOutlineFont(struct OutlineFont *of, struct List *list) { struct BulletBase *BulletBase = of->BulletBase; - CloseEngine(of->olf_EEngine); + CloseEngine(of->GEngine); CloseLibrary(BulletBase); FreeVec(of->OTagPath); diff --git a/amiga/os3support.h b/amiga/os3support.h index 44fca5cef..9778d991a 100644 --- a/amiga/os3support.h +++ b/amiga/os3support.h @@ -184,7 +184,7 @@ struct TimeRequest { /* OutlineFont */ struct OutlineFont { struct BulletBase *BulletBase; - struct GlyphEngine *olf_EEngine; + struct GlyphEngine *GEngine; STRPTR OTagPath; struct TagItem *olf_OTagList; }; -- cgit v1.2.3