- fixed: Blood translations did not properly treat color 0 as transparent.

This commit is contained in:
Christoph Oelckers 2017-06-20 09:10:19 +02:00
parent cc9fa8a6f5
commit f909b82074
3 changed files with 4 additions and 5 deletions

View file

@ -79,7 +79,6 @@ EXTERN_CVAR (Float, transsouls)
extern TArray<spritedef_t> sprites;
extern TArray<spriteframe_t> SpriteFrames;
extern TArray<PalEntry> BloodTranslationColors;
enum HWRenderStyle
{

View file

@ -726,7 +726,7 @@ int FRemapTable::StoreTranslation(int slot)
//
//----------------------------------------------------------------------------
TArray<PalEntry> BloodTranslationColors;
static TArray<PalEntry> BloodTranslationColors;
int CreateBloodTranslation(PalEntry color)
{
@ -754,7 +754,9 @@ int CreateBloodTranslation(PalEntry color)
I_Error("Too many blood colors");
}
FRemapTable *trans = new FRemapTable;
for (i = 0; i < 256; i++)
trans->Palette[0] = 0;
trans->Remap[0] = 0;
for (i = 1; i < 256; i++)
{
int bright = MAX(MAX(GPalette.BaseColors[i].r, GPalette.BaseColors[i].g), GPalette.BaseColors[i].b);
PalEntry pe = PalEntry(255, color.r*bright/255, color.g*bright/255, color.b*bright/255);

View file

@ -108,8 +108,6 @@ void R_GetPlayerTranslation (int color, const struct FPlayerColorSet *colorset,
extern const uint8_t IcePalette[16][3];
extern TArray<PalEntry> BloodTranslationColors;
int CreateBloodTranslation(PalEntry color);
int R_FindCustomTranslation(FName name);