From 9c62993efd45bcd685c579d51be013a1ae4f2770 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 18 Jan 2016 00:02:52 +0000 Subject: Don't expose the DPI-related variables --- amiga/font.c | 13 +++++++++++++ amiga/font.h | 9 +++++---- amiga/font_bullet.c | 4 ++-- amiga/gui.c | 6 +++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/amiga/font.c b/amiga/font.c index 27ea62d6e..39cb38602 100644 --- a/amiga/font.c +++ b/amiga/font.c @@ -32,6 +32,19 @@ #include "amiga/font_diskfont.h" #include "amiga/font_scan.h" +static ULONG ami_devicedpi = 72; +static ULONG ami_xdpi = 72; + +ULONG ami_font_dpi_get_devicedpi(void) +{ + return ami_devicedpi; +} + +ULONG ami_font_dpi_get_xdpi(void) +{ + return ami_xdpi; +} + void ami_font_setdevicedpi(int id) { DisplayInfoHandle dih; diff --git a/amiga/font.h b/amiga/font.h index e0799ea05..da23b5989 100755 --- a/amiga/font.h +++ b/amiga/font.h @@ -23,10 +23,14 @@ #include #include -void ami_font_setdevicedpi(int id); void ami_font_init(void); void ami_font_fini(void); +/* DPI stuff */ +void ami_font_setdevicedpi(int id); +ULONG ami_font_dpi_get_devicedpi(void); +ULONG ami_font_dpi_get_xdpi(void); + /* Simple diskfont functions for graphics.library use (not page rendering) */ struct TextFont *ami_font_open_disk_font(struct TextAttr *tattr); void ami_font_close_disk_font(struct TextFont *tfont); @@ -50,9 +54,6 @@ struct ami_font_functions { ULONG x, ULONG y, bool aa); }; -ULONG ami_devicedpi; -ULONG ami_xdpi; - const struct ami_font_functions *ami_nsfont; #endif diff --git a/amiga/font_bullet.c b/amiga/font_bullet.c index 69757e5a3..f63455257 100644 --- a/amiga/font_bullet.c +++ b/amiga/font_bullet.c @@ -55,7 +55,7 @@ #define NSA_VALUE_SHEARSIN (1 << 14) #define NSA_VALUE_SHEARCOS (1 << 16) -#define NSA_FONT_EMWIDTH(s) (s / FONT_SIZE_SCALE) * (ami_xdpi / 72.0) +#define NSA_FONT_EMWIDTH(s) (s / FONT_SIZE_SCALE) * (ami_font_dpi_get_xdpi() / 72.0) const uint16 sc_table[] = { 0x0061, 0x1D00, /* a */ @@ -510,7 +510,7 @@ static struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle #endif if(ESetInfo(AMI_OFONT_ENGINE, - OT_DeviceDPI, ami_devicedpi, + OT_DeviceDPI, ami_font_dpi_get_devicedpi(), OT_PointHeight, ysize, OT_EmboldenX, emboldenx, OT_EmboldenY, emboldeny, diff --git a/amiga/gui.c b/amiga/gui.c index e0f370f6e..768b4062a 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -5589,8 +5589,12 @@ int main(int argc, char** argv) #ifdef __amigaos4__ amiga_plugin_hack_init(); -#endif + + /* DataTypes loader needs datatypes.library v45, + * but for some reason that's not in OS3.9. + * Skip it to ensure it isn't causing other problems. */ ret = amiga_datatypes_init(); +#endif /* user options setup */ ret = nsoption_init(ami_set_options, &nsoptions, &nsoptions_default); -- cgit v1.2.3