]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_screen.c
changed scr_screenshot_jpeg default to 1 (note this does not affect any existing...
[xonotic/darkplaces.git] / cl_screen.c
index 34a3ee340201390e12b9dbf75475040869a5d799..4629e4923e87b454976a7e769e9cd07b2c26d36f 100644 (file)
@@ -14,11 +14,12 @@ cvar_t scr_centertime = {0, "scr_centertime","2"};
 cvar_t scr_showram = {CVAR_SAVE, "showram","1"};
 cvar_t scr_showturtle = {CVAR_SAVE, "showturtle","0"};
 cvar_t scr_showpause = {CVAR_SAVE, "showpause","1"};
+cvar_t scr_showbrand = {0, "showbrand","0"};
 cvar_t scr_printspeed = {0, "scr_printspeed","8"};
 cvar_t vid_conwidth = {CVAR_SAVE, "vid_conwidth", "640"};
 cvar_t vid_conheight = {CVAR_SAVE, "vid_conheight", "480"};
 cvar_t vid_pixelaspect = {CVAR_SAVE, "vid_pixelaspect", "1"};
-cvar_t scr_screenshot_jpeg = {CVAR_SAVE, "scr_screenshot_jpeg","0"};
+cvar_t scr_screenshot_jpeg = {CVAR_SAVE, "scr_screenshot_jpeg","1"};
 cvar_t scr_screenshot_jpeg_quality = {CVAR_SAVE, "scr_screenshot_jpeg_quality","0.9"};
 cvar_t scr_screenshot_gamma = {CVAR_SAVE, "scr_screenshot_gamma","2.2"};
 cvar_t scr_screenshot_name = {0, "scr_screenshot_name","dp"};
@@ -199,6 +200,7 @@ void SCR_DrawCenterString (void)
        int             l;
        int             x, y;
        int             remaining;
+       int             color;
 
 // the finale prints the characters one at a time
        if (cl.intermission)
@@ -214,6 +216,7 @@ void SCR_DrawCenterString (void)
        else
                y = 48;
 
+       color = -1;
        do
        {
        // scan the width of the line
@@ -225,7 +228,7 @@ void SCR_DrawCenterString (void)
                {
                        if (remaining < l)
                                l = remaining;
-                       DrawQ_String(x, y, start, l, 8, 8, 1, 1, 1, 1, 0);
+                       DrawQ_ColoredString(x, y, start, l, 8, 8, 1, 1, 1, 1, 0, &color);
                        remaining -= l;
                        if (remaining <= 0)
                                return;
@@ -328,9 +331,61 @@ void SCR_DrawPause (void)
        DrawQ_Pic ((vid_conwidth.integer - pic->width)/2, (vid_conheight.integer - pic->height)/2, "gfx/pause", 0, 0, 1, 1, 1, 1, 0);
 }
 
+/*
+==============
+SCR_DrawBrand
+==============
+*/
+void SCR_DrawBrand (void)
+{
+       cachepic_t      *pic;
+       float           x, y;
+
+       if (!scr_showbrand.value)
+               return;
 
+       pic = Draw_CachePic ("gfx/brand", true);
 
+       switch ((int)scr_showbrand.value)
+       {
+       case 1: // bottom left
+               x = 0;
+               y = vid_conheight.integer - pic->height;
+               break;
+       case 2: // bottom centre
+               x = (vid_conwidth.integer - pic->width) / 2;
+               y = vid_conheight.integer - pic->height;
+               break;
+       case 3: // bottom right
+               x = vid_conwidth.integer - pic->width;
+               y = vid_conheight.integer - pic->height;
+               break;
+       case 4: // centre right
+               x = vid_conwidth.integer - pic->width;
+               y = (vid_conheight.integer - pic->height) / 2;
+               break;
+       case 5: // top right
+               x = vid_conwidth.integer - pic->width;
+               y = 0;
+               break;
+       case 6: // top centre
+               x = (vid_conwidth.integer - pic->width) / 2;
+               y = 0;
+               break;
+       case 7: // top left
+               x = 0;
+               y = 0;
+               break;
+       case 8: // centre left
+               x = 0;
+               y = (vid_conheight.integer - pic->height) / 2;
+               break;
+       default:
+               return;
+       }
 
+       DrawQ_Pic (x, y, "gfx/brand", 0, 0, 1, 1, 1, 1, 0);
+}
 
 //=============================================================================
 
@@ -567,6 +622,7 @@ void CL_Screen_Init(void)
        Cvar_RegisterVariable (&scr_showram);
        Cvar_RegisterVariable (&scr_showturtle);
        Cvar_RegisterVariable (&scr_showpause);
+       Cvar_RegisterVariable (&scr_showbrand);
        Cvar_RegisterVariable (&scr_centertime);
        Cvar_RegisterVariable (&scr_printspeed);
        Cvar_RegisterVariable (&vid_conwidth);
@@ -1087,7 +1143,7 @@ void SCR_CaptureVideo_SoundFrame(qbyte *bufstereo16le, size_t length, int rate)
        if (!cl_capturevideo_soundfile)
                return;
        cl_capturevideo_soundrate = rate;
-       if (FS_Write (cl_capturevideo_soundfile, bufstereo16le, 4 * length) < 4 * length)
+       if (FS_Write (cl_capturevideo_soundfile, bufstereo16le, 4 * length) < (fs_offset_t)(4 * length))
        {
                Cvar_SetValueQuick(&cl_capturevideo, 0);
                Con_Printf("video sound saving failed on frame %i, out of disk space? stopping video capture.\n", cl_capturevideo_frame);
@@ -1408,6 +1464,8 @@ void CL_UpdateScreen(void)
 
        SCR_DrawConsole();
 
+       SCR_DrawBrand();
+
        SCR_UpdateScreen();
 }