109 if (!strcmp(path, pic->name))
118 Con_DPrintf(
"Draw_CachePic(\"%s\"): frame %i: reloading pic due to mismatch on flags\n", path,
draw_frame);
121 if (!pic->skinframe || !pic->skinframe->base)
129 pic->autoload =
false;
140 Con_DPrintf (
"Draw_CachePic(\"%s\"): frame %i: numcachepics == MAX_CACHED_PICS\n", path,
draw_frame);
146 memset(pic, 0,
sizeof(*pic));
147 dp_strlcpy (pic->name, path,
sizeof(pic->name));
156 pic->flags = cachepicflags;
173 if (pic->skinframe && pic->skinframe->base)
215 if (pic->autoload && (!pic->skinframe || !pic->skinframe->base))
217 Con_DPrintf(
"Draw_IsPicLoaded(\"%s\"): Loading external skin\n", pic->name);
221 return pic->skinframe !=
NULL && pic->skinframe->base !=
NULL;
228 if (pic->autoload && (!pic->skinframe || !pic->skinframe->base))
230 Con_DPrintf(
"Draw_GetPicTexture(\"%s\"): Loading external skin\n", pic->name);
234 return pic->skinframe ? pic->skinframe->base :
NULL;
241 static double nextpurgetime;
247 if (pic->autoload && pic->skinframe && pic->skinframe->base && pic->lastusedframe <
draw_frame - 3)
264 if (!strcmp (picname, pic->name))
277 Con_DPrintf(
"Draw_NewPic(\"%s\"): frame %i: reloading pic because flags/size changed\n", picname,
draw_frame);
283 Con_DPrintf (
"Draw_NewPic(\"%s\"): frame %i: numcachepics == MAX_CACHED_PICS\n", picname,
draw_frame);
289 memset(pic, 0,
sizeof(*pic));
290 dp_strlcpy (pic->name, picname,
sizeof(pic->name));
298 pic->autoload =
false;
319 if (!strcmp (picname, pic->name) && pic->skinframe)
338 if(
override || !fnt->
texpath[0])
371 Con_DPrintf(
"Failed to load font-file for '%s', it will not support as many characters.\n", fnt->
texpath);
388 dp_strlcpy(widthfile,
"gfx/conchars.width",
sizeof(widthfile));
397 for(ch = 0; ch < 256; ++ch)
403 float extraspacing = 0;
404 const char *p = widthbuf;
463 for(ch = 0; ch < 256; ++ch)
469 for(
i = 1;
i < 256; ++
i)
508 for(
i = 0;
i < oldsize; ++
i)
521 int snap = (
int) pixelpos;
522 if (pixelpos - snap >= roundUpAt) ++snap;
534 int snap = (
int) pixelpos;
535 if (pixelpos - snap > roundUpAt) ++snap;
548 const char *filelist, *c, *cm;
549 float sz,
scale, voffset;
558 Con_Printf(
"A font can simply be gfx/tgafile, or alternatively you\n"
559 "can specify multiple fonts and faces\n"
560 "Like this: gfx/vera-sans:2,gfx/fallback:1\n"
561 "to load face 2 of the font gfx/vera-sans and use face 1\n"
562 "of gfx/fallback as fallback font.\n"
563 "You can also specify a list of font sizes to load, like this:\n"
564 "loadfont console gfx/conchars,gfx/fallback 8 12 16 24 32\n"
565 "In many cases, 8 12 16 24 32 should be a good choice.\n"
567 " scale x : scale all characters by this amount when rendering (doesnt change line height)\n"
568 " voffset x : offset all chars vertical when rendering, this is multiplied to character height\n"
590 filelist =
"gfx/conchars";
594 memset(
f->fallbacks, 0,
sizeof(
f->fallbacks));
595 memset(
f->fallback_faces, 0,
sizeof(
f->fallback_faces));
598 c = strchr(filelist,
':');
599 cm = strchr(filelist,
',');
600 if(c && (!cm || c < cm))
601 f->req_face = atoi(c+1);
609 dp_strlcpy(mainfont, filelist,
sizeof(mainfont));
612 memcpy(mainfont, filelist, c - filelist);
613 mainfont[c - filelist] = 0;
618 c = strchr(filelist,
',');
624 c = strchr(filelist,
':');
625 cm = strchr(filelist,
',');
626 if(c && (!cm || c < cm))
627 f->fallback_faces[
i] = atoi(c+1);
630 f->fallback_faces[
i] = 0;
635 dp_strlcpy(
f->fallbacks[
i], filelist,
sizeof(mainfont));
639 memcpy(
f->fallbacks[
i], filelist, c - filelist);
640 f->fallbacks[
i][c - filelist] = 0;
647 f->req_sizes[
i] = -1;
676 if (sz > 0.001f && sz < 1000.0f)
680 for (j=0; j<sizes; j++)
681 if (
f->req_sizes[j] == sz)
692 f->req_sizes[sizes] = sz;
742 if (!pic->autoload && pic->skinframe)
785 Cmd_AddCommand(
CF_CLIENT,
"loadfont",
LoadFont_f,
"loadfont function tganame loads a font; example: loadfont console gfx/veramono; loadfont without arguments lists the available functions");
811 e0 =
Mod_Mesh_IndexForVertex(
mod, surf,
x ,
y , 0, 0, 0, -1, 0, 0, 0, 0, red,
green,
blue,
alpha);
812 e1 =
Mod_Mesh_IndexForVertex(
mod, surf,
x +
width,
y , 0, 0, 0, -1, 1, 0, 0, 0, red,
green,
blue,
alpha);
813 e2 =
Mod_Mesh_IndexForVertex(
mod, surf,
x +
width,
y +
height, 0, 0, 0, -1, 1, 1, 0, 0, red,
green,
blue,
alpha);
814 e3 =
Mod_Mesh_IndexForVertex(
mod, surf,
x ,
y +
height, 0, 0, 0, -1, 0, 1, 0, 0, red,
green,
blue,
alpha);
819void DrawQ_RotPic(
float x,
float y, cachepic_t *pic,
float width,
float height,
float org_x,
float org_y,
float angle,
float red,
float green,
float blue,
float alpha,
int flags)
822 float ar =
DEG2RAD(-angle + 90);
823 float sinaf =
sin(af);
824 float cosaf =
cos(af);
825 float sinar =
sin(ar);
826 float cosar =
cos(ar);
839 e0 =
Mod_Mesh_IndexForVertex(
mod, surf,
x - cosaf * org_x - cosar * org_y ,
y - sinaf * org_x - sinar * org_y , 0, 0, 0, -1, 0, 0, 0, 0, red,
green,
blue,
alpha);
840 e1 =
Mod_Mesh_IndexForVertex(
mod, surf,
x + cosaf * (
width - org_x) - cosar * org_y ,
y + sinaf * (
width - org_x) - sinar * org_y , 0, 0, 0, -1, 1, 0, 0, 0, red,
green,
blue,
alpha);
841 e2 =
Mod_Mesh_IndexForVertex(
mod, surf,
x + cosaf * (
width - org_x) + cosar * (
height - org_y),
y + sinaf * (
width - org_x) + sinar * (
height - org_y), 0, 0, 0, -1, 1, 1, 0, 0, red,
green,
blue,
alpha);
842 e3 =
Mod_Mesh_IndexForVertex(
mod, surf,
x - cosaf * org_x + cosar * (
height - org_y),
y - sinaf * org_x + sinar * (
height - org_y), 0, 0, 0, -1, 0, 1, 0, 0, red,
green,
blue,
alpha);
858 {0.0, 0.0, 0.0, 1.0},
859 {1.0, 0.0, 0.0, 1.0},
860 {0.0, 1.0, 0.0, 1.0},
861 {1.0, 1.0, 0.0, 1.0},
863 {0.05, 0.15, 1.0, 1.0},
864 {0.0, 1.0, 1.0, 1.0},
865 {1.0, 0.0, 1.0, 1.0},
866 {1.0, 1.0, 1.0, 1.0},
868 {1.0, 1.0, 1.0, 0.5},
881#define STRING_COLORS_COUNT (sizeof(string_colors) / sizeof(vec4_t))
887 if (colorindex & 0x10000)
889 color[0] = ((colorindex >> 12) & 0xf) / 15.0;
890 color[1] = ((colorindex >> 8) & 0xf) / 15.0;
891 color[2] = ((colorindex >> 4) & 0xf) / 15.0;
892 color[3] = (colorindex & 0xf) / 15.0;
909 int ind = 0x0001 << 4;
911 if (*str <=
'9' && *str >=
'0')
916 if (ch >=
'a' && ch <=
'f')
923 }
while(!(ind & 0x10000));
930 const char *text_start = text;
934 Uchar ch, mapch, nextch;
939 ft2_font_map_t *fontmap =
NULL;
940 ft2_font_map_t *map =
NULL;
944 qbool least_one =
false;
947 const float *width_of;
974 if (!outcolor || *outcolor == -1)
977 colorindex = *outcolor;
985 maxwidth = -maxwidth;
997 while (((bytes_left = *maxlen - (text - text_start)) > 0) && *text)
1000 nextch = ch =
u8_getnchar(text, &text, bytes_left);
1001 i = text - text_start;
1004 if (ch ==
' ' && !fontmap)
1006 if(!least_one || i0)
1007 if(
x + width_of[(
int)
' '] * dw > maxwidth)
1012 x += width_of[(
int)
' '] * dw;
1018 if (ch <=
'9' && ch >=
'0')
1020 colorindex = ch -
'0';
1027 const char *text_p = &text[1];
1031 colorindex = tempcolorindex;
1046 if (!fontmap || (ch <= 0xFF && fontmap->glyphs[ch].image) || (ch >= 0xE000 && ch <= 0xE0FF))
1055 if(!least_one || i0)
1056 if(
x + width_of[ch] * dw > maxwidth)
1061 x += width_of[ch] * dw;
1071 x += map->glyphs[mapch].advance_x * dw;
1079 *outcolor = colorindex;
1085float DrawQ_String_Scale(
float startx,
float starty,
const char *text,
size_t maxlen,
float w,
float h,
float sw,
float sh,
float basered,
float basegreen,
float baseblue,
float basealpha,
int flags,
int *outcolor,
qbool ignorecolorcodes,
const dp_font_t *fnt)
1089 float x = startx,
y, s, t, u,
v, thisw;
1090 Uchar ch, mapch, nextch;
1093 ft2_font_map_t *map =
NULL;
1094 ft2_font_map_t *fontmap =
NULL;
1096 const char *text_start = text;
1103 const float *width_of;
1135 ftbase_y = dh * (4.5/6.0);
1164 if (!outcolor || *outcolor == -1)
1167 colorindex = *outcolor;
1180 while (((bytes_left = maxlen - (text - text_start)) > 0) && *text)
1182 nextch = ch =
u8_getnchar(text, &text, bytes_left);
1183 i = text - text_start;
1186 if (ch ==
' ' && !fontmap)
1188 x += width_of[(
int)
' '] * dw;
1194 if (ch <=
'9' && ch >=
'0')
1196 colorindex = ch -
'0';
1204 const char *text_p = &text[1];
1208 colorindex = tempcolorindex;
1232 if (!fontmap || (ch <= 0xFF && fontmap->glyphs[ch].image) || (ch >= 0xE000 && ch <= 0xE0FF))
1247 s = (ch & 15)*0.0625f;
1248 t = (ch >> 4)*0.0625f;
1249 u = 0.0625f * thisw;
1254 s = (ch & 15)*0.0625f + (0.5f / tw);
1255 t = (ch >> 4)*0.0625f + (0.5f / th);
1256 u = 0.0625f * thisw - (1.0f / tw);
1257 v = 0.0625f - (1.0f / th);
1260 e0 =
Mod_Mesh_IndexForVertex(
mod, surf,
x ,
y , 10, 0, 0, -1, s , t , 0, 0,
DrawQ_Color[0],
DrawQ_Color[1],
DrawQ_Color[2],
DrawQ_Color[3]);
1261 e1 =
Mod_Mesh_IndexForVertex(
mod, surf,
x+dw*thisw,
y , 10, 0, 0, -1, s+u, t , 0, 0,
DrawQ_Color[0],
DrawQ_Color[1],
DrawQ_Color[2],
DrawQ_Color[3]);
1262 e2 =
Mod_Mesh_IndexForVertex(
mod, surf,
x+dw*thisw,
y+dh, 10, 0, 0, -1, s+u, t+
v, 0, 0,
DrawQ_Color[0],
DrawQ_Color[1],
DrawQ_Color[2],
DrawQ_Color[3]);
1263 e3 =
Mod_Mesh_IndexForVertex(
mod, surf,
x ,
y+dh, 10, 0, 0, -1, s , t+
v, 0, 0,
DrawQ_Color[0],
DrawQ_Color[1],
DrawQ_Color[2],
DrawQ_Color[3]);
1266 x += width_of[ch] * dw;
1278 thisw = map->glyphs[mapch].advance_x;
1290 e0 =
Mod_Mesh_IndexForVertex(
mod, surf,
x + dw * map->glyphs[mapch].vxmin,
y + dh * map->glyphs[mapch].vymin, 10, 0, 0, -1, map->glyphs[mapch].txmin, map->glyphs[mapch].tymin, 0, 0,
DrawQ_Color[0],
DrawQ_Color[1],
DrawQ_Color[2],
DrawQ_Color[3]);
1291 e1 =
Mod_Mesh_IndexForVertex(
mod, surf,
x + dw * map->glyphs[mapch].vxmax,
y + dh * map->glyphs[mapch].vymin, 10, 0, 0, -1, map->glyphs[mapch].txmax, map->glyphs[mapch].tymin, 0, 0,
DrawQ_Color[0],
DrawQ_Color[1],
DrawQ_Color[2],
DrawQ_Color[3]);
1292 e2 =
Mod_Mesh_IndexForVertex(
mod, surf,
x + dw * map->glyphs[mapch].vxmax,
y + dh * map->glyphs[mapch].vymax, 10, 0, 0, -1, map->glyphs[mapch].txmax, map->glyphs[mapch].tymax, 0, 0,
DrawQ_Color[0],
DrawQ_Color[1],
DrawQ_Color[2],
DrawQ_Color[3]);
1293 e3 =
Mod_Mesh_IndexForVertex(
mod, surf,
x + dw * map->glyphs[mapch].vxmin,
y + dh * map->glyphs[mapch].vymax, 10, 0, 0, -1, map->glyphs[mapch].txmin, map->glyphs[mapch].tymax, 0, 0,
DrawQ_Color[0],
DrawQ_Color[1],
DrawQ_Color[2],
DrawQ_Color[3]);
1314 *outcolor = colorindex;
1320float DrawQ_String(
float startx,
float starty,
const char *text,
size_t maxlen,
float w,
float h,
float basered,
float basegreen,
float baseblue,
float basealpha,
int flags,
int *outcolor,
qbool ignorecolorcodes,
const dp_font_t *fnt)
1322 return DrawQ_String_Scale(startx, starty, text, maxlen,
w, h, 1, 1, basered, basegreen, baseblue, basealpha,
flags, outcolor, ignorecolorcodes, fnt);
1343static int DrawQ_BuildColoredText(
char *output2c,
size_t maxoutchars,
const char *text,
int maxreadchars,
qbool ignorecolorcodes,
int *outcolor)
1345 int color, numchars = 0;
1346 char *outputend2c = output2c + maxoutchars - 2;
1347 if (!outcolor || *outcolor == -1)
1352 maxreadchars = 1<<30;
1353 textend = text + maxreadchars;
1354 while (text != textend && *text)
1360 else if (text[1] >=
'0' && text[1] <=
'9')
1362 color = text[1] -
'0';
1367 if (output2c >= outputend2c)
1369 *output2c++ = *text++;
1370 *output2c++ =
color;
1373 output2c[0] = output2c[1] = 0;
1380void DrawQ_SuperPic(
float x,
float y, cachepic_t *pic,
float width,
float height,
float s1,
float t1,
float r1,
float g1,
float b1,
float a1,
float s2,
float t2,
float r2,
float g2,
float b2,
float a2,
float s3,
float t3,
float r3,
float g3,
float b3,
float a3,
float s4,
float t4,
float r4,
float g4,
float b4,
float a4,
int flags)
1394 e0 =
Mod_Mesh_IndexForVertex(
mod, surf,
x ,
y , 0, 0, 0, -1, s1, t1, 0, 0, r1, g1, b1, a1);
1395 e1 =
Mod_Mesh_IndexForVertex(
mod, surf,
x +
width,
y , 0, 0, 0, -1, s2, t2, 0, 0, r2, g2, b2, a2);
1396 e2 =
Mod_Mesh_IndexForVertex(
mod, surf,
x +
width,
y +
height, 0, 0, 0, -1, s4, t4, 0, 0, r4, g4, b4, a4);
1397 e3 =
Mod_Mesh_IndexForVertex(
mod, surf,
x ,
y +
height, 0, 0, 0, -1, s3, t3, 0, 0, r3, g3, b3, a3);
1407 float offsetx, offsety;
1420 e0 =
Mod_Mesh_IndexForVertex(
mod, surf,
x1 - offsetx, y1 - offsety, 10, 0, 0, -1, 0, 0, 0, 0,
r,
g,
b,
alpha);
1421 e1 =
Mod_Mesh_IndexForVertex(
mod, surf,
x2 - offsetx,
y2 - offsety, 10, 0, 0, -1, 0, 0, 0, 0,
r,
g,
b,
alpha);
1422 e2 =
Mod_Mesh_IndexForVertex(
mod, surf,
x2 + offsetx,
y2 + offsety, 10, 0, 0, -1, 0, 0, 0, 0,
r,
g,
b,
alpha);
1423 e3 =
Mod_Mesh_IndexForVertex(
mod, surf,
x1 + offsetx, y1 + offsety, 10, 0, 0, -1, 0, 0, 0, 0,
r,
g,
b,
alpha);
1472 if (
mod->num_surfaces == 0)
entity_t cl_meshentities[NUM_MESHENTITIES]
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
static int Cmd_Argc(cmd_state_t *cmd)
static const char * Cmd_Argv(cmd_state_t *cmd, int arg)
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are alwa...
#define CF_CLIENT
cvar/command that only the client can change/execute
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
unsigned short CRC_Block(const unsigned char *data, size_t size)
char com_token[MAX_INPUTLINE]
char * va(char *buf, size_t buflen, const char *format,...)
qbool COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments)
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
#define dp_strlcpy(dst, src, dsize)
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
float mod(float dividend, float divisor)
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
@ CACHEPICFLAG_FAILONMISSING
@ CACHEPICFLAG_NOTPERSISTENT
@ CACHEPICFLAG_NOCOMPRESSION
#define STRING_COLOR_RGB_TAG_CHAR
#define STRING_COLOR_DEFAULT
#define MAX_FONT_FALLBACKS
unsigned char * FS_LoadFile(const char *path, mempool_t *pool, qbool quiet, fs_offset_t *filesizepointer)
static int(ZEXPORT *qz_inflate)(z_stream *strm
ft2_font_map_t * Font_MapForIndex(ft2_font_t *font, int index)
float Font_SnapTo(float val, float snapwidth)
qbool Font_LoadFont(const char *name, dp_font_t *dpfnt)
qbool Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h, Uchar left, Uchar right, float *outx, float *outy)
int Font_IndexForSize(ft2_font_t *font, float _fsize, float *outw, float *outh)
qbool Font_GetMapForChar(ft2_font_t *font, int map_index, Uchar ch, ft2_font_map_t **outmap, int *outmapch)
Query for or load a font map for a character, with the character's place on it.
void Font_UnloadFont(ft2_font_t *font)
void GL_DepthMask(int state)
void GL_Scissor(int x, int y, int width, int height)
void GL_ScissorTest(int state)
cachepic_t * Draw_CachePic(const char *path)
static cachepic_t cachepics[MAX_CACHED_PICS]
static cachepic_t * cachepichash[CACHEPICHASHSIZE]
rtexturepool_t * drawtexturepool
float DrawQ_TextWidth_UntilWidth_TrackColors(const char *text, size_t *maxlen, float w, float h, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt, float maxwidth)
void DrawQ_Fill(float x, float y, float width, float height, float red, float green, float blue, float alpha, int flags)
void Draw_FreePic(const char *picname)
static void LoadFont_f(cmd_state_t *cmd)
void DrawQ_Pic(float x, float y, cachepic_t *pic, float width, float height, float red, float green, float blue, float alpha, int flags)
void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height, float s1, float t1, float r1, float g1, float b1, float a1, float s2, float t2, float r2, float g2, float b2, float a2, float s3, float t3, float r3, float g3, float b3, float a3, float s4, float t4, float r4, float g4, float b4, float a4, int flags)
cvar_t r_font_postprocess_shadow_x
cachepic_t * Draw_NewPic(const char *picname, int width, int height, unsigned char *pixels_bgra, textype_t textype, int texflags)
cvar_t r_font_postprocess_outline
static void gl_draw_start(void)
static void DrawQ_GetTextColor(float color[4], int colorindex, float r, float g, float b, float a, qbool shadow)
void DrawQ_RotPic(float x, float y, cachepic_t *pic, float width, float height, float org_x, float org_y, float angle, float red, float green, float blue, float alpha, int flags)
void DrawQ_Line(float width, float x1, float y1, float x2, float y2, float r, float g, float b, float alpha, int flags)
const char * Draw_GetPicName(cachepic_t *pic)
cvar_t r_font_postprocess_shadow_z
const vec4_t string_colors[]
color tag printing
static void gl_draw_shutdown(void)
static int RGBstring_to_colorindex(const char *str)
cachepic_t * Draw_CachePic_Flags(const char *path, unsigned int cachepicflags)
float DrawQ_String_Scale(float startx, float starty, const char *text, size_t maxlen, float w, float h, float sw, float sh, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt)
int Draw_GetPicWidth(cachepic_t *pic)
static float snap_to_pixel_x(float x, float roundUpAt)
float DrawQ_TextWidth(const char *text, size_t maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt)
static void gl_draw_newmap(void)
cvar_t r_font_postprocess_shadow_y
cvar_t r_font_postprocess_blur
float DrawQ_String(float startx, float starty, const char *text, size_t maxlen, float w, float h, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt)
cvar_t r_font_always_reload
rtexture_t * Draw_GetPicTexture(cachepic_t *pic)
void DrawQ_SetClipArea(float x, float y, float width, float height)
float DrawQ_TextWidth_UntilWidth(const char *text, size_t *maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt, float maxWidth)
void LoadFont(qbool override, const char *name, dp_font_t *fnt, float scale, float voffset)
void DrawQ_RecalcView(void)
static float snap_to_pixel_y(float y, float roundUpAt)
cvar_t r_nearest_conchars
int Draw_GetPicHeight(cachepic_t *pic)
dp_font_t * FindFont(const char *title, qbool allocate_new)
float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *maxlen, float w, float h, float sw, float sh, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt, float maxwidth)
qbool Draw_IsPicLoaded(cachepic_t *pic)
void DrawQ_ResetClipArea(void)
static mempool_t * fonts_mempool
int r_textureframe
used only by R_GetCurrentTexture, incremented per view and per UI render
skinframe_t * R_SkinFrame_LoadExternal(const char *name, int textureflags, qbool complain, qbool fallbacknotexture)
skinframe_t * R_SkinFrame_LoadInternalBGRA(const char *name, int textureflags, const unsigned char *skindata, int width, int height, int comparewidth, int compareheight, int comparecrc, qbool sRGB)
void R_ResetViewRendering2D_Common(int viewfbo, rtexture_t *viewdepthtexture, rtexture_t *viewcolortexture, int viewx, int viewy, int viewwidth, int viewheight, float x2, float y2)
void R_DrawModelSurfaces(entity_render_t *ent, qbool skysurfaces, qbool writedepth, qbool depthonly, qbool debug, qbool prepass, qbool ui)
void R_SkinFrame_PurgeSkinFrame(skinframe_t *s)
skinframe_t * R_SkinFrame_LoadExternal_SkinFrame(skinframe_t *skinframe, const char *name, int textureflags, qbool complain, qbool fallbacknotexture)
void R_SkinFrame_MarkUsed(skinframe_t *skinframe)
void R_FreeTexturePool(rtexturepool_t **rtexturepool)
cvar_t gl_texturecompression
int R_TextureHeight(rtexture_t *rt)
void R_UpdateTexture(rtexture_t *rt, const unsigned char *data, int x, int y, int z, int width, int height, int depth, int combine)
int R_TextureWidth(rtexture_t *rt)
rtexturepool_t * R_AllocTexturePool(void)
cvar_t gl_texturecompression_2d
GLenum GLsizei GLsizei height
GLubyte GLubyte GLubyte GLubyte w
GLint GLenum GLint GLint y
qbool Image_GetStockPicSize(const char *filename, int *returnwidth, int *returnheight)
#define bound(min, num, max)
#define Vector4Set(vec, r, g, b, a)
#define Vector4Copy(in, out)
#define MATERIALFLAG_VERTEXCOLOR
#define MATERIALFLAG_ALPHA
#define MATERIALFLAG_BLENDED
#define MATERIALFLAG_ALPHAGEN_VERTEX
#define MATERIALFLAG_WALL
#define MATERIALFLAG_NOSHADOW
void Mod_Mesh_Reset(model_t *mod)
msurface_t * Mod_Mesh_AddSurface(model_t *mod, texture_t *tex, qbool batchwithprevioussurface)
int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a)
texture_t * Mod_Mesh_GetTexture(model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags)
void Mod_Mesh_AddTriangle(model_t *mod, msurface_t *surf, int e0, int e1, int e2)
void Mod_Mesh_Finalize(model_t *mod)
#define MAX_CACHED_PICS
max number of 2D pics loaded at once
#define MAX_QPATH
max length of a quake game pathname
#define CACHEPICHASHSIZE
number of hash buckets for accelerating 2D pic name lookups
void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
#define TEXF_FORCENEAREST
#define TEXF_FORCE_RELOAD
struct cachepic_s * chain
command interpreter state - the tokenizing and execution of commands, as well as pointers to which cv...
float width_of_ft2[MAX_FONT_SIZES][256]
char fallbacks[MAX_FONT_FALLBACKS][MAX_QPATH]
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
describes the textures to use on a range of triangles in the model, and mins/maxs (AABB) for culling.
float colorscale
global RGB color multiplier for rendering
qbool sRGB2D
whether 2D rendering is sRGB corrected (based on sRGBcapable2D)
viddef_mode_t mode
currently active video mode
#define u8_getnchar(c, e, n)
viddef_t vid
global video state
#define Mem_Alloc(pool, size)
#define Mem_AllocPool(name, flags, parent)
#define Mem_Realloc(pool, data, size)