diff --git a/polymer/build/src/polymost.c b/polymer/build/src/polymost.c index 583487db5..39079ca08 100644 --- a/polymer/build/src/polymost.c +++ b/polymer/build/src/polymost.c @@ -2005,6 +2005,7 @@ void drawpoly(double *dpx, double *dpy, int n, int method) // tinting happens only to hightile textures, and only if the texture we're // rendering isn't for the same palette as what we asked for if (!(hictinting[globalpal].f&4)) + { if (pth && (pth->flags & 2)) { if (pth->palnum != globalpal) @@ -2021,6 +2022,14 @@ void drawpoly(double *dpx, double *dpy, int n, int method) pc[2] *= (float)hictinting[MAXPALOOKUPS-1].b / 255.0; } } + // hack: this is for drawing the 8-bit crosshair recolored in polymost + else if (globalpal == (MAXPALOOKUPS>>1)) + { + pc[0] *= (float)hictinting[globalpal].r / 255.0; + pc[1] *= (float)hictinting[globalpal].g / 255.0; + pc[2] *= (float)hictinting[globalpal].b / 255.0; + } + } bglColor4f(pc[0],pc[1],pc[2],pc[3]); } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 3d9403c68..8359b0210 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3368,6 +3368,7 @@ static void drawoverheadmap(int cposx, int cposy, int czoom, short cang) extern int getclosestcol(int r, int g, int b); palette_t crosshair_colors = { 255, 255, 255, 0 }; palette_t default_crosshair_colors = { 0, 0, 0, 0 }; +int crosshair_sum; void GetCrosshairColor(void) { @@ -3408,10 +3409,9 @@ void SetCrosshairColor(int r, int g, int b) { char *ptr = (char *)waloff[CROSSHAIR]; int i, ii; - static int sum; - if (default_crosshair_colors.f == 0 || sum == r+(g<<1)+(b<<2)) return; - sum = r+(g<<1)+(b<<2); + if (default_crosshair_colors.f == 0 || crosshair_sum == r+(g<<1)+(b<<2)) return; + crosshair_sum = r+(g<<1)+(b<<2); crosshair_colors.r = r; crosshair_colors.g = g; crosshair_colors.b = b; @@ -3422,7 +3422,10 @@ void SetCrosshairColor(int r, int g, int b) ptr = (char *)waloff[CROSSHAIR]; } - i = getclosestcol(crosshair_colors.r>>2, crosshair_colors.g>>2, crosshair_colors.b>>2); + if (getrendermode() < 3) + i = getclosestcol(crosshair_colors.r>>2, crosshair_colors.g>>2, crosshair_colors.b>>2); + else i = getclosestcol(63, 63, 63); // use white in GL so we can tint it to the right color + ii = tilesizx[CROSSHAIR]*tilesizy[CROSSHAIR]; while (ii > 0) { diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 16173fd8c..68d2f2f1c 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -874,6 +874,7 @@ static int osdcmd_give(const osdfuncparm_t *parm) void onvideomodechange(int newmode) { char *pal; + extern int crosshair_sum; if (newmode) { @@ -895,6 +896,7 @@ void onvideomodechange(int newmode) setbrightness(ud.brightness>>2, pal, 0); restorepalette = 1; + crosshair_sum = 0; } static int osdcmd_usemousejoy(const osdfuncparm_t *parm)