From 1bee34e1648ec3f68421fe06753daf08aa085f00 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 12 Jan 2015 22:40:46 +0000 Subject: Stub out font.c and font_scan.c for OS3 for now A more involved fix required for later. --- amiga/font.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ amiga/font_scan.c | 23 ++++++++++++++++++++ amiga/os3support.h | 2 +- 3 files changed, 87 insertions(+), 1 deletion(-) (limited to 'amiga') diff --git a/amiga/font.c b/amiga/font.c index fdbd8b6fe..a60f1bdfc 100755 --- a/amiga/font.c +++ b/amiga/font.c @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#include "amiga/os3support.h" + #include #include @@ -173,6 +175,7 @@ const struct font_functions nsfont = { nsfont_split }; +#ifdef __amigaos4__ bool nsfont_width(const plot_font_style_t *fstyle, const char *string, size_t length, int *width) @@ -868,6 +871,66 @@ static void ami_font_cleanup(struct MinList *ami_font_list) /* reschedule to run in five minutes */ ami_schedule(300000, (void *)ami_font_cleanup, ami_font_list); } +#else +#warning FIXME: font.c needs fixing properly for OS3, currently bodged to get it to build +bool nsfont_width(const plot_font_style_t *fstyle, + const char *string, size_t length, + int *width) +{ + *width == length; + return true; +} + +bool nsfont_position_in_string(const plot_font_style_t *fstyle, + const char *string, size_t length, + int x, size_t *char_offset, int *actual_x) +{ + *actual_x = x; + *char_offset = x / 10; + return true; +} + +bool nsfont_split(const plot_font_style_t *fstyle, + const char *string, size_t length, + int x, size_t *char_offset, int *actual_x) +{ + *actual_x = x; + *char_offset = x / 10; + return true; +} + +ULONG ami_unicode_text(struct RastPort *rp, const char *string, + ULONG length, const plot_font_style_t *fstyle, ULONG x, ULONG y, bool aa) +{ + /* So we get some sort of text on screen */ + Move(rp, x, y); + Text(rp, string, length); +} + +void ami_init_fonts(void) +{ +} + +void ami_close_fonts(void) +{ +} + +void ami_font_close(struct ami_font_node *node) +{ +} + +void ami_font_initscanner(bool force, bool save) +{ +} + +void ami_font_finiscanner(void) +{ +} + +void ami_font_savescanner(void) +{ +} +#endif void ami_font_setdevicedpi(int id) { diff --git a/amiga/font_scan.c b/amiga/font_scan.c index f39fcac2f..8304c601e 100644 --- a/amiga/font_scan.c +++ b/amiga/font_scan.c @@ -20,6 +20,8 @@ * Font glyph scanner for Unicode substitutions. */ +#include "amiga/os3support.h" + #include #include #include @@ -66,6 +68,8 @@ struct ami_font_scan_window { char *glyphtext; }; +#ifdef __amigaos4__ + /** * Lookup a font that contains a UTF-16 codepoint * @@ -502,5 +506,24 @@ void ami_font_scan_init(const char *filename, bool force_scan, bool save, LOG(("Initialised with %ld glyphs", found)); } +#else +#warning FIXME: font_scan.c needs fixing for OS3 +void ami_font_scan_init(const char *filename, bool force_scan, bool save, + lwc_string **glypharray) +{ +} + +void ami_font_scan_fini(lwc_string **glypharray) +{ +} + +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.h b/amiga/os3support.h index 9a25197e9..4de39d82f 100644 --- a/amiga/os3support.h +++ b/amiga/os3support.h @@ -51,7 +51,7 @@ /* Easy compat macros */ /* application */ -#define Notify(...) (void)0; +#define Notify(...) (void)0 /* Exec */ /* AllocVecTagList with no tags */ -- cgit v1.2.3