R_RegisterModule("GL_Draw", gl_draw_start, gl_draw_shutdown, gl_draw_newmap, NULL, NULL);
}
-static void _DrawQ_Setup(void) // see R_ResetViewRendering2D
+void DrawQ_Start(void)
{
- if (r_refdef.draw2dstage == 1)
- return;
- DrawQ_FlushUI();
r_refdef.draw2dstage = 1;
R_ResetViewRendering2D_Common(0, NULL, NULL, 0, 0, vid.width, vid.height, vid_conwidth.integer, vid_conheight.integer);
}
dp_model_t *mod = CL_Mesh_UI();
msurface_t *surf;
int e0, e1, e2, e3;
- _DrawQ_Setup();
if (!pic)
pic = Draw_CachePic("white");
if (width == 0)
dp_model_t *mod = CL_Mesh_UI();
msurface_t *surf;
int e0, e1, e2, e3;
- _DrawQ_Setup();
if (!pic)
pic = Draw_CachePic("white");
if (width == 0)
tw = Draw_GetPicWidth(fnt->pic);
th = Draw_GetPicHeight(fnt->pic);
- _DrawQ_Setup();
-
if (!h) h = w;
if (!h) {
h = w = 1;
dp_model_t *mod = CL_Mesh_UI();
msurface_t *surf;
int e0, e1, e2, e3;
- _DrawQ_Setup();
if (!pic)
pic = Draw_CachePic("white");
if (width == 0)
msurface_t *surf;
int e0, e1, e2, e3;
float offsetx, offsety;
- _DrawQ_Setup();
// width is measured in real pixels
if (fabs(x2 - x1) > fabs(y2 - y1))
{
offsetx = 0;
- offsety = width * vid_conheight.value / vid.height;
+ offsety = 0.5f * width * vid_conheight.value / vid.height;
}
else
{
- offsetx = width * vid_conwidth.value / vid.width;
+ offsetx = 0.5f * width * vid_conwidth.value / vid.width;
offsety = 0;
}
surf = Mod_Mesh_AddSurface(mod, Mod_Mesh_GetTexture(mod, "white", 0, 0, MATERIALFLAG_VERTEXCOLOR), true);
void DrawQ_SetClipArea(float x, float y, float width, float height)
{
int ix, iy, iw, ih;
- _DrawQ_Setup();
DrawQ_FlushUI();
// We have to convert the con coords into real coords
void DrawQ_ResetClipArea(void)
{
DrawQ_FlushUI();
- _DrawQ_Setup();
GL_ScissorTest(false);
}