Export P_GetOffsetPosition and ADynamicLight::SetOffset to ZScript

This commit is contained in:
Cacodemon345 2018-12-20 16:01:24 +06:00 committed by Christoph Oelckers
parent 66a2cdb6e9
commit 789941f24d
4 changed files with 33 additions and 1 deletions

View file

@ -426,6 +426,20 @@ void ADynamicLight::SetOffset(const DVector3 &pos)
UpdateLocation(); UpdateLocation();
} }
static void SetOffset(ADynamicLight *self, const DVector3 &pos)
{
self->SetOffset(pos);
}
DEFINE_ACTION_FUNCTION_NATIVE(ADynamicLight, SetOffset, SetOffset)
{
PARAM_SELF_PROLOGUE(ADynamicLight)
PARAM_FLOAT(x)
PARAM_FLOAT(y)
PARAM_FLOAT(z)
self->SetOffset(DVector3(x, y, z));
return 0;
}
//========================================================================== //==========================================================================
// //

View file

@ -820,6 +820,20 @@ DVector2 P_GetOffsetPosition(double x, double y, double dx, double dy)
return dest; return dest;
} }
static void GetOffsetPosition(double x, double y, double dx, double dy, DVector2 *result)
{
*result = P_GetOffsetPosition(x, y, dx, dy);
}
DEFINE_ACTION_FUNCTION_NATIVE(DObject, GetOffsetPosition, GetOffsetPosition)
{
PARAM_PROLOGUE;
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_FLOAT(dx);
PARAM_FLOAT(dy);
ACTION_RETURN_VEC2(P_GetOffsetPosition(x, y, dx, dy));
}
//============================================================================ //============================================================================
// //

View file

@ -406,6 +406,8 @@ class Object native
native static uint MSTime(); native static uint MSTime();
native vararg static void ThrowAbortException(String fmt, ...); native vararg static void ThrowAbortException(String fmt, ...);
native static Vector2 GetOffsetPosition(double x, double y, double dx, double dy);
native virtualscope void Destroy(); native virtualscope void Destroy();
// This does not call into the native method of the same name to avoid problems with objects that get garbage collected late on shutdown. // This does not call into the native method of the same name to avoid problems with objects that get garbage collected late on shutdown.

View file

@ -28,7 +28,9 @@ class DynamicLight : Actor native
ColorFlickerLight, ColorFlickerLight,
RandomColorFlickerLight RandomColorFlickerLight
}; };
native void SetOffset(Vector3 offset);
Default Default
{ {
Height 0; Height 0;