]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sbar.c
fix several issues with PRVM_64, mostly cleaning up (int) casts
[xonotic/darkplaces.git] / sbar.c
diff --git a/sbar.c b/sbar.c
index 43a1b93d45e906c52813e924fb5a0252fb69116a..7f75a5d30d9146decf5c365e0972f0ff07bfee50 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 // sbar.c -- status bar code
 
 #include "quakedef.h"
-#include "time.h"
+#include <time.h>
 #include "cl_collision.h"
 #include "csprogs.h"
 
@@ -1211,14 +1211,18 @@ void Sbar_ShowFPS(void)
        }
        if (showtex.integer)
        {
+               vec3_t org;
                vec3_t dest;
+               vec3_t temp;
                trace_t trace;
 
-               VectorMA(r_refdef.view.origin, 65536, r_refdef.view.forward, dest);
+               Matrix4x4_OriginFromMatrix(&r_refdef.view.matrix, org);
+               VectorSet(temp, 65536, 0, 0);
+               Matrix4x4_Transform(&r_refdef.view.matrix, temp, dest);
                trace.hittexture = NULL; // to make sure
                // TODO change this trace to be stopped by anything "visible" (i.e. with a drawsurface), but not stuff like weapclip
                // probably needs adding a new SUPERCONTENTS type
-               trace = CL_TraceLine(r_refdef.view.origin, dest, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID, true, false, NULL, true, true);
+               trace = CL_TraceLine(org, dest, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID, true, false, NULL, true, true);
                if(trace.hittexture)
                        strlcpy(texstring, trace.hittexture->name, sizeof(texstring));
                else