Skip to content

Commit

Permalink
[FIXME] corpse palette crash
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrd2 committed Apr 1, 2023
1 parent 46b3661 commit 234bf23
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions src/game/Tactical/Rotting_Corpses.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,34 +582,35 @@ static void RemoveCorpse(ROTTING_CORPSE* const c)

static void CreateCorpsePalette(ROTTING_CORPSE* const c)
{
char const* const substitution =
c->def.ubType == ROTTING_STAGE2 ? "" :
c->def.usFlags & ROTTING_CORPSE_USE_CAMO_PALETTE ? ANIMSDIR "/camo.COL" :
GetBodyTypePaletteSubstitution(0, c->def.ubBodyType);

const SGPPaletteEntry* pal;
SGPPaletteEntry tmp_pal[256];
if (!substitution)
{
// Use palette from HVOBJECT, then use substitution for pants, etc
memcpy(tmp_pal, gpTileCache[c->pAniTile->sCachedTileID].pImagery->vo->Palette(), sizeof(tmp_pal));
SetPaletteReplacement(tmp_pal, c->def.HeadPal);
SetPaletteReplacement(tmp_pal, c->def.VestPal);
SetPaletteReplacement(tmp_pal, c->def.PantsPal);
SetPaletteReplacement(tmp_pal, c->def.SkinPal);
pal = tmp_pal;
}
else if (substitution[0] != '\0' && CreateSGPPaletteFromCOLFile(tmp_pal, substitution))
{
pal = tmp_pal;
}
else
{
// Use palette from hvobject
pal = gpTileCache[c->pAniTile->sCachedTileID].pImagery->vo->Palette();
}

CreateBiasedShadedPalettes(c->pShades, pal);
// FIXME: maxrd2 no more palette - superdead - enter tactical D15
// char const* const substitution =
// c->def.ubType == ROTTING_STAGE2 ? "" :
// c->def.usFlags & ROTTING_CORPSE_USE_CAMO_PALETTE ? ANIMSDIR "/camo.COL" :
// GetBodyTypePaletteSubstitution(0, c->def.ubBodyType);

// const SGPPaletteEntry* pal;
// SGPPaletteEntry tmp_pal[256];
// if (!substitution)
// {
// // Use palette from HVOBJECT, then use substitution for pants, etc
// memcpy(tmp_pal, gpTileCache[c->pAniTile->sCachedTileID].pImagery->vo->Palette(), sizeof(tmp_pal));
// SetPaletteReplacement(tmp_pal, c->def.HeadPal);
// SetPaletteReplacement(tmp_pal, c->def.VestPal);
// SetPaletteReplacement(tmp_pal, c->def.PantsPal);
// SetPaletteReplacement(tmp_pal, c->def.SkinPal);
// pal = tmp_pal;
// }
// else if (substitution[0] != '\0' && CreateSGPPaletteFromCOLFile(tmp_pal, substitution))
// {
// pal = tmp_pal;
// }
// else
// {
// // Use palette from hvobject
// pal = gpTileCache[c->pAniTile->sCachedTileID].pImagery->vo->Palette();
// }

// CreateBiasedShadedPalettes(c->pShades, pal);
}


Expand Down

0 comments on commit 234bf23

Please sign in to comment.