summaryrefslogtreecommitdiff
path: root/src/renderer/tr_font.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer/tr_font.c')
-rw-r--r--src/renderer/tr_font.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/renderer/tr_font.c b/src/renderer/tr_font.c
index 3fe80d0b..563b7068 100644
--- a/src/renderer/tr_font.c
+++ b/src/renderer/tr_font.c
@@ -117,14 +117,14 @@ FT_Bitmap *R_RenderGlyph(FT_GlyphSlot glyph, glyphInfo_t* glyphOut) {
if ( glyph->format == ft_glyph_format_outline ) {
size = pitch*height;
- bit2 = Z_Malloc(sizeof(FT_Bitmap));
+ bit2 = ri.Malloc(sizeof(FT_Bitmap));
bit2->width = width;
bit2->rows = height;
bit2->pitch = pitch;
bit2->pixel_mode = ft_pixel_mode_grays;
//bit2->pixel_mode = ft_pixel_mode_mono;
- bit2->buffer = Z_Malloc(pitch*height);
+ bit2->buffer = ri.Malloc(pitch*height);
bit2->num_grays = 256;
Com_Memset( bit2->buffer, 0, size );
@@ -150,7 +150,7 @@ void WriteTGA (char *filename, byte *data, int width, int height) {
byte *buffer;
int i, c;
- buffer = Z_Malloc(width*height*4 + 18);
+ buffer = ri.Malloc(width*height*4 + 18);
Com_Memset (buffer, 0, 18);
buffer[2] = 2; // uncompressed type
buffer[12] = width&255;
@@ -175,7 +175,7 @@ void WriteTGA (char *filename, byte *data, int width, int height) {
//fwrite (buffer, 1, c, f);
//fclose (f);
- Z_Free (buffer);
+ ri.Free (buffer);
}
static glyphInfo_t *RE_ConstructGlyphInfo(unsigned char *imageOut, int *xOut, int *yOut, int *maxHeight, FT_Face face, const unsigned char c, qboolean calcHeight) {
@@ -201,8 +201,8 @@ static glyphInfo_t *RE_ConstructGlyphInfo(unsigned char *imageOut, int *xOut, in
}
if (calcHeight) {
- Z_Free(bitmap->buffer);
- Z_Free(bitmap);
+ ri.Free(bitmap->buffer);
+ ri.Free(bitmap);
return &glyph;
}
@@ -223,8 +223,8 @@ static glyphInfo_t *RE_ConstructGlyphInfo(unsigned char *imageOut, int *xOut, in
if (*yOut + *maxHeight + 1 >= 255) {
*yOut = -1;
*xOut = -1;
- Z_Free(bitmap->buffer);
- Z_Free(bitmap);
+ ri.Free(bitmap->buffer);
+ ri.Free(bitmap);
return &glyph;
} else {
*xOut = 0;
@@ -233,8 +233,8 @@ static glyphInfo_t *RE_ConstructGlyphInfo(unsigned char *imageOut, int *xOut, in
} else if (*yOut + *maxHeight + 1 >= 255) {
*yOut = -1;
*xOut = -1;
- Z_Free(bitmap->buffer);
- Z_Free(bitmap);
+ ri.Free(bitmap->buffer);
+ ri.Free(bitmap);
return &glyph;
}
@@ -289,8 +289,8 @@ static glyphInfo_t *RE_ConstructGlyphInfo(unsigned char *imageOut, int *xOut, in
*xOut += scaled_width + 1;
}
- Z_Free(bitmap->buffer);
- Z_Free(bitmap);
+ ri.Free(bitmap->buffer);
+ ri.Free(bitmap);
return &glyph;
}
@@ -436,9 +436,9 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
// make a 256x256 image buffer, once it is full, register it, clean it and keep going
// until all glyphs are rendered
- out = Z_Malloc(1024*1024);
+ out = ri.Malloc(1024*1024);
if (out == NULL) {
- ri.Printf(PRINT_ALL, "RE_RegisterFont: Z_Malloc failure during output image creation.\n");
+ ri.Printf(PRINT_ALL, "RE_RegisterFont: ri.Malloc failure during output image creation.\n");
return;
}
Com_Memset(out, 0, 1024*1024);
@@ -466,7 +466,7 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
scaledSize = 256*256;
newSize = scaledSize * 4;
- imageBuff = Z_Malloc(newSize);
+ imageBuff = ri.Malloc(newSize);
left = 0;
max = 0;
satLevels = 255;
@@ -504,7 +504,7 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
Com_Memset(out, 0, 1024*1024);
xOut = 0;
yOut = 0;
- Z_Free(imageBuff);
+ ri.Free(imageBuff);
i++;
} else {
Com_Memcpy(&font->glyphs[i], glyph, sizeof(glyphInfo_t));
@@ -520,7 +520,7 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) {
ri.FS_WriteFile(va("fonts/fontImage_%i.dat", pointSize), font, sizeof(fontInfo_t));
}
- Z_Free(out);
+ ri.Free(out);
ri.FS_FreeFile(faceData);
#endif