From 56375ef6626c4bdf8ba8c6e287c5250581882c1f Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 8 Oct 2008 18:49:51 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1093 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/include/polymost.h | 2 +- polymer/build/src/polymost.c | 2 +- polymer/build/src/winlayer.c | 3 ++- polymer/eduke32/source/duke3d.h | 2 +- polymer/eduke32/source/game.c | 26 +++++++++++++++++--------- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/polymer/build/include/polymost.h b/polymer/build/include/polymost.h index 03629bd2a..30e858bba 100644 --- a/polymer/build/include/polymost.h +++ b/polymer/build/include/polymost.h @@ -46,6 +46,6 @@ extern float shadescale; extern int globalnoeffect; extern int drawingskybox; -#define HICEFFECTMASK (1|2|4) +#define HICEFFECTMASK (1|2|4|8) #endif // !_polymost_h_ diff --git a/polymer/build/src/polymost.c b/polymer/build/src/polymost.c index f7a18dc11..b1b9b8a4f 100644 --- a/polymer/build/src/polymost.c +++ b/polymer/build/src/polymost.c @@ -2023,7 +2023,7 @@ void drawpoly(double *dpx, double *dpy, int n, int method) } } // hack: this is for drawing the 8-bit crosshair recolored in polymost - else if (hictinting[globalpal].f & 16) + else if (hictinting[globalpal].f & 8) { pc[0] *= (float)hictinting[globalpal].r / 255.0; pc[1] *= (float)hictinting[globalpal].g / 255.0; diff --git a/polymer/build/src/winlayer.c b/polymer/build/src/winlayer.c index 3147062d2..2d3908dc8 100644 --- a/polymer/build/src/winlayer.c +++ b/polymer/build/src/winlayer.c @@ -933,7 +933,8 @@ DWORD WINAPI ProcessMouse() } } } - } while (1); + } + while (1); } } return 0; diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index d4108fd11..6fc0c069b 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -76,7 +76,7 @@ extern int g_ScriptVersion, g_Shareware, g_GameType; #define AUTO_AIM_ANGLE 48 #define RECSYNCBUFSIZ 2520 //2520 is the (LCM of 1-8)*3 -#define MOVEFIFOSIZ 1024 +#define MOVEFIFOSIZ 256 #define FOURSLEIGHT (1<<8) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index e18aacd89..54fb2543a 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -232,12 +232,12 @@ static inline int sbarxr(int x) return (((320l<<16) - scale(320l<<16,ud.statusbarscale,100)) >> 1) + scale(x<<16,ud.statusbarscale,100); } -inline int sbary(int y) +static inline int sbary(int y) { return ((200l<<16) - scale(200l<<16,ud.statusbarscale,100) + scale(y<<16,ud.statusbarscale,100)); } -inline int sbarsc(int sc) +static inline int sbarsc(int sc) { return scale(sc,ud.statusbarscale,100); } @@ -3477,7 +3477,7 @@ static void drawoverheadmap(int cposx, int cposy, int czoom, short cang) } } -#define CROSSHAIR_PAL (MAXPALOOKUPS>>1) +#define CROSSHAIR_PAL (MAXPALOOKUPS-RESERVEDPALS-1) extern int getclosestcol(int r, int g, int b); palette_t crosshair_colors = { 255, 255, 255, 0 }; @@ -3501,7 +3501,9 @@ void GetCrosshairColor(void) ii = tilesizx[CROSSHAIR]*tilesizy[CROSSHAIR]; - while (ii > 0) + if (ii <= 0) return; + + do { if (*ptr != 255) { @@ -3510,12 +3512,12 @@ void GetCrosshairColor(void) } ptr++; ii--; - } + } while (ii > 0); default_crosshair_colors.r = crosshair_colors.r = curpalette[bri].r; default_crosshair_colors.g = crosshair_colors.g = curpalette[bri].g; default_crosshair_colors.b = crosshair_colors.b = curpalette[bri].b; - default_crosshair_colors.f = 1; + default_crosshair_colors.f = 1; // this flag signifies that the color has been detected } } @@ -3525,6 +3527,7 @@ void SetCrosshairColor(int r, int g, int b) int i, ii; 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; @@ -3536,27 +3539,32 @@ void SetCrosshairColor(int r, int g, int b) ptr = (char *)waloff[CROSSHAIR]; } + ii = tilesizx[CROSSHAIR]*tilesizy[CROSSHAIR]; + if (ii <= 0) return; + 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) + do { if (*ptr != 255) *ptr = i; ptr++; ii--; } + while (ii > 0); + for (i = 255; i >= 0; i--) tempbuf[i] = i; + makepalookup(CROSSHAIR_PAL,tempbuf,crosshair_colors.r>>2, crosshair_colors.g>>2, crosshair_colors.b>>2,1); #if defined(USE_OPENGL) && defined(POLYMOST) hictinting[CROSSHAIR_PAL].r = crosshair_colors.r; hictinting[CROSSHAIR_PAL].g = crosshair_colors.g; hictinting[CROSSHAIR_PAL].b = crosshair_colors.b; - hictinting[CROSSHAIR_PAL].f = 17; + hictinting[CROSSHAIR_PAL].f = 9; #endif invalidatetile(CROSSHAIR, -1, -1); }