Make JUTResFont load all texture data into one texture

Together with the previous change, this enables entire blocks of text to be rendered in one draw call.
This commit is contained in:
PJB3005
2026-04-13 19:09:16 +02:00
parent 0a95a9e538
commit 1dac80f3a9
3 changed files with 51 additions and 42 deletions
@@ -7,8 +7,7 @@
#if TARGET_PC
struct FontDrawContext {
int loadedBlock = -1;
int loadedPage = -1;
bool isTextureLoaded = false;
};
#define FONT_DRAW_CTX , FontDrawContext* context
#define FONT_DRAW_CTX_ARG , context
@@ -18,10 +18,6 @@ struct BlockHeader {
BE(u32) size;
};
#if TARGET_PC
struct GlyphTextures;
#endif
/**
* @ingroup jsystem-jutility
*
@@ -91,6 +87,16 @@ public:
/* 0x66 */ u16 field_0x66;
/* 0x68 */ u16 mMaxCode;
/* 0x6C */ const IsLeadByte_func* mIsLeadByte;
#if TARGET_PC
// Dusk change: we use a single large texture for all characters.
// This enables better draw call merging, ideally enabling entire blocks of
// text to be one draw call.
TGXTexObj mJoinedTextureObject;
u16 mJoinedTextureHeight;
void initJoinedTexture();
#endif
};
extern u8 const JUTResFONT_Ascfont_fix12[];