diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index 92265ba05..cbf03cc4a 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -99,12 +99,13 @@ class DAnmPlayer : public DScreenJob AnimTextures animtex; const AnimSound* animSnd; const int* frameTicks; + bool nostopsound; public: bool isvalid() { return numframes > 0; } - DAnmPlayer(FileReader& fr, const AnimSound* ans, const int *frameticks) - : animSnd(ans), frameTicks(frameticks) + DAnmPlayer(FileReader& fr, const AnimSound* ans, const int *frameticks, bool nosoundcutoff) + : animSnd(ans), frameTicks(frameticks), nostopsound(nosoundcutoff) { buffer = fr.ReadPadded(1); fr.Close(); @@ -138,7 +139,7 @@ public: { twod->ClearScreen(); DrawTexture(twod, animtex.GetFrame(), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_Masked, false, TAG_DONE); - if (skiprequest) soundEngine->StopAllChannels(); + if (skiprequest && !nostopsound) soundEngine->StopAllChannels(); return skiprequest? -1 : 1; } @@ -169,7 +170,7 @@ public: } } curframe++; - if (skiprequest) soundEngine->StopAllChannels(); + if (skiprequest && !nostopsound) soundEngine->StopAllChannels(); return skiprequest ? -1 : curframe < numframes? 1 : 0; } @@ -325,7 +326,7 @@ public: // //--------------------------------------------------------------------------- -DScreenJob* PlayVideo(const char* filename, const AnimSound* ans, const int* frameticks) +DScreenJob* PlayVideo(const char* filename, const AnimSound* ans, const int* frameticks, bool nosoundcutoff) { auto nothing = []()->DScreenJob* { return Create(); }; if (!filename) @@ -355,7 +356,7 @@ DScreenJob* PlayVideo(const char* filename, const AnimSound* ans, const int* fra if (!memcmp(id, "LPF ", 4)) { - auto anm = Create(fr, ans, frameticks); + auto anm = Create(fr, ans, frameticks, nosoundcutoff); if (!anm->isvalid()) { Printf("%s: invalid ANM file.\n", filename); diff --git a/source/core/screenjob.h b/source/core/screenjob.h index 661d0a10a..455ba8d39 100644 --- a/source/core/screenjob.h +++ b/source/core/screenjob.h @@ -106,4 +106,4 @@ struct AnimSound int soundnum; }; -DScreenJob *PlayVideo(const char *filename, const AnimSound *ans = nullptr, const int *frameticks = nullptr); +DScreenJob *PlayVideo(const char *filename, const AnimSound *ans = nullptr, const int *frameticks = nullptr, bool nosoundstop = false); diff --git a/source/sw/src/2d.cpp b/source/sw/src/2d.cpp index b444b9906..b71c7f15a 100644 --- a/source/sw/src/2d.cpp +++ b/source/sw/src/2d.cpp @@ -89,7 +89,7 @@ void Logo(const CompletionFunc& completion) JobDesc jobs[3]; int job = 0; jobs[job++] = { Create() }; - jobs[job++] = { PlayVideo("sw.anm", logosound, logoframetimes)}; + jobs[job++] = { PlayVideo("sw.anm", logosound, logoframetimes, true)}; RunScreenJob(jobs, job, completion, true, true); } else completion(false); diff --git a/source/sw/src/sprite.cpp b/source/sw/src/sprite.cpp index 8ddbd47c3..09afd0056 100644 --- a/source/sw/src/sprite.cpp +++ b/source/sw/src/sprite.cpp @@ -5726,7 +5726,9 @@ KeyMain: // print to the console, and the user quote display. FStringf msg("%s %s", GStrings("TXTS_FORTUNE"), quoteMgr.GetQuote(QUOTE_COOKIE + cookie)); Printf(TEXTCOLOR_SAPPHIRE "%s\n", msg.GetChars()); - adduserquote(msg.GetChars()); + strncpy(pp->cookieQuote, msg, 255); + pp->cookieQuote[255] = 0; + pp->cookieTime = totalclock + 540; } SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup