mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-08 22:11:09 +00:00
8ca7c05e9d
that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. SVN r1036 (trunk)
101 lines
3 KiB
C++
101 lines
3 KiB
C++
#ifndef __S_SNDSEQ_H__
|
|
#define __S_SNDSEQ_H__
|
|
|
|
#include <stddef.h>
|
|
//#include "actor.h"
|
|
#include "s_sound.h"
|
|
#include "r_defs.h"
|
|
#include "name.h"
|
|
|
|
typedef enum {
|
|
SEQ_PLATFORM,
|
|
SEQ_DOOR,
|
|
SEQ_ENVIRONMENT,
|
|
SEQ_NUMSEQTYPES,
|
|
SEQ_NOTRANS
|
|
} seqtype_t;
|
|
|
|
struct sector_t;
|
|
|
|
class DSeqNode : public DObject
|
|
{
|
|
DECLARE_CLASS (DSeqNode, DObject)
|
|
HAS_OBJECT_POINTERS
|
|
public:
|
|
void Serialize (FArchive &arc);
|
|
void StopAndDestroy ();
|
|
void Destroy ();
|
|
void Tick ();
|
|
void ChangeData (int seqOffset, int delayTics, float volume, FSoundID currentSoundID);
|
|
void AddChoice (int seqnum, seqtype_t type);
|
|
FName GetSequenceName() const;
|
|
static void StaticMarkHead() { GC::Mark(SequenceListHead); }
|
|
|
|
virtual void MakeSound (int loop, FSoundID id) {}
|
|
virtual void *Source () { return NULL; }
|
|
virtual bool IsPlaying () { return false; }
|
|
virtual DSeqNode *SpawnChild (int seqnum) { return NULL; }
|
|
|
|
inline static DSeqNode *FirstSequence() { return SequenceListHead; }
|
|
inline DSeqNode *NextSequence() const { return m_Next; }
|
|
|
|
static void SerializeSequences (FArchive &arc);
|
|
|
|
protected:
|
|
DSeqNode ();
|
|
DSeqNode (int sequence, int modenum);
|
|
|
|
SDWORD *m_SequencePtr;
|
|
int m_Sequence;
|
|
|
|
FSoundID m_CurrentSoundID;
|
|
int m_StopSound;
|
|
int m_DelayUntilTic;
|
|
float m_Volume;
|
|
int m_Atten;
|
|
int m_ModeNum;
|
|
|
|
TArray<int> m_SequenceChoices;
|
|
TObjPtr<DSeqNode> m_ChildSeqNode;
|
|
TObjPtr<DSeqNode> m_ParentSeqNode;
|
|
|
|
private:
|
|
static DSeqNode *SequenceListHead;
|
|
DSeqNode *m_Next, *m_Prev;
|
|
|
|
void ActivateSequence (int sequence);
|
|
|
|
friend void SN_StopAllSequences (void);
|
|
};
|
|
|
|
void SN_StopAllSequences (void);
|
|
|
|
struct FSoundSequence
|
|
{
|
|
FName SeqName;
|
|
FName Slot;
|
|
int StopSound;
|
|
SDWORD Script[1]; // + more until end of sequence script
|
|
};
|
|
|
|
void S_ParseSndSeq (int levellump);
|
|
DSeqNode *SN_StartSequence (AActor *mobj, int sequence, seqtype_t type, int modenum, bool nostop=false);
|
|
DSeqNode *SN_StartSequence (AActor *mobj, const char *name, int modenum);
|
|
DSeqNode *SN_StartSequence (AActor *mobj, FName seqname, int modenum);
|
|
DSeqNode *SN_StartSequence (sector_t *sector, int chan, int sequence, seqtype_t type, int modenum, bool nostop=false);
|
|
DSeqNode *SN_StartSequence (sector_t *sector, int chan, const char *name, int modenum);
|
|
DSeqNode *SN_StartSequence (sector_t *sec, int chan, FName seqname, int modenum);
|
|
DSeqNode *SN_StartSequence (FPolyObj *poly, int sequence, seqtype_t type, int modenum, bool nostop=false);
|
|
DSeqNode *SN_StartSequence (FPolyObj *poly, const char *name, int modenum);
|
|
void SN_StopSequence (AActor *mobj);
|
|
void SN_StopSequence (sector_t *sector);
|
|
void SN_StopSequence (FPolyObj *poly);
|
|
void SN_UpdateActiveSequences (void);
|
|
ptrdiff_t SN_GetSequenceOffset (int sequence, SDWORD *sequencePtr);
|
|
void SN_DoStop (void *);
|
|
void SN_ChangeNodeData (int nodeNum, int seqOffset, int delayTics,
|
|
float volume, int currentSoundID);
|
|
FName SN_GetSequenceSlot (int sequence, seqtype_t type);
|
|
bool SN_IsMakingLoopingSound (sector_t *sector);
|
|
|
|
#endif //__S_SNDSEQ_H__
|