mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-28 23:12:40 +00:00
IOQ3 commit 2231
This commit is contained in:
parent
33defbaea3
commit
04a30e8dd8
1 changed files with 8 additions and 8 deletions
|
@ -363,7 +363,7 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
|
||||||
R_SyncRenderThread();
|
R_SyncRenderThread();
|
||||||
|
|
||||||
if (registeredFontCount >= MAX_FONTS) {
|
if (registeredFontCount >= MAX_FONTS) {
|
||||||
ri.Printf(PRINT_ALL, "RE_RegisterFont: Too many fonts registered already.\n");
|
ri.Printf(PRINT_WARNING, "RE_RegisterFont: Too many fonts registered already.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,28 +409,28 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef BUILD_FREETYPE
|
#ifndef BUILD_FREETYPE
|
||||||
ri.Printf(PRINT_ALL, "RE_RegisterFont: FreeType code not available\n");
|
ri.Printf(PRINT_WARNING, "RE_RegisterFont: FreeType code not available\n");
|
||||||
#else
|
#else
|
||||||
if (ftLibrary == NULL) {
|
if (ftLibrary == NULL) {
|
||||||
ri.Printf(PRINT_ALL, "RE_RegisterFont: FreeType not initialized.\n");
|
ri.Printf(PRINT_WARNING, "RE_RegisterFont: FreeType not initialized.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = ri.FS_ReadFile(fontName, &faceData);
|
len = ri.FS_ReadFile(fontName, &faceData);
|
||||||
if (len <= 0) {
|
if (len <= 0) {
|
||||||
ri.Printf(PRINT_ALL, "RE_RegisterFont: Unable to read font file\n");
|
ri.Printf(PRINT_WARNING, "RE_RegisterFont: Unable to read font file '%s'\n", fontName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate on the stack first in case we fail
|
// allocate on the stack first in case we fail
|
||||||
if (FT_New_Memory_Face( ftLibrary, faceData, len, 0, &face )) {
|
if (FT_New_Memory_Face( ftLibrary, faceData, len, 0, &face )) {
|
||||||
ri.Printf(PRINT_ALL, "RE_RegisterFont: FreeType2, unable to allocate new face.\n");
|
ri.Printf(PRINT_WARNING, "RE_RegisterFont: FreeType, unable to allocate new face.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (FT_Set_Char_Size( face, pointSize << 6, pointSize << 6, dpi, dpi)) {
|
if (FT_Set_Char_Size( face, pointSize << 6, pointSize << 6, dpi, dpi)) {
|
||||||
ri.Printf(PRINT_ALL, "RE_RegisterFont: FreeType2, Unable to set face char size.\n");
|
ri.Printf(PRINT_WARNING, "RE_RegisterFont: FreeType, unable to set face char size.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
|
||||||
|
|
||||||
out = ri.Malloc(1024*1024);
|
out = ri.Malloc(1024*1024);
|
||||||
if (out == NULL) {
|
if (out == NULL) {
|
||||||
ri.Printf(PRINT_ALL, "RE_RegisterFont: ri.Malloc failure during output image creation.\n");
|
ri.Printf(PRINT_WARNING, "RE_RegisterFont: ri.Malloc failure during output image creation.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Com_Memset(out, 0, 1024*1024);
|
Com_Memset(out, 0, 1024*1024);
|
||||||
|
@ -533,7 +533,7 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
|
||||||
void R_InitFreeType(void) {
|
void R_InitFreeType(void) {
|
||||||
#ifdef BUILD_FREETYPE
|
#ifdef BUILD_FREETYPE
|
||||||
if (FT_Init_FreeType( &ftLibrary )) {
|
if (FT_Init_FreeType( &ftLibrary )) {
|
||||||
ri.Printf(PRINT_ALL, "R_InitFreeType: Unable to initialize FreeType.\n");
|
ri.Printf(PRINT_WARNING, "R_InitFreeType: Unable to initialize FreeType.\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
registeredFontCount = 0;
|
registeredFontCount = 0;
|
||||||
|
|
Loading…
Reference in a new issue