-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -519,6 +519,7 @@ void R_InitSpriteLumps(void) | |
|
||
void R_InitColormaps(void) | ||
{ | ||
#ifndef CRISPY_TRUECOLOR | ||
int lump, length; | ||
// | ||
// load in the light tables | ||
|
@@ -528,6 +529,75 @@ void R_InitColormaps(void) | |
length = W_LumpLength(lump); | ||
colormaps = Z_Malloc(length, PU_STATIC, 0); | ||
W_ReadLump(lump, colormaps); | ||
#else | ||
byte *playpal; | ||
int c, i, j = 0; | ||
byte r, g, b; | ||
extern byte **gamma2table; | ||
|
||
// [crispy] intermediate gamma levels | ||
if (!gamma2table) | ||
{ | ||
extern void I_SetGammaTable (void); | ||
I_SetGammaTable(); | ||
} | ||
|
||
playpal = W_CacheLumpName("PLAYPAL", PU_STATIC); | ||
|
||
if (!colormaps) | ||
{ | ||
colormaps = (lighttable_t*) Z_Malloc((NUMCOLORMAPS + 1) * 256 * sizeof(lighttable_t), PU_STATIC, 0); | ||
} | ||
|
||
if (crispy->truecolor) | ||
{ | ||
for (c = 0; c < NUMCOLORMAPS; c++) | ||
{ | ||
const float scale = 1. * c / NUMCOLORMAPS; | ||
|
||
for (i = 0; i < 256; i++) | ||
{ | ||
r = gamma2table[usegamma][playpal[3 * i + 0]] * (1. - scale) + gamma2table[usegamma][0] * scale; | ||
g = gamma2table[usegamma][playpal[3 * i + 1]] * (1. - scale) + gamma2table[usegamma][0] * scale; | ||
b = gamma2table[usegamma][playpal[3 * i + 2]] * (1. - scale) + gamma2table[usegamma][0] * scale; | ||
|
||
colormaps[j++] = 0xff000000 | (r << 16) | (g << 8) | b; | ||
} | ||
} | ||
|
||
// [crispy] Invulnerability (c == COLORMAPS) | ||
// [JN] TODO - inacurate, should be fine-tuned | ||
for (i = 0; i < 256; i++) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JNechaevsky
Author
Collaborator
|
||
{ | ||
const byte gold = | ||
(byte) (0.500 * playpal[3 * i + 0] + | ||
0.500 * playpal[3 * i + 1]); | ||
r = g = gamma2table[usegamma][gold]; | ||
// [JN] Decrease green channel intensity | ||
g /= 1.500; | ||
|
||
colormaps[j++] = 0xff000000 | (r << 16) | (g << 8); | ||
} | ||
} | ||
else | ||
{ | ||
byte *const colormap = W_CacheLumpName("COLORMAP", PU_STATIC); | ||
|
||
for (c = 0; c <= NUMCOLORMAPS; c++) | ||
{ | ||
for (i = 0; i < 256; i++) | ||
{ | ||
r = gamma2table[usegamma][playpal[3 * colormap[c * 256 + i] + 0]] & ~3; | ||
g = gamma2table[usegamma][playpal[3 * colormap[c * 256 + i] + 1]] & ~3; | ||
b = gamma2table[usegamma][playpal[3 * colormap[c * 256 + i] + 2]] & ~3; | ||
|
||
colormaps[j++] = 0xff000000 | (r << 16) | (g << 8) | b; | ||
} | ||
} | ||
|
||
W_ReleaseLumpName("COLORMAP"); | ||
} | ||
#endif | ||
|
||
// [crispy] initialize color translation and color string tables | ||
{ | ||
|
2 comments
on commit e381e8e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabiangreffrath, a moment of your attention please. It's not about review or PR, there is more work needs to be done. But I have a very bad feeling...
Have a look at this lava please, it's in non true color mode:
And it's not limited to lava only. It feels like the game is loosing it's charm. Original palleted colors are daring, catchy and brave, but in true color they feels a bit dull. It's not a problem of true color implementation itself, GZDoom have exactly same problem. In other words: by trying to make the game looking nicer, it becomes uglier instead. In Doom, however, it feels absolutely opposite, probably because of there were no too-high-contrast colors in original palette. Or is it just me?
Anyways, what is your recommendation? Should I proceed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have read before that Heretic would look dull and washed out with truecolor rendering, but have never seen it before. However, it's right, the game looks a lot different, less poppy and candy. However, I wouldn't say I don't like it at all.
Please don't feel discouraged because the results don't look like you expected them. It would be a shame if you abandoned all the work on truecolor rendering for a purely subjective impression. Please proceed! 🙏
If you can't match the golden tint of the invulnerability colormap (I guess we don't have the formula for this), then you might either want to use the
CR_GOLD
translation table, or just load the COLORMAP lump and use its last translation table.