- data = (unsigned char *)Mem_Alloc(font_mempool, (FONT_CHAR_LINES * map->glyphSize) * pitch);
- if (!data)
- {
- Con_Printf("ERROR: Failed to allocate memory for font %s size %g\n", font->name, map->size);
- Mem_Free(map);
- return false;
- }
- // initialize as white texture with zero alpha
- tp = 0;
- while (tp < (FONT_CHAR_LINES * map->glyphSize) * pitch)
+ Con_Printf("ERROR: Failed to allocate memory for font %s size %g\n", font->name, map->size);
+ Mem_Free(map);
+ return false;
+ }
+ // initialize as white texture with zero alpha
+ tp = 0;
+ while (tp < (FONT_CHAR_LINES * map->glyphSize) * pitch)
+ {
+ if (bytesPerPixel == 4)