]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
renamed prvm_startupreuseedicttime to prvm_reuseedicts_startuptime
[xonotic/darkplaces.git] / gl_draw.c
index 2724c60d904adcdc40e965a348d7f9cd75e85b16..bea0007525ca0a19ac80f60b5dee258b43775d9a 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -780,13 +780,14 @@ void GL_Draw_Init (void)
 
 void _DrawQ_Setup(void)
 {
+       r_viewport_t viewport;
        if (r_refdef.draw2dstage)
                return;
        r_refdef.draw2dstage = true;
        CHECKGLERROR
-       qglViewport(r_refdef.view.x, vid.height - (r_refdef.view.y + r_refdef.view.height), r_refdef.view.width, r_refdef.view.height);CHECKGLERROR
+       R_Viewport_InitOrtho(&viewport, &identitymatrix, r_refdef.view.x, r_refdef.view.y, r_refdef.view.width, r_refdef.view.height, 0, 0, vid_conwidth.integer, vid_conheight.integer, -10, 100, NULL);
+       R_SetViewport(&viewport);
        GL_ColorMask(r_refdef.view.colormask[0], r_refdef.view.colormask[1], r_refdef.view.colormask[2], 1);
-       GL_SetupView_Mode_Ortho(0, 0, vid_conwidth.integer, vid_conheight.integer, -10, 100);
        qglDepthFunc(GL_LEQUAL);CHECKGLERROR
        qglDisable(GL_POLYGON_OFFSET_FILL);CHECKGLERROR
        GL_CullFace(GL_FRONT); // quake is backwards, this culls back faces
@@ -941,7 +942,7 @@ void DrawQ_Fill(float x, float y, float width, float height, float red, float gr
        R_Mesh_Draw(0, 4, 0, 2, NULL, polygonelements, 0, 0);
 }
 
-// color tag printing
+/// color tag printing
 static const vec4_t string_colors[] =
 {
        // Quake3 colors
@@ -1121,7 +1122,7 @@ float DrawQ_String_Font(float startx, float starty, const char *text, size_t max
                else
                        colorindex = *outcolor;
 
-               DrawQ_GetTextColor(color, colorindex, basered, basegreen, baseblue, basealpha, shadow);
+               DrawQ_GetTextColor(color, colorindex, basered, basegreen, baseblue, basealpha, shadow != 0);
 
                x = startx;
                y = starty;
@@ -1143,7 +1144,7 @@ float DrawQ_String_Font(float startx, float starty, const char *text, size_t max
                                if (ch <= '9' && ch >= '0') // ^[0-9] found
                                {
                                        colorindex = ch - '0';
-                                       DrawQ_GetTextColor(color, colorindex, basered, basegreen, baseblue, basealpha, shadow);
+                                       DrawQ_GetTextColor(color, colorindex, basered, basegreen, baseblue, basealpha, shadow != 0);
                                        continue;
                                }
                                else if (ch == STRING_COLOR_RGB_TAG_CHAR && i+3 < maxlen ) // ^x found
@@ -1171,7 +1172,7 @@ float DrawQ_String_Font(float startx, float starty, const char *text, size_t max
                                                                colorindex = tempcolorindex | 0xf;
                                                                // ...done! now colorindex has rgba codes (1,rrrr,gggg,bbbb,aaaa)
                                                                //Con_Printf("^1colorindex:^7 %x\n", colorindex);
-                                                               DrawQ_GetTextColor(color, colorindex, basered, basegreen, baseblue, basealpha, shadow);
+                                                               DrawQ_GetTextColor(color, colorindex, basered, basegreen, baseblue, basealpha, shadow != 0);
                                                                i+=3;
                                                                continue;
                                                        }
@@ -1380,11 +1381,16 @@ void DrawQ_Line (float width, float x1, float y1, float x2, float y2, float r, f
 
 void DrawQ_SetClipArea(float x, float y, float width, float height)
 {
+       int ix, iy, iw, ih;
        _DrawQ_Setup();
 
        // We have to convert the con coords into real coords
        // OGL uses top to bottom
-       GL_Scissor((int)(0.5 + x * ((float)vid.width / vid_conwidth.integer)), (int)(0.5 + y * ((float) vid.height / vid_conheight.integer)), (int)(width * ((float)vid.width / vid_conwidth.integer)), (int)(height * ((float)vid.height / vid_conheight.integer)));
+       ix = (int)(0.5 + x * ((float)vid.width / vid_conwidth.integer));
+       iy = (int)(0.5 + y * ((float) vid.height / vid_conheight.integer));
+       iw = (int)(width * ((float)vid.width / vid_conwidth.integer));
+       ih = (int)(height * ((float)vid.height / vid_conheight.integer));
+       GL_Scissor(ix, vid.height - iy - ih, iw, ih);
 
        GL_ScissorTest(true);
 }