mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-03-17 08:21:28 +00:00
Merge branch 'asmjit' of https://github.com/coelckers/gzdoom
This commit is contained in:
commit
c721744f7e
2 changed files with 37 additions and 40 deletions
|
@ -65,6 +65,7 @@
|
|||
#include "backend/vmbuilder.h"
|
||||
#include "types.h"
|
||||
#include "m_argv.h"
|
||||
#include "actorptrselect.h"
|
||||
|
||||
void JitDumpLog(FILE *file, VMScriptFunction *func);
|
||||
|
||||
|
@ -631,30 +632,18 @@ static int GetLine (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// misc1 = vrange (arg +3), misc2 = hrange (arg+4)
|
||||
static int CreateMushroomFunc(VMFunctionBuilder &buildit, int value1, int value2)
|
||||
{ // A_Mushroom
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0); // spawntype
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0); // numspawns
|
||||
int typereg = buildit.GetConstantAddress(PClass::FindClass("FatShot"));
|
||||
buildit.Emit(OP_PARAM, REGT_POINTER | REGT_KONST, typereg); // itemtype
|
||||
buildit.Emit(OP_PARAMI, 0); // numspawns
|
||||
buildit.Emit(OP_PARAMI, 1); // flag
|
||||
// vrange
|
||||
if (value1 == 0)
|
||||
{
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
buildit.Emit(OP_PARAM, REGT_FLOAT | REGT_KONST, buildit.GetConstantFloat(DEHToDouble(value1)));
|
||||
}
|
||||
buildit.Emit(OP_PARAM, REGT_FLOAT | REGT_KONST, buildit.GetConstantFloat(value1? DEHToDouble(value1) : 4.0));
|
||||
// hrange
|
||||
if (value2 == 0)
|
||||
{
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
buildit.Emit(OP_PARAM, REGT_FLOAT | REGT_KONST, buildit.GetConstantFloat(DEHToDouble(value2)));
|
||||
}
|
||||
buildit.Emit(OP_PARAM, REGT_FLOAT | REGT_KONST, buildit.GetConstantFloat(value2? DEHToDouble(value2) : 0.5));
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
@ -668,14 +657,17 @@ static int CreateSpawnFunc(VMFunctionBuilder &buildit, int value1, int value2)
|
|||
}
|
||||
int typereg = buildit.GetConstantAddress(InfoNames[value1-1]);
|
||||
int heightreg = buildit.GetConstantFloat(value2);
|
||||
int distreg = buildit.GetConstantFloat(0);
|
||||
|
||||
buildit.Emit(OP_PARAM, REGT_POINTER | REGT_KONST, typereg); // itemtype
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0); // distance
|
||||
buildit.Emit(OP_PARAM, REGT_FLOAT | REGT_KONST, distreg); // distance
|
||||
buildit.Emit(OP_PARAM, REGT_FLOAT | REGT_KONST, heightreg); // height
|
||||
// The rest of the parameters to A_SpawnItem can just keep their defaults
|
||||
return 3;
|
||||
buildit.Emit(OP_PARAMI, 0); // useammo
|
||||
buildit.Emit(OP_PARAMI, 0); // transfer_translation
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
||||
// misc1 = angle (in degrees) (arg +0 but factor in current actor angle too)
|
||||
static int CreateTurnFunc(VMFunctionBuilder &buildit, int value1, int value2)
|
||||
{ // A_Turn
|
||||
|
@ -687,19 +679,20 @@ static int CreateTurnFunc(VMFunctionBuilder &buildit, int value1, int value2)
|
|||
static int CreateFaceFunc(VMFunctionBuilder &buildit, int value1, int value2)
|
||||
{ // A_FaceTarget
|
||||
buildit.Emit(OP_PARAM, REGT_FLOAT | REGT_KONST, buildit.GetConstantFloat(value1)); // angle
|
||||
return 1;
|
||||
buildit.Emit(OP_PARAMI, 0); // flags
|
||||
buildit.Emit(OP_PARAMI, AAPTR_DEFAULT); // ptr
|
||||
return 3;
|
||||
}
|
||||
|
||||
// misc1 = damage, misc 2 = sound
|
||||
static int CreateScratchFunc(VMFunctionBuilder &buildit, int value1, int value2)
|
||||
{ // A_CustomMeleeAttack
|
||||
buildit.EmitParamInt(value1); // damage
|
||||
if (value2)
|
||||
{
|
||||
buildit.EmitParamInt(SoundMap[value2-1]); // hit sound
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
buildit.EmitParamInt(value1); // damage
|
||||
buildit.EmitParamInt(value2? SoundMap[value2 - 1] : 0); // hit sound
|
||||
buildit.Emit(OP_PARAMI, 0); // miss sound
|
||||
buildit.Emit(OP_PARAMI, NAME_None); // damage type
|
||||
buildit.Emit(OP_PARAMI, true); // bleed
|
||||
return 5;
|
||||
}
|
||||
|
||||
// misc1 = sound, misc2 = attenuation none (true) or normal (false)
|
||||
|
@ -713,7 +706,8 @@ static int CreatePlaySoundFunc(VMFunctionBuilder &buildit, int value1, int value
|
|||
buildit.Emit(OP_PARAM, REGT_FLOAT | REGT_KONST, float1); // volume
|
||||
buildit.Emit(OP_PARAMI, false); // looping
|
||||
buildit.Emit(OP_PARAM, REGT_FLOAT | REGT_KONST, attenreg); // attenuation
|
||||
return 5;
|
||||
buildit.Emit(OP_PARAMI, false); // local
|
||||
return 6;
|
||||
}
|
||||
|
||||
// misc1 = state, misc2 = probability
|
||||
|
@ -744,14 +738,18 @@ static int CreateNailBombFunc(VMFunctionBuilder &buildit, int value1, int value2
|
|||
{ // A_Explode
|
||||
// This one does not actually have MBF-style parameters. But since
|
||||
// we're aliasing it to an extension of A_Explode...
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0); // damage
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0); // distance
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0); // flags
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0); // alert
|
||||
buildit.Emit(OP_PARAM, REGT_NIL, 0); // fulldamagedistance
|
||||
buildit.Emit(OP_PARAMI, 30); // nails
|
||||
buildit.Emit(OP_PARAMI, 10); // naildamage
|
||||
return 7;
|
||||
int typereg = buildit.GetConstantAddress(PClass::FindClass(NAME_BulletPuff));
|
||||
buildit.Emit(OP_PARAMI, -1); // damage
|
||||
buildit.Emit(OP_PARAMI, -1); // distance
|
||||
buildit.Emit(OP_PARAMI, 1); // flags (1=XF_HURTSOURCE)
|
||||
buildit.Emit(OP_PARAMI, 0); // alert
|
||||
buildit.Emit(OP_PARAMI, 0); // fulldamagedistance
|
||||
buildit.Emit(OP_PARAMI, 30); // nails
|
||||
buildit.Emit(OP_PARAMI, 10); // naildamage
|
||||
buildit.Emit(OP_PARAM, REGT_POINTER | REGT_KONST, typereg); // itemtype
|
||||
buildit.Emit(OP_PARAMI, NAME_None); // damage type
|
||||
|
||||
return 9;
|
||||
}
|
||||
|
||||
// This array must be in sync with the Aliases array in DEHSUPP.
|
||||
|
@ -3183,4 +3181,3 @@ DEFINE_ACTION_FUNCTION(ADehackedPickup, DetermineType)
|
|||
}
|
||||
ACTION_RETURN_POINTER(nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -1062,7 +1062,7 @@ class Actor : Thinker native
|
|||
deprecated("2.3") native void A_PlaySoundEx(sound whattoplay, name slot, bool looping = false, int attenuation = 0);
|
||||
deprecated("2.3") native void A_StopSoundEx(name slot);
|
||||
native void A_SeekerMissile(int threshold, int turnmax, int flags = 0, int chance = 50, int distance = 10);
|
||||
native action state A_Jump(int chance, statelabel label);
|
||||
native action state A_Jump(int chance, statelabel label, ...);
|
||||
native Actor A_SpawnProjectile(class<Actor> missiletype, double spawnheight = 32, double spawnofs_xy = 0, double angle = 0, int flags = 0, double pitch = 0, int ptr = AAPTR_TARGET);
|
||||
native void A_CustomBulletAttack(double spread_xy, double spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", double range = 0, int flags = 0, int ptr = AAPTR_TARGET, class<Actor> missile = null, double Spawnheight = 32, double Spawnofs_xy = 0);
|
||||
native void A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = 0, color color2 = 0, int flags = 0, int aim = 0, double maxdiff = 0, class<Actor> pufftype = "BulletPuff", double spread_xy = 0, double spread_z = 0, double range = 0, int duration = 0, double sparsity = 1.0, double driftspeed = 1.0, class<Actor> spawnclass = null, double spawnofs_z = 0, int spiraloffset = 270, int limit = 0, double veleffect = 3);
|
||||
|
|
Loading…
Reference in a new issue