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
This commit is contained in:
terminx 2015-12-28 02:04:36 +00:00
parent 1d17d2c6f6
commit 935e9fa197
3 changed files with 24 additions and 21 deletions

View file

@ -700,7 +700,7 @@ EXTERN char *palookup[MAXPALOOKUPS];
extern uint8_t *basepaltable[MAXBASEPALS]; extern uint8_t *basepaltable[MAXBASEPALS];
EXTERN uint8_t paletteloaded; EXTERN uint8_t paletteloaded;
EXTERN char *blendtable[MAXBLENDTABS]; EXTERN char *blendtable[MAXBLENDTABS];
EXTERN uint8_t whitecol; EXTERN uint8_t whitecol, redcol;
enum { enum {
PALETTE_MAIN = 1<<0, PALETTE_MAIN = 1<<0,

View file

@ -8435,6 +8435,8 @@ static void E_PostLoadPalette(void)
if (j < k) { k = j; blackcol = i; } if (j < k) { k = j; blackcol = i; }
} }
redcol = getclosestcol(255, 0, 0);
// Bmemset(PaletteIndexFullbrights, 0, sizeof(PaletteIndexFullbrights)); // Bmemset(PaletteIndexFullbrights, 0, sizeof(PaletteIndexFullbrights));
for (int c = 0; c < 255; ++c) // skipping transparent color for (int c = 0; c < 255; ++c) // skipping transparent color
{ {

View file

@ -1362,6 +1362,9 @@ extern int32_t cacnum;
extern cactype cac[]; extern cactype cac[];
#endif #endif
#define COLOR_RED redcol
#define COLOR_WHITE whitecol
static void G_ShowCacheLocks(void) static void G_ShowCacheLocks(void)
{ {
int16_t i,k; int16_t i,k;
@ -1378,7 +1381,7 @@ static void G_ShowCacheLocks(void)
break; break;
Bsprintf(tempbuf,"Locked- %d: Leng:%d, Lock:%d",i,cac[i].leng,*cac[i].lock); 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; k += 6;
} }
#endif #endif
@ -1392,12 +1395,12 @@ static void G_ShowCacheLocks(void)
break; break;
Bsprintf(tempbuf,"RTS Locked %d:",i); Bsprintf(tempbuf,"RTS Locked %d:",i);
printext256(0,k,31,-1,tempbuf,1); printext256(0,k,COLOR_WHITE,-1,tempbuf,1);
k += 6; k += 6;
} }
if (k >= ydim-12 && k<ydim-6) if (k >= ydim-12 && k<ydim-6)
printext256(0,k,31,-1,"(MORE . . .)",1); printext256(0,k,COLOR_WHITE,-1,"(MORE . . .)",1);
// sounds // sounds
if (xdim < 640) if (xdim < 640)
@ -1416,7 +1419,7 @@ static void G_ShowCacheLocks(void)
Bsprintf(tempbuf, "snd #%d inst %d: voice %d, ow %d", i, j, Bsprintf(tempbuf, "snd #%d inst %d: voice %d, ow %d", i, j,
g_sounds[i].SoundOwner[j].voice, g_sounds[i].SoundOwner[j].ow); g_sounds[i].SoundOwner[j].voice, g_sounds[i].SoundOwner[j].ow);
printext256(240,k,31,-1,tempbuf,0); printext256(240,k,COLOR_WHITE,-1,tempbuf,0);
k += 9; k += 9;
} }
@ -2423,8 +2426,6 @@ static void G_DrawStatusBar(int32_t snum)
} }
} }
#define COLOR_RED 248
#define COLOR_WHITE whitecol
#define LOW_FPS 30 #define LOW_FPS 30
#if defined GEKKO #if defined GEKKO
@ -2518,7 +2519,7 @@ static struct {
#define printcoordsline(fmt, ...) do { \ #define printcoordsline(fmt, ...) do { \
Bsprintf(tempbuf, fmt, ## __VA_ARGS__); \ Bsprintf(tempbuf, fmt, ## __VA_ARGS__); \
printext256(20, y+=9, 31, -1, tempbuf, 0); \ printext256(20, y+=9, COLOR_WHITE, -1, tempbuf, 0); \
} while (0) } while (0)
static void G_PrintCoords(int32_t snum) static void G_PrintCoords(int32_t snum)
@ -2537,32 +2538,32 @@ static void G_PrintCoords(int32_t snum)
y = 24; y = 24;
} }
Bsprintf(tempbuf, "XYZ= (%d, %d, %d)", ps->pos.x, ps->pos.y, ps->pos.z); Bsprintf(tempbuf, "XYZ= (%d, %d, %d)", ps->pos.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); 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)", 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); 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); 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) if (sectnum >= 0)
Bsprintf(tempbuf, "SECT= %d (LO=%d EX=%d)", sectnum, Bsprintf(tempbuf, "SECT= %d (LO=%d EX=%d)", sectnum,
TrackerCast(sector[sectnum].lotag), TrackerCast(sector[sectnum].extra)); TrackerCast(sector[sectnum].lotag), TrackerCast(sector[sectnum].extra));
else else
Bsprintf(tempbuf,"SECT= %d", sectnum); 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); // 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 -= 9;
y += 7; y += 7;
Bsprintf(tempbuf,"THOLD= %d", ps->transporter_hold); 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); 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 #ifdef DEBUGGINGAIDS
Bsprintf(tempbuf,"NUMSPRITES= %d", Numsprites); 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) if (g_moveThingsCount > g_spriteStat.lastgtic + REALGAMETICSPERSEC)
{ {
g_spriteStat.lastgtic = g_moveThingsCount; g_spriteStat.lastgtic = g_moveThingsCount;
@ -2570,16 +2571,16 @@ static void G_PrintCoords(int32_t snum)
g_spriteStat.numins = 0; g_spriteStat.numins = 0;
} }
Bsprintf(tempbuf,"INSERTIONS/s= %u", g_spriteStat.lastnumins); 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); 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; y += 3*9;
#endif #endif
y += 7; y += 7;
Bsprintf(tempbuf,"VR=%.03f YX=%.03f",(double)dr_viewingrange/65536.0,(double)dr_yxaspect/65536.0); 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); 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 #ifdef USE_OPENGL
if (ud.coords == 2) if (ud.coords == 2)