- removed the default parameter handling from all native script functions because it is no longer needed.

This commit is contained in:
Christoph Oelckers 2018-11-17 10:03:40 +01:00
parent e643582957
commit 94ed30e782
45 changed files with 736 additions and 769 deletions

View file

@ -1294,7 +1294,7 @@ DEFINE_ACTION_FUNCTION(_Console, HideConsole)
DEFINE_ACTION_FUNCTION(_Console, Printf) DEFINE_ACTION_FUNCTION(_Console, Printf)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
FString s = FStringFormat(param, defaultparam, numparam, ret, numret); FString s = FStringFormat(param, numparam, ret, numret);
Printf("%s\n", s.GetChars()); Printf("%s\n", s.GetChars());
return 0; return 0;
} }
@ -1788,7 +1788,7 @@ DEFINE_ACTION_FUNCTION(_Console, MidPrint)
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER_NOT_NULL(fnt, FFont); PARAM_POINTER_NOT_NULL(fnt, FFont);
PARAM_STRING(text); PARAM_STRING(text);
PARAM_BOOL_DEF(bold); PARAM_BOOL(bold);
const char *txt = text[0] == '$'? GStrings(&text[1]) : text.GetChars(); const char *txt = text[0] == '$'? GStrings(&text[1]) : text.GetChars();
if (!bold) C_MidPrint(fnt, txt); if (!bold) C_MidPrint(fnt, txt);

View file

@ -1589,7 +1589,7 @@ DEFINE_ACTION_FUNCTION(_CVar, GetCVar)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_NAME(name); PARAM_NAME(name);
PARAM_POINTER_DEF(plyr, player_t); PARAM_POINTER(plyr, player_t);
ACTION_RETURN_POINTER(GetCVar(plyr ? plyr->mo : nullptr, name)); ACTION_RETURN_POINTER(GetCVar(plyr ? plyr->mo : nullptr, name));
} }

View file

@ -287,7 +287,7 @@ DEFINE_ACTION_FUNCTION(_Sector, MoveFloor)
PARAM_INT(crush); PARAM_INT(crush);
PARAM_INT(dir); PARAM_INT(dir);
PARAM_BOOL(hex); PARAM_BOOL(hex);
PARAM_BOOL_DEF(inst); PARAM_BOOL(inst);
ACTION_RETURN_INT((int)self->MoveFloor(speed, dest, crush, dir, hex, inst)); ACTION_RETURN_INT((int)self->MoveFloor(speed, dest, crush, dir, hex, inst));
} }

View file

@ -979,8 +979,8 @@ IMPLEMENT_CLASS(DThinkerIterator, true, false);
DEFINE_ACTION_FUNCTION(DThinkerIterator, Create) DEFINE_ACTION_FUNCTION(DThinkerIterator, Create)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_CLASS_DEF(type, DThinker); PARAM_CLASS(type, DThinker);
PARAM_INT_DEF(statnum); PARAM_INT(statnum);
ACTION_RETURN_OBJECT(Create<DThinkerIterator>(type, statnum)); ACTION_RETURN_OBJECT(Create<DThinkerIterator>(type, statnum));
} }

View file

@ -636,9 +636,9 @@ DEFINE_ACTION_FUNCTION(DEventHandler, SendNetworkEvent)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_STRING(name); PARAM_STRING(name);
PARAM_INT_DEF(arg1); PARAM_INT(arg1);
PARAM_INT_DEF(arg2); PARAM_INT(arg2);
PARAM_INT_DEF(arg3); PARAM_INT(arg3);
// //
ACTION_RETURN_BOOL(E_SendNetworkEvent(name, arg1, arg2, arg3, false)); ACTION_RETURN_BOOL(E_SendNetworkEvent(name, arg1, arg2, arg3, false));

View file

@ -1656,7 +1656,7 @@ DEFINE_ACTION_FUNCTION(DObject, G_PickPlayerStart)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_INT(playernum); PARAM_INT(playernum);
PARAM_INT_DEF(flags); PARAM_INT(flags);
auto ps = G_PickPlayerStart(playernum, flags); auto ps = G_PickPlayerStart(playernum, flags);
if (numret > 1) if (numret > 1)
{ {
@ -2976,7 +2976,7 @@ void G_StartSlideshow(FName whichone)
DEFINE_ACTION_FUNCTION(FLevelLocals, StartSlideshow) DEFINE_ACTION_FUNCTION(FLevelLocals, StartSlideshow)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_NAME_DEF(whichone); PARAM_NAME(whichone);
G_StartSlideshow(whichone); G_StartSlideshow(whichone);
return 0; return 0;
} }

View file

@ -522,7 +522,7 @@ DEFINE_ACTION_FUNCTION(AActor, CheckKeys)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(locknum); PARAM_INT(locknum);
PARAM_BOOL(remote); PARAM_BOOL(remote);
PARAM_BOOL_DEF(quiet); PARAM_BOOL(quiet);
ACTION_RETURN_BOOL(P_CheckKeys(self, locknum, remote, quiet)); ACTION_RETURN_BOOL(P_CheckKeys(self, locknum, remote, quiet));
} }

View file

@ -298,8 +298,8 @@ DEFINE_ACTION_FUNCTION(AWeapon, CheckAmmo)
PARAM_SELF_PROLOGUE(AWeapon); PARAM_SELF_PROLOGUE(AWeapon);
PARAM_INT(mode); PARAM_INT(mode);
PARAM_BOOL(autoswitch); PARAM_BOOL(autoswitch);
PARAM_BOOL_DEF(require); PARAM_BOOL(require);
PARAM_INT_DEF(ammocnt); PARAM_INT(ammocnt);
ACTION_RETURN_BOOL(self->DoCheckAmmo(mode, autoswitch, require, ammocnt)); ACTION_RETURN_BOOL(self->DoCheckAmmo(mode, autoswitch, require, ammocnt));
} }
@ -376,8 +376,8 @@ DEFINE_ACTION_FUNCTION(AWeapon, DepleteAmmo)
{ {
PARAM_SELF_PROLOGUE(AWeapon); PARAM_SELF_PROLOGUE(AWeapon);
PARAM_BOOL(altfire); PARAM_BOOL(altfire);
PARAM_BOOL_DEF(checkenough); PARAM_BOOL(checkenough);
PARAM_INT_DEF(ammouse); PARAM_INT(ammouse);
ACTION_RETURN_BOOL(self->DoDepleteAmmo(altfire, checkenough, ammouse)); ACTION_RETURN_BOOL(self->DoDepleteAmmo(altfire, checkenough, ammouse));
} }

View file

@ -2097,9 +2097,9 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, SphericalCoords)
PARAM_FLOAT(targetX); PARAM_FLOAT(targetX);
PARAM_FLOAT(targetY); PARAM_FLOAT(targetY);
PARAM_FLOAT(targetZ); PARAM_FLOAT(targetZ);
PARAM_ANGLE_DEF(viewYaw); PARAM_ANGLE(viewYaw);
PARAM_ANGLE_DEF(viewPitch); PARAM_ANGLE(viewPitch);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
DVector3 viewpoint(viewpointX, viewpointY, viewpointZ); DVector3 viewpoint(viewpointX, viewpointY, viewpointZ);
DVector3 target(targetX, targetY, targetZ); DVector3 target(targetX, targetY, targetZ);
@ -2119,7 +2119,7 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, Vec2Offset)
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(dx); PARAM_FLOAT(dx);
PARAM_FLOAT(dy); PARAM_FLOAT(dy);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
if (absolute) if (absolute)
{ {
ACTION_RETURN_VEC2(DVector2(x + dx, y + dy)); ACTION_RETURN_VEC2(DVector2(x + dx, y + dy));
@ -2139,7 +2139,7 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, Vec2OffsetZ)
PARAM_FLOAT(dx); PARAM_FLOAT(dx);
PARAM_FLOAT(dy); PARAM_FLOAT(dy);
PARAM_FLOAT(atz); PARAM_FLOAT(atz);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
if (absolute) if (absolute)
{ {
ACTION_RETURN_VEC3(DVector3(x + dx, y + dy, atz)); ACTION_RETURN_VEC3(DVector3(x + dx, y + dy, atz));
@ -2160,7 +2160,7 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, Vec3Offset)
PARAM_FLOAT(dx); PARAM_FLOAT(dx);
PARAM_FLOAT(dy); PARAM_FLOAT(dy);
PARAM_FLOAT(dz); PARAM_FLOAT(dz);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
if (absolute) if (absolute)
{ {
ACTION_RETURN_VEC3(DVector3(x + dx, y + dy, z + dz)); ACTION_RETURN_VEC3(DVector3(x + dx, y + dy, z + dz));

View file

@ -84,7 +84,7 @@ void A_Unblock(AActor *self, bool drop)
DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking) DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(drop); PARAM_BOOL(drop);
A_Unblock(self, drop); A_Unblock(self, drop);
return 0; return 0;
} }

View file

@ -180,8 +180,8 @@ DEFINE_ACTION_FUNCTION(_PlayerInfo, MorphPlayer)
PARAM_CLASS(spawntype, APlayerPawn); PARAM_CLASS(spawntype, APlayerPawn);
PARAM_INT(duration); PARAM_INT(duration);
PARAM_INT(style); PARAM_INT(style);
PARAM_CLASS_DEF(enter_flash, AActor); PARAM_CLASS(enter_flash, AActor);
PARAM_CLASS_DEF(exit_flash, AActor); PARAM_CLASS(exit_flash, AActor);
ACTION_RETURN_BOOL(P_MorphPlayer(activator, self, spawntype, duration, style, enter_flash, exit_flash)); ACTION_RETURN_BOOL(P_MorphPlayer(activator, self, spawntype, duration, style, enter_flash, exit_flash));
} }
@ -396,8 +396,8 @@ DEFINE_ACTION_FUNCTION(_PlayerInfo, UndoPlayerMorph)
{ {
PARAM_SELF_STRUCT_PROLOGUE(player_t); PARAM_SELF_STRUCT_PROLOGUE(player_t);
PARAM_POINTER_NOT_NULL(player, player_t); PARAM_POINTER_NOT_NULL(player, player_t);
PARAM_INT_DEF(unmorphflag); PARAM_INT(unmorphflag);
PARAM_BOOL_DEF(force); PARAM_BOOL(force);
ACTION_RETURN_BOOL(P_UndoPlayerMorph(self, player, unmorphflag, force)); ACTION_RETURN_BOOL(P_UndoPlayerMorph(self, player, unmorphflag, force));
} }
@ -466,8 +466,8 @@ DEFINE_ACTION_FUNCTION(AActor, MorphMonster)
PARAM_CLASS(spawntype, AActor); PARAM_CLASS(spawntype, AActor);
PARAM_INT(duration); PARAM_INT(duration);
PARAM_INT(style); PARAM_INT(style);
PARAM_CLASS_DEF(enter_flash, AActor); PARAM_CLASS(enter_flash, AActor);
PARAM_CLASS_DEF(exit_flash, AActor); PARAM_CLASS(exit_flash, AActor);
ACTION_RETURN_BOOL(P_MorphMonster(self, spawntype, duration, style, enter_flash, exit_flash)); ACTION_RETURN_BOOL(P_MorphMonster(self, spawntype, duration, style, enter_flash, exit_flash));
} }
@ -725,10 +725,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Morph)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS(type, AActor); PARAM_CLASS(type, AActor);
PARAM_INT_DEF(duration); PARAM_INT(duration);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_CLASS_DEF(enter_flash, AActor); PARAM_CLASS(enter_flash, AActor);
PARAM_CLASS_DEF(exit_flash, AActor); PARAM_CLASS(exit_flash, AActor);
bool res = false; bool res = false;
if (self->player) if (self->player)
{ {

View file

@ -404,9 +404,9 @@ DEFINE_ACTION_FUNCTION(ASpecialSpot, A_SpawnSingleItem)
{ {
PARAM_SELF_PROLOGUE(ASpecialSpot); PARAM_SELF_PROLOGUE(ASpecialSpot);
PARAM_CLASS_NOT_NULL(cls, AActor); PARAM_CLASS_NOT_NULL(cls, AActor);
PARAM_INT_DEF (fail_sp) PARAM_INT (fail_sp)
PARAM_INT_DEF (fail_co) PARAM_INT (fail_co)
PARAM_INT_DEF (fail_dm) PARAM_INT (fail_dm)
AActor *spot = NULL; AActor *spot = NULL;
DSpotState *state = DSpotState::GetSpotState(); DSpotState *state = DSpotState::GetSpotState();

View file

@ -417,8 +417,8 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, SetSize)
PARAM_INT(rt); PARAM_INT(rt);
PARAM_INT(vw); PARAM_INT(vw);
PARAM_INT(vh); PARAM_INT(vh);
PARAM_INT_DEF(hvw); PARAM_INT(hvw);
PARAM_INT_DEF(hvh); PARAM_INT(hvh);
self->SetSize(rt, vw, vh, hvw, hvh); self->SetSize(rt, vw, vh, hvw, hvh);
return 0; return 0;
} }
@ -555,10 +555,10 @@ void DBaseStatusBar::BeginStatusBar(int resW, int resH, int relTop, bool forceSc
DEFINE_ACTION_FUNCTION(DBaseStatusBar, BeginStatusBar) DEFINE_ACTION_FUNCTION(DBaseStatusBar, BeginStatusBar)
{ {
PARAM_SELF_PROLOGUE(DBaseStatusBar); PARAM_SELF_PROLOGUE(DBaseStatusBar);
PARAM_BOOL_DEF(fs); PARAM_BOOL(fs);
PARAM_INT_DEF(w); PARAM_INT(w);
PARAM_INT_DEF(h); PARAM_INT(h);
PARAM_INT_DEF(r); PARAM_INT(r);
self->BeginStatusBar(w, h, r, fs); self->BeginStatusBar(w, h, r, fs);
return 0; return 0;
} }
@ -580,10 +580,10 @@ void DBaseStatusBar::BeginHUD(int resW, int resH, double Alpha, bool forcescaled
DEFINE_ACTION_FUNCTION(DBaseStatusBar, BeginHUD) DEFINE_ACTION_FUNCTION(DBaseStatusBar, BeginHUD)
{ {
PARAM_SELF_PROLOGUE(DBaseStatusBar); PARAM_SELF_PROLOGUE(DBaseStatusBar);
PARAM_FLOAT_DEF(a); PARAM_FLOAT(a);
PARAM_BOOL_DEF(fs); PARAM_BOOL(fs);
PARAM_INT_DEF(w); PARAM_INT(w);
PARAM_INT_DEF(h); PARAM_INT(h);
self->BeginHUD(w, h, a, fs); self->BeginHUD(w, h, a, fs);
return 0; return 0;
} }
@ -736,8 +736,8 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, AttachMessage)
{ {
PARAM_SELF_PROLOGUE(DBaseStatusBar); PARAM_SELF_PROLOGUE(DBaseStatusBar);
PARAM_OBJECT(msg, DHUDMessageBase); PARAM_OBJECT(msg, DHUDMessageBase);
PARAM_UINT_DEF(id); PARAM_UINT(id);
PARAM_INT_DEF(layer); PARAM_INT(layer);
self->AttachMessage(msg, id, layer); self->AttachMessage(msg, id, layer);
return 0; return 0;
} }
@ -1508,9 +1508,9 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, StatusbarToRealCoords)
{ {
PARAM_SELF_PROLOGUE(DBaseStatusBar); PARAM_SELF_PROLOGUE(DBaseStatusBar);
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT_DEF(y); PARAM_FLOAT(y);
PARAM_FLOAT_DEF(w); PARAM_FLOAT(w);
PARAM_FLOAT_DEF(h); PARAM_FLOAT(h);
self->StatusbarToRealCoords(x, y, w, h); self->StatusbarToRealCoords(x, y, w, h);
if (numret > 0) ret[0].SetFloat(x); if (numret > 0) ret[0].SetFloat(x);
if (numret > 1) ret[1].SetFloat(y); if (numret > 1) ret[1].SetFloat(y);
@ -1657,12 +1657,12 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, DrawTexture)
PARAM_INT(texid); PARAM_INT(texid);
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_FLOAT_DEF(alpha); PARAM_FLOAT(alpha);
PARAM_FLOAT_DEF(w); PARAM_FLOAT(w);
PARAM_FLOAT_DEF(h); PARAM_FLOAT(h);
PARAM_FLOAT_DEF(scaleX); PARAM_FLOAT(scaleX);
PARAM_FLOAT_DEF(scaleY); PARAM_FLOAT(scaleY);
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
self->DrawGraphic(FSetTextureID(texid), x, y, flags, alpha, w, h, scaleX, scaleY); self->DrawGraphic(FSetTextureID(texid), x, y, flags, alpha, w, h, scaleX, scaleY);
return 0; return 0;
@ -1674,12 +1674,12 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, DrawImage)
PARAM_STRING(texid); PARAM_STRING(texid);
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_FLOAT_DEF(alpha); PARAM_FLOAT(alpha);
PARAM_FLOAT_DEF(w); PARAM_FLOAT(w);
PARAM_FLOAT_DEF(h); PARAM_FLOAT(h);
PARAM_FLOAT_DEF(scaleX); PARAM_FLOAT(scaleX);
PARAM_FLOAT_DEF(scaleY); PARAM_FLOAT(scaleY);
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
self->DrawGraphic(TexMan.CheckForTexture(texid, ETextureType::Any), x, y, flags, alpha, w, h, scaleX, scaleY); self->DrawGraphic(TexMan.CheckForTexture(texid, ETextureType::Any), x, y, flags, alpha, w, h, scaleX, scaleY);
return 0; return 0;
@ -1714,10 +1714,10 @@ DEFINE_ACTION_FUNCTION(DHUDFont, Create)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER(fnt, FFont); PARAM_POINTER(fnt, FFont);
PARAM_INT_DEF(spac); PARAM_INT(spac);
PARAM_BOOL_DEF(mono); PARAM_BOOL(mono);
PARAM_INT_DEF(sx); PARAM_INT(sx);
PARAM_INT_DEF(sy); PARAM_INT(sy);
ACTION_RETURN_POINTER(Create<DHUDFont>(fnt, spac, mono, sy, sy)); ACTION_RETURN_POINTER(Create<DHUDFont>(fnt, spac, mono, sy, sy));
} }
@ -1860,11 +1860,11 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, DrawString)
PARAM_STRING(string); PARAM_STRING(string);
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_INT_DEF(trans); PARAM_INT(trans);
PARAM_FLOAT_DEF(alpha); PARAM_FLOAT(alpha);
PARAM_INT_DEF(wrapwidth); PARAM_INT(wrapwidth);
PARAM_INT_DEF(linespacing); PARAM_INT(linespacing);
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
@ -1958,7 +1958,7 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, TransformRect)
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(w); PARAM_FLOAT(w);
PARAM_FLOAT(h); PARAM_FLOAT(h);
PARAM_INT_DEF(flags); PARAM_INT(flags);
self->TransformRect(x, y, w, h, flags); self->TransformRect(x, y, w, h, flags);
if (numret > 0) ret[0].SetFloat(x); if (numret > 0) ret[0].SetFloat(x);
if (numret > 1) ret[1].SetFloat(y); if (numret > 1) ret[1].SetFloat(y);
@ -1997,7 +1997,7 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, Fill)
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(w); PARAM_FLOAT(w);
PARAM_FLOAT(h); PARAM_FLOAT(h);
PARAM_INT_DEF(flags); PARAM_INT(flags);
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
self->Fill(color, x, y, w, h, flags); self->Fill(color, x, y, w, h, flags);
return 0; return 0;
@ -2027,7 +2027,7 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, SetClipRect)
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(w); PARAM_FLOAT(w);
PARAM_FLOAT(h); PARAM_FLOAT(h);
PARAM_INT_DEF(flags); PARAM_INT(flags);
self->SetClipRect(x, y, w, h, flags); self->SetClipRect(x, y, w, h, flags);
return 0; return 0;
} }
@ -2126,10 +2126,10 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, FormatNumber)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_INT(number); PARAM_INT(number);
PARAM_INT_DEF(minsize); PARAM_INT(minsize);
PARAM_INT_DEF(maxsize); PARAM_INT(maxsize);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_STRING_DEF(prefix); PARAM_STRING(prefix);
static int maxvals[] = { 1, 9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999 }; static int maxvals[] = { 1, 9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999 };
if (number == 0 && (flags & FNF_WHENNOTZERO)) ACTION_RETURN_STRING(""); if (number == 0 && (flags & FNF_WHENNOTZERO)) ACTION_RETURN_STRING("");
@ -2155,8 +2155,8 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, GetMugshot)
{ {
PARAM_SELF_PROLOGUE(DBaseStatusBar); PARAM_SELF_PROLOGUE(DBaseStatusBar);
PARAM_INT(accuracy); PARAM_INT(accuracy);
PARAM_INT_DEF(stateflags); PARAM_INT(stateflags);
PARAM_STRING_DEF(def_face); PARAM_STRING(def_face);
auto tex = self->mugshot.GetFace(self->CPlayer, def_face, accuracy, (FMugShot::StateFlags)stateflags); auto tex = self->mugshot.GetFace(self->CPlayer, def_face, accuracy, (FMugShot::StateFlags)stateflags);
ACTION_RETURN_INT(tex ? tex->id.GetIndex() : -1); ACTION_RETURN_INT(tex ? tex->id.GetIndex() : -1);
} }

View file

@ -38,9 +38,9 @@ static bool IsConsolePlayer(player_t *player)
DEFINE_ACTION_FUNCTION(_Shader, SetEnabled) DEFINE_ACTION_FUNCTION(_Shader, SetEnabled)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER_DEF(player, player_t); PARAM_POINTER(player, player_t);
PARAM_STRING(shaderName); PARAM_STRING(shaderName);
PARAM_BOOL_DEF(value); PARAM_BOOL(value);
if (IsConsolePlayer(player)) if (IsConsolePlayer(player))
{ {
@ -57,10 +57,10 @@ DEFINE_ACTION_FUNCTION(_Shader, SetEnabled)
DEFINE_ACTION_FUNCTION(_Shader, SetUniform1f) DEFINE_ACTION_FUNCTION(_Shader, SetUniform1f)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER_DEF(player, player_t); PARAM_POINTER(player, player_t);
PARAM_STRING(shaderName); PARAM_STRING(shaderName);
PARAM_STRING(uniformName); PARAM_STRING(uniformName);
PARAM_FLOAT_DEF(value); PARAM_FLOAT(value);
if (IsConsolePlayer(player)) if (IsConsolePlayer(player))
{ {
@ -83,11 +83,11 @@ DEFINE_ACTION_FUNCTION(_Shader, SetUniform1f)
DEFINE_ACTION_FUNCTION(_Shader, SetUniform2f) DEFINE_ACTION_FUNCTION(_Shader, SetUniform2f)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER_DEF(player, player_t); PARAM_POINTER(player, player_t);
PARAM_STRING(shaderName); PARAM_STRING(shaderName);
PARAM_STRING(uniformName); PARAM_STRING(uniformName);
PARAM_FLOAT_DEF(x); PARAM_FLOAT(x);
PARAM_FLOAT_DEF(y); PARAM_FLOAT(y);
if (IsConsolePlayer(player)) if (IsConsolePlayer(player))
{ {
@ -110,12 +110,12 @@ DEFINE_ACTION_FUNCTION(_Shader, SetUniform2f)
DEFINE_ACTION_FUNCTION(_Shader, SetUniform3f) DEFINE_ACTION_FUNCTION(_Shader, SetUniform3f)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER_DEF(player, player_t); PARAM_POINTER(player, player_t);
PARAM_STRING(shaderName); PARAM_STRING(shaderName);
PARAM_STRING(uniformName); PARAM_STRING(uniformName);
PARAM_FLOAT_DEF(x); PARAM_FLOAT(x);
PARAM_FLOAT_DEF(y); PARAM_FLOAT(y);
PARAM_FLOAT_DEF(z); PARAM_FLOAT(z);
if (IsConsolePlayer(player)) if (IsConsolePlayer(player))
{ {
@ -138,10 +138,10 @@ DEFINE_ACTION_FUNCTION(_Shader, SetUniform3f)
DEFINE_ACTION_FUNCTION(_Shader, SetUniform1i) DEFINE_ACTION_FUNCTION(_Shader, SetUniform1i)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER_DEF(player, player_t); PARAM_POINTER(player, player_t);
PARAM_STRING(shaderName); PARAM_STRING(shaderName);
PARAM_STRING(uniformName); PARAM_STRING(uniformName);
PARAM_INT_DEF(value); PARAM_INT(value);
if (IsConsolePlayer(player)) if (IsConsolePlayer(player))
{ {

View file

@ -535,7 +535,7 @@ DEFINE_ACTION_FUNCTION(DMenu, SetMenu)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_NAME(menu); PARAM_NAME(menu);
PARAM_INT_DEF(mparam); PARAM_INT(mparam);
M_SetMenu(menu, mparam); M_SetMenu(menu, mparam);
return 0; return 0;
} }

View file

@ -270,8 +270,8 @@ DEFINE_ACTION_FUNCTION(DMenu, StartMessage)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_STRING(msg); PARAM_STRING(msg);
PARAM_INT_DEF(mode); PARAM_INT(mode);
PARAM_NAME_DEF(action); PARAM_NAME(action);
M_StartMessage(msg, mode, action); M_StartMessage(msg, mode, action);
return 0; return 0;
} }

File diff suppressed because it is too large Load diff

View file

@ -473,11 +473,11 @@ DEFINE_ACTION_FUNCTION(DCeiling, CreateCeiling)
PARAM_POINTER(ln, line_t); PARAM_POINTER(ln, line_t);
PARAM_FLOAT(speed); PARAM_FLOAT(speed);
PARAM_FLOAT(speed2); PARAM_FLOAT(speed2);
PARAM_FLOAT_DEF(height); PARAM_FLOAT(height);
PARAM_INT_DEF(crush); PARAM_INT(crush);
PARAM_INT_DEF(silent); PARAM_INT(silent);
PARAM_INT_DEF(change); PARAM_INT(change);
PARAM_INT_DEF(crushmode); PARAM_INT(crushmode);
ACTION_RETURN_BOOL(P_CreateCeiling(sec, (DCeiling::ECeiling)type, ln, 0, speed, speed2, height, crush, silent, change, (DCeiling::ECrushMode)crushmode)); ACTION_RETURN_BOOL(P_CreateCeiling(sec, (DCeiling::ECeiling)type, ln, 0, speed, speed2, height, crush, silent, change, (DCeiling::ECrushMode)crushmode));
} }

View file

@ -261,8 +261,8 @@ DEFINE_ACTION_FUNCTION(AActor, SoundAlert)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT(target, AActor); PARAM_OBJECT(target, AActor);
PARAM_BOOL_DEF(splash); PARAM_BOOL(splash);
PARAM_FLOAT_DEF(maxdist); PARAM_FLOAT(maxdist);
// Note that the emitter is self, not the target of the alert! Target can be NULL. // Note that the emitter is self, not the target of the alert! Target can be NULL.
P_NoiseAlert(target, self, splash, maxdist); P_NoiseAlert(target, self, splash, maxdist);
return 0; return 0;
@ -1350,7 +1350,7 @@ DEFINE_ACTION_FUNCTION(AActor, IsVisible)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT(other, AActor); PARAM_OBJECT(other, AActor);
PARAM_BOOL(allaround); PARAM_BOOL(allaround);
PARAM_POINTER_DEF(params, FLookExParams); PARAM_POINTER(params, FLookExParams);
ACTION_RETURN_BOOL(P_IsVisible(self, other, allaround, params)); ACTION_RETURN_BOOL(P_IsVisible(self, other, allaround, params));
} }
@ -1589,7 +1589,7 @@ DEFINE_ACTION_FUNCTION(AActor, LookForTID)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL(allaround); PARAM_BOOL(allaround);
PARAM_POINTER_DEF(params, FLookExParams); PARAM_POINTER(params, FLookExParams);
ACTION_RETURN_BOOL(P_LookForTID(self, allaround, params)); ACTION_RETURN_BOOL(P_LookForTID(self, allaround, params));
} }
@ -1736,7 +1736,7 @@ DEFINE_ACTION_FUNCTION(AActor, LookForEnemies)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL(allaround); PARAM_BOOL(allaround);
PARAM_POINTER_DEF(params, FLookExParams); PARAM_POINTER(params, FLookExParams);
ACTION_RETURN_BOOL(P_LookForEnemies(self, allaround, params)); ACTION_RETURN_BOOL(P_LookForEnemies(self, allaround, params));
} }
@ -1931,7 +1931,7 @@ DEFINE_ACTION_FUNCTION(AActor, LookForPlayers)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL(allaround); PARAM_BOOL(allaround);
PARAM_POINTER_DEF(params, FLookExParams); PARAM_POINTER(params, FLookExParams);
ACTION_RETURN_BOOL(P_LookForPlayers(self, allaround, params)); ACTION_RETURN_BOOL(P_LookForPlayers(self, allaround, params));
} }
@ -2067,12 +2067,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look)
DEFINE_ACTION_FUNCTION(AActor, A_LookEx) DEFINE_ACTION_FUNCTION(AActor, A_LookEx)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT_DEF (flags) PARAM_INT (flags)
PARAM_FLOAT_DEF (minseedist) PARAM_FLOAT (minseedist)
PARAM_FLOAT_DEF (maxseedist) PARAM_FLOAT (maxseedist)
PARAM_FLOAT_DEF (maxheardist) PARAM_FLOAT (maxheardist)
PARAM_ANGLE_DEF (fov) PARAM_ANGLE (fov)
PARAM_STATE_DEF (seestate) PARAM_STATE (seestate)
AActor *targ = NULL; // Shuts up gcc AActor *targ = NULL; // Shuts up gcc
double dist; double dist;
@ -2284,7 +2284,7 @@ enum ChaseFlags
DEFINE_ACTION_FUNCTION(AActor, A_Wander) DEFINE_ACTION_FUNCTION(AActor, A_Wander)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT_DEF(flags); PARAM_INT(flags);
A_Wander(self, flags); A_Wander(self, flags);
return 0; return 0;
} }
@ -2972,9 +2972,9 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates)
DEFINE_ACTION_FUNCTION(AActor, A_Chase) DEFINE_ACTION_FUNCTION(AActor, A_Chase)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_STATE_DEF (melee) PARAM_STATE (melee)
PARAM_STATE_DEF (missile) PARAM_STATE (missile)
PARAM_INT_DEF (flags) PARAM_INT (flags)
if (melee != nullptr || missile != nullptr || flags != 0x40000000) if (melee != nullptr || missile != nullptr || flags != 0x40000000)
{ {
@ -3013,8 +3013,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_ExtChase)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL (domelee); PARAM_BOOL (domelee);
PARAM_BOOL (domissile); PARAM_BOOL (domissile);
PARAM_BOOL_DEF (playactive); PARAM_BOOL (playactive);
PARAM_BOOL_DEF (nightmarefast); PARAM_BOOL (nightmarefast);
// Now that A_Chase can handle state label parameters, this function has become rather useless... // Now that A_Chase can handle state label parameters, this function has become rather useless...
A_DoChase(self, false, A_DoChase(self, false,
@ -3158,12 +3158,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_Face)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT(faceto, AActor) PARAM_OBJECT(faceto, AActor)
PARAM_ANGLE_DEF(max_turn) PARAM_ANGLE(max_turn)
PARAM_ANGLE_DEF(max_pitch) PARAM_ANGLE(max_pitch)
PARAM_ANGLE_DEF(ang_offset) PARAM_ANGLE(ang_offset)
PARAM_ANGLE_DEF(pitch_offset) PARAM_ANGLE(pitch_offset)
PARAM_INT_DEF(flags) PARAM_INT(flags)
PARAM_FLOAT_DEF(z_add) PARAM_FLOAT(z_add)
A_Face(self, faceto, max_turn, max_pitch, ang_offset, pitch_offset, flags, z_add); A_Face(self, faceto, max_turn, max_pitch, ang_offset, pitch_offset, flags, z_add);
return 0; return 0;

View file

@ -509,11 +509,11 @@ DEFINE_ACTION_FUNCTION(DFloor, CreateFloor)
PARAM_INT(floortype); PARAM_INT(floortype);
PARAM_POINTER(ln, line_t); PARAM_POINTER(ln, line_t);
PARAM_FLOAT(speed); PARAM_FLOAT(speed);
PARAM_FLOAT_DEF(height); PARAM_FLOAT(height);
PARAM_INT_DEF(crush); PARAM_INT(crush);
PARAM_INT_DEF(change); PARAM_INT(change);
PARAM_BOOL_DEF(hereticlower); PARAM_BOOL(hereticlower);
PARAM_BOOL_DEF(hexencrush); PARAM_BOOL(hexencrush);
ACTION_RETURN_BOOL(P_CreateFloor(sec, (DFloor::EFloor)floortype, ln, speed, height, crush, change, hexencrush, hereticlower)); ACTION_RETURN_BOOL(P_CreateFloor(sec, (DFloor::EFloor)floortype, ln, speed, height, crush, change, hexencrush, hereticlower));
} }

View file

@ -728,8 +728,8 @@ DEFINE_ACTION_FUNCTION(AActor, Die)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT(source, AActor); PARAM_OBJECT(source, AActor);
PARAM_OBJECT(inflictor, AActor); PARAM_OBJECT(inflictor, AActor);
PARAM_INT_DEF(dmgflags); PARAM_INT(dmgflags);
PARAM_NAME_DEF(MeansOfDeath); PARAM_NAME(MeansOfDeath);
self->Die(source, inflictor, dmgflags, MeansOfDeath); self->Die(source, inflictor, dmgflags, MeansOfDeath);
return 0; return 0;
} }
@ -1635,8 +1635,8 @@ DEFINE_ACTION_FUNCTION(AActor, DamageMobj)
PARAM_OBJECT(source, AActor); PARAM_OBJECT(source, AActor);
PARAM_INT(damage); PARAM_INT(damage);
PARAM_NAME(mod); PARAM_NAME(mod);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_FLOAT_DEF(angle); PARAM_FLOAT(angle);
// [ZZ] event handlers need the result. // [ZZ] event handlers need the result.
bool needevent = true; bool needevent = true;

View file

@ -3955,11 +3955,11 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, ExecuteSpecial)
PARAM_OBJECT(activator, AActor); PARAM_OBJECT(activator, AActor);
PARAM_POINTER(linedef, line_t); PARAM_POINTER(linedef, line_t);
PARAM_BOOL(lineside); PARAM_BOOL(lineside);
PARAM_INT_DEF(arg1); PARAM_INT(arg1);
PARAM_INT_DEF(arg2); PARAM_INT(arg2);
PARAM_INT_DEF(arg3); PARAM_INT(arg3);
PARAM_INT_DEF(arg4); PARAM_INT(arg4);
PARAM_INT_DEF(arg5); PARAM_INT(arg5);
bool res = !!P_ExecuteSpecial(special, linedef, activator, lineside, arg1, arg2, arg3, arg4, arg5); bool res = !!P_ExecuteSpecial(special, linedef, activator, lineside, arg1, arg2, arg3, arg4, arg5);

View file

@ -417,7 +417,7 @@ void P_FindFloorCeiling(AActor *actor, int flags)
DEFINE_ACTION_FUNCTION(AActor, FindFloorCeiling) DEFINE_ACTION_FUNCTION(AActor, FindFloorCeiling)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT_DEF(flags); PARAM_INT(flags);
P_FindFloorCeiling(self, flags); P_FindFloorCeiling(self, flags);
return 0; return 0;
} }
@ -583,7 +583,7 @@ DEFINE_ACTION_FUNCTION(AActor, TeleportMove)
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(z); PARAM_FLOAT(z);
PARAM_BOOL(telefrag); PARAM_BOOL(telefrag);
PARAM_BOOL_DEF(modify); PARAM_BOOL(modify);
ACTION_RETURN_BOOL(P_TeleportMove(self, DVector3(x, y, z), telefrag, modify)); ACTION_RETURN_BOOL(P_TeleportMove(self, DVector3(x, y, z), telefrag, modify));
} }
@ -1959,8 +1959,8 @@ DEFINE_ACTION_FUNCTION(AActor, CheckPosition)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_BOOL_DEF(actorsonly); PARAM_BOOL(actorsonly);
PARAM_POINTER_DEF(tm, FCheckPosition); PARAM_POINTER(tm, FCheckPosition);
if (tm) if (tm)
{ {
ACTION_RETURN_BOOL(P_CheckPosition(self, DVector2(x, y), *tm, actorsonly)); ACTION_RETURN_BOOL(P_CheckPosition(self, DVector2(x, y), *tm, actorsonly));
@ -2117,7 +2117,7 @@ bool P_TestMobjZ(AActor *actor, bool quick, AActor **pOnmobj)
DEFINE_ACTION_FUNCTION(AActor, TestMobjZ) DEFINE_ACTION_FUNCTION(AActor, TestMobjZ)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(quick); PARAM_BOOL(quick);
AActor *on = nullptr;; AActor *on = nullptr;;
bool retv = P_TestMobjZ(self, quick, &on); bool retv = P_TestMobjZ(self, quick, &on);
@ -2773,8 +2773,8 @@ DEFINE_ACTION_FUNCTION(AActor, TryMove)
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_INT(dropoff); PARAM_INT(dropoff);
PARAM_BOOL_DEF(missilecheck); PARAM_BOOL(missilecheck);
PARAM_POINTER_DEF(tm, FCheckPosition); PARAM_POINTER(tm, FCheckPosition);
if (tm == nullptr) if (tm == nullptr)
{ {
ACTION_RETURN_BOOL(P_TryMove(self, DVector2(x, y), dropoff, nullptr, missilecheck)); ACTION_RETURN_BOOL(P_TryMove(self, DVector2(x, y), dropoff, nullptr, missilecheck));
@ -2898,8 +2898,8 @@ DEFINE_ACTION_FUNCTION(AActor, CheckMove)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_POINTER_DEF(tm, FCheckPosition); PARAM_POINTER(tm, FCheckPosition);
if (tm == nullptr) if (tm == nullptr)
{ {
ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), flags)); ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), flags));
@ -4489,11 +4489,11 @@ DEFINE_ACTION_FUNCTION(AActor, AimLineAttack)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_ANGLE(angle); PARAM_ANGLE(angle);
PARAM_FLOAT(distance); PARAM_FLOAT(distance);
PARAM_POINTER_DEF(pLineTarget, FTranslatedLineTarget); PARAM_POINTER(pLineTarget, FTranslatedLineTarget);
PARAM_ANGLE_DEF(vrange); PARAM_ANGLE(vrange);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_OBJECT_DEF(target, AActor); PARAM_OBJECT(target, AActor);
PARAM_OBJECT_DEF(friender, AActor); PARAM_OBJECT(friender, AActor);
ACTION_RETURN_FLOAT(P_AimLineAttack(self, angle, distance, pLineTarget, vrange, flags, target, friender).Degrees); ACTION_RETURN_FLOAT(P_AimLineAttack(self, angle, distance, pLineTarget, vrange, flags, target, friender).Degrees);
} }
@ -4925,11 +4925,11 @@ DEFINE_ACTION_FUNCTION(AActor, LineAttack)
PARAM_INT(damage); PARAM_INT(damage);
PARAM_NAME(damageType); PARAM_NAME(damageType);
PARAM_CLASS(puffType, AActor); PARAM_CLASS(puffType, AActor);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_POINTER_DEF(victim, FTranslatedLineTarget); PARAM_POINTER(victim, FTranslatedLineTarget);
PARAM_FLOAT_DEF(offsetz); PARAM_FLOAT(offsetz);
PARAM_FLOAT_DEF(offsetforward); PARAM_FLOAT(offsetforward);
PARAM_FLOAT_DEF(offsetside); PARAM_FLOAT(offsetside);
int acdmg; int acdmg;
if (puffType == nullptr) puffType = PClass::FindActor("BulletPuff"); // P_LineAttack does not work without a puff to take info from. if (puffType == nullptr) puffType = PClass::FindActor("BulletPuff"); // P_LineAttack does not work without a puff to take info from.
@ -5088,11 +5088,11 @@ DEFINE_ACTION_FUNCTION(AActor, LineTrace)
PARAM_ANGLE(angle); PARAM_ANGLE(angle);
PARAM_FLOAT(distance); PARAM_FLOAT(distance);
PARAM_ANGLE(pitch); PARAM_ANGLE(pitch);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_FLOAT_DEF(offsetz); PARAM_FLOAT(offsetz);
PARAM_FLOAT_DEF(offsetforward); PARAM_FLOAT(offsetforward);
PARAM_FLOAT_DEF(offsetside); PARAM_FLOAT(offsetside);
PARAM_POINTER_DEF(data, FLineTraceData); PARAM_POINTER(data, FLineTraceData);
ACTION_RETURN_BOOL(P_LineTrace(self,angle,distance,pitch,flags,offsetz,offsetforward,offsetside,data)); ACTION_RETURN_BOOL(P_LineTrace(self,angle,distance,pitch,flags,offsetz,offsetforward,offsetside,data));
} }
@ -6117,8 +6117,8 @@ DEFINE_ACTION_FUNCTION(AActor, GetRadiusDamage)
PARAM_OBJECT(thing, AActor); PARAM_OBJECT(thing, AActor);
PARAM_INT(damage); PARAM_INT(damage);
PARAM_INT(distance); PARAM_INT(distance);
PARAM_INT_DEF(fulldmgdistance); PARAM_INT(fulldmgdistance);
PARAM_BOOL_DEF(oldradiusdmg); PARAM_BOOL(oldradiusdmg);
if (!thing) if (!thing)
{ {

View file

@ -348,7 +348,7 @@ void AActor::UnlinkFromWorld (FLinkContext *ctx)
DEFINE_ACTION_FUNCTION(AActor, UnlinkFromWorld) DEFINE_ACTION_FUNCTION(AActor, UnlinkFromWorld)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_POINTER_DEF(ctx, FLinkContext); PARAM_POINTER(ctx, FLinkContext);
self->UnlinkFromWorld(ctx); // fixme self->UnlinkFromWorld(ctx); // fixme
return 0; return 0;
} }
@ -567,7 +567,7 @@ void AActor::LinkToWorld(FLinkContext *ctx, bool spawningmapthing, sector_t *sec
DEFINE_ACTION_FUNCTION(AActor, LinkToWorld) DEFINE_ACTION_FUNCTION(AActor, LinkToWorld)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_POINTER_DEF(ctx, FLinkContext); PARAM_POINTER(ctx, FLinkContext);
self->LinkToWorld(ctx); self->LinkToWorld(ctx);
return 0; return 0;
} }
@ -980,7 +980,7 @@ DEFINE_ACTION_FUNCTION(DBlockLinesIterator, Create)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_OBJECT_NOT_NULL(origin, AActor); PARAM_OBJECT_NOT_NULL(origin, AActor);
PARAM_FLOAT_DEF(radius); PARAM_FLOAT(radius);
ACTION_RETURN_OBJECT(Create<DBlockLinesIterator>(origin, radius)); ACTION_RETURN_OBJECT(Create<DBlockLinesIterator>(origin, radius));
} }
@ -992,7 +992,7 @@ DEFINE_ACTION_FUNCTION(DBlockLinesIterator, CreateFromPos)
PARAM_FLOAT(z); PARAM_FLOAT(z);
PARAM_FLOAT(h); PARAM_FLOAT(h);
PARAM_FLOAT(radius); PARAM_FLOAT(radius);
PARAM_POINTER_DEF(sec, sector_t); PARAM_POINTER(sec, sector_t);
ACTION_RETURN_OBJECT(Create<DBlockLinesIterator>(x, y, z, h, radius, sec)); ACTION_RETURN_OBJECT(Create<DBlockLinesIterator>(x, y, z, h, radius, sec));
} }
@ -1319,8 +1319,8 @@ DEFINE_ACTION_FUNCTION(DBlockThingsIterator, Create)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_OBJECT_NOT_NULL(origin, AActor); PARAM_OBJECT_NOT_NULL(origin, AActor);
PARAM_FLOAT_DEF(radius); PARAM_FLOAT(radius);
PARAM_BOOL_DEF(ignore); PARAM_BOOL(ignore);
ACTION_RETURN_OBJECT(Create<DBlockThingsIterator>(origin, radius, ignore)); ACTION_RETURN_OBJECT(Create<DBlockThingsIterator>(origin, radius, ignore));
} }
@ -2028,8 +2028,8 @@ DEFINE_ACTION_FUNCTION(AActor, RoughMonsterSearch)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(distance); PARAM_INT(distance);
PARAM_BOOL_DEF(onlyseekable); PARAM_BOOL(onlyseekable);
PARAM_BOOL_DEF(frontonly); PARAM_BOOL(frontonly);
ACTION_RETURN_OBJECT(P_RoughMonsterSearch(self, distance, onlyseekable, frontonly)); ACTION_RETURN_OBJECT(P_RoughMonsterSearch(self, distance, onlyseekable, frontonly));
} }

View file

@ -748,7 +748,7 @@ DEFINE_ACTION_FUNCTION(AActor, SetState)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_POINTER(state, FState); PARAM_POINTER(state, FState);
PARAM_BOOL_DEF(nofunction); PARAM_BOOL(nofunction);
ACTION_RETURN_BOOL(self->SetState(state, nofunction)); ACTION_RETURN_BOOL(self->SetState(state, nofunction));
}; };
@ -862,7 +862,7 @@ DEFINE_ACTION_FUNCTION(AActor, GiveInventory)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS(type, AInventory); PARAM_CLASS(type, AInventory);
PARAM_INT(amount); PARAM_INT(amount);
PARAM_BOOL_DEF(givecheat); PARAM_BOOL(givecheat);
ACTION_RETURN_BOOL(self->GiveInventory(type, amount, givecheat)); ACTION_RETURN_BOOL(self->GiveInventory(type, amount, givecheat));
} }
@ -962,8 +962,8 @@ DEFINE_ACTION_FUNCTION(AActor, TakeInventory)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS_NOT_NULL(item, AInventory); PARAM_CLASS_NOT_NULL(item, AInventory);
PARAM_INT(amount); PARAM_INT(amount);
PARAM_BOOL_DEF(fromdecorate); PARAM_BOOL(fromdecorate);
PARAM_BOOL_DEF(notakeinfinite); PARAM_BOOL(notakeinfinite);
ACTION_RETURN_BOOL(self->TakeInventory(item, amount, fromdecorate, notakeinfinite)); ACTION_RETURN_BOOL(self->TakeInventory(item, amount, fromdecorate, notakeinfinite));
} }
@ -1032,7 +1032,7 @@ DEFINE_ACTION_FUNCTION(AActor, SetInventory)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS_NOT_NULL(item, AInventory); PARAM_CLASS_NOT_NULL(item, AInventory);
PARAM_INT(amount); PARAM_INT(amount);
PARAM_BOOL_DEF(beyondMax); PARAM_BOOL(beyondMax);
ACTION_RETURN_BOOL(self->SetInventory(item, amount, beyondMax)); ACTION_RETURN_BOOL(self->SetInventory(item, amount, beyondMax));
} }
@ -1182,7 +1182,7 @@ DEFINE_ACTION_FUNCTION(AActor, DropInventory)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT_NOT_NULL(item, AInventory); PARAM_OBJECT_NOT_NULL(item, AInventory);
PARAM_INT_DEF(amt); PARAM_INT(amt);
ACTION_RETURN_OBJECT(self->DropInventory(item, amt)); ACTION_RETURN_OBJECT(self->DropInventory(item, amt));
} }
@ -1229,7 +1229,7 @@ DEFINE_ACTION_FUNCTION(AActor, FindInventory)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS(type, AInventory); PARAM_CLASS(type, AInventory);
PARAM_BOOL_DEF(subclass); PARAM_BOOL(subclass);
ACTION_RETURN_OBJECT(self->FindInventory(type, subclass)); ACTION_RETURN_OBJECT(self->FindInventory(type, subclass));
} }
@ -1390,8 +1390,8 @@ DEFINE_ACTION_FUNCTION(AActor, CopyFriendliness)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT_NOT_NULL(other, AActor); PARAM_OBJECT_NOT_NULL(other, AActor);
PARAM_BOOL_DEF(changetarget); PARAM_BOOL(changetarget);
PARAM_BOOL_DEF(resethealth); PARAM_BOOL(resethealth);
self->CopyFriendliness(other, changetarget, resethealth); self->CopyFriendliness(other, changetarget, resethealth);
return 0; return 0;
} }
@ -1566,7 +1566,7 @@ DEFINE_ACTION_FUNCTION(AActor, GiveBody)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(num); PARAM_INT(num);
PARAM_INT_DEF(max); PARAM_INT(max);
ACTION_RETURN_BOOL(P_GiveBody(self, num, max)); ACTION_RETURN_BOOL(P_GiveBody(self, num, max));
} }
@ -2088,8 +2088,8 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target, bool onsky)
DEFINE_ACTION_FUNCTION(AActor, ExplodeMissile) DEFINE_ACTION_FUNCTION(AActor, ExplodeMissile)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_POINTER_DEF(line, line_t); PARAM_POINTER(line, line_t);
PARAM_OBJECT_DEF(target, AActor); PARAM_OBJECT(target, AActor);
P_ExplodeMissile(self, line, target); P_ExplodeMissile(self, line, target);
return 0; return 0;
} }
@ -3339,7 +3339,7 @@ DEFINE_ACTION_FUNCTION(AActor, CheckFakeFloorTriggers)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(oldz); PARAM_FLOAT(oldz);
PARAM_BOOL_DEF(oldz_has_viewh); PARAM_BOOL(oldz_has_viewh);
P_CheckFakeFloorTriggers(self, oldz, oldz_has_viewh); P_CheckFakeFloorTriggers(self, oldz, oldz_has_viewh);
return 0; return 0;
} }
@ -3652,8 +3652,8 @@ int P_FindUniqueTID(int start_tid, int limit)
DEFINE_ACTION_FUNCTION(AActor, FindUniqueTid) DEFINE_ACTION_FUNCTION(AActor, FindUniqueTid)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_INT_DEF(start); PARAM_INT(start);
PARAM_INT_DEF(limit); PARAM_INT(limit);
ACTION_RETURN_INT(P_FindUniqueTID(start, limit)); ACTION_RETURN_INT(P_FindUniqueTID(start, limit));
} }
@ -4098,7 +4098,7 @@ void AActor::CheckPortalTransition(bool islinked)
DEFINE_ACTION_FUNCTION(AActor, CheckPortalTransition) DEFINE_ACTION_FUNCTION(AActor, CheckPortalTransition)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(linked); PARAM_BOOL(linked);
self->CheckPortalTransition(linked); self->CheckPortalTransition(linked);
return 0; return 0;
} }
@ -4976,7 +4976,7 @@ bool AActor::UpdateWaterLevel(bool dosplash)
DEFINE_ACTION_FUNCTION(AActor, UpdateWaterLevel) DEFINE_ACTION_FUNCTION(AActor, UpdateWaterLevel)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(splash); PARAM_BOOL(splash);
ACTION_RETURN_BOOL(self->UpdateWaterLevel(splash)); ACTION_RETURN_BOOL(self->UpdateWaterLevel(splash));
} }
@ -5176,10 +5176,10 @@ DEFINE_ACTION_FUNCTION(AActor, Spawn)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_CLASS_NOT_NULL(type, AActor); PARAM_CLASS_NOT_NULL(type, AActor);
PARAM_FLOAT_DEF(x); PARAM_FLOAT(x);
PARAM_FLOAT_DEF(y); PARAM_FLOAT(y);
PARAM_FLOAT_DEF(z); PARAM_FLOAT(z);
PARAM_INT_DEF(flags); PARAM_INT(flags);
ACTION_RETURN_OBJECT(AActor::StaticSpawn(type, DVector3(x, y, z), replace_t(flags))); ACTION_RETURN_OBJECT(AActor::StaticSpawn(type, DVector3(x, y, z), replace_t(flags)));
} }
@ -6291,8 +6291,8 @@ DEFINE_ACTION_FUNCTION(AActor, SpawnPuff)
PARAM_ANGLE(hitdir); PARAM_ANGLE(hitdir);
PARAM_ANGLE(particledir); PARAM_ANGLE(particledir);
PARAM_INT(updown); PARAM_INT(updown);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_OBJECT_DEF(victim, AActor); PARAM_OBJECT(victim, AActor);
ACTION_RETURN_OBJECT(P_SpawnPuff(self, pufftype, DVector3(x, y, z), hitdir, particledir, updown, flags, victim)); ACTION_RETURN_OBJECT(P_SpawnPuff(self, pufftype, DVector3(x, y, z), hitdir, particledir, updown, flags, victim));
} }
@ -6491,7 +6491,7 @@ DEFINE_ACTION_FUNCTION(AActor, BloodSplatter)
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(z); PARAM_FLOAT(z);
PARAM_ANGLE(dir); PARAM_ANGLE(dir);
PARAM_BOOL_DEF(axe); PARAM_BOOL(axe);
if (axe) P_BloodSplatter2(DVector3(x, y, z), self, dir); if (axe) P_BloodSplatter2(DVector3(x, y, z), self, dir);
else P_BloodSplatter(DVector3(x, y, z), self, dir); else P_BloodSplatter(DVector3(x, y, z), self, dir);
return 0; return 0;
@ -6723,9 +6723,9 @@ DEFINE_ACTION_FUNCTION(AActor, HitWater)
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(z); PARAM_FLOAT(z);
PARAM_BOOL_DEF(checkabove); PARAM_BOOL(checkabove);
PARAM_BOOL_DEF(alert); PARAM_BOOL(alert);
PARAM_BOOL_DEF(force); PARAM_BOOL(force);
ACTION_RETURN_BOOL(P_HitWater(self, sec, DVector3(x, y, z), checkabove, alert, force)); ACTION_RETURN_BOOL(P_HitWater(self, sec, DVector3(x, y, z), checkabove, alert, force));
} }
@ -7062,8 +7062,8 @@ DEFINE_ACTION_FUNCTION(AActor, SpawnMissileXYZ)
PARAM_FLOAT(z); PARAM_FLOAT(z);
PARAM_OBJECT_NOT_NULL(dest, AActor); PARAM_OBJECT_NOT_NULL(dest, AActor);
PARAM_CLASS(type, AActor); PARAM_CLASS(type, AActor);
PARAM_BOOL_DEF(check); PARAM_BOOL(check);
PARAM_OBJECT_DEF(owner, AActor); PARAM_OBJECT(owner, AActor);
ACTION_RETURN_OBJECT(P_SpawnMissileXYZ(DVector3(x,y,z), self, dest, type, check, owner)); ACTION_RETURN_OBJECT(P_SpawnMissileXYZ(DVector3(x,y,z), self, dest, type, check, owner));
} }
@ -7081,7 +7081,7 @@ DEFINE_ACTION_FUNCTION(AActor, SpawnMissile)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT_NOT_NULL(dest, AActor); PARAM_OBJECT_NOT_NULL(dest, AActor);
PARAM_CLASS(type, AActor); PARAM_CLASS(type, AActor);
PARAM_OBJECT_DEF(owner, AActor); PARAM_OBJECT(owner, AActor);
ACTION_RETURN_OBJECT(P_SpawnMissile(self, dest, type, owner)); ACTION_RETURN_OBJECT(P_SpawnMissile(self, dest, type, owner));
} }
@ -7137,7 +7137,7 @@ DEFINE_ACTION_FUNCTION(AActor, OldSpawnMissile)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT_NOT_NULL(dest, AActor); PARAM_OBJECT_NOT_NULL(dest, AActor);
PARAM_CLASS(type, AActor); PARAM_CLASS(type, AActor);
PARAM_OBJECT_DEF(owner, AActor); PARAM_OBJECT(owner, AActor);
ACTION_RETURN_OBJECT(P_OldSpawnMissile(self, owner, dest, type)); ACTION_RETURN_OBJECT(P_OldSpawnMissile(self, owner, dest, type));
} }
@ -7250,8 +7250,8 @@ DEFINE_ACTION_FUNCTION(AActor, SpawnMissileAngleZSpeed)
PARAM_ANGLE(angle); PARAM_ANGLE(angle);
PARAM_FLOAT(vz); PARAM_FLOAT(vz);
PARAM_FLOAT(speed); PARAM_FLOAT(speed);
PARAM_OBJECT_DEF(owner, AActor); PARAM_OBJECT(owner, AActor);
PARAM_BOOL_DEF(checkspawn); PARAM_BOOL(checkspawn);
ACTION_RETURN_OBJECT(P_SpawnMissileAngleZSpeed(self, z, type, angle, vz, speed, owner, checkspawn)); ACTION_RETURN_OBJECT(P_SpawnMissileAngleZSpeed(self, z, type, angle, vz, speed, owner, checkspawn));
} }
@ -7424,14 +7424,14 @@ DEFINE_ACTION_FUNCTION(AActor, SpawnPlayerMissile)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS(type, AActor); PARAM_CLASS(type, AActor);
PARAM_ANGLE_DEF(angle); PARAM_ANGLE(angle);
PARAM_FLOAT_DEF(x); PARAM_FLOAT(x);
PARAM_FLOAT_DEF(y); PARAM_FLOAT(y);
PARAM_FLOAT_DEF(z); PARAM_FLOAT(z);
PARAM_POINTER_DEF(lt, FTranslatedLineTarget); PARAM_POINTER(lt, FTranslatedLineTarget);
PARAM_BOOL_DEF(nofreeaim); PARAM_BOOL(nofreeaim);
PARAM_BOOL_DEF(noautoaim); PARAM_BOOL(noautoaim);
PARAM_INT_DEF(aimflags); PARAM_INT(aimflags);
AActor *missileactor; AActor *missileactor;
if (angle == 1e37) angle = self->Angles.Yaw; if (angle == 1e37) angle = self->Angles.Yaw;
AActor *misl = P_SpawnPlayerMissile(self, x, y, z, type, angle, lt, &missileactor, nofreeaim, noautoaim, aimflags); AActor *misl = P_SpawnPlayerMissile(self, x, y, z, type, angle, lt, &missileactor, nofreeaim, noautoaim, aimflags);
@ -7773,7 +7773,7 @@ void AActor::SetIdle(bool nofunction)
DEFINE_ACTION_FUNCTION(AActor, SetIdle) DEFINE_ACTION_FUNCTION(AActor, SetIdle)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(nofunction); PARAM_BOOL(nofunction);
self->SetIdle(nofunction); self->SetIdle(nofunction);
return 0; return 0;
} }
@ -7950,7 +7950,7 @@ const char *AActor::GetTag(const char *def) const
DEFINE_ACTION_FUNCTION(AActor, GetTag) DEFINE_ACTION_FUNCTION(AActor, GetTag)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_STRING_DEF(def); PARAM_STRING(def);
ACTION_RETURN_STRING(self->GetTag(def.Len() == 0? nullptr : def.GetChars())); ACTION_RETURN_STRING(self->GetTag(def.Len() == 0? nullptr : def.GetChars()));
} }
@ -8171,7 +8171,7 @@ double AActor::GetBobOffset(double ticfrac) const
DEFINE_ACTION_FUNCTION(AActor, GetBobOffset) DEFINE_ACTION_FUNCTION(AActor, GetBobOffset)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT_DEF(frac); PARAM_FLOAT(frac);
ACTION_RETURN_FLOAT(self->GetBobOffset(frac)); ACTION_RETURN_FLOAT(self->GetBobOffset(frac));
} }
@ -8194,7 +8194,7 @@ DEFINE_ACTION_FUNCTION(DActorIterator, Create)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_INT(tid); PARAM_INT(tid);
PARAM_CLASS_DEF(type, AActor); PARAM_CLASS(type, AActor);
ACTION_RETURN_OBJECT(Create<DActorIterator>(type, tid)); ACTION_RETURN_OBJECT(Create<DActorIterator>(type, tid));
} }
@ -8261,7 +8261,7 @@ DEFINE_ACTION_FUNCTION(AActor, AddZ)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(addz); PARAM_FLOAT(addz);
PARAM_BOOL_DEF(moving); PARAM_BOOL(moving);
self->AddZ(addz, moving); self->AddZ(addz, moving);
return 0; return 0;
} }
@ -8355,7 +8355,7 @@ DEFINE_ACTION_FUNCTION(AActor, AngleTo)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT_NOT_NULL(targ, AActor); PARAM_OBJECT_NOT_NULL(targ, AActor);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
ACTION_RETURN_FLOAT(self->AngleTo(targ, absolute).Degrees); ACTION_RETURN_FLOAT(self->AngleTo(targ, absolute).Degrees);
} }
@ -8363,7 +8363,7 @@ DEFINE_ACTION_FUNCTION(AActor, AngleToVector)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_ANGLE(angle); PARAM_ANGLE(angle);
PARAM_FLOAT_DEF(length); PARAM_FLOAT(length);
ACTION_RETURN_VEC2(angle.ToVector(length)); ACTION_RETURN_VEC2(angle.ToVector(length));
} }
@ -8406,7 +8406,7 @@ DEFINE_ACTION_FUNCTION(AActor, Vec2Angle)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(length); PARAM_FLOAT(length);
PARAM_ANGLE(angle); PARAM_ANGLE(angle);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
ACTION_RETURN_VEC2(self->Vec2Angle(length, angle, absolute)); ACTION_RETURN_VEC2(self->Vec2Angle(length, angle, absolute));
} }
@ -8430,8 +8430,8 @@ DEFINE_ACTION_FUNCTION(AActor, Vec3Angle)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(length) PARAM_FLOAT(length)
PARAM_ANGLE(angle); PARAM_ANGLE(angle);
PARAM_FLOAT_DEF(z); PARAM_FLOAT(z);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
ACTION_RETURN_VEC3(self->Vec3Angle(length, angle, z, absolute)); ACTION_RETURN_VEC3(self->Vec3Angle(length, angle, z, absolute));
} }
@ -8441,7 +8441,7 @@ DEFINE_ACTION_FUNCTION(AActor, Vec2OffsetZ)
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(z); PARAM_FLOAT(z);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
ACTION_RETURN_VEC3(self->Vec2OffsetZ(x, y, z, absolute)); ACTION_RETURN_VEC3(self->Vec2OffsetZ(x, y, z, absolute));
} }
@ -8450,7 +8450,7 @@ DEFINE_ACTION_FUNCTION(AActor, Vec2Offset)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
ACTION_RETURN_VEC2(self->Vec2Offset(x, y, absolute)); ACTION_RETURN_VEC2(self->Vec2Offset(x, y, absolute));
} }
@ -8460,7 +8460,7 @@ DEFINE_ACTION_FUNCTION(AActor, Vec3Offset)
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(z); PARAM_FLOAT(z);
PARAM_BOOL_DEF(absolute); PARAM_BOOL(absolute);
ACTION_RETURN_VEC3(self->Vec3Offset(x, y, z, absolute)); ACTION_RETURN_VEC3(self->Vec3Offset(x, y, z, absolute));
} }

View file

@ -240,7 +240,7 @@ DEFINE_ACTION_FUNCTION(_PlayerInfo, SetPSprite) // the underscore is needed to g
PARAM_SELF_STRUCT_PROLOGUE(player_t); PARAM_SELF_STRUCT_PROLOGUE(player_t);
PARAM_INT(id); PARAM_INT(id);
PARAM_POINTER(state, FState); PARAM_POINTER(state, FState);
PARAM_BOOL_DEF(pending); PARAM_BOOL(pending);
P_SetPsprite(self, (PSPLayers)id, state, pending); P_SetPsprite(self, (PSPLayers)id, state, pending);
return 0; return 0;
} }
@ -540,7 +540,7 @@ DEFINE_ACTION_FUNCTION(DPSprite, SetState)
{ {
PARAM_SELF_PROLOGUE(DPSprite); PARAM_SELF_PROLOGUE(DPSprite);
PARAM_POINTER(state, FState); PARAM_POINTER(state, FState);
PARAM_BOOL_DEF(pending); PARAM_BOOL(pending);
self->SetState(state, pending); self->SetState(state, pending);
return 0; return 0;
} }
@ -856,7 +856,7 @@ void DoReadyWeaponToGeneric(AActor *self, int paramflags)
DEFINE_ACTION_FUNCTION(AStateProvider, A_WeaponReady) DEFINE_ACTION_FUNCTION(AStateProvider, A_WeaponReady)
{ {
PARAM_ACTION_PROLOGUE(AStateProvider); PARAM_ACTION_PROLOGUE(AStateProvider);
PARAM_INT_DEF(flags); PARAM_INT(flags);
DoReadyWeaponToSwitch(self, !(flags & WRF_NoSwitch)); DoReadyWeaponToSwitch(self, !(flags & WRF_NoSwitch));
if ((flags & WRF_NoFire) != WRF_NoFire) DoReadyWeaponToFire(self, !(flags & WRF_NoPrimary), !(flags & WRF_NoSecondary)); if ((flags & WRF_NoFire) != WRF_NoFire) DoReadyWeaponToFire(self, !(flags & WRF_NoPrimary), !(flags & WRF_NoSecondary));
@ -972,10 +972,10 @@ void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
DEFINE_ACTION_FUNCTION(AActor, A_OverlayOffset) DEFINE_ACTION_FUNCTION(AActor, A_OverlayOffset)
{ {
PARAM_ACTION_PROLOGUE(AActor); PARAM_ACTION_PROLOGUE(AActor);
PARAM_INT_DEF(layer) PARAM_INT(layer)
PARAM_FLOAT_DEF(wx) PARAM_FLOAT(wx)
PARAM_FLOAT_DEF(wy) PARAM_FLOAT(wy)
PARAM_INT_DEF(flags) PARAM_INT(flags)
A_OverlayOffset(self, ((layer != 0) ? layer : stateinfo->mPSPIndex), wx, wy, flags); A_OverlayOffset(self, ((layer != 0) ? layer : stateinfo->mPSPIndex), wx, wy, flags);
return 0; return 0;
} }
@ -983,9 +983,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_OverlayOffset)
DEFINE_ACTION_FUNCTION(AActor, A_WeaponOffset) DEFINE_ACTION_FUNCTION(AActor, A_WeaponOffset)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT_DEF(wx) PARAM_FLOAT(wx)
PARAM_FLOAT_DEF(wy) PARAM_FLOAT(wy)
PARAM_INT_DEF(flags) PARAM_INT(flags)
A_OverlayOffset(self, PSP_WEAPON, wx, wy, flags); A_OverlayOffset(self, PSP_WEAPON, wx, wy, flags);
return 0; return 0;
} }
@ -1042,7 +1042,7 @@ static double GetOverlayPosition(AActor *self, int layer, bool gety)
DEFINE_ACTION_FUNCTION(AActor, OverlayX) DEFINE_ACTION_FUNCTION(AActor, OverlayX)
{ {
PARAM_ACTION_PROLOGUE(AActor); PARAM_ACTION_PROLOGUE(AActor);
PARAM_INT_DEF(layer); PARAM_INT(layer);
if (ACTION_CALL_FROM_PSPRITE()) if (ACTION_CALL_FROM_PSPRITE())
{ {
@ -1055,7 +1055,7 @@ DEFINE_ACTION_FUNCTION(AActor, OverlayX)
DEFINE_ACTION_FUNCTION(AActor, OverlayY) DEFINE_ACTION_FUNCTION(AActor, OverlayY)
{ {
PARAM_ACTION_PROLOGUE(AActor); PARAM_ACTION_PROLOGUE(AActor);
PARAM_INT_DEF(layer); PARAM_INT(layer);
if (ACTION_CALL_FROM_PSPRITE()) if (ACTION_CALL_FROM_PSPRITE())
{ {
@ -1108,7 +1108,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_OverlayAlpha)
DEFINE_ACTION_FUNCTION(AActor, OverlayAlpha) DEFINE_ACTION_FUNCTION(AActor, OverlayAlpha)
{ {
PARAM_ACTION_PROLOGUE(AActor); PARAM_ACTION_PROLOGUE(AActor);
PARAM_INT_DEF(layer); PARAM_INT(layer);
if (ACTION_CALL_FROM_PSPRITE()) if (ACTION_CALL_FROM_PSPRITE())
{ {
@ -1156,8 +1156,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Overlay)
{ {
PARAM_ACTION_PROLOGUE(AActor); PARAM_ACTION_PROLOGUE(AActor);
PARAM_INT (layer); PARAM_INT (layer);
PARAM_STATE_ACTION_DEF(state); PARAM_STATE_ACTION(state);
PARAM_BOOL_DEF(dontoverride); PARAM_BOOL(dontoverride);
player_t *player = self->player; player_t *player = self->player;
@ -1175,9 +1175,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Overlay)
DEFINE_ACTION_FUNCTION(AActor, A_ClearOverlays) DEFINE_ACTION_FUNCTION(AActor, A_ClearOverlays)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT_DEF(start); PARAM_INT(start);
PARAM_INT_DEF(stop); PARAM_INT(stop);
PARAM_BOOL_DEF(safety) PARAM_BOOL(safety)
if (self->player == nullptr) if (self->player == nullptr)
ACTION_RETURN_INT(0); ACTION_RETURN_INT(0);
@ -1255,8 +1255,8 @@ DAngle P_BulletSlope (AActor *mo, FTranslatedLineTarget *pLineTarget, int aimfla
DEFINE_ACTION_FUNCTION(AActor, BulletSlope) DEFINE_ACTION_FUNCTION(AActor, BulletSlope)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_POINTER_DEF(t, FTranslatedLineTarget); PARAM_POINTER(t, FTranslatedLineTarget);
PARAM_INT_DEF(aimflags); PARAM_INT(aimflags);
ACTION_RETURN_FLOAT(P_BulletSlope(self, t, aimflags).Degrees); ACTION_RETURN_FLOAT(P_BulletSlope(self, t, aimflags).Degrees);
} }

View file

@ -1300,7 +1300,7 @@ DEFINE_ACTION_FUNCTION(_Sector, NextHighestCeilingAt)
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(bottomz); PARAM_FLOAT(bottomz);
PARAM_FLOAT(topz); PARAM_FLOAT(topz);
PARAM_INT_DEF(flags); PARAM_INT(flags);
sector_t *resultsec; sector_t *resultsec;
F3DFloor *resultff; F3DFloor *resultff;
double resultheight = self->NextHighestCeilingAt(x, y, bottomz, topz, flags, &resultsec, &resultff); double resultheight = self->NextHighestCeilingAt(x, y, bottomz, topz, flags, &resultsec, &resultff);
@ -1377,8 +1377,8 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt)
PARAM_FLOAT(x); PARAM_FLOAT(x);
PARAM_FLOAT(y); PARAM_FLOAT(y);
PARAM_FLOAT(z); PARAM_FLOAT(z);
PARAM_INT_DEF(flags); PARAM_INT(flags);
PARAM_FLOAT_DEF(steph); PARAM_FLOAT(steph);
sector_t *resultsec; sector_t *resultsec;
F3DFloor *resultff; F3DFloor *resultff;
double resultheight = self->NextLowestFloorAt(x, y, z, flags, steph, &resultsec, &resultff); double resultheight = self->NextLowestFloorAt(x, y, z, flags, steph, &resultsec, &resultff);
@ -1723,7 +1723,7 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt)
{ {
PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos); PARAM_INT(pos);
PARAM_BOOL_DEF(addbase); PARAM_BOOL(addbase);
ACTION_RETURN_FLOAT(self->GetYOffset(pos, addbase)); ACTION_RETURN_FLOAT(self->GetYOffset(pos, addbase));
} }
@ -1773,7 +1773,7 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt)
{ {
PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos); PARAM_INT(pos);
PARAM_BOOL_DEF(addbase); PARAM_BOOL(addbase);
ACTION_RETURN_FLOAT(self->GetAngle(pos, addbase).Degrees); ACTION_RETURN_FLOAT(self->GetAngle(pos, addbase).Degrees);
} }
@ -1848,7 +1848,7 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt)
PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos); PARAM_INT(pos);
PARAM_INT(o); PARAM_INT(o);
PARAM_BOOL_DEF(adj); PARAM_BOOL(adj);
self->SetTexture(pos, FSetTextureID(o), adj); self->SetTexture(pos, FSetTextureID(o), adj);
return 0; return 0;
} }
@ -1865,7 +1865,7 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt)
PARAM_SELF_STRUCT_PROLOGUE(sector_t); PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos); PARAM_INT(pos);
PARAM_FLOAT(o); PARAM_FLOAT(o);
PARAM_BOOL_DEF(dirty); PARAM_BOOL(dirty);
self->SetPlaneTexZ(pos, o, true); // not setting 'dirty' here is a guaranteed cause for problems. self->SetPlaneTexZ(pos, o, true); // not setting 'dirty' here is a guaranteed cause for problems.
return 0; return 0;
} }

View file

@ -940,7 +940,7 @@ DEFINE_ACTION_FUNCTION(AActor, CheckSight)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT_NOT_NULL(target, AActor); PARAM_OBJECT_NOT_NULL(target, AActor);
PARAM_INT_DEF(flags); PARAM_INT(flags);
ACTION_RETURN_BOOL(P_CheckSight(self, target, flags)); ACTION_RETURN_BOOL(P_CheckSight(self, target, flags));
} }

View file

@ -618,8 +618,8 @@ void P_GiveSecret(AActor *actor, bool printmessage, bool playsound, int sectornu
DEFINE_ACTION_FUNCTION(AActor, GiveSecret) DEFINE_ACTION_FUNCTION(AActor, GiveSecret)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(printmessage); PARAM_BOOL(printmessage);
PARAM_BOOL_DEF(playsound); PARAM_BOOL(playsound);
P_GiveSecret(self, printmessage, playsound, -1); P_GiveSecret(self, printmessage, playsound, -1);
return 0; return 0;
} }
@ -629,8 +629,8 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, GiveSecret)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_OBJECT(activator, AActor); PARAM_OBJECT(activator, AActor);
PARAM_BOOL_DEF(printmessage); PARAM_BOOL(printmessage);
PARAM_BOOL_DEF(playsound); PARAM_BOOL(playsound);
P_GiveSecret(activator, printmessage, playsound, -1); P_GiveSecret(activator, printmessage, playsound, -1);
return 0; return 0;
} }

View file

@ -61,9 +61,9 @@ DEFINE_ACTION_FUNCTION(FState, GetSpriteTexture)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FState); PARAM_SELF_STRUCT_PROLOGUE(FState);
PARAM_INT(rotation); PARAM_INT(rotation);
PARAM_INT_DEF(skin); PARAM_INT(skin);
PARAM_FLOAT_DEF(scalex); PARAM_FLOAT(scalex);
PARAM_FLOAT_DEF(scaley); PARAM_FLOAT(scaley);
spriteframe_t *sprframe; spriteframe_t *sprframe;
if (skin == 0) if (skin == 0)
@ -378,7 +378,7 @@ DEFINE_ACTION_FUNCTION(AActor, FindState)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(newstate); PARAM_INT(newstate);
PARAM_BOOL_DEF(exact) PARAM_BOOL(exact)
ACTION_RETURN_STATE(StateLabels.GetState(newstate, self->GetClass(), exact)); ACTION_RETURN_STATE(StateLabels.GetState(newstate, self->GetClass(), exact));
} }

View file

@ -381,7 +381,7 @@ DEFINE_ACTION_FUNCTION(DSectorTagIterator, Create)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_INT(tag); PARAM_INT(tag);
PARAM_POINTER_DEF(line, line_t); PARAM_POINTER(line, line_t);
ACTION_RETURN_POINTER(Create<DSectorTagIterator>(tag, line)); ACTION_RETURN_POINTER(Create<DSectorTagIterator>(tag, line));
} }

View file

@ -234,9 +234,9 @@ DEFINE_ACTION_FUNCTION(AActor, VelIntercept)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT_NOT_NULL(targ, AActor); PARAM_OBJECT_NOT_NULL(targ, AActor);
PARAM_FLOAT_DEF(speed); PARAM_FLOAT(speed);
PARAM_BOOL_DEF(aimpitch); PARAM_BOOL(aimpitch);
PARAM_BOOL_DEF(oldvel); PARAM_BOOL(oldvel);
if (speed < 0) speed = self->Speed; if (speed < 0) speed = self->Speed;
VelIntercept(targ, self, speed, aimpitch, oldvel); VelIntercept(targ, self, speed, aimpitch, oldvel);
return 0; return 0;
@ -993,15 +993,15 @@ int P_Thing_Warp(AActor *caller, AActor *reference, double xofs, double yofs, do
DEFINE_ACTION_FUNCTION(AActor, Warp) DEFINE_ACTION_FUNCTION(AActor, Warp)
{ {
PARAM_SELF_PROLOGUE(AActor) PARAM_SELF_PROLOGUE(AActor)
PARAM_OBJECT_DEF(destination, AActor) PARAM_OBJECT(destination, AActor)
PARAM_FLOAT_DEF(xofs) PARAM_FLOAT(xofs)
PARAM_FLOAT_DEF(yofs) PARAM_FLOAT(yofs)
PARAM_FLOAT_DEF(zofs) PARAM_FLOAT(zofs)
PARAM_ANGLE_DEF(angle) PARAM_ANGLE(angle)
PARAM_INT_DEF(flags) PARAM_INT(flags)
PARAM_FLOAT_DEF(heightoffset) PARAM_FLOAT(heightoffset)
PARAM_FLOAT_DEF(radiusoffset) PARAM_FLOAT(radiusoffset)
PARAM_ANGLE_DEF(pitch) PARAM_ANGLE(pitch)
ACTION_RETURN_INT(!!P_Thing_Warp(self, destination, xofs, yofs, zofs, angle, flags, heightoffset, radiusoffset, pitch)); ACTION_RETURN_INT(!!P_Thing_Warp(self, destination, xofs, yofs, zofs, angle, flags, heightoffset, radiusoffset, pitch));
} }

View file

@ -1385,7 +1385,7 @@ int APlayerPawn::GetMaxHealth(bool withupgrades) const
DEFINE_ACTION_FUNCTION(APlayerPawn, GetMaxHealth) DEFINE_ACTION_FUNCTION(APlayerPawn, GetMaxHealth)
{ {
PARAM_SELF_PROLOGUE(APlayerPawn); PARAM_SELF_PROLOGUE(APlayerPawn);
PARAM_BOOL_DEF(withupgrades); PARAM_BOOL(withupgrades);
ACTION_RETURN_INT(self->GetMaxHealth(withupgrades)); ACTION_RETURN_INT(self->GetMaxHealth(withupgrades));
} }
@ -1445,7 +1445,7 @@ bool APlayerPawn::ResetAirSupply (bool playgasp)
DEFINE_ACTION_FUNCTION(APlayerPawn, ResetAirSupply) DEFINE_ACTION_FUNCTION(APlayerPawn, ResetAirSupply)
{ {
PARAM_SELF_PROLOGUE(APlayerPawn); PARAM_SELF_PROLOGUE(APlayerPawn);
PARAM_BOOL_DEF(playgasp); PARAM_BOOL(playgasp);
ACTION_RETURN_BOOL(self->ResetAirSupply(playgasp)); ACTION_RETURN_BOOL(self->ResetAirSupply(playgasp));
} }
@ -1771,7 +1771,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream)
DEFINE_ACTION_FUNCTION(AActor, A_SkullPop) DEFINE_ACTION_FUNCTION(AActor, A_SkullPop)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS_DEF(spawntype, APlayerPawn); PARAM_CLASS(spawntype, APlayerPawn);
APlayerPawn *mo; APlayerPawn *mo;
player_t *player; player_t *player;

View file

@ -900,7 +900,7 @@ DEFINE_ACTION_FUNCTION(AActor, StartSoundSequenceID)
PARAM_INT(seq); PARAM_INT(seq);
PARAM_INT(type); PARAM_INT(type);
PARAM_INT(modenum); PARAM_INT(modenum);
PARAM_BOOL_DEF(nostop); PARAM_BOOL(nostop);
ACTION_RETURN_POINTER(SN_StartSequence(self, seq, seqtype_t(type), modenum, nostop)); ACTION_RETURN_POINTER(SN_StartSequence(self, seq, seqtype_t(type), modenum, nostop));
} }
@ -924,7 +924,7 @@ DEFINE_ACTION_FUNCTION(_Sector, StartSoundSequenceID)
PARAM_INT(seq); PARAM_INT(seq);
PARAM_INT(type); PARAM_INT(type);
PARAM_INT(modenum); PARAM_INT(modenum);
PARAM_BOOL_DEF(nostop); PARAM_BOOL(nostop);
ACTION_RETURN_POINTER(SN_StartSequence(self, chan, seq, seqtype_t(type), modenum, nostop)); ACTION_RETURN_POINTER(SN_StartSequence(self, chan, seq, seqtype_t(type), modenum, nostop));
} }

View file

@ -1342,8 +1342,8 @@ DEFINE_ACTION_FUNCTION(DObject, S_Sound)
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_SOUND(id); PARAM_SOUND(id);
PARAM_INT(channel); PARAM_INT(channel);
PARAM_FLOAT_DEF(volume); PARAM_FLOAT(volume);
PARAM_FLOAT_DEF(attn); PARAM_FLOAT(attn);
S_Sound(channel, id, static_cast<float>(volume), static_cast<float>(attn)); S_Sound(channel, id, static_cast<float>(volume), static_cast<float>(attn));
return 0; return 0;
} }
@ -2736,9 +2736,9 @@ DEFINE_ACTION_FUNCTION(DObject, S_ChangeMusic)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_STRING(music); PARAM_STRING(music);
PARAM_INT_DEF(order); PARAM_INT(order);
PARAM_BOOL_DEF(looping); PARAM_BOOL(looping);
PARAM_BOOL_DEF(force); PARAM_BOOL(force);
ACTION_RETURN_BOOL(S_ChangeMusic(music, order, looping, force)); ACTION_RETURN_BOOL(S_ChangeMusic(music, order, looping, force));
} }

View file

@ -5512,7 +5512,7 @@ FxExpression *FxRandom::Resolve(FCompileContext &ctx)
// //
//========================================================================== //==========================================================================
int BuiltinRandom(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret) int BuiltinRandom(VMValue *param, int numparam, VMReturn *ret, int numret)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER(rng, FRandom); PARAM_POINTER(rng, FRandom);
@ -5744,7 +5744,7 @@ FxFRandom::FxFRandom(FRandom *r, FxExpression *mi, FxExpression *ma, const FScri
// //
//========================================================================== //==========================================================================
int BuiltinFRandom(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret) int BuiltinFRandom(VMValue *param, int numparam, VMReturn *ret, int numret)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER(rng, FRandom); PARAM_POINTER(rng, FRandom);
@ -5850,7 +5850,7 @@ FxExpression *FxRandom2::Resolve(FCompileContext &ctx)
// //
//========================================================================== //==========================================================================
int BuiltinRandom2(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret) int BuiltinRandom2(VMValue *param, int numparam, VMReturn *ret, int numret)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER(rng, FRandom); PARAM_POINTER(rng, FRandom);
@ -5938,7 +5938,7 @@ FxExpression *FxRandomSeed::Resolve(FCompileContext &ctx)
// //
//========================================================================== //==========================================================================
int BuiltinRandomSeed(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret) int BuiltinRandomSeed(VMValue *param, int numparam, VMReturn *ret, int numret)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_POINTER(rng, FRandom) PARAM_POINTER(rng, FRandom)
@ -8624,16 +8624,16 @@ FxExpression *FxActionSpecialCall::Resolve(FCompileContext& ctx)
// //
//========================================================================== //==========================================================================
int BuiltinCallLineSpecial(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret) int BuiltinCallLineSpecial(VMValue *param, int numparam, VMReturn *ret, int numret)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_INT(special); PARAM_INT(special);
PARAM_OBJECT(activator, AActor); PARAM_OBJECT(activator, AActor);
PARAM_INT_DEF(arg1); PARAM_INT(arg1);
PARAM_INT_DEF(arg2); PARAM_INT(arg2);
PARAM_INT_DEF(arg3); PARAM_INT(arg3);
PARAM_INT_DEF(arg4); PARAM_INT(arg4);
PARAM_INT_DEF(arg5); PARAM_INT(arg5);
ACTION_RETURN_INT(P_ExecuteSpecial(special, nullptr, activator, 0, arg1, arg2, arg3, arg4, arg5)); ACTION_RETURN_INT(P_ExecuteSpecial(special, nullptr, activator, 0, arg1, arg2, arg3, arg4, arg5));
} }
@ -10898,7 +10898,7 @@ FxExpression *FxClassTypeCast::Resolve(FCompileContext &ctx)
// //
//========================================================================== //==========================================================================
int BuiltinNameToClass(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret) int BuiltinNameToClass(VMValue *param, int numparam, VMReturn *ret, int numret)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_NAME(clsname); PARAM_NAME(clsname);
@ -11023,7 +11023,7 @@ FxExpression *FxClassPtrCast::Resolve(FCompileContext &ctx)
// //
//========================================================================== //==========================================================================
int BuiltinClassCast(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret) int BuiltinClassCast(VMValue *param, int numparam, VMReturn *ret, int numret)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_CLASS(from, DObject); PARAM_CLASS(from, DObject);

View file

@ -114,7 +114,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_I8, Delete)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I8); PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I8);
PARAM_INT(index); PARAM_INT(index);
PARAM_INT_DEF(count); PARAM_INT(count);
self->Delete(index, count); self->Delete(index, count);
return 0; return 0;
} }
@ -219,7 +219,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_I16, Delete)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I16); PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I16);
PARAM_INT(index); PARAM_INT(index);
PARAM_INT_DEF(count); PARAM_INT(count);
self->Delete(index, count); self->Delete(index, count);
return 0; return 0;
} }
@ -324,7 +324,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_I32, Delete)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I32); PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I32);
PARAM_INT(index); PARAM_INT(index);
PARAM_INT_DEF(count); PARAM_INT(count);
self->Delete(index, count); self->Delete(index, count);
return 0; return 0;
} }
@ -429,7 +429,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_F32, Delete)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_F32); PARAM_SELF_STRUCT_PROLOGUE(FDynArray_F32);
PARAM_INT(index); PARAM_INT(index);
PARAM_INT_DEF(count); PARAM_INT(count);
self->Delete(index, count); self->Delete(index, count);
return 0; return 0;
} }
@ -534,7 +534,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_F64, Delete)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_F64); PARAM_SELF_STRUCT_PROLOGUE(FDynArray_F64);
PARAM_INT(index); PARAM_INT(index);
PARAM_INT_DEF(count); PARAM_INT(count);
self->Delete(index, count); self->Delete(index, count);
return 0; return 0;
} }
@ -639,7 +639,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_Ptr, Delete)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Ptr); PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Ptr);
PARAM_INT(index); PARAM_INT(index);
PARAM_INT_DEF(count); PARAM_INT(count);
self->Delete(index, count); self->Delete(index, count);
return 0; return 0;
} }
@ -746,7 +746,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_Obj, Delete)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj); PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
PARAM_INT(index); PARAM_INT(index);
PARAM_INT_DEF(count); PARAM_INT(count);
self->Delete(index, count); self->Delete(index, count);
return 0; return 0;
} }
@ -853,7 +853,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_String, Delete)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_String); PARAM_SELF_STRUCT_PROLOGUE(FDynArray_String);
PARAM_INT(index); PARAM_INT(index);
PARAM_INT_DEF(count); PARAM_INT(count);
self->Delete(index, count); self->Delete(index, count);
return 0; return 0;
} }

View file

@ -1008,7 +1008,7 @@ DEFINE_ACTION_FUNCTION(FStringTable, Localize)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_STRING(label); PARAM_STRING(label);
PARAM_BOOL_DEF(prefixed); PARAM_BOOL(prefixed);
if (!prefixed) ACTION_RETURN_STRING(GStrings(label)); if (!prefixed) ACTION_RETURN_STRING(GStrings(label));
if (label[0] != '$') ACTION_RETURN_STRING(label); if (label[0] != '$') ACTION_RETURN_STRING(label);
ACTION_RETURN_STRING(GStrings(&label[1])); ACTION_RETURN_STRING(GStrings(&label[1]));
@ -1184,7 +1184,7 @@ FString FStringFormat(VM_ARGS)
DEFINE_ACTION_FUNCTION(FStringStruct, Format) DEFINE_ACTION_FUNCTION(FStringStruct, Format)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
FString s = FStringFormat(param, defaultparam, numparam, ret, numret); FString s = FStringFormat(param, numparam, ret, numret);
ACTION_RETURN_STRING(s); ACTION_RETURN_STRING(s);
} }
@ -1192,7 +1192,7 @@ DEFINE_ACTION_FUNCTION(FStringStruct, AppendFormat)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FString); PARAM_SELF_STRUCT_PROLOGUE(FString);
// first parameter is the self pointer // first parameter is the self pointer
FString s = FStringFormat(param+1, defaultparam, numparam-1, ret, numret); FString s = FStringFormat(param+1, numparam-1, ret, numret);
(*self) += s; (*self) += s;
return 0; return 0;
} }
@ -1200,8 +1200,8 @@ DEFINE_ACTION_FUNCTION(FStringStruct, AppendFormat)
DEFINE_ACTION_FUNCTION(FStringStruct, Mid) DEFINE_ACTION_FUNCTION(FStringStruct, Mid)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FString); PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_UINT_DEF(pos); PARAM_UINT(pos);
PARAM_UINT_DEF(len); PARAM_UINT(len);
FString s = self->Mid(pos, len); FString s = self->Mid(pos, len);
ACTION_RETURN_STRING(s); ACTION_RETURN_STRING(s);
} }
@ -1262,7 +1262,7 @@ DEFINE_ACTION_FUNCTION(FStringStruct, IndexOf)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FString); PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_STRING(substr); PARAM_STRING(substr);
PARAM_INT_DEF(startIndex); PARAM_INT(startIndex);
ACTION_RETURN_INT(self->IndexOf(substr, startIndex)); ACTION_RETURN_INT(self->IndexOf(substr, startIndex));
} }
@ -1270,7 +1270,7 @@ DEFINE_ACTION_FUNCTION(FStringStruct, LastIndexOf)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FString); PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_STRING(substr); PARAM_STRING(substr);
PARAM_INT_DEF(endIndex); PARAM_INT(endIndex);
ACTION_RETURN_INT(self->LastIndexOfBroken(substr, endIndex)); ACTION_RETURN_INT(self->LastIndexOfBroken(substr, endIndex));
} }
@ -1278,7 +1278,7 @@ DEFINE_ACTION_FUNCTION(FStringStruct, RightIndexOf)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FString); PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_STRING(substr); PARAM_STRING(substr);
PARAM_INT_DEF(endIndex); PARAM_INT(endIndex);
ACTION_RETURN_INT(self->LastIndexOf(substr, endIndex)); ACTION_RETURN_INT(self->LastIndexOf(substr, endIndex));
} }
@ -1299,7 +1299,7 @@ DEFINE_ACTION_FUNCTION(FStringStruct, ToLower)
DEFINE_ACTION_FUNCTION(FStringStruct, ToInt) DEFINE_ACTION_FUNCTION(FStringStruct, ToInt)
{ {
PARAM_SELF_STRUCT_PROLOGUE(FString); PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_INT_DEF(base); PARAM_INT(base);
ACTION_RETURN_INT(self->ToLong(base)); ACTION_RETURN_INT(self->ToLong(base));
} }
@ -1314,7 +1314,7 @@ DEFINE_ACTION_FUNCTION(FStringStruct, Split)
PARAM_SELF_STRUCT_PROLOGUE(FString); PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_POINTER(tokens, TArray<FString>); PARAM_POINTER(tokens, TArray<FString>);
PARAM_STRING(delimiter); PARAM_STRING(delimiter);
PARAM_INT_DEF(keepEmpty); PARAM_INT(keepEmpty);
self->Split(*tokens, delimiter, static_cast<FString::EmptyTokenType>(keepEmpty)); self->Split(*tokens, delimiter, static_cast<FString::EmptyTokenType>(keepEmpty));
return 0; return 0;
} }

View file

@ -359,7 +359,7 @@ protected:
class VMNativeFunction : public VMFunction class VMNativeFunction : public VMFunction
{ {
public: public:
typedef int (*NativeCallType)(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret); typedef int (*NativeCallType)(VMValue *param, int numparam, VMReturn *ret, int numret);
// 8 is VARF_Native. I can't write VARF_Native because of circular references between this and dobject/dobjtype. // 8 is VARF_Native. I can't write VARF_Native because of circular references between this and dobject/dobjtype.
VMNativeFunction() : NativeCall(NULL) { VarFlags = 8; ScriptCall = &VMNativeFunction::NativeScriptCall; } VMNativeFunction() : NativeCall(NULL) { VarFlags = 8; ScriptCall = &VMNativeFunction::NativeScriptCall; }
@ -382,8 +382,8 @@ inline int VMCallAction(VMFunction *func, VMValue *params, int numparams, VMRetu
} }
// Use this in the prototype for a native function. // Use this in the prototype for a native function.
#define VM_ARGS VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret #define VM_ARGS VMValue *param, int numparam, VMReturn *ret, int numret
#define VM_ARGS_NAMES param, defaultparam, numparam, ret, numret #define VM_ARGS_NAMES param, numparam, ret, numret
// Use these to collect the parameters in a native function. // Use these to collect the parameters in a native function.
// variable name <x> at position <p> // variable name <x> at position <p>
@ -421,23 +421,6 @@ bool AssertObject(void * ob);
#define PARAM_OBJECT_NOT_NULL_AT(p,x,type) assert((p) < numparam); assert(param[p].Type == REGT_POINTER && (AssertObject(param[p].a))); type *x = (type *)PARAM_NULLCHECK(param[p].a, #x); assert(x == NULL || x->IsKindOf(RUNTIME_CLASS(type))); #define PARAM_OBJECT_NOT_NULL_AT(p,x,type) assert((p) < numparam); assert(param[p].Type == REGT_POINTER && (AssertObject(param[p].a))); type *x = (type *)PARAM_NULLCHECK(param[p].a, #x); assert(x == NULL || x->IsKindOf(RUNTIME_CLASS(type)));
#define PARAM_CLASS_NOT_NULL_AT(p,x,base) assert((p) < numparam); assert(param[p].Type == REGT_POINTER); base::MetaClass *x = (base::MetaClass *)PARAM_NULLCHECK(param[p].a, #x); assert(x == NULL || x->IsDescendantOf(RUNTIME_CLASS(base))); #define PARAM_CLASS_NOT_NULL_AT(p,x,base) assert((p) < numparam); assert(param[p].Type == REGT_POINTER); base::MetaClass *x = (base::MetaClass *)PARAM_NULLCHECK(param[p].a, #x); assert(x == NULL || x->IsDescendantOf(RUNTIME_CLASS(base)));
#define PARAM_EXISTS(p) ((p) < numparam)
#define PARAM_INT_DEF_AT(p,x) int x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = param[p].i; } else { ASSERTINT(defaultparam[p]); x = defaultparam[p].i; }
#define PARAM_UINT_DEF_AT(p,x) unsigned x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = param[p].i; } else { ASSERTINT(defaultparam[p]); x = defaultparam[p].i; }
#define PARAM_BOOL_DEF_AT(p,x) bool x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = !!param[p].i; } else { ASSERTINT(defaultparam[p]); x = !!defaultparam[p].i; }
#define PARAM_NAME_DEF_AT(p,x) FName x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = ENamedName(param[p].i); } else { ASSERTINT(defaultparam[p]); x = ENamedName(defaultparam[p].i); }
#define PARAM_SOUND_DEF_AT(p,x) FSoundID x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = FSoundID(param[p].i); } else { ASSERTINT(defaultparam[p]); x = FSoundID(defaultparam[p].i); }
#define PARAM_COLOR_DEF_AT(p,x) PalEntry x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = param[p].i; } else { ASSERTINT(defaultparam[p]); x = defaultparam[p].i; }
#define PARAM_FLOAT_DEF_AT(p,x) double x; if (PARAM_EXISTS(p)) { ASSERTFLOAT(param[p]); x = param[p].f; } else { ASSERTFLOAT(defaultparam[p]); x = defaultparam[p].f; }
#define PARAM_ANGLE_DEF_AT(p,x) DAngle x; if (PARAM_EXISTS(p)) { ASSERTFLOAT(param[p]); x = param[p].f; } else { ASSERTFLOAT(defaultparam[p]); x = defaultparam[p].f; }
#define PARAM_STRING_DEF_AT(p,x) FString x; if (PARAM_EXISTS(p)) { ASSERTSTRING(param[p]); x = param[p].s(); } else { ASSERTSTRING(defaultparam[p]); x = defaultparam[p].s(); }
#define PARAM_STATE_DEF_AT(p,x) FState *x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = (FState*)StateLabels.GetState(param[p].i, self->GetClass()); } else { ASSERTINT(defaultparam[p]); x = (FState*)StateLabels.GetState(defaultparam[p].i, self->GetClass()); }
#define PARAM_STATE_ACTION_DEF_AT(p,x) FState *x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = (FState*)StateLabels.GetState(param[p].i, stateowner->GetClass()); } else { ASSERTINT(defaultparam[p]); x = (FState*)StateLabels.GetState(defaultparam[p].i, stateowner->GetClass()); }
#define PARAM_POINTER_DEF_AT(p,x,t) t *x; if (PARAM_EXISTS(p)) { ASSERTPOINTER(param[p]); x = (t*)param[p].a; } else { ASSERTPOINTER(defaultparam[p]); x = (t*)defaultparam[p].a; }
#define PARAM_OBJECT_DEF_AT(p,x,t) t *x; if (PARAM_EXISTS(p)) { ASSERTOBJECT(param[p]); x = (t*)param[p].a; } else { ASSERTOBJECT(defaultparam[p]); x = (t*)defaultparam[p].a; }
#define PARAM_CLASS_DEF_AT(p,x,t) t::MetaClass *x; if (PARAM_EXISTS(p)) { x = (t::MetaClass*)param[p].a; } else { ASSERTPOINTER(defaultparam[p]); x = (t::MetaClass*)defaultparam[p].a; }
#define PARAM_CLASS_DEF_NOT_NULL_AT(p,x,t) t::MetaClass *x; if (PARAM_EXISTS(p)) { x = (t::MetaClass*)PARAM_NULLCHECK(param[p].a, #x); } else { x = (t::MetaClass*)PARAM_NULLCHECK(defaultparam[p].a, #x); }
// The above, but with an automatically increasing position index. // The above, but with an automatically increasing position index.
#define PARAM_PROLOGUE int paramnum = -1; #define PARAM_PROLOGUE int paramnum = -1;
@ -462,23 +445,7 @@ bool AssertObject(void * ob);
#define PARAM_OBJECT_NOT_NULL(x,type) ++paramnum; PARAM_OBJECT_NOT_NULL_AT(paramnum,x,type) #define PARAM_OBJECT_NOT_NULL(x,type) ++paramnum; PARAM_OBJECT_NOT_NULL_AT(paramnum,x,type)
#define PARAM_CLASS_NOT_NULL(x,base) ++paramnum; PARAM_CLASS_NOT_NULL_AT(paramnum,x,base) #define PARAM_CLASS_NOT_NULL(x,base) ++paramnum; PARAM_CLASS_NOT_NULL_AT(paramnum,x,base)
#define PARAM_INT_DEF(x) ++paramnum; PARAM_INT_DEF_AT(paramnum,x) typedef int(*actionf_p)(VMValue *param, int numparam, VMReturn *ret, int numret);/*(VM_ARGS)*/
#define PARAM_UINT_DEF(x) ++paramnum; PARAM_UINT_DEF_AT(paramnum,x)
#define PARAM_BOOL_DEF(x) ++paramnum; PARAM_BOOL_DEF_AT(paramnum,x)
#define PARAM_NAME_DEF(x) ++paramnum; PARAM_NAME_DEF_AT(paramnum,x)
#define PARAM_SOUND_DEF(x) ++paramnum; PARAM_SOUND_DEF_AT(paramnum,x)
#define PARAM_COLOR_DEF(x) ++paramnum; PARAM_COLOR_DEF_AT(paramnum,x)
#define PARAM_FLOAT_DEF(x) ++paramnum; PARAM_FLOAT_DEF_AT(paramnum,x)
#define PARAM_ANGLE_DEF(x) ++paramnum; PARAM_ANGLE_DEF_AT(paramnum,x)
#define PARAM_STRING_DEF(x) ++paramnum; PARAM_STRING_DEF_AT(paramnum,x)
#define PARAM_STATE_DEF(x) ++paramnum; PARAM_STATE_DEF_AT(paramnum,x)
#define PARAM_STATE_ACTION_DEF(x) ++paramnum; PARAM_STATE_ACTION_DEF_AT(paramnum,x)
#define PARAM_POINTER_DEF(x,type) ++paramnum; PARAM_POINTER_DEF_AT(paramnum,x,type)
#define PARAM_OBJECT_DEF(x,type) ++paramnum; PARAM_OBJECT_DEF_AT(paramnum,x,type)
#define PARAM_CLASS_DEF(x,base) ++paramnum; PARAM_CLASS_DEF_AT(paramnum,x,base)
#define PARAM_CLASS_DEF_NOT_NULL(x,base) ++paramnum; PARAM_CLASS_DEF_NOT_NULL_AT(paramnum,x,base)
typedef int(*actionf_p)(VMValue *param, TArray<VMValue> &defaultparam, int numparam, VMReturn *ret, int numret);/*(VM_ARGS)*/
struct FieldDesc struct FieldDesc
{ {

View file

@ -697,7 +697,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
try try
{ {
VMCycles[0].Unclock(); VMCycles[0].Unclock();
numret = static_cast<VMNativeFunction *>(call)->NativeCall(reg.param + f->NumParam - b, call->DefaultArgs, b, returns, C); numret = static_cast<VMNativeFunction *>(call)->NativeCall(reg.param + f->NumParam - b, b, returns, C);
VMCycles[0].Clock(); VMCycles[0].Clock();
} }
catch (CVMAbortException &err) catch (CVMAbortException &err)
@ -738,7 +738,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
try try
{ {
VMCycles[0].Unclock(); VMCycles[0].Unclock();
auto r = static_cast<VMNativeFunction *>(call)->NativeCall(reg.param + f->NumParam - B, call->DefaultArgs, B, ret, numret); auto r = static_cast<VMNativeFunction *>(call)->NativeCall(reg.param + f->NumParam - B, B, ret, numret);
VMCycles[0].Clock(); VMCycles[0].Clock();
return r; return r;
} }

View file

@ -260,7 +260,7 @@ int VMNativeFunction::NativeScriptCall(VMFunction *func, VMValue *params, int nu
try try
{ {
VMCycles[0].Unclock(); VMCycles[0].Unclock();
numret = static_cast<VMNativeFunction *>(func)->NativeCall(params, func->DefaultArgs, numparams, returns, numret); numret = static_cast<VMNativeFunction *>(func)->NativeCall(params, numparams, returns, numret);
VMCycles[0].Clock(); VMCycles[0].Clock();
return numret; return numret;
@ -535,7 +535,7 @@ int VMCall(VMFunction *func, VMValue *params, int numparams, VMReturn *results,
{ {
if (func->VarFlags & VARF_Native) if (func->VarFlags & VARF_Native)
{ {
return static_cast<VMNativeFunction *>(func)->NativeCall(params, func->DefaultArgs, numparams, results, numresults); return static_cast<VMNativeFunction *>(func)->NativeCall(params, numparams, results, numresults);
} }
else else
{ {
@ -694,7 +694,7 @@ void ThrowAbortException(VMScriptFunction *sfunc, VMOP *line, EVMAbortException
DEFINE_ACTION_FUNCTION(DObject, ThrowAbortException) DEFINE_ACTION_FUNCTION(DObject, ThrowAbortException)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
FString s = FStringFormat(param, defaultparam, numparam, ret, numret); FString s = FStringFormat(param, numparam, ret, numret);
ThrowAbortException(X_OTHER, s.GetChars()); ThrowAbortException(X_OTHER, s.GetChars());
return 0; return 0;
} }

View file

@ -265,7 +265,7 @@ DEFINE_ACTION_FUNCTION(_TexMan, CheckForTexture)
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_STRING(name); PARAM_STRING(name);
PARAM_INT(type); PARAM_INT(type);
PARAM_INT_DEF(flags); PARAM_INT(flags);
ACTION_RETURN_INT(TexMan.CheckForTexture(name, static_cast<ETextureType>(type), flags).GetIndex()); ACTION_RETURN_INT(TexMan.CheckForTexture(name, static_cast<ETextureType>(type), flags).GetIndex());
} }

View file

@ -40,7 +40,7 @@ IMPLEMENT_CLASS(DShape2D, false, false)
DEFINE_ACTION_FUNCTION(DShape2D, Clear) DEFINE_ACTION_FUNCTION(DShape2D, Clear)
{ {
PARAM_SELF_PROLOGUE(DShape2D); PARAM_SELF_PROLOGUE(DShape2D);
PARAM_INT_DEF(which); PARAM_INT(which);
if ( which&C_Verts ) self->mVertices.Clear(); if ( which&C_Verts ) self->mVertices.Clear();
if ( which&C_Coords ) self->mCoords.Clear(); if ( which&C_Coords ) self->mCoords.Clear();
if ( which&C_Indices ) self->mIndices.Clear(); if ( which&C_Indices ) self->mIndices.Clear();

View file

@ -993,8 +993,8 @@ DEFINE_ACTION_FUNCTION(_Screen, VirtualToRealCoords)
PARAM_FLOAT(h); PARAM_FLOAT(h);
PARAM_FLOAT(vw); PARAM_FLOAT(vw);
PARAM_FLOAT(vh); PARAM_FLOAT(vh);
PARAM_BOOL_DEF(vbottom); PARAM_BOOL(vbottom);
PARAM_BOOL_DEF(handleaspect); PARAM_BOOL(handleaspect);
screen->VirtualToRealCoords(x, y, w, h, vw, vh, vbottom, handleaspect); screen->VirtualToRealCoords(x, y, w, h, vw, vh, vbottom, handleaspect);
if (numret >= 1) ret[0].SetVector2(DVector2(x, y)); if (numret >= 1) ret[0].SetVector2(DVector2(x, y));
if (numret >= 2) ret[1].SetVector2(DVector2(w, h)); if (numret >= 2) ret[1].SetVector2(DVector2(w, h));
@ -1088,7 +1088,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawLine)
PARAM_INT(x1); PARAM_INT(x1);
PARAM_INT(y1); PARAM_INT(y1);
PARAM_INT(color); PARAM_INT(color);
PARAM_INT_DEF(alpha); PARAM_INT(alpha);
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
screen->DrawLine(x0, y0, x1, y1, -1, color, alpha); screen->DrawLine(x0, y0, x1, y1, -1, color, alpha);
return 0; return 0;
@ -1107,7 +1107,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawThickLine)
PARAM_INT(y1); PARAM_INT(y1);
PARAM_FLOAT(thickness); PARAM_FLOAT(thickness);
PARAM_INT(color); PARAM_INT(color);
PARAM_INT_DEF(alpha); PARAM_INT(alpha);
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
screen->DrawThickLine(x0, y0, x1, y1, thickness, color, alpha); screen->DrawThickLine(x0, y0, x1, y1, thickness, color, alpha);
return 0; return 0;
@ -1172,7 +1172,7 @@ DEFINE_ACTION_FUNCTION(_Screen, Clear)
PARAM_INT(x2); PARAM_INT(x2);
PARAM_INT(y2); PARAM_INT(y2);
PARAM_INT(color); PARAM_INT(color);
PARAM_INT_DEF(palcol); PARAM_INT(palcol);
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
screen->Clear(x1, y1, x2, y2, palcol, color); screen->Clear(x1, y1, x2, y2, palcol, color);
return 0; return 0;

View file

@ -471,8 +471,8 @@ DEFINE_ACTION_FUNCTION(_Wads, CheckNumForName)
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_STRING(name); PARAM_STRING(name);
PARAM_INT(ns); PARAM_INT(ns);
PARAM_INT_DEF(wadnum); PARAM_INT(wadnum);
PARAM_BOOL_DEF(exact); PARAM_BOOL(exact);
ACTION_RETURN_INT(Wads.CheckNumForName(name, ns, wadnum, exact)); ACTION_RETURN_INT(Wads.CheckNumForName(name, ns, wadnum, exact));
} }
//========================================================================== //==========================================================================
@ -1081,8 +1081,8 @@ DEFINE_ACTION_FUNCTION(_Wads, FindLump)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;
PARAM_STRING(name); PARAM_STRING(name);
PARAM_INT_DEF(startlump); PARAM_INT(startlump);
PARAM_INT_DEF(ns); PARAM_INT(ns);
const bool isLumpValid = startlump >= 0 && startlump < Wads.GetNumLumps(); const bool isLumpValid = startlump >= 0 && startlump < Wads.GetNumLumps();
ACTION_RETURN_INT(isLumpValid ? Wads.FindLump(name, &startlump, 0 != ns) : -1); ACTION_RETURN_INT(isLumpValid ? Wads.FindLump(name, &startlump, 0 != ns) : -1);
} }