perl_object.cpp formatting

This commit is contained in:
Akkadius 2018-07-01 20:29:09 -05:00
parent ed37715993
commit 5b05987e27

View File

@ -26,7 +26,9 @@
*/
#include "../common/features.h"
#ifdef EMBPERL_XS_CLASSES
#include "../common/global_define.h"
#include "embperl.h"
@ -41,8 +43,7 @@
#endif
XS(XS_Object_IsGroundSpawn); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_IsGroundSpawn)
{
XS(XS_Object_IsGroundSpawn) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::IsGroundSpawn(THIS)");
@ -53,8 +54,7 @@ XS(XS_Object_IsGroundSpawn)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -67,10 +67,8 @@ XS(XS_Object_IsGroundSpawn)
}
XS(XS_Object_Close); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_Close)
{
XS(XS_Object_Close) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::Close(THIS)");
@ -80,8 +78,7 @@ XS(XS_Object_Close)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -93,8 +90,7 @@ XS(XS_Object_Close)
XS(XS_Object_Delete); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_Delete)
{
XS(XS_Object_Delete) {
dXSARGS;
if (items < 1 || items > 2)
Perl_croak(aTHX_ "Usage: Object::Delete(THIS, [bool reset_state = false])");
@ -105,8 +101,7 @@ XS(XS_Object_Delete)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -122,8 +117,7 @@ XS(XS_Object_Delete)
XSRETURN_EMPTY;
}
XS(XS_Object_StartDecay); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_StartDecay)
{
XS(XS_Object_StartDecay) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::StartDecay(THIS)");
@ -133,8 +127,7 @@ XS(XS_Object_StartDecay)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -146,8 +139,7 @@ XS(XS_Object_StartDecay)
XS(XS_Object_DeleteItem); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_DeleteItem)
{
XS(XS_Object_DeleteItem) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::DeleteItem(THIS, uint8 index)");
@ -158,8 +150,7 @@ XS(XS_Object_DeleteItem)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -170,8 +161,7 @@ XS(XS_Object_DeleteItem)
}
XS(XS_Object_IsObject); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_IsObject)
{
XS(XS_Object_IsObject) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::IsObject(THIS)");
@ -182,8 +172,7 @@ XS(XS_Object_IsObject)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -197,8 +186,7 @@ XS(XS_Object_IsObject)
XS(XS_Object_Save); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_Save)
{
XS(XS_Object_Save) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::Save(THIS)");
@ -209,8 +197,7 @@ XS(XS_Object_Save)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -224,8 +211,7 @@ XS(XS_Object_Save)
XS(XS_Object_SetID); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetID)
{
XS(XS_Object_SetID) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetID(THIS, uint16 id)");
@ -236,8 +222,7 @@ XS(XS_Object_SetID)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -249,8 +234,7 @@ XS(XS_Object_SetID)
XS(XS_Object_ClearUser); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_ClearUser)
{
XS(XS_Object_ClearUser) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::ClearUser(THIS)");
@ -260,8 +244,7 @@ XS(XS_Object_ClearUser)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -273,8 +256,7 @@ XS(XS_Object_ClearUser)
XS(XS_Object_GetDBID); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetDBID)
{
XS(XS_Object_GetDBID) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetDBID(THIS)");
@ -286,21 +268,20 @@ XS(XS_Object_GetDBID)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetDBID();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_GetID); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetID)
{
XS(XS_Object_GetID) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetID(THIS)");
@ -312,21 +293,20 @@ XS(XS_Object_GetID)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetID();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_GetX); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetX)
{
XS(XS_Object_GetX) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetX(THIS)");
@ -338,21 +318,20 @@ XS(XS_Object_GetX)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetX();
XSprePUSH; PUSHn((double)RETVAL);
XSprePUSH;
PUSHn((double) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_GetY); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetY)
{
XS(XS_Object_GetY) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetY(THIS)");
@ -364,21 +343,20 @@ XS(XS_Object_GetY)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetY();
XSprePUSH; PUSHn((double)RETVAL);
XSprePUSH;
PUSHn((double) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_GetZ); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetZ)
{
XS(XS_Object_GetZ) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetZ(THIS)");
@ -390,21 +368,20 @@ XS(XS_Object_GetZ)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetZ();
XSprePUSH; PUSHn((double)RETVAL);
XSprePUSH;
PUSHn((double) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_GetHeading); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetHeading)
{
XS(XS_Object_GetHeading) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetHeading(THIS)");
@ -416,21 +393,20 @@ XS(XS_Object_GetHeading)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetHeadingData();
XSprePUSH; PUSHn((double)RETVAL);
XSprePUSH;
PUSHn((double) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_VarSave); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_VarSave)
{
XS(XS_Object_VarSave) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::VarSave(THIS)");
@ -442,22 +418,21 @@ XS(XS_Object_VarSave)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->VarSave();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_GetType); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetType)
{
XS(XS_Object_GetType) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetType(THIS)");
@ -469,22 +444,21 @@ XS(XS_Object_GetType)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetType();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_SetType); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetType)
{
XS(XS_Object_SetType) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetType(THIS, uint32 type)");
@ -495,8 +469,7 @@ XS(XS_Object_SetType)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -508,8 +481,7 @@ XS(XS_Object_SetType)
XS(XS_Object_GetIcon); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetIcon)
{
XS(XS_Object_GetIcon) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetIcon(THIS)");
@ -521,22 +493,21 @@ XS(XS_Object_GetIcon)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetIcon();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_SetIcon); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetIcon)
{
XS(XS_Object_SetIcon) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetIcon(THIS, uint32 icon)");
@ -547,8 +518,7 @@ XS(XS_Object_SetIcon)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -560,8 +530,7 @@ XS(XS_Object_SetIcon)
XS(XS_Object_GetItemID); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetItemID)
{
XS(XS_Object_GetItemID) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetItemID(THIS)");
@ -573,22 +542,21 @@ XS(XS_Object_GetItemID)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetItemID();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_SetItemID); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetItemID)
{
XS(XS_Object_SetItemID) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetItemID(THIS, uint32 item_id)");
@ -599,8 +567,7 @@ XS(XS_Object_SetItemID)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -611,8 +578,7 @@ XS(XS_Object_SetItemID)
}
XS(XS_Object_SetLocation); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetLocation)
{
XS(XS_Object_SetLocation) {
dXSARGS;
if (items != 4)
Perl_croak(aTHX_ "Usage: Object::SetLocation(THIS, float x, float y, float z)");
@ -625,8 +591,7 @@ XS(XS_Object_SetLocation)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -637,8 +602,7 @@ XS(XS_Object_SetLocation)
}
XS(XS_Object_SetX); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetX)
{
XS(XS_Object_SetX) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetX(THIS, float x)");
@ -649,8 +613,7 @@ XS(XS_Object_SetX)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -661,8 +624,7 @@ XS(XS_Object_SetX)
}
XS(XS_Object_SetY); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetY)
{
XS(XS_Object_SetY) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetY(THIS, float y)");
@ -673,8 +635,7 @@ XS(XS_Object_SetY)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -685,8 +646,7 @@ XS(XS_Object_SetY)
}
XS(XS_Object_SetZ); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetZ)
{
XS(XS_Object_SetZ) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetZ(THIS, float z)");
@ -697,8 +657,7 @@ XS(XS_Object_SetZ)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -709,8 +668,7 @@ XS(XS_Object_SetZ)
}
XS(XS_Object_SetHeading); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetHeading)
{
XS(XS_Object_SetHeading) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetHeading(THIS, float heading)");
@ -721,8 +679,7 @@ XS(XS_Object_SetHeading)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -733,8 +690,7 @@ XS(XS_Object_SetHeading)
}
XS(XS_Object_SetModelName); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetModelName)
{
XS(XS_Object_SetModelName) {
dXSARGS;
if (items < 1 || items > 2)
Perl_croak(aTHX_ "Usage: Object::SetModelName(THIS, string name)");
@ -745,8 +701,7 @@ XS(XS_Object_SetModelName)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -758,8 +713,7 @@ XS(XS_Object_SetModelName)
XSRETURN_EMPTY;
}
XS(XS_Object_GetModelName); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetModelName)
{
XS(XS_Object_GetModelName) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetModelName(THIS)");
@ -771,21 +725,21 @@ XS(XS_Object_GetModelName)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetModelName();
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
sv_setpv(TARG, RETVAL);
XSprePUSH;
PUSHTARG;
}
XSRETURN(1);
}
XS(XS_Object_Repop); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_Repop)
{
XS(XS_Object_Repop) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::Repop(THIS)");
@ -796,8 +750,7 @@ XS(XS_Object_Repop)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -807,8 +760,7 @@ XS(XS_Object_Repop)
}
XS(XS_Object_Depop); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_Depop)
{
XS(XS_Object_Depop) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::Depop(THIS)");
@ -819,8 +771,7 @@ XS(XS_Object_Depop)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -831,8 +782,7 @@ XS(XS_Object_Depop)
XS(XS_Object_GetEntityVariable); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetEntityVariable)
{
XS(XS_Object_GetEntityVariable) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::GetEntityVariable(THIS, string key)");
@ -845,21 +795,21 @@ XS(XS_Object_GetEntityVariable)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetEntityVariable(id);
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
sv_setpv(TARG, RETVAL);
XSprePUSH;
PUSHTARG;
}
XSRETURN(1);
}
XS(XS_Object_EntityVariableExists); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_EntityVariableExists)
{
XS(XS_Object_EntityVariableExists) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::EntityVariableExists(THIS, string key)");
@ -871,8 +821,7 @@ XS(XS_Object_EntityVariableExists)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -885,8 +834,7 @@ XS(XS_Object_EntityVariableExists)
}
XS(XS_Object_SetEntityVariable); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetEntityVariable)
{
XS(XS_Object_SetEntityVariable) {
dXSARGS;
if (items != 3)
Perl_croak(aTHX_ "Usage: Object::SetEntityVariable(THIS, string key, string var)");
@ -898,8 +846,7 @@ XS(XS_Object_SetEntityVariable)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -910,8 +857,7 @@ XS(XS_Object_SetEntityVariable)
}
XS(XS_Object_GetSolidType); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetSolidType)
{
XS(XS_Object_GetSolidType) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetSolidType(THIS)");
@ -923,22 +869,21 @@ XS(XS_Object_GetSolidType)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetSolidType();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_SetSolidType); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetSolidType)
{
XS(XS_Object_SetSolidType) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetSolidType(THIS, uint16 type)");
@ -949,8 +894,7 @@ XS(XS_Object_SetSolidType)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -961,8 +905,7 @@ XS(XS_Object_SetSolidType)
}
XS(XS_Object_GetSize); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetSize)
{
XS(XS_Object_GetSize) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetSize(THIS)");
@ -974,22 +917,21 @@ XS(XS_Object_GetSize)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetSize();
XSprePUSH; PUSHn((double)RETVAL);
XSprePUSH;
PUSHn((double) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_SetSize); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetSize)
{
XS(XS_Object_SetSize) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetSize(THIS, float size)");
@ -1000,8 +942,7 @@ XS(XS_Object_SetSize)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -1012,8 +953,7 @@ XS(XS_Object_SetSize)
}
XS(XS_Object_SetTiltX); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetTiltX)
{
XS(XS_Object_SetTiltX) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetTiltX(THIS, float tilt_x)");
@ -1024,8 +964,7 @@ XS(XS_Object_SetTiltX)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -1036,8 +975,7 @@ XS(XS_Object_SetTiltX)
}
XS(XS_Object_SetTiltY); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_SetTiltY)
{
XS(XS_Object_SetTiltY) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Object::SetTiltY(THIS, float tilt_y)");
@ -1048,8 +986,7 @@ XS(XS_Object_SetTiltY)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -1060,8 +997,7 @@ XS(XS_Object_SetTiltY)
}
XS(XS_Object_GetTiltX); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetTiltX)
{
XS(XS_Object_GetTiltX) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetSize(THIS)");
@ -1073,21 +1009,20 @@ XS(XS_Object_GetTiltX)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetTiltX();
XSprePUSH; PUSHn((double)RETVAL);
XSprePUSH;
PUSHn((double) RETVAL);
}
XSRETURN(1);
}
XS(XS_Object_GetTiltY); /* prototype to pass -Wmissing-prototypes */
XS(XS_Object_GetTiltY)
{
XS(XS_Object_GetTiltY) {
dXSARGS;
if (items != 1)
Perl_croak(aTHX_ "Usage: Object::GetSize(THIS)");
@ -1099,14 +1034,14 @@ XS(XS_Object_GetTiltY)
if (sv_derived_from(ST(0), "Object")) {
IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Object *, tmp);
}
else
} else
Perl_croak(aTHX_ "THIS is not of type Object");
if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetTiltY();
XSprePUSH; PUSHn((double)RETVAL);
XSprePUSH;
PUSHn((double) RETVAL);
}
XSRETURN(1);
}
@ -1115,8 +1050,7 @@ XS(XS_Object_GetTiltY)
extern "C"
#endif
XS(boot_Object); /* prototype to pass -Wmissing-prototypes */
XS(boot_Object)
{
XS(boot_Object) {
dXSARGS;
char file[256];
strncpy(file, __FILE__, 256);