X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=r_crosshairs.c;h=4884f1f26b65bcd4ac837436f978d1d496a077f9;hb=70b62f84e5627007e91fba7606cdea4ad470c1ec;hp=316627134f1ea63fabe5bf03c6310ccac017714e;hpb=2e1aa637da83f529908ed8d7aedc657f34624b16;p=xonotic%2Fdarkplaces.git diff --git a/r_crosshairs.c b/r_crosshairs.c index 31662713..4884f1f2 100644 --- a/r_crosshairs.c +++ b/r_crosshairs.c @@ -25,7 +25,7 @@ void R_Crosshairs_Init(void) void R_GetCrosshairColor(float *out) { int i; - qbyte *color; + unsigned char *color; float scale, base; if (cl.viewentity >= 1 && cl.viewentity <= cl.maxclients) { @@ -37,7 +37,7 @@ void R_GetCrosshairColor(float *out) } else i = 15; - color = (qbyte *) &palette_complete[i]; + color = (unsigned char *) &palette_complete[i]; if (crosshair_flashspeed.value >= 0.01f) base = (sin(realtime * crosshair_flashspeed.value * (M_PI*2.0f)) * crosshair_flashrange.value); else @@ -72,7 +72,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), true); + pic = Draw_CachePic(va("gfx/crosshair%i", num), true); if (!pic) return; R_GetCrosshairColor(color); @@ -90,7 +90,7 @@ void R_DrawWorldCrosshair(void) VectorCopy(trace.endpos, spriteorigin); // draw the sprite - 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]); + R_DrawSprite(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, pic->tex, NULL, true, spriteorigin, r_viewright, r_viewup, spritescale, -spritescale, -spritescale, spritescale, color[0], color[1], color[2], color[3]); } void R_Draw2DCrosshair(void) @@ -107,7 +107,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), true); + pic = Draw_CachePic(va("gfx/crosshair%i", num), true); if (pic) { R_GetCrosshairColor(color);