PCExhumed: Fix the timing of credits text when not using CD audio.

# Conflicts:
#	source/exhumed/src/exhumed.cpp
This commit is contained in:
sirlemonhead 2020-03-10 00:38:33 +00:00 committed by Christoph Oelckers
parent 262f2234c6
commit 20cfbc1786
3 changed files with 22 additions and 36 deletions

View file

@ -1233,7 +1233,7 @@ void DoCredits()
playCDtrack(19, false); playCDtrack(19, false);
int var_20 = 0; int nSecretSkipKeyCount = 0;
if (videoGetRenderMode() == REND_CLASSIC) if (videoGetRenderMode() == REND_CLASSIC)
FadeOut(0); FadeOut(0);
@ -1271,14 +1271,14 @@ void DoCredits()
while ((int)totalclock <= nDuration) while ((int)totalclock <= nDuration)
{ {
handleevents(); HandleAsync();
if(inputState.GetKeyStatus(sc_F12)) if(inputState.GetKeyStatus(sc_F12))
{ {
var_20++; nSecretSkipKeyCount++;
inputState.ClearKeyStatus(sc_F12); inputState.ClearKeyStatus(sc_F12);
if (var_20 > 5) { if (nSecretSkipKeyCount > 5) {
return; return;
} }
} }
@ -1290,6 +1290,7 @@ void DoCredits()
while (CDplaying()) while (CDplaying())
{ {
HandleAsync();
inputState.keyGetChar(); inputState.keyGetChar();
} }

View file

@ -1119,26 +1119,26 @@ void ReadyCinemaText(uint16_t nVal)
ComputeCinemaText(line); ComputeCinemaText(line);
} }
uint8_t AdvanceCinemaText() bool AdvanceCinemaText()
{ {
int tmp = nHeight + nCrawlY > 0; bool bDoText = nHeight + nCrawlY > 0;
if (tmp || CDplaying()) if (bDoText || CDplaying())
{ {
nextclock = (int)totalclock + 14; nextclock = (int)totalclock + 15; // NOTE: Value was 14 in original code but seems a touch too fast now
if (tmp > 0) if (bDoText)
{ {
short y = nCrawlY; short y = nCrawlY;
int edi = 0; int i = 0;
while (edi < linecount && y <= 199) while (i < linecount && y <= 199)
{ {
if (y >= -10) { if (y >= -10) {
myprintext(nLeft[edi], y, gString[line + edi], 0); myprintext(nLeft[i], y, gString[line + i], 0);
} }
edi++; i++;
y += 10; y += 10;
} }
@ -1154,44 +1154,29 @@ uint8_t AdvanceCinemaText()
break; break;
} }
if (CDplaying())
{
if (nextclock <= (int)totalclock) { if (nextclock <= (int)totalclock) {
return kTrue; return true;
}
}
else
{
return kTrue;
} }
} }
} }
return kFalse; return false;
} }
void DoCinemaText(short nVal) void DoCinemaText(short nVal)
{ {
ReadyCinemaText(nVal); ReadyCinemaText(nVal);
while (1) bool bContinue = true;
while (bContinue)
{ {
overwritesprite(0, 0, cinematile, 0, 2, kPalNormal); overwritesprite(0, 0, cinematile, 0, 2, kPalNormal);
uint8_t bContinue = AdvanceCinemaText(); bContinue = AdvanceCinemaText();
WaitVBL(); WaitVBL();
videoNextPage(); videoNextPage();
// TEMP
int time = (int)totalclock + 4;
while ((int)totalclock < time) {
HandleAsync();
}
if (!bContinue) {
return;
}
} }
} }

View file

@ -67,7 +67,7 @@ int LoadCinemaPalette(int nPal);
void CinemaFadeIn(); void CinemaFadeIn();
void ReadyCinemaText(uint16_t nVal); void ReadyCinemaText(uint16_t nVal);
uint8_t AdvanceCinemaText(); bool AdvanceCinemaText();
void DoFailedFinalScene(); void DoFailedFinalScene();