Okay, thanks for giving insight.
For anybody wondering:
As a workaround I use an array of dummy TEXT objects. In draw instructions I use their IDs as an extra argument.
A custom DRAWCONTAINER struct is stored in a TEXT object's skill_x. If any parameters (in the custom draw_text or draw_obj call) changed or if it's the first time that text is supposed to be drawn, the text will be drawn to a BMAP.
If nothing changes, just the bitmap from previous frames will be drawn to the screen using draw_quad.
This has cut down the text rendering performance impact from 2.5+ms to ~0.15ms (depending on how often strings change) in my game on my machine.
typedef struct
{
int type;
void *obj;
BMAP* bmp;
int bmpIsExternal;
int forceUpdate;
int lastFrameUpdate;
long flags;
STRING *pstr;
char *charsCopy;
char *pchars;
int length;
COLOR color;
FONT* font;
var size_x,size_y;
} DRAWCONTAINER;
int draw_obj_cached(void *sourceObj)
{
int index = ((int*)sourceObj)[0];
int type = (index >> 24);
if(type == HBYTE_TEXT)
{
TEXT* txt = (TEXT*)sourceObj;
STRING* str = (txt->pstring)[0];
DRAWCONTAINER* container = (DRAWCONTAINER*)txt->skill_x;
compare data... -> create bmap if necessary and redraw
draw_quad(bmp)
}
}