From 935e9fa1973e49e964b6f7007d63985feb1843a7 Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 28 Dec 2015 02:04:36 +0000 Subject: [PATCH] Fix hard coded white and red color indexes used in on-screen debug output, to better operate with a palette dissimilar to Duke3D. git-svn-id: https://svn.eduke32.com/eduke32@5497 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 2 +- polymer/eduke32/build/src/engine.c | 2 ++ polymer/eduke32/source/game.c | 41 ++++++++++++++------------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 73ec6cf21..52ba227cd 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -700,7 +700,7 @@ EXTERN char *palookup[MAXPALOOKUPS]; extern uint8_t *basepaltable[MAXBASEPALS]; EXTERN uint8_t paletteloaded; EXTERN char *blendtable[MAXBLENDTABS]; -EXTERN uint8_t whitecol; +EXTERN uint8_t whitecol, redcol; enum { PALETTE_MAIN = 1<<0, diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 11dc5df26..2a6e96592 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -8435,6 +8435,8 @@ static void E_PostLoadPalette(void) if (j < k) { k = j; blackcol = i; } } + redcol = getclosestcol(255, 0, 0); + // Bmemset(PaletteIndexFullbrights, 0, sizeof(PaletteIndexFullbrights)); for (int c = 0; c < 255; ++c) // skipping transparent color { diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index b4104d5df..f55e449b1 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1362,6 +1362,9 @@ extern int32_t cacnum; extern cactype cac[]; #endif +#define COLOR_RED redcol +#define COLOR_WHITE whitecol + static void G_ShowCacheLocks(void) { int16_t i,k; @@ -1378,7 +1381,7 @@ static void G_ShowCacheLocks(void) break; Bsprintf(tempbuf,"Locked- %d: Leng:%d, Lock:%d",i,cac[i].leng,*cac[i].lock); - printext256(0L,k,31,-1,tempbuf,1); + printext256(0L,k,COLOR_WHITE,-1,tempbuf,1); k += 6; } #endif @@ -1392,12 +1395,12 @@ static void G_ShowCacheLocks(void) break; Bsprintf(tempbuf,"RTS Locked %d:",i); - printext256(0,k,31,-1,tempbuf,1); + printext256(0,k,COLOR_WHITE,-1,tempbuf,1); k += 6; } if (k >= ydim-12 && kpos.x, ps->pos.y, ps->pos.z); - printext256(x,y,31,-1,tempbuf,0); + printext256(x,y,COLOR_WHITE,-1,tempbuf,0); Bsprintf(tempbuf, "A/H/HO= %d, %d, %d", ps->ang, ps->horiz, ps->horizoff); - printext256(x,y+9,31,-1,tempbuf,0); + printext256(x,y+9,COLOR_WHITE,-1,tempbuf,0); Bsprintf(tempbuf,"VEL= (%d, %d, %d) + (%d, %d, 0)", ps->vel.x>>14, ps->vel.y>>14, ps->vel.z, ps->fric.x>>5, ps->fric.y>>5); - printext256(x,y+18,31,-1,tempbuf,0); + printext256(x,y+18,COLOR_WHITE,-1,tempbuf,0); Bsprintf(tempbuf,"OG= %d SBRIDGE=%d SBS=%d", ps->on_ground, ps->spritebridge, ps->sbs); - printext256(x,y+27,31,-1,tempbuf,0); + printext256(x,y+27,COLOR_WHITE,-1,tempbuf,0); if (sectnum >= 0) Bsprintf(tempbuf, "SECT= %d (LO=%d EX=%d)", sectnum, TrackerCast(sector[sectnum].lotag), TrackerCast(sector[sectnum].extra)); else Bsprintf(tempbuf,"SECT= %d", sectnum); - printext256(x,y+36,31,-1,tempbuf,0); + printext256(x,y+36,COLOR_WHITE,-1,tempbuf,0); // Bsprintf(tempbuf,"SEED= %d",randomseed); -// printext256(x,y+45,31,-1,tempbuf,0); +// printext256(x,y+45,COLOR_WHITE,-1,tempbuf,0); y -= 9; y += 7; Bsprintf(tempbuf,"THOLD= %d", ps->transporter_hold); - printext256(x,y+54,31,-1,tempbuf,0); + printext256(x,y+54,COLOR_WHITE,-1,tempbuf,0); Bsprintf(tempbuf,"GAMETIC= %d, TOTALCLOCK=%d", g_moveThingsCount, totalclock); - printext256(x,y+63,31,-1,tempbuf,0); + printext256(x,y+63,COLOR_WHITE,-1,tempbuf,0); #ifdef DEBUGGINGAIDS Bsprintf(tempbuf,"NUMSPRITES= %d", Numsprites); - printext256(x,y+72,31,-1,tempbuf,0); + printext256(x,y+72,COLOR_WHITE,-1,tempbuf,0); if (g_moveThingsCount > g_spriteStat.lastgtic + REALGAMETICSPERSEC) { g_spriteStat.lastgtic = g_moveThingsCount; @@ -2570,16 +2571,16 @@ static void G_PrintCoords(int32_t snum) g_spriteStat.numins = 0; } Bsprintf(tempbuf,"INSERTIONS/s= %u", g_spriteStat.lastnumins); - printext256(x,y+81,31,-1,tempbuf,0); + printext256(x,y+81,COLOR_WHITE,-1,tempbuf,0); Bsprintf(tempbuf,"ONSCREEN= %d", g_spriteStat.numonscreen); - printext256(x,y+90,31,-1,tempbuf,0); + printext256(x,y+90,COLOR_WHITE,-1,tempbuf,0); y += 3*9; #endif y += 7; Bsprintf(tempbuf,"VR=%.03f YX=%.03f",(double)dr_viewingrange/65536.0,(double)dr_yxaspect/65536.0); - printext256(x,y+72,31,-1,tempbuf,0); + printext256(x,y+72,COLOR_WHITE,-1,tempbuf,0); Bsprintf(tempbuf, "MOVEACTORS [ms]= %.3e", g_moveActorsTime); - printext256(x,y+81,31,-1,tempbuf,0); + printext256(x,y+81,COLOR_WHITE,-1,tempbuf,0); #ifdef USE_OPENGL if (ud.coords == 2)