Crosshairs should be working fine now, apart from the text-based ones at least, which arn't implemented

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@820 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-23 17:42:06 +00:00
parent 55d941cb32
commit adbd57f02c
1 changed files with 6 additions and 5 deletions

View File

@ -74,7 +74,6 @@ int cs_texture; // crosshair texture
extern int detailtexture;
static unsigned cs_data[16*16];
int cachedcrosshair;
typedef struct
{
@ -914,7 +913,7 @@ TRACE(("dbg: GLDraw_ReInit: Allocating upload buffers\n"));
}
cs_texture = texture_extension_number++;
cachedcrosshair=0;
crosshair.modified=true;
crosshairimage.modified = true;
GL_SetupSceneProcessingTextures();
@ -1259,7 +1258,7 @@ void GLDraw_Crosshair(void)
float x1, x2, y1, y2;
float size;
if (crosshair.value == 1)
if (crosshair.value == 1 && !*crosshairimage.string)
{
for (sc = 0; sc < cl.splitclients; sc++)
{
@ -1288,11 +1287,14 @@ void GLDraw_Crosshair(void)
{
GL_Bind (cs_texture);
if (cachedcrosshair != crosshair.value || crosshair.value >= FIRSTANIMATEDCROSHAIR)
if (crosshair.modified || crosshaircolor.modified || crosshair.value >= FIRSTANIMATEDCROSHAIR)
{
int c = d_8to24rgbtable[(qbyte) crosshaircolor.value];
int c2 = d_8to24rgbtable[(qbyte) crosshaircolor.value];
crosshair.modified = false;
crosshaircolor.modified = false;
#define Pix(x,y,c) { \
if (y+8<0)c=0; \
if (y+8>=16)c=0; \
@ -1310,7 +1312,6 @@ void GLDraw_Crosshair(void)
GL_Upload32(NULL, cs_data, 16, 16, 0, true);
#undef Pix
cachedcrosshair = crosshair.value;
}
if (crosshairsize.value <= 16)
{