]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/util.qc
Unify boolean constants
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / util.qc
index 3473bb38c3103558d4e317c37e4f6e0c48aa9dfa..ba5da4fca0b4c25533afe5e30a796443e818f989 100644 (file)
@@ -307,17 +307,17 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
        }
        if(status != 0)
        {
-               printf(_("error receiving update notification: status is %d\n"), status);
+               dprintf("error receiving update notification: status is %d\n", status);
                return;
        }
        if(substring(data, 0, 1) == "<")
        {
-               print(_("error: received HTML instead of an update notification\n"));
+               dprint("error: received HTML instead of an update notification\n");
                return;
        }
        if(strstrofs(data, "\r", 0) != -1)
        {
-               print(_("error: received carriage returns from update notification server\n"));
+               dprint("error: received carriage returns from update notification server\n");
                return;
        }
 
@@ -345,7 +345,6 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                
                switch(substring(argv(i), 0, 1))
                {
-                       #define APPEND_TO_STRING(list,sep,add) ((list) = (((list) != "") ? strcat(list, sep, add) : (add)))
                        case "V":
                        {
                                un_version = s;
@@ -404,7 +403,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                {
                        if(un_compatexpire != "")
                        {
-                               string curdate = strftime(FALSE, "%Y%m%d%H%M%S");
+                               string curdate = strftime(false, "%Y%m%d%H%M%S");
                                if (strcmp(curdate, un_compatexpire) >= 0)
                                        DisableServerBackwardsCompatibility();
                        }
@@ -456,12 +455,12 @@ void updateCheck()
                float n, i;
                float allgood;
                n = tokenize_console(_Nex_ExtResponseSystem_Packs);
-               allgood = TRUE;
+               allgood = true;
                for(i = 0; i+1 < n; i += 2)
                {
                        if(fexists(argv(i+1)))
                                continue;
-                       allgood = FALSE;
+                       allgood = false;
                        if(_Nex_ExtResponseSystem_PacksStep == 1) // first run
                                localcmd("\ncurl --pak \"", argv(i), "\"\n");
                }
@@ -495,11 +494,11 @@ float preMenuInit()
        {
                draw_reset_cropped();
 
-               sz = eX * 0.025 + eY * 0.025 * (draw_scale_x / draw_scale_y);
-               draw_CenterText('0.5 0.5 0' - 1.25 * sz_y * eY, _("Autogenerating mapinfo for newly added maps..."), sz, '1 1 1', 1, 0);
+               sz = eX * 0.025 + eY * 0.025 * (draw_scale.x / draw_scale.y);
+               draw_CenterText('0.5 0.5 0' - 1.25 * sz.y * eY, _("Autogenerating mapinfo for newly added maps..."), sz, '1 1 1', 1, 0);
 
-               boxA = '0.05 0.5 0' + 0.25 * sz_y * eY;
-               boxB = '0.95 0.5 0' + 1.25 * sz_y * eY;
+               boxA = '0.05 0.5 0' + 0.25 * sz.y * eY;
+               boxB = '0.95 0.5 0' + 1.25 * sz.y * eY;
                draw_Fill(boxA, boxB - boxA, '1 1 1', 1);
 
                boxA += sz * 0.1;
@@ -509,9 +508,9 @@ float preMenuInit()
                boxB_x = boxA_x * (1 - MapInfo_progress) + boxB_x * MapInfo_progress;
                draw_Fill(boxA, boxB - boxA, '0 0 1', 1);
 
-               return FALSE;
+               return false;
        }
-       return TRUE;
+       return true;
 }
 
 string campaign_name_previous;
@@ -537,8 +536,8 @@ void preMenuDraw()
        if(_Nex_ExtResponseSystem_UpdateTo != "")
        {
                // TODO rather turn this into a dialog
-               fs = ((1/draw_scale_x) * eX + (1/draw_scale_y) * eY) * 12;
-               line = eY * fs_y;
+               fs = ((1/draw_scale.x) * eX + (1/draw_scale.y) * eY) * 12;
+               line = eY * fs.y;
                string l1, l2;
                l1 = sprintf(_("Update to %s now!"), _Nex_ExtResponseSystem_UpdateTo);
                l2 = "http://www.xonotic.org/";
@@ -549,11 +548,11 @@ void preMenuDraw()
                                draw_TextWidth(l1, 0, fs),
                                draw_TextWidth(l2, 0, fs)
                        );
-               sz_y = 3 * fs_y;
+               sz_y = 3 * fs.y;
 
                draw_alpha = bound(0, sin(time * 0.112 - 0.3) * 10, 1);
-               mid = eX * (0.5 + 0.5 * (1 - sz_x) * cos(time * 0.071))
-                   + eY * (0.5 + 0.5 * (1 - sz_y) * sin(time * 0.071));
+               mid = eX * (0.5 + 0.5 * (1 - sz.x) * cos(time * 0.071))
+                   + eY * (0.5 + 0.5 * (1 - sz.y) * sin(time * 0.071));
 
                draw_Fill(mid - 0.5 * sz, sz, '1 1 0', 1);
                draw_CenterText(mid - 1 * line, l1, fs, '1 0 0', 1, 0);