diff --git a/libs/video/renderer/gl/gl_draw.c b/libs/video/renderer/gl/gl_draw.c index 9c3d04a2a..79976ad6b 100644 --- a/libs/video/renderer/gl/gl_draw.c +++ b/libs/video/renderer/gl/gl_draw.c @@ -82,15 +82,24 @@ static int cs_texture; // crosshair texturea static byte color_0_8[4] = { 204, 204, 204, 255 }; -static byte cs_data[64] = { - 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, - 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, - 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +static byte cs_data[2*64] = { + 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, + 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + + 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, + 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, + 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; typedef struct { @@ -342,7 +351,7 @@ Draw_Init (void) // now turn them into textures char_texture = GL_LoadTexture ("charset", 128, 128, draw_chars, false, true, 1); - cs_texture = GL_LoadTexture ("crosshair", 8, 8, cs_data, false, true, 1); + cs_texture = GL_LoadTexture ("crosshair", 8, 16, cs_data, false, true, 1); qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -500,6 +509,7 @@ Draw_Crosshair (void) cl_crossy->int_val, '+'); break; case 2: + case 3: x = scr_vrect.x + scr_vrect.width / 2 - 3 + cl_crossx->int_val; y = scr_vrect.y + scr_vrect.height / 2 - 3 + cl_crossy->int_val; @@ -508,14 +518,25 @@ Draw_Crosshair (void) qfglBindTexture (GL_TEXTURE_2D, cs_texture); qfglBegin (GL_QUADS); - qfglTexCoord2f (0, 0); - qfglVertex2f (x - 4, y - 4); - qfglTexCoord2f (1, 0); - qfglVertex2f (x + 12, y - 4); - qfglTexCoord2f (1, 1); - qfglVertex2f (x + 12, y + 12); - qfglTexCoord2f (0, 1); - qfglVertex2f (x - 4, y + 12); + if (crosshair->int_val == 2) { + qfglTexCoord2f (0, 0); + qfglVertex2f (x - 4, y - 4); + qfglTexCoord2f (1, 0); + qfglVertex2f (x + 12, y - 4); + qfglTexCoord2f (1, 0.5); + qfglVertex2f (x + 12, y + 12); + qfglTexCoord2f (0, 0.5); + qfglVertex2f (x - 4, y + 12); + } else { + qfglTexCoord2f (0, 0.5); + qfglVertex2f (x - 4, y - 4); + qfglTexCoord2f (1, 0.5); + qfglVertex2f (x + 12, y - 4); + qfglTexCoord2f (1, 1); + qfglVertex2f (x + 12, y + 12); + qfglTexCoord2f (0, 1); + qfglVertex2f (x - 4, y + 12); + } qfglEnd (); qfglColor3ubv (color_white); break;