mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
Export P_GetOffsetPosition and ADynamicLight::SetOffset to ZScript
This commit is contained in:
parent
66a2cdb6e9
commit
789941f24d
4 changed files with 33 additions and 1 deletions
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
|
|
@ -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));
|
||||||
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
//
|
//
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -29,6 +29,8 @@ class DynamicLight : Actor native
|
||||||
RandomColorFlickerLight
|
RandomColorFlickerLight
|
||||||
};
|
};
|
||||||
|
|
||||||
|
native void SetOffset(Vector3 offset);
|
||||||
|
|
||||||
Default
|
Default
|
||||||
{
|
{
|
||||||
Height 0;
|
Height 0;
|
||||||
|
|
Loading…
Reference in a new issue