diff --git a/src/platform/3ds/ctr-gpu.c b/src/platform/3ds/ctr-gpu.c index 14446b79d..b7984b713 100644 --- a/src/platform/3ds/ctr-gpu.c +++ b/src/platform/3ds/ctr-gpu.c @@ -27,7 +27,7 @@ struct ctrUIVertex { u32 abgr; }; -#define MAX_NUM_QUADS 1024 +#define MAX_NUM_QUADS 256 #define VERTEX_BUFFER_SIZE MAX_NUM_QUADS * sizeof(struct ctrUIVertex) static struct ctrUIVertex* ctrVertexBuffer = NULL; @@ -146,6 +146,13 @@ void ctrActivateTexture(C3D_Tex* texture) { } void ctrAddRectScaled(u32 color, s16 x, s16 y, s16 w, s16 h, s16 u, s16 v, s16 uw, s16 vh) { + if (x >= 400 && w >= 0) { + return; + } + if (y >= 240 && h >= 0) { + return; + } + if (ctrNumVerts + ctrVertStart == MAX_NUM_QUADS) { ctrFlushBatch(); C3D_Flush(); diff --git a/src/platform/3ds/gui-font.c b/src/platform/3ds/gui-font.c index f044ce35c..d3a27f864 100644 --- a/src/platform/3ds/gui-font.c +++ b/src/platform/3ds/gui-font.c @@ -95,7 +95,7 @@ void GUIFontIconMetrics(const struct GUIFont* font, enum GUIIcon icon, unsigned* void GUIFontDrawGlyph(const struct GUIFont* font, int glyph_x, int glyph_y, uint32_t color, uint32_t glyph) { int index = fontGlyphIndexFromCodePoint(glyph); fontGlyphPos_s data; - fontCalcGlyphPos(&data, index, GLYPH_POS_CALC_VTXCOORD, 1.0, 1.0); + fontCalcGlyphPos(&data, index, 0, 1.0, 1.0); C3D_Tex* tex = &font->sheets[data.sheetIndex]; ctrActivateTexture(tex);