- added workaround for DukeDC's ending cutscene which was abusing undefined behavior in the original code.

This commit is contained in:
Christoph Oelckers 2020-08-05 22:57:45 +02:00
parent 514c029e47
commit 3e8ff96e6b
4 changed files with 23 additions and 9 deletions

View File

@ -110,7 +110,7 @@ enum
GAMEFLAG_EXHUMED = 0x00004000, GAMEFLAG_EXHUMED = 0x00004000,
GAMEFLAG_PSEXHUMED = GAMEFLAG_POWERSLAVE | GAMEFLAG_EXHUMED, // the two games really are the same, except for the name and the publisher. GAMEFLAG_PSEXHUMED = GAMEFLAG_POWERSLAVE | GAMEFLAG_EXHUMED, // the two games really are the same, except for the name and the publisher.
GAMEFLAG_WORLDTOUR = 0x00008000, GAMEFLAG_WORLDTOUR = 0x00008000,
GAMEFLAG_STANDALONE = 0x00010000, GAMEFLAG_DUKEDC = 0x00010000,
GAMEFLAGMASK = 0x0000FFFF, // flags allowed from grpinfo GAMEFLAGMASK = 0x0000FFFF, // flags allowed from grpinfo
// We still need these for the parsers. // We still need these for the parsers.

View File

@ -399,6 +399,7 @@ static TArray<GrpInfo> ParseGrpInfo(const char *fn, FileReader &fr, TMap<FString
FlagMap.Insert("GAMEFLAG_SW", GAMEFLAG_SW); FlagMap.Insert("GAMEFLAG_SW", GAMEFLAG_SW);
FlagMap.Insert("GAMEFLAG_POWERSLAVE", GAMEFLAG_POWERSLAVE); FlagMap.Insert("GAMEFLAG_POWERSLAVE", GAMEFLAG_POWERSLAVE);
FlagMap.Insert("GAMEFLAG_EXHUMED", GAMEFLAG_EXHUMED); FlagMap.Insert("GAMEFLAG_EXHUMED", GAMEFLAG_EXHUMED);
FlagMap.Insert("GAMEFLAG_DUKEDC", GAMEFLAG_DUKEDC);
FScanner sc; FScanner sc;
auto mem = fr.Read(); auto mem = fr.Read();

View File

@ -548,6 +548,12 @@ static void bonussequence_d(int num, JobDesc *jobs, int &job)
{ -1,-1 } { -1,-1 }
}; };
static const AnimSound dukedcsound[] =
{
{ 144, ENDSEQVOL3SND3 + 1 },
{ -1,-1 }
};
static const AnimSound vol4e1[] = static const AnimSound vol4e1[] =
{ {
{ 3, DUKE_UNDERWATER+1 }, { 3, DUKE_UNDERWATER+1 },
@ -591,10 +597,17 @@ static void bonussequence_d(int num, JobDesc *jobs, int &job)
break; break;
case 2: case 2:
jobs[job++] = { PlayVideo("cineov3.anm", cineov3sound, framespeed_10), nullptr }; if (g_gameType & GAMEFLAG_DUKEDC)
jobs[job++] = { Create<DBlackScreen>(200), []() { FX_StopAllSounds(); } }; {
jobs[job++] = { Create<DEpisode3End>(), []() { if (!PLUTOPAK) S_PlaySound(ENDSEQVOL3SND4, CHAN_AUTO, CHANF_UI); } }; jobs[job++] = { PlayVideo("radlogo.anm", dukedcsound, framespeed_10), nullptr };
if (!PLUTOPAK) jobs[job++] = { Create<DImageScreen>(TexMan.GetGameTextureByName("DUKETEAM.ANM", false, FTextureManager::TEXMAN_ForceLookup)), []() { FX_StopAllSounds(); } }; }
else
{
jobs[job++] = { PlayVideo("cineov3.anm", cineov3sound, framespeed_10), nullptr };
jobs[job++] = { Create<DBlackScreen>(200), []() { FX_StopAllSounds(); } };
jobs[job++] = { Create<DEpisode3End>(), []() { if (!PLUTOPAK) S_PlaySound(ENDSEQVOL3SND4, CHAN_AUTO, CHANF_UI); } };
if (!PLUTOPAK) jobs[job++] = { Create<DImageScreen>(TexMan.GetGameTextureByName("DUKETEAM.ANM", false, FTextureManager::TEXMAN_ForceLookup)), []() { FX_StopAllSounds(); } };
}
break; break;
case 3: case 3:

View File

@ -159,7 +159,7 @@ grpinfo
name "Duke it out in D.C. (1.3D)" name "Duke it out in D.C. (1.3D)"
size 7926624 size 7926624
crc DUKEDC13_CRC crc DUKEDC13_CRC
flags GAMEFLAG_DUKE|GAMEFLAG_ADDON flags GAMEFLAG_DUKE|GAMEFLAG_ADDON|GAMEFLAG_DUKEDC
dependency DUKE13_CRC dependency DUKE13_CRC
gamefilter "Duke.DukeDC" gamefilter "Duke.DukeDC"
} }
@ -169,7 +169,7 @@ grpinfo
name "Duke it out in D.C." name "Duke it out in D.C."
size 8225517 size 8225517
crc DUKEDCPP_CRC crc DUKEDCPP_CRC
flags GAMEFLAG_DUKE|GAMEFLAG_ADDON flags GAMEFLAG_DUKE|GAMEFLAG_ADDON|GAMEFLAG_DUKEDC
dependency DUKE15_CRC dependency DUKE15_CRC
gamefilter "Duke.DukeDC" gamefilter "Duke.DukeDC"
} }
@ -179,7 +179,7 @@ grpinfo
name "Duke it out in D.C." name "Duke it out in D.C."
size 8410183 size 8410183
crc DUKEDC_CRC crc DUKEDC_CRC
flags GAMEFLAG_DUKE|GAMEFLAG_ADDON flags GAMEFLAG_DUKE|GAMEFLAG_ADDON|GAMEFLAG_DUKEDC
dependency DUKE15_CRC dependency DUKE15_CRC
gamefilter "Duke.DukeDC" gamefilter "Duke.DukeDC"
} }
@ -190,7 +190,7 @@ grpinfo
scriptname "DUKEDC.CON" scriptname "DUKEDC.CON"
size 8410187 size 8410187
crc 0x39A692BF crc 0x39A692BF
flags GAMEFLAG_DUKE|GAMEFLAG_ADDON flags GAMEFLAG_DUKE|GAMEFLAG_ADDON|GAMEFLAG_DUKEDC
dependency DUKE15_CRC dependency DUKE15_CRC
gamefilter "Duke.DukeDC" gamefilter "Duke.DukeDC"
} }