// // E_AutoAllocFontNum // // Automatically assigns an unused font number to a font // which was not given one by the author, to allow reference by name // anywhere without the chore of number allocation. // static bool E_AutoAllocFontNum(vfont_t *font) { int num; #ifdef RANGECHECK if(font->num > 0) I_Error("E_AutoAllocFontNum: called for vfont_t with valid num\n"); #endif // cannot assign because we're out of dehnums? if(edf_alloc_fontnum < 0) return false; do { num = edf_alloc_fontnum--; } while(num >= 0 && E_FontForNum(num)); // ran out while looking for an unused number? if(num < 0) return false; // assign it! font->num = num; E_AddFontToNumHash(font); return true; }
void initProps(int px, int py, int fontNum, int pcleartic, int pflags, const char *pmsg) { x = px; y = py; if(!(font = E_FontForNum(fontNum))) font = hud_font; cleartic = pcleartic >= 0 ? pcleartic : 0; flags = pflags; message = alloc = estrdup(pmsg); }