mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 20:20:43 +00:00
alphageek's crosshair patch modified so it's crosshair 3 (need to port this
to the sw renderer's:/)
This commit is contained in:
parent
218d9382d6
commit
8a2fbf43a7
1 changed files with 39 additions and 18 deletions
|
@ -82,7 +82,7 @@ static int cs_texture; // crosshair texturea
|
||||||
|
|
||||||
static byte color_0_8[4] = { 204, 204, 204, 255 };
|
static byte color_0_8[4] = { 204, 204, 204, 255 };
|
||||||
|
|
||||||
static byte cs_data[64] = {
|
static byte cs_data[2*64] = {
|
||||||
0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff,
|
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, 0xfe, 0xff, 0xff, 0xff, 0xff,
|
0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff,
|
||||||
|
@ -90,7 +90,16 @@ static byte cs_data[64] = {
|
||||||
0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff,
|
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, 0xfe, 0xff, 0xff, 0xff, 0xff,
|
0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff,
|
||||||
0xff, 0xff, 0xff, 0xff, 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 {
|
typedef struct {
|
||||||
|
@ -342,7 +351,7 @@ Draw_Init (void)
|
||||||
// now turn them into textures
|
// now turn them into textures
|
||||||
char_texture = GL_LoadTexture ("charset", 128, 128, draw_chars, false,
|
char_texture = GL_LoadTexture ("charset", 128, 128, draw_chars, false,
|
||||||
true, 1);
|
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_MIN_FILTER, GL_NEAREST);
|
||||||
qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
qfglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
@ -500,6 +509,7 @@ Draw_Crosshair (void)
|
||||||
cl_crossy->int_val, '+');
|
cl_crossy->int_val, '+');
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
case 3:
|
||||||
x = scr_vrect.x + scr_vrect.width / 2 - 3 + cl_crossx->int_val;
|
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;
|
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);
|
qfglBindTexture (GL_TEXTURE_2D, cs_texture);
|
||||||
|
|
||||||
qfglBegin (GL_QUADS);
|
qfglBegin (GL_QUADS);
|
||||||
|
if (crosshair->int_val == 2) {
|
||||||
qfglTexCoord2f (0, 0);
|
qfglTexCoord2f (0, 0);
|
||||||
qfglVertex2f (x - 4, y - 4);
|
qfglVertex2f (x - 4, y - 4);
|
||||||
qfglTexCoord2f (1, 0);
|
qfglTexCoord2f (1, 0);
|
||||||
qfglVertex2f (x + 12, y - 4);
|
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);
|
qfglTexCoord2f (1, 1);
|
||||||
qfglVertex2f (x + 12, y + 12);
|
qfglVertex2f (x + 12, y + 12);
|
||||||
qfglTexCoord2f (0, 1);
|
qfglTexCoord2f (0, 1);
|
||||||
qfglVertex2f (x - 4, y + 12);
|
qfglVertex2f (x - 4, y + 12);
|
||||||
|
}
|
||||||
qfglEnd ();
|
qfglEnd ();
|
||||||
qfglColor3ubv (color_white);
|
qfglColor3ubv (color_white);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue