- Exhumed: Add fixSeqs() and use it to patch OOB issue with skulstrt.seq.

This commit is contained in:
Mitchell Richters 2023-04-26 20:27:16 +10:00
parent 33d4809663
commit ea7fe0e0b4

View file

@ -137,6 +137,29 @@ const TArray<Seq>* const getFileSeqs(const FName nSeqFile)
//
//---------------------------------------------------------------------------
static void fixSeqs()
{
// Seq file "skulstrt" has one sprite face with 20 frames instead of 24.
if (auto skulstrt = FileSeqMap.CheckKey("skulstrt"))
{
// Get sequence and store last frame.
auto& seq = skulstrt->operator[](4);
const auto lastframe = seq.frames.Last();
// Repeat last frame another four times.
for (unsigned i = 20; i < 24; i++)
{
seq.frames.Push(lastframe);
}
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static int addSeq(const char *seqName)
{
const FStringf seqfilename("%s.seq", seqName);
@ -310,6 +333,9 @@ void seq_LoadSequences()
}
}
// Perform sequence post-processing for where original assets are malformed.
fixSeqs();
nShadowPic = getSequence("shadow").getFirstFrameTexture();
nShadowWidth = (int16_t)TexMan.GetGameTexture(nShadowPic)->GetDisplayWidth();