]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Make use of CACHEPICFLAG_FAILONMISSING flag for conback if missing content
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 16 May 2020 20:12:43 +0000 (20:12 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 16 May 2020 20:12:43 +0000 (20:12 +0000)
This makes the console readable if game content is missing, by rendering
solid black, just like before.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12529 d7cf8633-e32d-0410-b094-e92efae38249

console.c

index a2f850c0b0877a76f94b55b86d25b8353f93bbb8..5f14b83f1f7aed5dc5cadec72c48361fabc8ffcc 100644 (file)
--- a/console.c
+++ b/console.c
@@ -1956,6 +1956,7 @@ void Con_DrawConsole (int lines)
        int mask_must = 0;
        int mask_mustnot = (developer.integer>0) ? 0 : CON_MASK_DEVELOPER;
        cachepic_t *conbackpic;
+       unsigned int conbackflags;
 
        if (lines <= 0)
                return;
@@ -1975,7 +1976,10 @@ void Con_DrawConsole (int lines)
        {
                sx = scr_conscroll_x.value;
                sy = scr_conscroll_y.value;
-               conbackpic = scr_conbrightness.value >= 0.01f ? Draw_CachePic_Flags("gfx/conback", (sx != 0 || sy != 0) ? CACHEPICFLAG_NOCLAMP : 0) : NULL;
+               conbackflags = CACHEPICFLAG_FAILONMISSING; // So console is readable when game content is missing
+               if (sx != 0 || sy != 0)
+                       conbackflags &= CACHEPICFLAG_NOCLAMP;
+               conbackpic = scr_conbrightness.value >= 0.01f ? Draw_CachePic_Flags("gfx/conback", conbackflags) : NULL;
                sx *= realtime; sy *= realtime;
                sx -= floor(sx); sy -= floor(sy);
                if (Draw_IsPicLoaded(conbackpic))