]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/warpzone/client.qc
Shownames: calculate distance only when really needed to avoid wasting a vlen call...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / warpzone / client.qc
index 26304b4f39a53e6e937829da65084adb0f648781..95c78e3898a8fa7f86ed416a2a3bb14ea004464d 100644 (file)
@@ -275,11 +275,13 @@ void WarpZone_FixView()
        setproperty(VF_ORIGIN, org);
        setproperty(VF_ANGLES, ang);
 
+       vector width = '1 0 0' * cvar("vid_conwidth");
+       vector height = '0 1 0' * cvar("vid_conheight");
        nearclip = '0 0 1' * (cvar("r_nearclip") * 1.125);
        corner0 = cs_unproject('0 0 0' + nearclip);
-       corner1 = cs_unproject('1 0 0' * cvar("vid_conwidth") + nearclip);
-       corner2 = cs_unproject('0 1 0' * cvar("vid_conheight") + nearclip);
-       corner3 = cs_unproject('1 0 0' * cvar("vid_conwidth") + '0 1 0' * cvar("vid_conheight") + nearclip);
+       corner1 = cs_unproject(width + nearclip);
+       corner2 = cs_unproject(height + nearclip);
+       corner3 = cs_unproject(width + height + nearclip);
        o = WarpZone_FixNearClip(org, corner0, corner1, corner2, corner3);
        if(o != '0 0 0')
                setproperty(VF_ORIGIN, org + o);