From 3f7fc5f2b9b710faac981f21b616ae7ada47e1e8 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 29 May 2021 12:16:32 +0200 Subject: [PATCH] added CAP_EXTFONT for when font textures are not available (i.e., mobile devices) --- complex2.cpp | 2 ++ drawing.cpp | 4 +++- sysconfig.h | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/complex2.cpp b/complex2.cpp index 36b00c7a..e7dbac5d 100644 --- a/complex2.cpp +++ b/complex2.cpp @@ -1229,6 +1229,7 @@ EX namespace dice { queuecurve(V1, 0xFFFFFFFF, color & 0xFFFFFF9F, PPR::WALL); + #if !CAP_EXTFONT pointfunction pf = [&] (ld x, ld y) { hyperpoint hs; dynamicval g(geometry, gSpace534); @@ -1242,6 +1243,7 @@ EX namespace dice { else if(fid == 9) s = "9."; else s = its(fid); write_in_space(V1, max_glfont_size, dw->faces < 10 ? -1.2 : -.75, s, 0xFFFFFFFF, 0, 8, PPR::WALL, pf); + #endif } } diff --git a/drawing.cpp b/drawing.cpp index 8ad79a9a..6e90cd27 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -2640,6 +2640,7 @@ EX hyperpoint default_pointfunction(ld x, ld y) { return xpush(x) * ypush(y) * C0; } +#if !CAP_EXTFONT EX void write_in_space(const shiftmatrix& V, int fsize, double size, const string& s, color_t col, int frame IS(0), int align IS(8), PPR prio IS(PPR::TEXT), pointfunction pf IS(default_pointfunction)) { init_glfont(fsize); glfont_t& f(*(glfont[fsize])); @@ -2694,9 +2695,10 @@ EX void write_in_space(const shiftmatrix& V, int fsize, double size, const strin curvestart = isize(curvedata); } #endif +#endif EX void queuestr(const shiftmatrix& V, double size, const string& chr, color_t col, int frame IS(0), int align IS(8)) { - #if CAP_GL + #if CAP_GL && !CAP_EXTFONT if(vid.usingGL) { shiftmatrix V1 ; if(GDIM == 3) diff --git a/sysconfig.h b/sysconfig.h index a93165ea..c91818da 100644 --- a/sysconfig.h +++ b/sysconfig.h @@ -44,6 +44,10 @@ #define ISANDROID 0 #endif +#ifndef CAP_EXTFONT +#define CAP_EXTFONT (ISIOS || ISANDROID) +#endif + #ifndef ISSTEAM #define ISSTEAM 0 #endif