- exported the sound sequence interface to scripting.

- split out the map data definitions from base.txt into their own file.
This commit is contained in:
Christoph Oelckers 2017-01-14 13:02:08 +01:00
commit f83444f3cc
8 changed files with 501 additions and 381 deletions

View file

@ -869,6 +869,16 @@ DSeqNode *SN_StartSequence (AActor *actor, int sequence, seqtype_t type, int mod
return NULL;
}
DEFINE_ACTION_FUNCTION(AActor, StartSoundSequenceID)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(seq);
PARAM_INT(type);
PARAM_INT(modenum);
PARAM_BOOL_DEF(nostop);
ACTION_RETURN_POINTER(SN_StartSequence(self, seq, seqtype_t(type), modenum, nostop));
}
DSeqNode *SN_StartSequence (sector_t *sector, int chan, int sequence, seqtype_t type, int modenum, bool nostop)
{
if (!nostop)
@ -882,6 +892,17 @@ DSeqNode *SN_StartSequence (sector_t *sector, int chan, int sequence, seqtype_t
return NULL;
}
DEFINE_ACTION_FUNCTION(_Sector, StartSoundSequenceID)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(chan);
PARAM_INT(seq);
PARAM_INT(type);
PARAM_INT(modenum);
PARAM_BOOL_DEF(nostop);
ACTION_RETURN_POINTER(SN_StartSequence(self, chan, seq, seqtype_t(type), modenum, nostop));
}
DSeqNode *SN_StartSequence (FPolyObj *poly, int sequence, seqtype_t type, int modenum, bool nostop)
{
if (!nostop)
@ -921,6 +942,15 @@ DSeqNode *SN_StartSequence (AActor *actor, FName seqname, int modenum)
return NULL;
}
DEFINE_ACTION_FUNCTION(AActor, StartSoundSequence)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_NAME(seq);
PARAM_INT(modenum);
ACTION_RETURN_POINTER(SN_StartSequence(self, seq, modenum));
}
DSeqNode *SN_StartSequence (sector_t *sec, int chan, const char *seqname, int modenum)
{
int seqnum = FindSequence(seqname);
@ -941,6 +971,15 @@ DSeqNode *SN_StartSequence (sector_t *sec, int chan, FName seqname, int modenum)
return NULL;
}
DEFINE_ACTION_FUNCTION(_Sector, StartSoundSequence)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(chan);
PARAM_NAME(seq);
PARAM_INT(modenum);
ACTION_RETURN_POINTER(SN_StartSequence(self, chan, seq, modenum));
}
DSeqNode *SN_StartSequence (FPolyObj *poly, const char *seqname, int modenum)
{
int seqnum = FindSequence(seqname);
@ -1001,6 +1040,13 @@ DSeqNode *SN_CheckSequence(sector_t *sector, int chan)
return NULL;
}
DEFINE_ACTION_FUNCTION(_Sector, CheckSoundSequence)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(chan);
ACTION_RETURN_POINTER(SN_CheckSequence(self, chan));
}
//==========================================================================
//
// SN_StopSequence
@ -1012,6 +1058,13 @@ void SN_StopSequence (AActor *actor)
SN_DoStop (actor);
}
DEFINE_ACTION_FUNCTION(AActor, StopSoundSequence)
{
PARAM_SELF_PROLOGUE(AActor);
SN_StopSequence(self);
return 0;
}
void SN_StopSequence (sector_t *sector, int chan)
{
DSeqNode *node = SN_CheckSequence(sector, chan);
@ -1021,6 +1074,15 @@ void SN_StopSequence (sector_t *sector, int chan)
}
}
DEFINE_ACTION_FUNCTION(_Sector, StopSoundSequence)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(chan);
SN_StopSequence(self, chan);
return 0;
}
void SN_StopSequence (FPolyObj *poly)
{
SN_DoStop (poly);
@ -1090,6 +1152,13 @@ bool SN_IsMakingLoopingSound (sector_t *sector)
return false;
}
DEFINE_ACTION_FUNCTION(_Sector, IsMakingLoopingSound)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
ACTION_RETURN_BOOL(SN_IsMakingLoopingSound(self));
}
//==========================================================================
//
// SN_UpdateActiveSequences
@ -1325,6 +1394,15 @@ FName SN_GetSequenceSlot (int sequence, seqtype_t type)
return NAME_None;
}
DEFINE_ACTION_FUNCTION(DSeqNode, GetSequenceSlot)
{
PARAM_PROLOGUE;
PARAM_INT(seq);
PARAM_INT(type);
ACTION_RETURN_INT(SN_GetSequenceSlot(seq, seqtype_t(type)).GetIndex());
}
//==========================================================================
//
// SN_MarkPrecacheSounds
@ -1351,6 +1429,16 @@ void SN_MarkPrecacheSounds(int sequence, seqtype_t type)
}
}
DEFINE_ACTION_FUNCTION(DSeqNode, MarkPrecacheSounds)
{
PARAM_PROLOGUE;
PARAM_INT(seq);
PARAM_INT(type);
SN_MarkPrecacheSounds(seq, seqtype_t(type));
return 0;
}
//==========================================================================
//
// SN_ChangeNodeData
@ -1462,7 +1550,16 @@ bool SN_AreModesSame(int seqnum, seqtype_t type, int mode1, int mode2)
return true;
}
bool SN_AreModesSame(const char *name, int mode1, int mode2)
DEFINE_ACTION_FUNCTION(DSeqNode, AreModesSameID)
{
PARAM_SELF_PROLOGUE(DSeqNode);
PARAM_INT(seqnum);
PARAM_INT(type);
PARAM_INT(mode);
ACTION_RETURN_BOOL(SN_AreModesSame(seqnum, seqtype_t(type), mode, self->GetModeNum()));
}
bool SN_AreModesSame(FName name, int mode1, int mode2)
{
int seqnum = FindSequence(name);
if (seqnum >= 0)
@ -1473,6 +1570,14 @@ bool SN_AreModesSame(const char *name, int mode1, int mode2)
return true;
}
DEFINE_ACTION_FUNCTION(DSeqNode, AreModesSame)
{
PARAM_SELF_PROLOGUE(DSeqNode);
PARAM_NAME(seq);
PARAM_INT(mode);
ACTION_RETURN_BOOL(SN_AreModesSame(seq, mode, self->GetModeNum()));
}
//==========================================================================
//
// CCMD playsequence