+void R_DrawWorldCrosshair(void)
+{
+ int num;
+ cachepic_t *pic;
+ vec3_t v1, v2, spriteorigin;
+ vec_t spritescale;
+ vec4_t color;
+ if (crosshair_static.integer)
+ return;
+ num = crosshair.integer;
+ if (num < 1 || num > NUMCROSSHAIRS || cl.intermission)
+ return;
+ if (!cl.viewentity || !cl_entities[cl.viewentity].state_current.active)
+ return;
+ pic = Draw_CachePic(va("gfx/crosshair%i.tga", num + 1));
+ if (!pic)
+ return;
+ R_GetCrosshairColor(color);
+
+ // trace the shot path up to a certain distance
+ VectorCopy(cl_entities[cl.viewentity].render.origin, v1);
+ v1[2] += 16; // HACK: this depends on the QC
+
+ // get the forward vector for the gun (not the view)
+ AngleVectors(cl.viewangles, v2, NULL, NULL);
+ //VectorCopy(r_origin, v1);
+ VectorMA(v1, 8192, v2, v2);
+ spritescale = CL_TraceLine(v1, v2, spriteorigin, NULL, 0, true) * (8192.0f / 40.0f) * crosshair_size.value;
+
+ // draw the sprite
+ R_DrawCrosshairSprite(pic->tex, spriteorigin, spritescale, color[0], color[1], color[2], color[3]);
+}
+
+void R_Draw2DCrosshair(void)
+{
+ int num;
+ cachepic_t *pic;
+ vec4_t color;
+ if (!crosshair_static.integer)
+ return;
+ num = crosshair.integer;
+ if (num < 1 || num > NUMCROSSHAIRS || cl.intermission)
+ return;
+ R_GetCrosshairColor(color);
+ pic = Draw_CachePic(va("gfx/crosshair%i.tga", num + 1));
+ if (pic)
+ DrawQ_Pic((vid.conwidth - pic->width * crosshair_size.value) * 0.5f, (vid.conheight - pic->height * crosshair_size.value) * 0.5f, pic->name, pic->width * crosshair_size.value, pic->height * crosshair_size.value, color[0], color[1], color[2], color[3], 0);
+}
+
+
+
+