}
-#define OPTIONS_ITEMS 27
+#define OPTIONS_ITEMS 28
int options_cursor;
case 18:
Cvar_SetValueQuick (&crosshair_size, bound(1, crosshair_size.value + dir, 5));
break;
- case 19: // show framerate
+ case 19: // static crosshair
+ Cvar_SetValueQuick (&crosshair_static, !crosshair_static.integer);
+ break;
+ case 20: // show framerate
Cvar_SetValueQuick (&showfps, !showfps.integer);
break;
- case 20: // always run
+ case 21: // always run
if (cl_forwardspeed.value > 200)
{
Cvar_SetValueQuick (&cl_forwardspeed, 200);
Cvar_SetValueQuick (&cl_backspeed, 400);
}
break;
- case 21: // lookspring
+ case 22: // lookspring
Cvar_SetValueQuick (&lookspring, !lookspring.integer);
break;
- case 22: // lookstrafe
+ case 23: // lookstrafe
Cvar_SetValueQuick (&lookstrafe, !lookstrafe.integer);
break;
- case 23: // mouse speed
+ case 24: // mouse speed
Cvar_SetValueQuick (&sensitivity, bound(1, sensitivity.value + dir * 0.5, 50));
break;
- case 24: // mouse look
+ case 25: // mouse look
Cvar_SetValueQuick (&freelook, !freelook.integer);
break;
- case 25: // invert mouse
+ case 26: // invert mouse
Cvar_SetValueQuick (&m_pitch, -m_pitch.value);
break;
- case 26: // windowed mouse
+ case 27: // windowed mouse
Cvar_SetValueQuick (&vid_mouse, !vid_mouse.integer);
break;
}
M_ItemPrint(16, y, " Sound Volume", snd_initialized);M_DrawSlider(220, y, volume.value);y += 8;
M_Print(16, y, " Crosshair");M_DrawSlider(220, y, crosshair.value / 5);y += 8;
M_Print(16, y, " Crosshair Size");M_DrawSlider(220, y, (crosshair_size.value - 1) / 4);y += 8;
+ M_Print(16, y, " Static Crosshair");M_DrawCheckbox(220, y, crosshair_static.integer);y += 8;
M_Print(16, y, " Show Framerate");M_DrawCheckbox(220, y, showfps.integer);y += 8;
M_Print(16, y, " Always Run");M_DrawCheckbox(220, y, cl_forwardspeed.value > 200);y += 8;
M_Print(16, y, " Lookspring");M_DrawCheckbox(220, y, lookspring.integer);y += 8;
cvar_t crosshair_flashspeed = {CVAR_SAVE, "crosshair_flashspeed", "2"};
cvar_t crosshair_flashrange = {CVAR_SAVE, "crosshair_flashrange", "0.1"};
cvar_t crosshair_size = {CVAR_SAVE, "crosshair_size", "1"};
+cvar_t crosshair_static = {CVAR_SAVE, "crosshair_static", "0"};
// must match NUMCROSSHAIRS in gl_draw.c
#define NUMCROSSHAIRS 5
Cvar_RegisterVariable(&crosshair_flashspeed);
Cvar_RegisterVariable(&crosshair_flashrange);
Cvar_RegisterVariable(&crosshair_size);
+ Cvar_RegisterVariable(&crosshair_static);
R_RegisterModule("R_Crosshair", r_crosshairs_start, r_crosshairs_shutdown, r_crosshairs_newmap);
}
-/*
-void DrawCrosshair(int num)
-{
- int i;
- qbyte *color;
- float scale, base;
- char *picname;
- cachepic_t *pic;
- if (num < 0 || num >= NUMCROSSHAIRS)
- num = 0;
- if (cl.viewentity >= 1 && cl.viewentity <= cl.maxclients)
- {
- i = (cl.scores[cl.viewentity-1].colors & 0xF) << 4;
- if (i >= 208 && i < 224) // blue
- i += 8;
- else if (i < 128 || i >= 224) // 128-224 are backwards ranges (bright to dark, rather than dark to bright)
- i += 15;
- }
- else
- i = 15;
- color = (qbyte *) &d_8to24table[i];
- if (crosshair_flashspeed.value >= 0.01f)
- base = (sin(realtime * crosshair_flashspeed.value * (M_PI*2.0f)) * crosshair_flashrange.value);
- else
- base = 0.0f;
- scale = crosshair_brightness.value * (1.0f / 255.0f);
- picname = va("gfx/crosshair%i.tga", num + 1);
- pic = Draw_CachePic(picname);
- if (pic)
- DrawQ_Pic((vid.conwidth - pic->width * crosshair_size.value) * 0.5f, (vid.conheight - pic->height * crosshair_size.value) * 0.5f, picname, pic->width * crosshair_size.value, pic->height * crosshair_size.value, color[0] * scale + base, color[1] * scale + base, color[2] * scale + base, crosshair_alpha.value, 0);
-}
-*/
-
void R_DrawCrosshairSprite(rtexture_t *texture, vec3_t origin, vec_t scale, float cr, float cg, float cb, float ca)
{
rmeshbufferinfo_t m;
else
base = 0.0f;
scale = crosshair_brightness.value * (1.0f / 255.0f);
- //picname = va("gfx/crosshair%i.tga", num + 1);
- //pic = Draw_CachePic(picname);
- //if (pic)
- // DrawQ_Pic((vid.conwidth - pic->width * crosshair_size.value) * 0.5f, (vid.conheight - pic->height * crosshair_size.value) * 0.5f, picname, pic->width * crosshair_size.value, pic->height * crosshair_size.value, color[0] * scale + base, color[1] * scale + base, color[2] * scale + base, crosshair_alpha.value, 0);
+
+ if (crosshair_static.integer)
+ {
+ char *picname;
+ cachepic_t *pic;
+
+ picname = va("gfx/crosshair%i.tga", num + 1);
+ pic = Draw_CachePic(picname);
+ if (pic)
+ DrawQ_Pic((vid.conwidth - pic->width * crosshair_size.value) * 0.5f, (vid.conheight - pic->height * crosshair_size.value) * 0.5f, picname, pic->width * crosshair_size.value, pic->height * crosshair_size.value, color[0] * scale + base, color[1] * scale + base, color[2] * scale + base, crosshair_alpha.value, 0);
+ }
+ else
{
// trace the shot path up to a certain distance
VectorCopy(cl_entities[cl.viewentity].render.origin, v1);