mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@940 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b9895ca078
commit
31b05a433c
2 changed files with 22 additions and 13 deletions
|
@ -3367,6 +3367,9 @@ extern int getclosestcol(int r, int g, int b);
|
||||||
int crosshair_red = 255;
|
int crosshair_red = 255;
|
||||||
int crosshair_green = 255;
|
int crosshair_green = 255;
|
||||||
int crosshair_blue = 0;
|
int crosshair_blue = 0;
|
||||||
|
static int crosshair_red_default = -1;
|
||||||
|
static int crosshair_green_default = -1;
|
||||||
|
static int crosshair_blue_default = -1;
|
||||||
#define CROSSHAIR_PAL (MAXPALOOKUPS>>1)
|
#define CROSSHAIR_PAL (MAXPALOOKUPS>>1)
|
||||||
|
|
||||||
void SetCrosshairColor(int r, int g, int b)
|
void SetCrosshairColor(int r, int g, int b)
|
||||||
|
@ -3374,17 +3377,19 @@ void SetCrosshairColor(int r, int g, int b)
|
||||||
/* TODO: turn this into something useful */
|
/* TODO: turn this into something useful */
|
||||||
char *ptr = (char *)waloff[CROSSHAIR];
|
char *ptr = (char *)waloff[CROSSHAIR];
|
||||||
int i, ii;
|
int i, ii;
|
||||||
static int crosshair_red_default = -1;
|
static int sum;
|
||||||
static int crosshair_green_default = -1;
|
|
||||||
static int crosshair_blue_default = -1;
|
|
||||||
|
|
||||||
hictinting[CROSSHAIR_PAL].r = crosshair_red = r;
|
if (sum == r+(g<<1)+(b<<2)) return;
|
||||||
hictinting[CROSSHAIR_PAL].g = crosshair_green = g;
|
sum = r+(g<<1)+(b<<2);
|
||||||
hictinting[CROSSHAIR_PAL].b = crosshair_blue = b;
|
crosshair_red = r;
|
||||||
hictinting[CROSSHAIR_PAL].f = 1;
|
crosshair_green = g;
|
||||||
invalidatetile(CROSSHAIR, -1, -1);
|
crosshair_blue = b;
|
||||||
|
|
||||||
if (waloff[CROSSHAIR] == 0) return;
|
if (waloff[CROSSHAIR] == 0)
|
||||||
|
{
|
||||||
|
loadtile(CROSSHAIR);
|
||||||
|
ptr = (char *)waloff[CROSSHAIR];
|
||||||
|
}
|
||||||
|
|
||||||
if (crosshair_red_default == -1)
|
if (crosshair_red_default == -1)
|
||||||
{
|
{
|
||||||
|
@ -3401,7 +3406,6 @@ void SetCrosshairColor(int r, int g, int b)
|
||||||
ptr++;
|
ptr++;
|
||||||
ii--;
|
ii--;
|
||||||
}
|
}
|
||||||
OSD_Printf("brightest color index: %d\n",bri);
|
|
||||||
crosshair_red_default = crosshair_red = curpalette[bri].r;
|
crosshair_red_default = crosshair_red = curpalette[bri].r;
|
||||||
crosshair_green_default = crosshair_green = curpalette[bri].g;
|
crosshair_green_default = crosshair_green = curpalette[bri].g;
|
||||||
crosshair_blue_default = crosshair_blue = curpalette[bri].b;
|
crosshair_blue_default = crosshair_blue = curpalette[bri].b;
|
||||||
|
@ -3419,6 +3423,12 @@ void SetCrosshairColor(int r, int g, int b)
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
tempbuf[i] = i;
|
tempbuf[i] = i;
|
||||||
makepalookup(CROSSHAIR_PAL,tempbuf,crosshair_red>>2, crosshair_green>>2, crosshair_blue>>2,1);
|
makepalookup(CROSSHAIR_PAL,tempbuf,crosshair_red>>2, crosshair_green>>2, crosshair_blue>>2,1);
|
||||||
|
|
||||||
|
hictinting[CROSSHAIR_PAL].r = crosshair_red;
|
||||||
|
hictinting[CROSSHAIR_PAL].g = crosshair_green;
|
||||||
|
hictinting[CROSSHAIR_PAL].b = crosshair_blue;
|
||||||
|
hictinting[CROSSHAIR_PAL].f = 1;
|
||||||
|
invalidatetile(CROSSHAIR, -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void palto(int r,int g,int b,int e)
|
void palto(int r,int g,int b,int e)
|
||||||
|
|
|
@ -502,9 +502,6 @@ void cacheit(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loadtile(CROSSHAIR);
|
|
||||||
SetCrosshairColor(crosshair_red, crosshair_green, crosshair_blue);
|
|
||||||
|
|
||||||
clearbufbyte(gotpic,sizeof(gotpic),0L);
|
clearbufbyte(gotpic,sizeof(gotpic),0L);
|
||||||
|
|
||||||
endtime = getticks();
|
endtime = getticks();
|
||||||
|
@ -562,6 +559,8 @@ void vscrn(void)
|
||||||
|
|
||||||
setview(x1,y1,x2-1,y2-1);
|
setview(x1,y1,x2-1,y2-1);
|
||||||
|
|
||||||
|
SetCrosshairColor(crosshair_red, crosshair_green, crosshair_blue);
|
||||||
|
|
||||||
pub = NUMPAGES;
|
pub = NUMPAGES;
|
||||||
pus = NUMPAGES;
|
pus = NUMPAGES;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue