- scriptified two of the Acolyte's functions.

- added a DActorIterator class.
- fixed: It was not possible to have functions of the same name in two different classes because the name they were searched for was not qualified by the class. Changed so that the class name is included now, but to avoid renaming several hundreds of functions all at once, if the search fails, it will repeat with 'Actor' as class name.

This commit contains preparations for scriptifying Hexen's Dragon, but that doesn't work yet so it's not included.
This commit is contained in:
Christoph Oelckers 2016-11-16 01:36:21 +01:00
commit 633da6e5d8
32 changed files with 334 additions and 260 deletions

View file

@ -3098,6 +3098,13 @@ void AActor::RemoveFromHash ()
tid = 0;
}
DEFINE_ACTION_FUNCTION(AActor, RemoveFromHash)
{
PARAM_SELF_PROLOGUE(AActor);
self->RemoveFromHash();
return 0;
}
//==========================================================================
//
// P_IsTIDUsed
@ -6886,6 +6893,42 @@ void AActor::SetTranslation(const char *trname)
// silently ignore if the name does not exist, this would create some insane message spam otherwise.
}
class DActorIterator : public DObject, public NActorIterator
{
DECLARE_CLASS(DActorIterator, DObject)
public:
DActorIterator(PClassActor *cls= nullptr, int tid = 0)
: NActorIterator(cls, tid)
{
}
};
IMPLEMENT_CLASS(DActorIterator, false, false, false, false);
DEFINE_ACTION_FUNCTION(DActorIterator, Create)
{
PARAM_PROLOGUE;
PARAM_INT_DEF(tid);
PARAM_CLASS_DEF(type, AActor);
ACTION_RETURN_OBJECT(new DActorIterator(type, tid));
}
DEFINE_ACTION_FUNCTION(DActorIterator, Next)
{
PARAM_SELF_PROLOGUE(DActorIterator);
ACTION_RETURN_OBJECT(self->Next());
}
DEFINE_ACTION_FUNCTION(DActorIterator, Reinit)
{
PARAM_SELF_PROLOGUE(DActorIterator);
self->Reinit();
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, deltaangle) // should this be global?
{
PARAM_PROLOGUE;
@ -6894,6 +6937,14 @@ DEFINE_ACTION_FUNCTION(AActor, deltaangle) // should this be global?
ACTION_RETURN_FLOAT(deltaangle(DAngle(a1), DAngle(a2)).Degrees);
}
DEFINE_ACTION_FUNCTION(AActor, absangle) // should this be global?
{
PARAM_PROLOGUE;
PARAM_FLOAT(a1);
PARAM_FLOAT(a2);
ACTION_RETURN_FLOAT(absangle(DAngle(a1), DAngle(a2)).Degrees);
}
DEFINE_ACTION_FUNCTION(AActor, Distance2D)
{
PARAM_SELF_PROLOGUE(AActor);