alphageek's crosshair patch modified so it's crosshair 3 (need to port this

to the sw renderer's:/)
This commit is contained in:
Bill Currie 2003-01-03 03:36:45 +00:00
parent 218d9382d6
commit 8a2fbf43a7

View file

@ -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;