From f9b05c2b0ca8d618af7ffc5043f7ecaf10c514a8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 25 Mar 2008 12:21:30 +0000 Subject: [PATCH] - Increased the limit for 'imp/active' to 6. This sound definitely benefits from a higher limit. - Fixed: $limit should not apply to sounds played from the menu. - Fixed: The SNDSEQ parser tried to set bDoorSound before actually creating the sound sequence data. SVN r852 (trunk) --- docs/rh-log.txt | 5 +++++ src/s_sndseq.cpp | 22 ++++++++++++---------- src/s_sound.cpp | 2 +- wadsrc/sndinfo.txt | 1 + 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index d0c9df09a..b931c8459 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,9 @@ March 25, 2008 (Changes by Graf Zahl) +- Increased the limit for 'imp/active' to 6. This sound definitely benefits + from a higher limit. +- Fixed: $limit should not apply to sounds played from the menu. +- Fixed: The SNDSEQ parser tried to set bDoorSound before actually creating + the sound sequence data. - Changed Lemon so that it always writes the header. It still kept recompiling the grammar over and over again once it had been changed locally. - Fixed: ANIMATED allowed animations between different texture types. diff --git a/src/s_sndseq.cpp b/src/s_sndseq.cpp index 72f29b90f..53d335a0c 100644 --- a/src/s_sndseq.cpp +++ b/src/s_sndseq.cpp @@ -161,7 +161,7 @@ struct FSoundSequencePtrArray : public TArray static void AssignTranslations (FScanner &sc, int seq, seqtype_t type); static void AssignHexenTranslations (void); -static void AddSequence (int curseq, FName seqname, FName slot, int stopsound, const TArray &ScriptTemp); +static void AddSequence (int curseq, FName seqname, FName slot, int stopsound, const TArray &ScriptTemp, bool bDoorSound); static int FindSequence (const char *searchname); static int FindSequence (FName seqname); static bool TwiddleSeqNum (int &sequence, seqtype_t type); @@ -413,10 +413,6 @@ static void AssignTranslations (FScanner &sc, int seq, seqtype_t type) if (IsNum(sc.String)) { SeqTrans[(atoi(sc.String) & 63) + type * 64] = seq; - if (type == SEQ_DOOR) - { - Sequences[seq]->bDoorSound |= true; - } } } sc.UnGet(); @@ -506,6 +502,8 @@ void S_ParseSndSeq (int levellump) FScanner sc(lump, "SNDSEQ"); while (sc.GetString ()) { + bool bDoorSound; + if (*sc.String == ':' || *sc.String == '[') { if (curseq != -1) @@ -530,6 +528,7 @@ void S_ParseSndSeq (int levellump) ScriptTemp.Clear(); stopsound = 0; slot = NAME_None; + bDoorSound = false; if (seqtype == '[') { sc.SetCMode (true); @@ -546,7 +545,7 @@ void S_ParseSndSeq (int levellump) if (sc.String[0] == ']') { // End of this definition ScriptTemp[0] = MakeCommand(SS_CMD_SELECT, (ScriptTemp.Size()-1)/2); - AddSequence (curseq, seqname, slot, stopsound, ScriptTemp); + AddSequence (curseq, seqname, slot, stopsound, ScriptTemp, bDoorSound); curseq = -1; sc.SetCMode (false); } @@ -561,7 +560,9 @@ void S_ParseSndSeq (int levellump) } else { - AssignTranslations (sc, curseq, seqtype_t(sc.MustMatchString (SSStrings + SS_STRING_PLATFORM))); + seqtype_t seqtype = seqtype_t(sc.MustMatchString (SSStrings + SS_STRING_PLATFORM)); + AssignTranslations (sc, curseq, seqtype); + if (seqtype == SEQ_DOOR) bDoorSound = true; } } continue; @@ -660,7 +661,7 @@ void S_ParseSndSeq (int levellump) break; case SS_STRING_END: - AddSequence (curseq, seqname, slot, stopsound, ScriptTemp); + AddSequence (curseq, seqname, slot, stopsound, ScriptTemp, bDoorSound); curseq = -1; break; @@ -670,6 +671,7 @@ void S_ParseSndSeq (int levellump) case SS_STRING_DOOR: AssignTranslations (sc, curseq, SEQ_DOOR); + bDoorSound = true; break; case SS_STRING_ENVIRONMENT: @@ -688,13 +690,13 @@ void S_ParseSndSeq (int levellump) AssignHexenTranslations (); } -static void AddSequence (int curseq, FName seqname, FName slot, int stopsound, const TArray &ScriptTemp) +static void AddSequence (int curseq, FName seqname, FName slot, int stopsound, const TArray &ScriptTemp, bool bDoorSound) { Sequences[curseq] = (FSoundSequence *)M_Malloc (sizeof(FSoundSequence) + sizeof(DWORD)*ScriptTemp.Size()); Sequences[curseq]->SeqName = seqname; Sequences[curseq]->Slot = slot; Sequences[curseq]->StopSound = stopsound; - Sequences[curseq]->bDoorSound = false; + Sequences[curseq]->bDoorSound = bDoorSound; memcpy (Sequences[curseq]->Script, &ScriptTemp[0], sizeof(DWORD)*ScriptTemp.Size()); Sequences[curseq]->Script[ScriptTemp.Size()] = MakeCommand(SS_CMD_END, 0); } diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 467e51545..c47b1b8c7 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -708,7 +708,7 @@ static void S_StartSound (fixed_t *pt, AActor *mover, int channel, // If this sound doesn't like playing near itself, don't play it if // that's what would happen. - if (sfx->NearLimit && S_CheckSoundLimit(sfx, pos)) + if (sfx->NearLimit && pt != NULL && S_CheckSoundLimit(sfx, pos)) return; // Make sure the sound is loaded. diff --git a/wadsrc/sndinfo.txt b/wadsrc/sndinfo.txt index a640f32b6..e50fb9592 100644 --- a/wadsrc/sndinfo.txt +++ b/wadsrc/sndinfo.txt @@ -304,6 +304,7 @@ imp/death1 dsbgdth1 imp/death2 dsbgdth2 imp/attack dsfirsht imp/shotx dsfirxpl +$limit imp/active 6 // Demon