X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=r_crosshairs.c;h=2b61af1001ad0c62f72f565edb4b4067a2665e97;hb=22442382b975b7dc9fa1541eb5c259664d10d100;hp=4ed1ca6577dec3c12e7bfbd63f25c691982e5743;hpb=dda9525d00cbd81ad257870fbcb60079e11e367f;p=xonotic%2Fdarkplaces.git diff --git a/r_crosshairs.c b/r_crosshairs.c index 4ed1ca65..2b61af10 100644 --- a/r_crosshairs.c +++ b/r_crosshairs.c @@ -62,6 +62,8 @@ void R_DrawWorldCrosshair(void) vec3_t v1, v2, spriteorigin; vec_t spritescale; vec4_t color; + if (r_letterbox.value) + return; if (crosshair_static.integer) return; num = crosshair.integer; @@ -69,7 +71,7 @@ void R_DrawWorldCrosshair(void) return; if (!cl.viewentity || !cl_entities[cl.viewentity].state_current.active) return; - pic = Draw_CachePic(va("gfx/crosshair%i.tga", num)); + pic = Draw_CachePic(va("gfx/crosshair%i.tga", num), true); if (!pic) return; R_GetCrosshairColor(color); @@ -80,12 +82,12 @@ void R_DrawWorldCrosshair(void) // get the forward vector for the gun (not the view) AngleVectors(cl.viewangles, v2, NULL, NULL); - //VectorCopy(r_origin, v1); + //VectorCopy(r_vieworigin, v1); VectorMA(v1, 8192, v2, v2); - spritescale = CL_TraceLine(v1, v2, spriteorigin, NULL, 0, true, NULL) * (8192.0f / 40.0f) * crosshair_size.value; + spritescale = CL_TraceLine(v1, v2, spriteorigin, NULL, true, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_SKY) * (8192.0f / 40.0f) * crosshair_size.value; // draw the sprite - R_DrawSprite(GL_SRC_ALPHA, GL_ONE, pic->tex, true, spriteorigin, vright, vup, spritescale, -spritescale, -spritescale, spritescale, color[0], color[1], color[2], color[3]); + R_DrawSprite(GL_SRC_ALPHA, GL_ONE, pic->tex, true, spriteorigin, r_viewright, r_viewup, spritescale, -spritescale, -spritescale, spritescale, color[0], color[1], color[2], color[3]); } void R_Draw2DCrosshair(void) @@ -93,6 +95,8 @@ void R_Draw2DCrosshair(void) int num; cachepic_t *pic; vec4_t color; + if (r_letterbox.value) + return; if (!crosshair_static.integer) return; num = crosshair.integer; @@ -100,7 +104,7 @@ void R_Draw2DCrosshair(void) return; if (!cl.viewentity || !cl_entities[cl.viewentity].state_current.active) return; - pic = Draw_CachePic(va("gfx/crosshair%i.tga", num)); + pic = Draw_CachePic(va("gfx/crosshair%i.tga", num), true); if (pic) { R_GetCrosshairColor(color);