]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_screen.c
fix segfault with long aliases
[xonotic/darkplaces.git] / cl_screen.c
index d65701b652ef03e1f92ae0671f31dd5e863c3a75..48fb04131bbb2abb50460a98e6716c79b1129555 100644 (file)
@@ -118,6 +118,9 @@ void SCR_DrawCenterString (void)
                if(sb_showscores) // make TAB hide the finale message (sb_showscores overrides finale in sbar.c)
                        return;
 
+       if(scr_centertime.value <= 0 && !cl.intermission)
+               return;
+
 // the finale prints the characters one at a time, except if printspeed is an absurdly high value
        if (cl.intermission && scr_printspeed.value > 0 && scr_printspeed.value < 1000000)
                remaining = (int)(scr_printspeed.value * (cl.time - scr_centertime_start));
@@ -334,7 +337,7 @@ void SCR_DrawTurtle (void)
        if (count < 3)
                return;
 
-       DrawQ_Pic (0, 0, Draw_CachePic("gfx/turtle", true), 0, 0, 1, 1, 1, 1, 0);
+       DrawQ_Pic (0, 0, Draw_CachePic ("gfx/turtle"), 0, 0, 1, 1, 1, 1, 0);
 }
 
 /*
@@ -351,7 +354,7 @@ void SCR_DrawNet (void)
        if (cls.demoplayback)
                return;
 
-       DrawQ_Pic (64, 0, Draw_CachePic("gfx/net", true), 0, 0, 1, 1, 1, 1, 0);
+       DrawQ_Pic (64, 0, Draw_CachePic ("gfx/net"), 0, 0, 1, 1, 1, 1, 0);
 }
 
 /*
@@ -372,7 +375,7 @@ void SCR_DrawPause (void)
        if (!cl.paused)
                return;
 
-       pic = Draw_CachePic ("gfx/pause", true);
+       pic = Draw_CachePic ("gfx/pause");
        DrawQ_Pic ((vid_conwidth.integer - pic->width)/2, (vid_conheight.integer - pic->height)/2, pic, 0, 0, 1, 1, 1, 1, 0);
 }
 
@@ -389,7 +392,7 @@ void SCR_DrawBrand (void)
        if (!scr_showbrand.value)
                return;
 
-       pic = Draw_CachePic ("gfx/brand", true);
+       pic = Draw_CachePic ("gfx/brand");
 
        switch ((int)scr_showbrand.value)
        {
@@ -1808,7 +1811,7 @@ void SHOWLMP_drawall(void)
        int i;
        for (i = 0;i < cl.num_showlmps;i++)
                if (cl.showlmps[i].isactive)
-                       DrawQ_Pic(cl.showlmps[i].x, cl.showlmps[i].y, Draw_CachePic(cl.showlmps[i].pic, true), 0, 0, 1, 1, 1, 1, 0);
+                       DrawQ_Pic(cl.showlmps[i].x, cl.showlmps[i].y, Draw_CachePic (cl.showlmps[i].pic), 0, 0, 1, 1, 1, 1, 0);
 }
 
 /*
@@ -2051,7 +2054,7 @@ void SCR_UpdateLoadingScreen (qboolean clear)
        R_Mesh_Start();
        R_Mesh_Matrix(&identitymatrix);
        // draw the loading plaque
-       pic = Draw_CachePic("gfx/loading", true);
+       pic = Draw_CachePic ("gfx/loading");
        x = (vid_conwidth.integer - pic->width)/2;
        y = (vid_conheight.integer - pic->height)/2;
        GL_Color(1,1,1,1);
@@ -2107,6 +2110,16 @@ void CL_UpdateScreen(void)
        double rendertime1;
        float conwidth, conheight;
 
+       // play a bit with the palette
+       palette_rgb_pantscolormap[15][0] = 128 + 127 * sin(cl.time / exp(1) + 0*M_PI/3);
+       palette_rgb_pantscolormap[15][1] = 128 + 127 * sin(cl.time / exp(1) + 2*M_PI/3);
+       palette_rgb_pantscolormap[15][2] = 128 + 127 * sin(cl.time / exp(1) + 4*M_PI/3);
+       palette_rgb_shirtcolormap[15][0] = 128 + 127 * sin(cl.time /  M_PI  + 5*M_PI/3);
+       palette_rgb_shirtcolormap[15][1] = 128 + 127 * sin(cl.time /  M_PI  + 3*M_PI/3);
+       palette_rgb_shirtcolormap[15][2] = 128 + 127 * sin(cl.time /  M_PI  + 1*M_PI/3);
+       memcpy(palette_rgb_pantsscoreboard[15], palette_rgb_pantscolormap[15], sizeof(*palette_rgb_pantscolormap));
+       memcpy(palette_rgb_shirtscoreboard[15], palette_rgb_shirtcolormap[15], sizeof(*palette_rgb_shirtcolormap));
+
        if (vid_hidden || !scr_refresh.integer)
                return;