From: Samual Date: Tue, 15 Feb 2011 20:50:29 +0000 (-0500) Subject: Fix the calculation of the edgedistance for when an edgeoffset is used. X-Git-Tag: xonotic-v0.5.0~148^2~48^2~2 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=55ad82a2d32288bde13846ef39ef28cc83adf606;hp=0e7468efbf995788333f2353884377a70449ef43;p=xonotic%2Fxonotic-data.pk3dir.git Fix the calculation of the edgedistance for when an edgeoffset is used. --- diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index 6a89f3289..38390ff2e 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -258,10 +258,10 @@ void Draw_WaypointSprite() spriteimage = strcat("models/sprites/", spriteimage, "_frame", ftos(mod(floor((max(0, time - self.spawntime)) * 2), t))); float edgedistance_min, crosshairdistance; - edgedistance_min = min4(o_y, // todo: FIGURE THIS SHIT OUT - o_x, - vid_conwidth - o_x, - vid_conheight - o_y); + edgedistance_min = min4((o_y - (vid_conheight * waypointsprite_edgeoffset_left)), + (o_x - (vid_conwidth * waypointsprite_edgeoffset_top)), + (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, + (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y); crosshairdistance = sqrt( pow(o_x - vid_conwidth/2, 2) + pow(o_y - vid_conheight/2, 2) );