From 22aaa2d06e97bfb80582a1567bc4daafd4d4675a Mon Sep 17 00:00:00 2001 From: div0 Date: Wed, 26 Nov 2008 09:41:10 +0000 Subject: [PATCH] vid_pixelheight now is a float git-svn-id: svn://svn.icculus.org/nexuiz/trunk@5105 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/View.qc | 3 ++- data/qcsrc/client/main.qh | 2 +- data/qcsrc/client/waypointsprites.qc | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index 1f64231a0..67153edb8 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -175,7 +175,7 @@ vector GetCurrentFov(float fov) float frustumx, frustumy, fovx, fovy; frustumy = tan(fov * 0.00872664625997164788) * 0.75 * current_viewzoom; - frustumx = frustumy * vid_width / vid_height / cvar("vid_pixelheight"); + frustumx = frustumy * vid_width / vid_height / vid_pixelheight; fovx = atan2(frustumx, 1) / 0.00872664625997164788; fovy = atan2(frustumy, 1) / 0.00872664625997164788; @@ -292,6 +292,7 @@ void CSQC_UpdateView(float w, float h) // Set the console size vars vid_conwidth = cvar("vid_conwidth"); vid_conheight = cvar("vid_conheight"); + vid_pixelheight = cvar("vid_pixelheight"); // fetch this one only once per frame sbar_showbinds = cvar("sbar_showbinds"); diff --git a/data/qcsrc/client/main.qh b/data/qcsrc/client/main.qh index 62d0b2d15..758808ed4 100644 --- a/data/qcsrc/client/main.qh +++ b/data/qcsrc/client/main.qh @@ -139,4 +139,4 @@ float vote_waiting_for_me; float current_zoomfraction; float cs_project_is_b0rked; -float vid_width, vid_height; +float vid_width, vid_height, vid_pixelheight; diff --git a/data/qcsrc/client/waypointsprites.qc b/data/qcsrc/client/waypointsprites.qc index b151c77bc..86997c0be 100644 --- a/data/qcsrc/client/waypointsprites.qc +++ b/data/qcsrc/client/waypointsprites.qc @@ -144,8 +144,8 @@ void Draw_WaypointSprite() float f1, f2; // get the waypoint angle vector - d_x = view_right * (self.origin - view_origin) * cvar("vid_pixelheight") * vid_conwidth / vid_width; - d_y = -view_up * (self.origin - view_origin) * vid_conheight / vid_height; + d_x = view_right * (self.origin - view_origin) * vid_conwidth / vid_width; + d_y = -view_up * (self.origin - view_origin) * vid_conheight / (vid_height * vid_pixelheight); d_z = 0; //d = o - '0.5 0 0' * vid_conwidth - '0 0.5 0' * vid_conheight; -- 2.39.2