Raise SNDSEQ limit to 4096 sequences

# Conflicts:
#	src/maploader/polyobjects.cpp
This commit is contained in:
Nikolay Ambartsumov 2020-10-24 05:29:22 +03:00 committed by drfrag
parent 676f160634
commit 4b529914ae
3 changed files with 22 additions and 16 deletions

View file

@ -45,6 +45,7 @@
#include "g_levellocals.h"
#include "actorinlines.h"
#include "v_text.h"
#include "s_sndseq.h"
// MACROS ------------------------------------------------------------------
@ -1561,7 +1562,7 @@ static void SpawnPolyobj (int index, int tag, int type)
po->bHurtOnTouch = (type == SMT_PolySpawnHurt);
po->tag = tag;
po->seqType = sd->linedef->args[2];
if (po->seqType < 0 || po->seqType > 63)
if (po->seqType < 0 || po->seqType > (MAX_SNDSEQS - 1))
{
po->seqType = 0;
}

View file

@ -50,10 +50,13 @@
#define GetData(a) (int32_t(a) >> 8 )
#define GetFloatData(a) float((int32_t(a) >> 8 )/65536.f)
#define MakeCommand(a,b) ((a) | ((b) << 8))
#define HexenPlatSeq(a) (a)
#define HexenDoorSeq(a) ((a) | 0x40)
#define HexenEnvSeq(a) ((a) | 0x80)
#define HexenLastSeq (0xff)
#define HexenPlatSeqStart (0)
#define HexenDoorSeqStart (MAX_SNDSEQS)
#define HexenEnvSeqStart (MAX_SNDSEQS << 1)
#define HexenPlatSeq(a) ((a) | (HexenPlatSeqStart))
#define HexenDoorSeq(a) ((a) | (HexenDoorSeqStart))
#define HexenEnvSeq(a) ((a) | (HexenEnvSeqStart))
#define HexenLastSeq ((MAX_SNDSEQS << 2) - 1)
// TYPES -------------------------------------------------------------------
@ -108,7 +111,7 @@ typedef enum
struct hexenseq_t
{
ENamedName Name;
uint8_t Seqs[4];
uint16_t Seqs[4];
};
class DSeqActorNode : public DSeqNode
@ -285,7 +288,7 @@ static const hexenseq_t HexenSequences[] = {
{ NAME_None, {0} }
};
static int SeqTrans[64*3];
static int SeqTrans[MAX_SNDSEQS*3];
static FRandom pr_sndseq ("SndSeq");
@ -498,7 +501,7 @@ static void AssignTranslations (FScanner &sc, int seq, seqtype_t type)
{
if (IsNum(sc.String))
{
SeqTrans[(atoi(sc.String) & 63) + type * 64] = seq;
SeqTrans[(atoi(sc.String) & (MAX_SNDSEQS - 1)) + type * MAX_SNDSEQS] = seq;
}
}
sc.UnGet();
@ -528,16 +531,16 @@ static void AssignHexenTranslations (void)
{
int trans;
if (HexenSequences[i].Seqs[j] & 0x40)
if (HexenSequences[i].Seqs[j] & HexenDoorSeqStart)
{
trans = 64 * SEQ_DOOR;
trans = MAX_SNDSEQS * SEQ_DOOR;
}
else if (HexenSequences[i].Seqs[j] & 0x80)
trans = 64 * SEQ_ENVIRONMENT;
else if (HexenSequences[i].Seqs[j] & HexenEnvSeqStart)
trans = MAX_SNDSEQS * SEQ_ENVIRONMENT;
else
trans = 64 * SEQ_PLATFORM;
trans = MAX_SNDSEQS * SEQ_PLATFORM;
SeqTrans[trans + (HexenSequences[i].Seqs[j] & 0x3f)] = seq;
SeqTrans[trans + (HexenSequences[i].Seqs[j] & (MAX_SNDSEQS - 1))] = seq;
}
}
}
@ -866,9 +869,9 @@ static bool TwiddleSeqNum (int &sequence, seqtype_t type)
{
// [GrafZahl] Needs some range checking:
// Sector_ChangeSound doesn't do it so this makes invalid sequences play nothing.
if (sequence >= 0 && sequence < 64)
if (sequence >= 0 && sequence < MAX_SNDSEQS)
{
sequence = SeqTrans[sequence + type * 64];
sequence = SeqTrans[sequence + type * MAX_SNDSEQS];
}
else
{

View file

@ -5,6 +5,8 @@
#include "dobject.h"
#include "s_sound.h"
#define MAX_SNDSEQS (4096)
enum
{
// Sound channel aliases for sound sequences.