- added a larger batch of function exports.
- cleaned up the virtual function interface of APlayerPawn which still had many virtual declarations from old times when class properties were handled through virtual overrides. None of this makes sense these days anymore.
This commit is contained in:
parent
4372a14479
commit
bbf62132d8
12 changed files with 499 additions and 42 deletions
187
src/p_mobj.cpp
187
src/p_mobj.cpp
|
|
@ -568,6 +568,13 @@ bool AActor::InStateSequence(FState * newstate, FState * basestate)
|
|||
return false;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, InStateSequence)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_POINTER(newstate, FState);
|
||||
PARAM_POINTER(basestate, FState);
|
||||
ACTION_RETURN_BOOL(self->InStateSequence(newstate, basestate));
|
||||
}
|
||||
//==========================================================================
|
||||
//
|
||||
// AActor::GetTics
|
||||
|
|
@ -736,6 +743,15 @@ void AActor::AddInventory (AInventory *item)
|
|||
Inventory->InventoryID = InventoryID++;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, AddInventory)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_OBJECT(item, AInventory);
|
||||
self->AddInventory(item);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// AActor :: GiveInventory
|
||||
|
|
@ -795,6 +811,14 @@ bool AActor::GiveInventory(PClassInventory *type, int amount, bool givecheat)
|
|||
return result;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, Inventory)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_OBJECT(item, AInventory);
|
||||
ACTION_RETURN_BOOL(self->UseInventory(item));
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// AActor :: RemoveInventory
|
||||
|
|
@ -822,6 +846,15 @@ void AActor::RemoveInventory(AInventory *item)
|
|||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, RemoveInventory)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_OBJECT(item, AInventory);
|
||||
self->RemoveInventory(item);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// AActor :: TakeInventory
|
||||
|
|
@ -1186,6 +1219,14 @@ void AActor::ClearInventory()
|
|||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, ClearInventory)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
self->ClearInventory();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// AActor :: CopyFriendliness
|
||||
|
|
@ -3176,6 +3217,18 @@ DEFINE_ACTION_FUNCTION(AActor, RemoveFromHash)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, ChangeTid)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_INT(tid);
|
||||
self->RemoveFromHash();
|
||||
self->tid = tid;
|
||||
self->AddToHash();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// P_IsTIDUsed
|
||||
|
|
@ -3258,6 +3311,17 @@ int P_FindUniqueTID(int start_tid, int limit)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, FindUniqueTid)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_INT_DEF(start);
|
||||
PARAM_INT_DEF(limit);
|
||||
ACTION_RETURN_INT(P_FindUniqueTID(start, limit));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
CCMD(utid)
|
||||
{
|
||||
Printf("%d\n",
|
||||
|
|
@ -3537,6 +3601,14 @@ void AActor::SetShade (int r, int g, int b)
|
|||
fillcolor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, SetShade)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_INT(color);
|
||||
self->SetShade(color);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AActor::SetPitch(DAngle p, bool interpolate, bool forceclamp)
|
||||
{
|
||||
if (player != NULL || forceclamp)
|
||||
|
|
@ -5777,6 +5849,19 @@ void P_SpawnBlood (const DVector3 &pos1, DAngle dir, int damage, AActor *origina
|
|||
P_DrawSplash2 (40, pos, dir, 2, bloodcolor);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, SpawnBlood)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_FLOAT(x);
|
||||
PARAM_FLOAT(y);
|
||||
PARAM_FLOAT(z);
|
||||
PARAM_ANGLE(dir);
|
||||
PARAM_INT(damage);
|
||||
P_SpawnBlood(DVector3(x, y, z), dir, damage, self);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// PROC P_BloodSplatter
|
||||
|
|
@ -5859,6 +5944,20 @@ void P_BloodSplatter2 (const DVector3 &pos, AActor *originator, DAngle hitangle)
|
|||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, BloodSplatter)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_FLOAT(x);
|
||||
PARAM_FLOAT(y);
|
||||
PARAM_FLOAT(z);
|
||||
PARAM_ANGLE(dir);
|
||||
PARAM_BOOL_DEF(axe);
|
||||
if (axe) P_BloodSplatter2(DVector3(x, y, z), self, dir);
|
||||
else P_BloodSplatter(DVector3(x, y, z), self, dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// PROC P_RipperBlood
|
||||
|
|
@ -6078,6 +6177,20 @@ foundone:
|
|||
return plane == &sec->floorplane ? Terrains[terrainnum].IsLiquid : false;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, HitWater)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_POINTER(sec, sector_t);
|
||||
PARAM_FLOAT(x);
|
||||
PARAM_FLOAT(y);
|
||||
PARAM_FLOAT(z);
|
||||
PARAM_BOOL_DEF(checkabove);
|
||||
PARAM_BOOL_DEF(alert);
|
||||
PARAM_BOOL_DEF(force);
|
||||
ACTION_RETURN_BOOL(P_HitWater(self, sec, DVector3(x, y, z), checkabove, alert, force));
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// FUNC P_HitFloor
|
||||
|
|
@ -6284,6 +6397,15 @@ void P_PlaySpawnSound(AActor *missile, AActor *spawner)
|
|||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, PlaySpawnSound)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_OBJECT(missile, AActor);
|
||||
P_PlaySpawnSound(missile, self);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static double GetDefaultSpeed(PClassActor *type)
|
||||
{
|
||||
if (type == NULL)
|
||||
|
|
@ -6911,6 +7033,14 @@ bool AActor::IsHostile (AActor *other)
|
|||
return true;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, isHostile)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_OBJECT(other, AActor);
|
||||
ACTION_RETURN_BOOL(self->IsHostile(other));
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// AActor :: DoSpecialDamage
|
||||
|
|
@ -7179,6 +7309,13 @@ double AActor::GetCameraHeight() const
|
|||
return GetClass()->CameraHeight == INT_MIN ? Height / 2 : GetClass()->CameraHeight;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, GetCameraHeight)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
ACTION_RETURN_FLOAT(self->GetCameraHeight());
|
||||
}
|
||||
|
||||
|
||||
DDropItem *AActor::GetDropItems() const
|
||||
{
|
||||
return GetClass()->DropItems;
|
||||
|
|
@ -7196,6 +7333,13 @@ double AActor::GetGravity() const
|
|||
return level.gravity * Sector->gravity * Gravity * 0.00125;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, GetGravity)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
ACTION_RETURN_FLOAT(self->GetGravity());
|
||||
}
|
||||
|
||||
|
||||
// killough 11/98:
|
||||
// Whether an object is "sentient" or not. Used for environmental influences.
|
||||
// (left precisely the same as MBF even though it doesn't make much sense.)
|
||||
|
|
@ -7240,14 +7384,17 @@ DEFINE_ACTION_FUNCTION(AActor, GetTag)
|
|||
|
||||
void AActor::SetTag(const char *def)
|
||||
{
|
||||
if (def == NULL || *def == 0)
|
||||
{
|
||||
Tag = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
Tag = mStringPropertyData.Alloc(def);
|
||||
}
|
||||
if (def == NULL || *def == 0) Tag = nullptr;
|
||||
else Tag = mStringPropertyData.Alloc(def);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, SetTag)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_STRING(def);
|
||||
if (def.IsEmpty()) self->Tag = nullptr;
|
||||
else self->Tag = self->mStringPropertyData.Alloc(def);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -7392,6 +7539,13 @@ DEFINE_ACTION_FUNCTION(AActor, Distance2D)
|
|||
ACTION_RETURN_FLOAT(self->Distance2D(other));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, Distance3D)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_OBJECT(other, AActor);
|
||||
ACTION_RETURN_FLOAT(self->Distance3D(other));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, AddZ)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
|
|
@ -7455,6 +7609,17 @@ DEFINE_ACTION_FUNCTION(AActor, VelFromAngle)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// This combines all 3 variations of the internal function
|
||||
DEFINE_ACTION_FUNCTION(AActor, Vel3DFromAngle)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_FLOAT(speed);
|
||||
PARAM_ANGLE(angle);
|
||||
PARAM_ANGLE(pitch);
|
||||
self->Vel3DFromAngle(pitch, angle, speed);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This combines all 3 variations of the internal function
|
||||
DEFINE_ACTION_FUNCTION(AActor, Thrust)
|
||||
{
|
||||
|
|
@ -7619,6 +7784,12 @@ DEFINE_ACTION_FUNCTION(AActor, AccuracyFactor)
|
|||
ACTION_RETURN_FLOAT(self->AccuracyFactor());
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, CountsAsKill)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
ACTION_RETURN_FLOAT(self->CountsAsKill());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
// DropItem handling
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue