This commit is contained in:
Rachael Alexanderson 2018-11-28 00:23:34 -05:00
commit 0ef6e5b4f0
34 changed files with 542 additions and 401 deletions

View file

@ -182,7 +182,7 @@ void GLFlat::SetupLights(HWDrawInfo *di, FLightNode * node, FDynLightData &light
void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
{
if (level.HasDynamicLights && screen->BuffersArePersistent())
if (level.HasDynamicLights && screen->BuffersArePersistent() && !di->isFullbrightScene())
{
SetupLights(di, section->lighthead, lightdata, sector->PortalGroup);
}
@ -375,7 +375,7 @@ inline void GLFlat::PutFlat(HWDrawInfo *di, bool fog)
}
else if (!screen->BuffersArePersistent())
{
if (level.HasDynamicLights && gltexture != nullptr && !(hacktype & (SSRF_PLANEHACK|SSRF_FLOODHACK)) )
if (level.HasDynamicLights && gltexture != nullptr && !di->isFullbrightScene() && !(hacktype & (SSRF_PLANEHACK|SSRF_FLOODHACK)) )
{
SetupLights(di, section->lighthead, lightdata, sector->PortalGroup);
}

View file

@ -94,7 +94,7 @@ void GLSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
gl_usecolorblending && !di->isFullbrightScene() && actor &&
fullbright && gltexture && !gltexture->tex->GetTranslucency())
{
RenderStyle = LegacyRenderStyles[STYLE_ColorBlend];
RenderStyle = LegacyRenderStyles[STYLE_ColorAdd];
}
state.SetRenderStyle(RenderStyle);

View file

@ -46,6 +46,9 @@ xx(Shadow)
xx(Subtract)
xx(Subtractive)
xx(FillColor)
xx(ColorBlend)
xx(ColorAdd)
xx(Multiply)
// Healingradius types
xx(Mana)

View file

@ -8590,7 +8590,7 @@ void PrintMiscActorInfo(AActor *query)
/*for (flagi = 0; flagi < 31; flagi++)
if (query->BounceFlags & 1<<flagi) Printf(" %s", flagnamesb[flagi]);*/
Printf("\nRender style = %i:%s, alpha %f\nRender flags: %x",
querystyle, (querystyle < STYLE_Count ? renderstyles[querystyle] : "Unknown"),
querystyle, (querystyle < countof(renderstyles) ? renderstyles[querystyle] : "Custom"),
query->Alpha, query->renderflags.GetValue());
/*for (flagi = 0; flagi < 31; flagi++)
if (query->renderflags & 1<<flagi) Printf(" %s", flagnamesr[flagi]);*/

View file

@ -139,16 +139,6 @@ double sector_t::FindLowestFloorSurrounding (vertex_t **v) const
return floor;
}
DEFINE_ACTION_FUNCTION(_Sector, FindLowestFloorSurrounding)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindLowestFloorSurrounding(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//
// P_FindHighestFloorSurrounding()
// FIND HIGHEST FLOOR HEIGHT IN SURROUNDING SECTORS
@ -188,18 +178,6 @@ double sector_t::FindHighestFloorSurrounding (vertex_t **v) const
return floor;
}
DEFINE_ACTION_FUNCTION(_Sector, FindHighestFloorSurrounding)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindHighestFloorSurrounding(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//
// P_FindNextHighestFloor()
//
@ -251,16 +229,6 @@ double sector_t::FindNextHighestFloor (vertex_t **v) const
return height;
}
DEFINE_ACTION_FUNCTION(_Sector, FindNextHighestFloor)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindNextHighestFloor(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//
// P_FindNextLowestFloor()
@ -313,16 +281,6 @@ double sector_t::FindNextLowestFloor (vertex_t **v) const
return height;
}
DEFINE_ACTION_FUNCTION(_Sector, FindNextLowestFloor)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindNextLowestFloor(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//
// P_FindNextLowestCeiling()
@ -375,16 +333,6 @@ double sector_t::FindNextLowestCeiling (vertex_t **v) const
return height;
}
DEFINE_ACTION_FUNCTION(_Sector, FindNextLowestCeiling)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindNextLowestCeiling(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//
// P_FindNextHighestCeiling()
@ -438,16 +386,6 @@ double sector_t::FindNextHighestCeiling (vertex_t **v) const
}
DEFINE_ACTION_FUNCTION(_Sector, FindNextHighestCeiling)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindNextHighestCeiling(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//
// FIND LOWEST CEILING IN THE SURROUNDING SECTORS
//
@ -486,16 +424,6 @@ double sector_t::FindLowestCeilingSurrounding (vertex_t **v) const
return height;
}
DEFINE_ACTION_FUNCTION(_Sector, FindLowestCeilingSurrounding)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindLowestCeilingSurrounding(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//
// FIND HIGHEST CEILING IN THE SURROUNDING SECTORS
@ -535,16 +463,6 @@ double sector_t::FindHighestCeilingSurrounding (vertex_t **v) const
return height;
}
DEFINE_ACTION_FUNCTION(_Sector, FindHighestCeilingSurrounding)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindHighestCeilingSurrounding(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//
// P_FindShortestTextureAround()
@ -692,14 +610,6 @@ int sector_t::FindMinSurroundingLight (int min) const
return min;
}
DEFINE_ACTION_FUNCTION(_Sector, FindMinSurroundingLight)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(min);
auto h = self->FindMinSurroundingLight(min);
ACTION_RETURN_INT(h);
}
//
// Find the highest point on the floor of the sector
//
@ -739,15 +649,6 @@ double sector_t::FindHighestFloorPoint (vertex_t **v) const
return height;
}
DEFINE_ACTION_FUNCTION(_Sector, FindHighestFloorPoint)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindHighestFloorPoint(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//
// Find the lowest point on the ceiling of the sector
@ -788,15 +689,6 @@ double sector_t::FindLowestCeilingPoint (vertex_t **v) const
return height;
}
DEFINE_ACTION_FUNCTION(_Sector, FindLowestCeilingPoint)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindLowestCeilingPoint(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
//=====================================================================================
//
@ -1056,18 +948,6 @@ double sector_t::HighestCeilingAt(const DVector2 &p, sector_t **resultsec)
return check->ceilingplane.ZatPoint(pos);
}
DEFINE_ACTION_FUNCTION(_Sector, HighestCeilingAt)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
sector_t *s;
double h = self->HighestCeilingAt(DVector2(x, y), &s);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(s);
return numret;
}
//===========================================================================
//
// Finds the lowest floor at the given position, all portals considered
@ -1091,18 +971,6 @@ double sector_t::LowestFloorAt(const DVector2 &p, sector_t **resultsec)
return check->floorplane.ZatPoint(pos);
}
DEFINE_ACTION_FUNCTION(_Sector, LowestFloorAt)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
sector_t *s;
double h = self->LowestFloorAt(DVector2(x, y), &s);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(s);
return numret;
}
//=====================================================================================
//
//
@ -1152,34 +1020,6 @@ double sector_t::NextHighestCeilingAt(double x, double y, double bottomz, double
}
}
DEFINE_ACTION_FUNCTION(_Sector, NextHighestCeilingAt)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_FLOAT(bottomz);
PARAM_FLOAT(topz);
PARAM_INT(flags);
sector_t *resultsec;
F3DFloor *resultff;
double resultheight = self->NextHighestCeilingAt(x, y, bottomz, topz, flags, &resultsec, &resultff);
if (numret > 2)
{
ret[2].SetPointer(resultff);
numret = 3;
}
if (numret > 1)
{
ret[1].SetPointer(resultsec);
}
if (numret > 0)
{
ret[0].SetFloat(resultheight);
}
return numret;
}
//=====================================================================================
//
//
@ -1230,35 +1070,6 @@ double sector_t::NextLowestFloorAt(double x, double y, double z, int flags, doub
}
}
DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_FLOAT(z);
PARAM_INT(flags);
PARAM_FLOAT(steph);
sector_t *resultsec;
F3DFloor *resultff;
double resultheight = self->NextLowestFloorAt(x, y, z, flags, steph, &resultsec, &resultff);
if (numret > 2)
{
ret[2].SetPointer(resultff);
numret = 3;
}
if (numret > 1)
{
ret[1].SetPointer(resultsec);
}
if (numret > 0)
{
ret[0].SetFloat(resultheight);
}
return numret;
}
//===========================================================================
//
//
@ -1285,18 +1096,7 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt)
}
}
DEFINE_ACTION_FUNCTION(_Sector, GetFriction)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(plane);
double mf;
double h = self->GetFriction(plane, &mf);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetFloat(mf);
return numret;
}
//===========================================================================
//===========================================================================
//
//
//
@ -1478,14 +1278,6 @@ DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt)
return res;
}
DEFINE_ACTION_FUNCTION(_Sector, TriggerSectorActions)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_OBJECT(thing, AActor);
PARAM_INT(activation);
ACTION_RETURN_BOOL(self->TriggerSectorActions(thing, activation));
}
//===========================================================================
//
// checks if the floor is higher than the ceiling and sets a flag
@ -1782,88 +1574,3 @@ void vertex_t::RecalcVertexHeights()
dirty = false;
}
DEFINE_ACTION_FUNCTION(_Sector, GetPortalDisplacement)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos);
ACTION_RETURN_VEC2(self->GetPortalDisplacement(pos));
}
DEFINE_FIELD_X(Sector, sector_t, floorplane)
DEFINE_FIELD_X(Sector, sector_t, ceilingplane)
DEFINE_FIELD_X(Sector, sector_t, Colormap)
DEFINE_FIELD_X(Sector, sector_t, SpecialColors)
DEFINE_FIELD_X(Sector, sector_t, SoundTarget)
DEFINE_FIELD_X(Sector, sector_t, special)
DEFINE_FIELD_X(Sector, sector_t, lightlevel)
DEFINE_FIELD_X(Sector, sector_t, seqType)
DEFINE_FIELD_X(Sector, sector_t, sky)
DEFINE_FIELD_X(Sector, sector_t, SeqName)
DEFINE_FIELD_X(Sector, sector_t, centerspot)
DEFINE_FIELD_X(Sector, sector_t, validcount)
DEFINE_FIELD_X(Sector, sector_t, thinglist)
DEFINE_FIELD_X(Sector, sector_t, friction)
DEFINE_FIELD_X(Sector, sector_t, movefactor)
DEFINE_FIELD_X(Sector, sector_t, terrainnum)
DEFINE_FIELD_X(Sector, sector_t, floordata)
DEFINE_FIELD_X(Sector, sector_t, ceilingdata)
DEFINE_FIELD_X(Sector, sector_t, lightingdata)
DEFINE_FIELD_X(Sector, sector_t, interpolations)
DEFINE_FIELD_X(Sector, sector_t, soundtraversed)
DEFINE_FIELD_X(Sector, sector_t, stairlock)
DEFINE_FIELD_X(Sector, sector_t, prevsec)
DEFINE_FIELD_X(Sector, sector_t, nextsec)
DEFINE_FIELD_UNSIZED(Sector, sector_t, Lines)
DEFINE_FIELD_X(Sector, sector_t, heightsec)
DEFINE_FIELD_X(Sector, sector_t, bottommap)
DEFINE_FIELD_X(Sector, sector_t, midmap)
DEFINE_FIELD_X(Sector, sector_t, topmap)
DEFINE_FIELD_X(Sector, sector_t, touching_thinglist)
DEFINE_FIELD_X(Sector, sector_t, sectorportal_thinglist)
DEFINE_FIELD_X(Sector, sector_t, gravity)
DEFINE_FIELD_X(Sector, sector_t, damagetype)
DEFINE_FIELD_X(Sector, sector_t, damageamount)
DEFINE_FIELD_X(Sector, sector_t, damageinterval)
DEFINE_FIELD_X(Sector, sector_t, leakydamage)
DEFINE_FIELD_X(Sector, sector_t, ZoneNumber)
DEFINE_FIELD_X(Sector, sector_t, healthceiling)
DEFINE_FIELD_X(Sector, sector_t, healthfloor)
DEFINE_FIELD_X(Sector, sector_t, healthceilinggroup)
DEFINE_FIELD_X(Sector, sector_t, healthfloorgroup)
DEFINE_FIELD_X(Sector, sector_t, MoreFlags)
DEFINE_FIELD_X(Sector, sector_t, Flags)
DEFINE_FIELD_X(Sector, sector_t, SecActTarget)
DEFINE_FIELD_X(Sector, sector_t, Portals)
DEFINE_FIELD_X(Sector, sector_t, PortalGroup)
DEFINE_FIELD_X(Sector, sector_t, sectornum)
DEFINE_FIELD_X(Line, line_t, v1)
DEFINE_FIELD_X(Line, line_t, v2)
DEFINE_FIELD_X(Line, line_t, delta)
DEFINE_FIELD_X(Line, line_t, flags)
DEFINE_FIELD_X(Line, line_t, activation)
DEFINE_FIELD_X(Line, line_t, special)
DEFINE_FIELD_X(Line, line_t, args)
DEFINE_FIELD_X(Line, line_t, alpha)
DEFINE_FIELD_X(Line, line_t, sidedef)
DEFINE_FIELD_X(Line, line_t, bbox)
DEFINE_FIELD_X(Line, line_t, frontsector)
DEFINE_FIELD_X(Line, line_t, backsector)
DEFINE_FIELD_X(Line, line_t, validcount)
DEFINE_FIELD_X(Line, line_t, locknumber)
DEFINE_FIELD_X(Line, line_t, portalindex)
DEFINE_FIELD_X(Line, line_t, portaltransferred)
DEFINE_FIELD_X(Line, line_t, health)
DEFINE_FIELD_X(Line, line_t, healthgroup)
DEFINE_FIELD_X(Side, side_t, sector)
DEFINE_FIELD_X(Side, side_t, linedef)
DEFINE_FIELD_X(Side, side_t, Light)
DEFINE_FIELD_X(Side, side_t, Flags)
DEFINE_FIELD_X(Secplane, secplane_t, normal)
DEFINE_FIELD_X(Secplane, secplane_t, D)
DEFINE_FIELD_X(Secplane, secplane_t, negiC)
DEFINE_FIELD_X(Vertex, vertex_t, p)

View file

@ -739,6 +739,15 @@ public:
case NAME_Subtractive:
th->RenderStyle = STYLE_Subtract;
break;
case NAME_ColorBlend:
th->RenderStyle = STYLE_ColorBlend;
break;
case NAME_ColorAdd:
th->RenderStyle = STYLE_ColorAdd;
break;
case NAME_Multiply:
th->RenderStyle = STYLE_Multiply;
break;
default:
break;
}

View file

@ -62,6 +62,7 @@ FRenderStyle LegacyRenderStyles[STYLE_Count] =
{ { STYLEOP_Add, STYLEALPHA_InvDstCol, STYLEALPHA_Zero, 0 } }, /* STYLE_InverseMultiply */
{ { STYLEOP_Add, STYLEALPHA_SrcCol, STYLEALPHA_InvSrcCol, 0 } }, /* STYLE_ColorBlend */
{ { STYLEOP_Add, STYLEALPHA_One, STYLEALPHA_Zero, 0 } }, /* STYLE_Source */
{ { STYLEOP_Add, STYLEALPHA_SrcCol, STYLEALPHA_One, 0 } }, /* STYLE_ColorAdd */
};
double GetAlpha(int type, double alpha)

View file

@ -78,6 +78,7 @@ enum ERenderStyle
STYLE_InverseMultiply, // Multiply source with inverse of destination (HW renderer only.)
STYLE_ColorBlend, // Use color intensity as transparency factor
STYLE_Source, // No blending (only used internally)
STYLE_ColorAdd, // Use color intensity as transparency factor and blend additively.
STYLE_Count
};

View file

@ -35,6 +35,7 @@
#include "vmbuilder.h"
#include "codegen.h"
#include "m_argv.h"
#include "c_cvars.h"
#include "scripting/vm/jit.h"
struct VMRemap
@ -1046,6 +1047,8 @@ void FunctionCallEmitter::AddParameterStringConst(const FString &konst)
});
}
EXTERN_CVAR(Bool, vm_jit)
ExpEmit FunctionCallEmitter::EmitCall(VMFunctionBuilder *build, TArray<ExpEmit> *ReturnRegs)
{
unsigned paramcount = 0;
@ -1085,6 +1088,15 @@ ExpEmit FunctionCallEmitter::EmitCall(VMFunctionBuilder *build, TArray<ExpEmit>
if (ReturnRegs) ReturnRegs->Push(reg);
else return reg;
}
if (vm_jit) // The JIT compiler needs this, but the VM interpreter does not.
{
for (unsigned i = returns.Size(); i < target->Proto->ReturnTypes.Size(); i++)
{
ExpEmit reg(build, target->Proto->ReturnTypes[i]->RegType, target->Proto->ReturnTypes[i]->RegCount);
build->Emit(OP_RESULT, 0, EncodeRegType(reg), reg.RegNum);
reg.Free(build);
}
}
return ExpEmit();
}

View file

@ -700,12 +700,14 @@ DEFINE_PROPERTY(renderstyle, S, Actor)
PROP_STRING_PARM(str, 0);
static const char * renderstyles[]={
"NONE", "NORMAL", "FUZZY", "SOULTRANS", "OPTFUZZY", "STENCIL",
"TRANSLUCENT", "ADD", "SHADED", "SHADOW", "SUBTRACT", "ADDSTENCIL", "ADDSHADED", NULL };
"TRANSLUCENT", "ADD", "SHADED", "SHADOW", "SUBTRACT", "ADDSTENCIL",
"ADDSHADED", "COLORBLEND", "COLORADD", "MULTIPLY", NULL };
static const int renderstyle_values[]={
STYLE_None, STYLE_Normal, STYLE_Fuzzy, STYLE_SoulTrans, STYLE_OptFuzzy,
STYLE_TranslucentStencil, STYLE_Translucent, STYLE_Add, STYLE_Shaded,
STYLE_Shadow, STYLE_Subtract, STYLE_AddStencil, STYLE_AddShaded};
STYLE_Shadow, STYLE_Subtract, STYLE_AddStencil, STYLE_AddShaded,
STYLE_ColorBlend, STYLE_ColorAdd, STYLE_Multiply};
// make this work for old style decorations, too.
if (!strnicmp(str, "style_", 6)) str+=6;

View file

@ -42,7 +42,7 @@ void JitCompiler::EmitVtbl(const VMOP *op)
void JitCompiler::EmitCALL()
{
EmitVMCall(regA[A]);
EmitVMCall(regA[A], nullptr);
pc += C; // Skip RESULTs
}
@ -62,13 +62,13 @@ void JitCompiler::EmitCALL_K()
{
auto ptr = newTempIntPtr();
cc.mov(ptr, asmjit::imm_ptr(target));
EmitVMCall(ptr);
EmitVMCall(ptr, target);
}
pc += C; // Skip RESULTs
}
void JitCompiler::EmitVMCall(asmjit::X86Gp vmfunc)
void JitCompiler::EmitVMCall(asmjit::X86Gp vmfunc, VMFunction *target)
{
using namespace asmjit;
@ -97,6 +97,7 @@ void JitCompiler::EmitVMCall(asmjit::X86Gp vmfunc)
call->setArg(2, Imm(B));
call->setArg(3, GetCallReturns());
call->setArg(4, Imm(C));
call->setInlineComment(target ? target->PrintableName.GetChars() : "VMCall");
LoadInOuts();
LoadReturns(pc + 1, C);
@ -323,7 +324,8 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target)
}
asmjit::CBNode *cursorBefore = cc.getCursor();
auto call = cc.call(imm_ptr(target->DirectNativeCall), CreateFuncSignature(target));
auto call = cc.call(imm_ptr(target->DirectNativeCall), CreateFuncSignature());
call->setInlineComment(target->PrintableName.GetChars());
asmjit::CBNode *cursorAfter = cc.getCursor();
cc.setCursor(cursorBefore);
@ -401,36 +403,78 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target)
}
}
cc.setCursor(cursorAfter);
if (numparams != B)
I_FatalError("OP_CALL parameter count does not match the number of preceding OP_PARAM instructions\n");
// Note: the usage of newResultXX is intentional. Asmjit has a register allocation bug
// if the return virtual register is already allocated in an argument slot.
const VMOP *retval = pc + 1;
int numret = C;
if (numret > 1)
I_FatalError("Only one return parameter is supported for direct native calls\n");
if (numret == 1)
// Check if first return value was placed in the function's real return value slot
int startret = 1;
if (numret > 0)
{
const auto &retval = pc[1];
if (retval.op != OP_RESULT)
int type = retval[0].b;
switch (type)
{
I_FatalError("Expected OP_RESULT to follow OP_CALL\n");
case REGT_INT:
case REGT_FLOAT:
case REGT_POINTER:
break;
default:
startret = 0;
break;
}
}
int type = retval.b;
int regnum = retval.c;
// Pass return pointers as arguments
for (int i = startret; i < numret; ++i)
{
int type = retval[i].b;
int regnum = retval[i].c;
if (type & REGT_KONST)
{
I_FatalError("OP_RESULT with REGT_KONST is not allowed\n");
}
// Note: the usage of newResultXX is intentional. Asmjit has a register allocation bug
// if the return virtual register is already allocated in an argument slot.
CheckVMFrame();
auto regPtr = newTempIntPtr();
switch (type & REGT_TYPE)
{
case REGT_INT:
cc.lea(regPtr, x86::ptr(vmframe, offsetD + (int)(regnum * sizeof(int32_t))));
break;
case REGT_FLOAT:
cc.lea(regPtr, x86::ptr(vmframe, offsetF + (int)(regnum * sizeof(double))));
break;
case REGT_STRING:
cc.lea(regPtr, x86::ptr(vmframe, offsetS + (int)(regnum * sizeof(FString))));
break;
case REGT_POINTER:
cc.lea(regPtr, x86::ptr(vmframe, offsetA + (int)(regnum * sizeof(void*))));
break;
default:
I_FatalError("Unknown OP_RESULT type encountered\n");
break;
}
cc.setArg(numparams + i - startret, regPtr);
}
cc.setCursor(cursorAfter);
if (startret == 1 && numret > 0)
{
int type = retval[0].b;
int regnum = retval[0].c;
switch (type)
{
case REGT_INT:
tmp = newResultInt32();
call->setRet(0, tmp);
@ -443,13 +487,43 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target)
break;
case REGT_POINTER:
tmp = newResultIntPtr();
call->setRet(0, tmp);
cc.mov(regA[regnum], tmp);
break;
case REGT_STRING:
}
}
// Move the result into virtual registers
for (int i = startret; i < numret; ++i)
{
int type = retval[i].b;
int regnum = retval[i].c;
switch (type)
{
case REGT_INT:
cc.mov(regD[regnum], asmjit::x86::dword_ptr(vmframe, offsetD + regnum * sizeof(int32_t)));
break;
case REGT_FLOAT:
cc.movsd(regF[regnum], asmjit::x86::qword_ptr(vmframe, offsetF + regnum * sizeof(double)));
break;
case REGT_FLOAT | REGT_MULTIREG2:
cc.movsd(regF[regnum], asmjit::x86::qword_ptr(vmframe, offsetF + regnum * sizeof(double)));
cc.movsd(regF[regnum + 1], asmjit::x86::qword_ptr(vmframe, offsetF + (regnum + 1) * sizeof(double)));
break;
case REGT_FLOAT | REGT_MULTIREG3:
cc.movsd(regF[regnum], asmjit::x86::qword_ptr(vmframe, offsetF + regnum * sizeof(double)));
cc.movsd(regF[regnum + 1], asmjit::x86::qword_ptr(vmframe, offsetF + (regnum + 1) * sizeof(double)));
cc.movsd(regF[regnum + 2], asmjit::x86::qword_ptr(vmframe, offsetF + (regnum + 2) * sizeof(double)));
break;
case REGT_STRING:
// We don't have to do anything in this case. String values are never moved to virtual registers.
break;
case REGT_POINTER:
cc.mov(regA[regnum], asmjit::x86::ptr(vmframe, offsetA + regnum * sizeof(void*)));
break;
default:
I_FatalError("Unsupported OP_RESULT type encountered in EmitNativeCall\n");
I_FatalError("Unknown OP_RESULT type encountered\n");
break;
}
}
@ -457,81 +531,122 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target)
ParamOpcodes.Clear();
}
asmjit::FuncSignature JitCompiler::CreateFuncSignature(VMFunction *func)
asmjit::FuncSignature JitCompiler::CreateFuncSignature()
{
using namespace asmjit;
TArray<uint8_t> args;
FString key;
for (unsigned int i = 0; i < func->Proto->ArgumentTypes.Size(); i++)
// First add parameters as args to the signature
for (unsigned int i = 0; i < ParamOpcodes.Size(); i++)
{
const PType *type = func->Proto->ArgumentTypes[i];
if (func->ArgFlags.Size() && func->ArgFlags[i] & (VARF_Out | VARF_Ref))
{
args.Push(TypeIdOf<void*>::kTypeId);
key += "v";
}
else if (type == TypeVector2)
{
args.Push(TypeIdOf<double>::kTypeId);
args.Push(TypeIdOf<double>::kTypeId);
key += "ff";
}
else if (type == TypeVector3)
{
args.Push(TypeIdOf<double>::kTypeId);
args.Push(TypeIdOf<double>::kTypeId);
args.Push(TypeIdOf<double>::kTypeId);
key += "fff";
}
else if (type == TypeFloat64)
{
args.Push(TypeIdOf<double>::kTypeId);
key += "f";
}
else if (type == TypeString)
{
args.Push(TypeIdOf<void*>::kTypeId);
key += "s";
}
else if (type->isIntCompatible())
if (ParamOpcodes[i]->op == OP_PARAMI)
{
args.Push(TypeIdOf<int>::kTypeId);
key += "i";
}
else
else // OP_PARAM
{
args.Push(TypeIdOf<void*>::kTypeId);
key += "v";
int bc = ParamOpcodes[i]->i16u;
switch (ParamOpcodes[i]->a)
{
case REGT_NIL:
case REGT_POINTER:
case REGT_POINTER | REGT_KONST:
case REGT_STRING | REGT_ADDROF:
case REGT_INT | REGT_ADDROF:
case REGT_POINTER | REGT_ADDROF:
case REGT_FLOAT | REGT_ADDROF:
args.Push(TypeIdOf<void*>::kTypeId);
key += "v";
break;
case REGT_INT:
case REGT_INT | REGT_KONST:
args.Push(TypeIdOf<int>::kTypeId);
key += "i";
break;
case REGT_STRING:
case REGT_STRING | REGT_KONST:
args.Push(TypeIdOf<void*>::kTypeId);
key += "s";
break;
case REGT_FLOAT:
case REGT_FLOAT | REGT_KONST:
args.Push(TypeIdOf<double>::kTypeId);
key += "f";
break;
case REGT_FLOAT | REGT_MULTIREG2:
args.Push(TypeIdOf<double>::kTypeId);
args.Push(TypeIdOf<double>::kTypeId);
key += "ff";
break;
case REGT_FLOAT | REGT_MULTIREG3:
args.Push(TypeIdOf<double>::kTypeId);
args.Push(TypeIdOf<double>::kTypeId);
args.Push(TypeIdOf<double>::kTypeId);
key += "fff";
break;
default:
I_FatalError("Unknown REGT value passed to EmitPARAM\n");
break;
}
}
}
const VMOP *retval = pc + 1;
int numret = C;
uint32_t rettype = TypeIdOf<void>::kTypeId;
if (func->Proto->ReturnTypes.Size() > 0)
// Check if first return value can be placed in the function's real return value slot
int startret = 1;
if (numret > 0)
{
const PType *type = func->Proto->ReturnTypes[0];
if (type == TypeFloat64)
if (retval[0].op != OP_RESULT)
{
rettype = TypeIdOf<double>::kTypeId;
key += "rf";
I_FatalError("Expected OP_RESULT to follow OP_CALL\n");
}
else if (type == TypeString)
{
rettype = TypeIdOf<void*>::kTypeId;
key += "rs";
}
else if (type->isIntCompatible())
int type = retval[0].b;
switch (type)
{
case REGT_INT:
rettype = TypeIdOf<int>::kTypeId;
key += "ri";
}
else
{
break;
case REGT_FLOAT:
rettype = TypeIdOf<double>::kTypeId;
key += "rf";
break;
case REGT_STRING:
rettype = TypeIdOf<void*>::kTypeId;
key += "rs";
break;
case REGT_POINTER:
rettype = TypeIdOf<void*>::kTypeId;
key += "rv";
break;
default:
startret = 0;
break;
}
}
// Add any additional return values as function arguments
for (int i = startret; i < numret; ++i)
{
if (retval[i].op != OP_RESULT)
{
I_FatalError("Expected OP_RESULT to follow OP_CALL\n");
}
args.Push(TypeIdOf<void*>::kTypeId);
key += "v";
}
// FuncSignature only keeps a pointer to its args array. Store a copy of each args array variant.
static std::map<FString, std::unique_ptr<TArray<uint8_t>>> argsCache;
std::unique_ptr<TArray<uint8_t>> &cachedArgs = argsCache[key];

View file

@ -38,7 +38,7 @@ private:
#include "vmops.h"
#undef xx
static asmjit::FuncSignature CreateFuncSignature(VMFunction *sfunc);
asmjit::FuncSignature CreateFuncSignature();
void Setup();
void CreateRegisters();
@ -51,7 +51,7 @@ private:
void EmitPopFrame();
void EmitNativeCall(VMNativeFunction *target);
void EmitVMCall(asmjit::X86Gp ptr);
void EmitVMCall(asmjit::X86Gp ptr, VMFunction *target);
void EmitVtbl(const VMOP *op);
int StoreCallParams();

View file

@ -36,8 +36,8 @@
#ifndef VM_H
#define VM_H
#include "zstring.h"
#include "autosegs.h"
#include "zstring.h"
#include "vectors.h"
#include "cmdlib.h"
#include "doomerrors.h"

View file

@ -17,7 +17,7 @@
//
//-----------------------------------------------------------------------------
//
// VM thunks for simple functions.
// VM thunks for internal functions.
//
//-----------------------------------------------------------------------------
@ -27,6 +27,219 @@
#include "s_sound.h"
#include "p_local.h"
DEFINE_ACTION_FUNCTION(_Sector, FindLowestFloorSurrounding)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindLowestFloorSurrounding(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, FindHighestFloorSurrounding)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindHighestFloorSurrounding(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, FindNextHighestFloor)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindNextHighestFloor(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, FindNextLowestFloor)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindNextLowestFloor(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, FindNextLowestCeiling)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindNextLowestCeiling(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, FindNextHighestCeiling)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindNextHighestCeiling(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, FindLowestCeilingSurrounding)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindLowestCeilingSurrounding(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, FindHighestCeilingSurrounding)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindHighestCeilingSurrounding(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, FindMinSurroundingLight)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(min);
auto h = self->FindMinSurroundingLight(min);
ACTION_RETURN_INT(h);
}
DEFINE_ACTION_FUNCTION(_Sector, FindHighestFloorPoint)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindHighestFloorPoint(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, FindLowestCeilingPoint)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
vertex_t *v;
double h = self->FindLowestCeilingPoint(&v);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(v);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, HighestCeilingAt)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
sector_t *s;
double h = self->HighestCeilingAt(DVector2(x, y), &s);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(s);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, LowestFloorAt)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
sector_t *s;
double h = self->LowestFloorAt(DVector2(x, y), &s);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetPointer(s);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, NextHighestCeilingAt)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_FLOAT(bottomz);
PARAM_FLOAT(topz);
PARAM_INT(flags);
sector_t *resultsec;
F3DFloor *resultff;
double resultheight = self->NextHighestCeilingAt(x, y, bottomz, topz, flags, &resultsec, &resultff);
if (numret > 2)
{
ret[2].SetPointer(resultff);
numret = 3;
}
if (numret > 1)
{
ret[1].SetPointer(resultsec);
}
if (numret > 0)
{
ret[0].SetFloat(resultheight);
}
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, NextLowestFloorAt)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_FLOAT(z);
PARAM_INT(flags);
PARAM_FLOAT(steph);
sector_t *resultsec;
F3DFloor *resultff;
double resultheight = self->NextLowestFloorAt(x, y, z, flags, steph, &resultsec, &resultff);
if (numret > 2)
{
ret[2].SetPointer(resultff);
numret = 3;
}
if (numret > 1)
{
ret[1].SetPointer(resultsec);
}
if (numret > 0)
{
ret[0].SetFloat(resultheight);
}
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, GetFriction)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(plane);
double mf;
double h = self->GetFriction(plane, &mf);
if (numret > 0) ret[0].SetFloat(h);
if (numret > 1) ret[1].SetFloat(mf);
return numret;
}
DEFINE_ACTION_FUNCTION(_Sector, TriggerSectorActions)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_OBJECT(thing, AActor);
PARAM_INT(activation);
ACTION_RETURN_BOOL(self->TriggerSectorActions(thing, activation));
}
DEFINE_ACTION_FUNCTION(_Sector, GetPortalDisplacement)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos);
ACTION_RETURN_VEC2(self->GetPortalDisplacement(pos));
}
DEFINE_ACTION_FUNCTION_NATIVE(_Sector, FindShortestTextureAround, FindShortestTextureAround)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
@ -1265,3 +1478,82 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_PlaySound, A_PlaySound)
A_PlaySound(self, soundid, channel, volume, looping, attenuation, local);
return 0;
}
DEFINE_FIELD_X(Sector, sector_t, floorplane)
DEFINE_FIELD_X(Sector, sector_t, ceilingplane)
DEFINE_FIELD_X(Sector, sector_t, Colormap)
DEFINE_FIELD_X(Sector, sector_t, SpecialColors)
DEFINE_FIELD_X(Sector, sector_t, SoundTarget)
DEFINE_FIELD_X(Sector, sector_t, special)
DEFINE_FIELD_X(Sector, sector_t, lightlevel)
DEFINE_FIELD_X(Sector, sector_t, seqType)
DEFINE_FIELD_X(Sector, sector_t, sky)
DEFINE_FIELD_X(Sector, sector_t, SeqName)
DEFINE_FIELD_X(Sector, sector_t, centerspot)
DEFINE_FIELD_X(Sector, sector_t, validcount)
DEFINE_FIELD_X(Sector, sector_t, thinglist)
DEFINE_FIELD_X(Sector, sector_t, friction)
DEFINE_FIELD_X(Sector, sector_t, movefactor)
DEFINE_FIELD_X(Sector, sector_t, terrainnum)
DEFINE_FIELD_X(Sector, sector_t, floordata)
DEFINE_FIELD_X(Sector, sector_t, ceilingdata)
DEFINE_FIELD_X(Sector, sector_t, lightingdata)
DEFINE_FIELD_X(Sector, sector_t, interpolations)
DEFINE_FIELD_X(Sector, sector_t, soundtraversed)
DEFINE_FIELD_X(Sector, sector_t, stairlock)
DEFINE_FIELD_X(Sector, sector_t, prevsec)
DEFINE_FIELD_X(Sector, sector_t, nextsec)
DEFINE_FIELD_UNSIZED(Sector, sector_t, Lines)
DEFINE_FIELD_X(Sector, sector_t, heightsec)
DEFINE_FIELD_X(Sector, sector_t, bottommap)
DEFINE_FIELD_X(Sector, sector_t, midmap)
DEFINE_FIELD_X(Sector, sector_t, topmap)
DEFINE_FIELD_X(Sector, sector_t, touching_thinglist)
DEFINE_FIELD_X(Sector, sector_t, sectorportal_thinglist)
DEFINE_FIELD_X(Sector, sector_t, gravity)
DEFINE_FIELD_X(Sector, sector_t, damagetype)
DEFINE_FIELD_X(Sector, sector_t, damageamount)
DEFINE_FIELD_X(Sector, sector_t, damageinterval)
DEFINE_FIELD_X(Sector, sector_t, leakydamage)
DEFINE_FIELD_X(Sector, sector_t, ZoneNumber)
DEFINE_FIELD_X(Sector, sector_t, healthceiling)
DEFINE_FIELD_X(Sector, sector_t, healthfloor)
DEFINE_FIELD_X(Sector, sector_t, healthceilinggroup)
DEFINE_FIELD_X(Sector, sector_t, healthfloorgroup)
DEFINE_FIELD_X(Sector, sector_t, MoreFlags)
DEFINE_FIELD_X(Sector, sector_t, Flags)
DEFINE_FIELD_X(Sector, sector_t, SecActTarget)
DEFINE_FIELD_X(Sector, sector_t, Portals)
DEFINE_FIELD_X(Sector, sector_t, PortalGroup)
DEFINE_FIELD_X(Sector, sector_t, sectornum)
DEFINE_FIELD_X(Line, line_t, v1)
DEFINE_FIELD_X(Line, line_t, v2)
DEFINE_FIELD_X(Line, line_t, delta)
DEFINE_FIELD_X(Line, line_t, flags)
DEFINE_FIELD_X(Line, line_t, activation)
DEFINE_FIELD_X(Line, line_t, special)
DEFINE_FIELD_X(Line, line_t, args)
DEFINE_FIELD_X(Line, line_t, alpha)
DEFINE_FIELD_X(Line, line_t, sidedef)
DEFINE_FIELD_X(Line, line_t, bbox)
DEFINE_FIELD_X(Line, line_t, frontsector)
DEFINE_FIELD_X(Line, line_t, backsector)
DEFINE_FIELD_X(Line, line_t, validcount)
DEFINE_FIELD_X(Line, line_t, locknumber)
DEFINE_FIELD_X(Line, line_t, portalindex)
DEFINE_FIELD_X(Line, line_t, portaltransferred)
DEFINE_FIELD_X(Line, line_t, health)
DEFINE_FIELD_X(Line, line_t, healthgroup)
DEFINE_FIELD_X(Side, side_t, sector)
DEFINE_FIELD_X(Side, side_t, linedef)
DEFINE_FIELD_X(Side, side_t, Light)
DEFINE_FIELD_X(Side, side_t, Flags)
DEFINE_FIELD_X(Secplane, secplane_t, normal)
DEFINE_FIELD_X(Secplane, secplane_t, D)
DEFINE_FIELD_X(Secplane, secplane_t, negiC)
DEFINE_FIELD_X(Vertex, vertex_t, p)

View file

@ -660,7 +660,7 @@ SPREE15 = "%k is dominating!";
SPREE20 = "%k is unstoppable!";
SPREE25 = "%k is Godlike!";
// Mulitkill messages
// Multikill messages
MULTI2 = "Double kill!";
MULTI3 = "Multi kill!";
MULTI4 = "Ultra kill!";
@ -824,12 +824,12 @@ OB_MPCWEAPFLAME = "%o was lit up by %k's flames.";
OB_MPCWEAPWRAITHVERGE = "%o was cleansed by %k's Wraithverge.";
OB_MPMWEAPWAND = "%o took one too many sapphire beams from %k.";
OB_MPMWEAPFROST = "%o was turned into a frosty fellow by %k.";
OB_MPMWEAPLIGHTNING = "%o recieved a shocking revelation from %k.";
OB_MPMWEAPLIGHTNING = "%o received a shocking revelation from %k.";
OB_MPMWEAPBLOODSCOURGE = "%o was wiped off the face of the universe by %k's Bloodscourge.";
OB_MPPUNCHDAGGER = "%o was unwittingly backstabbed by %k.";
OB_MPELECTRICBOLT = "%o got bolted to the wall by %k.";
OB_MPPOISONBOLT = "%o recieved a lethal dose of %k's wrath.";
OB_MPPOISONBOLT = "%o received a lethal dose of %k's wrath.";
OB_MPASSAULTGUN = "%o was drilled full of holes by %k's assault gun.";
OB_MPMINIMISSILELAUNCHER = "%o gulped down %k's missile.";
OB_MPSTRIFEGRENADE = "%o was inverted by %k's H-E grenade.";
@ -950,7 +950,7 @@ TAG_ARTIPUZZGEMGREEN2 = "Emerald Planet (2)";
TAG_ARTIPUZZGEMBLUE1 = "Sapphire Planet (1)";
TAG_ARTIPUZZGEMBLUE2 = "Sapphire Planet (2)";
TAG_ARTIPUZZBOOK1 = "Daemon Codex";
TAG_ARTIPUZZBOOK2 = "Liber Obscura";
TAG_ARTIPUZZBOOK2 = "Liber Oscura";
TAG_ARTIPUZZSKULL2 = "Flame Mask";
TAG_ARTIPUZZFWEAPON = "Glaive Seal";
TAG_ARTIPUZZCWEAPON = "Holy Relic";
@ -1003,7 +1003,7 @@ TAG_TELEPORTERBEACON = "Teleporter Beacon";
TAG_METALARMOR = "Metal Armor";
TAG_LEATHER = "Leather Armor";
TAG_HEGRENADES = "HE-Grenade Rounds";
TAG_PHGRENADES = "Phoshorus-Grenade Rounds"; // "Fire-Grenade_Rounds" in the Teaser
TAG_PHGRENADES = "Phosphorus-Grenade Rounds"; // "Fire-Grenade_Rounds" in the Teaser
TAG_CLIPOFBULLETS = "Clip of Bullets"; // "bullets" in the Teaser
TAG_BOXOFBULLETS = "Ammo";
TAG_MINIMISSILES = "Mini Missiles"; //"rocket" in the Teaser
@ -2692,7 +2692,7 @@ OB_CYCLOPTIS = "%o was slimed by a cycloptis.";
OB_FLEMBRANE = "%o was defeated by the Flembrane.";
OB_MPSPOON = "%o was spoon fed by %k.";
OB_MPBOOTSPORK = "%o was thouroughly mixed with %k's bootspork.";
OB_MPBOOTSPORK = "%o was thoroughly mixed with %k's bootspork.";
OB_MPZORCH = "%o was zorched by %k.";
OB_MPMEGAZORCH = "%o was hit by %k's mega-zorcher.";
OB_MPRAPIDZORCH = "%o was rapid zorched by %k.";

View file

@ -1016,7 +1016,7 @@ TAG_ARTIPUZZGEMGREEN2 = "Planète en émeraude (2)";
TAG_ARTIPUZZGEMBLUE1 = "Planète en saphir (1)";
TAG_ARTIPUZZGEMBLUE2 = "Planète en saphir (2)";
TAG_ARTIPUZZBOOK1 = "Codex Démoniaque";
TAG_ARTIPUZZBOOK2 = "Liber Obscura";
TAG_ARTIPUZZBOOK2 = "Liber Oscura";
TAG_ARTIPUZZSKULL2 = "Masque de Flammes";
TAG_ARTIPUZZFWEAPON = "Sceau du Glaive";
TAG_ARTIPUZZCWEAPON = "Relique Sacrée";
@ -1459,7 +1459,7 @@ TXT_ARTIPUZZGEMGREEN2 = "PLANETE D'EMERAUDE";
TXT_ARTIPUZZGEMBLUE1 = "PLANETE DE SAPHIR";
TXT_ARTIPUZZGEMBLUE2 = "PLANETE DE SAPHIR";
TXT_ARTIPUZZBOOK1 = "CODEX DEMONIAQUE";
TXT_ARTIPUZZBOOK2 = "LIBER OBSCURA";
TXT_ARTIPUZZBOOK2 = "LIBER OSCURA";
TXT_ARTIPUZZSKULL2 = "MASQUE DE FLAMMES";
TXT_ARTIPUZZFWEAPON = "SCEAU DU GLAIVE";
TXT_ARTIPUZZCWEAPON = "RELIQUE SACREE";

View file

@ -882,7 +882,7 @@ TAG_ARTIPUZZGEMGREEN2 = "Emerald Planet (2)";
TAG_ARTIPUZZGEMBLUE1 = "Sapphire Planet (1)";
TAG_ARTIPUZZGEMBLUE2 = "Sapphire Planet (2)";
TAG_ARTIPUZZBOOK1 = "Daemon Codex";
TAG_ARTIPUZZBOOK2 = "Liber Obscura";
TAG_ARTIPUZZBOOK2 = "Liber Oscura";
TAG_ARTIPUZZSKULL2 = "Flame Mask";
TAG_ARTIPUZZFWEAPON = "Glaive Seal";
TAG_ARTIPUZZCWEAPON = "Holy Relic";

View file

@ -1175,7 +1175,7 @@ class Actor : Thinker native
native void A_SetMugshotState(String name);
native void A_RearrangePointers(int newtarget, int newmaster = AAPTR_DEFAULT, int newtracer = AAPTR_DEFAULT, int flags=0);
native void A_TransferPointer(int ptr_source, int ptr_recepient, int sourcefield, int recepientfield=AAPTR_DEFAULT, int flags=0);
native void A_TransferPointer(int ptr_source, int ptr_recipient, int sourcefield, int recipientfield=AAPTR_DEFAULT, int flags=0);
native void A_CopyFriendliness(int ptr_source = AAPTR_MASTER);
action native bool A_Overlay(int layer, statelabel start = null, bool nooverride = false);

View file

@ -428,7 +428,7 @@ const ATTN_NORM = 1;
const ATTN_IDLE = 1.001;
const ATTN_STATIC = 3;
// For SetPlayerProprty action special
// For SetPlayerProperty action special
enum EPlayerProperties
{
PROP_FROZEN = 0,

View file

@ -194,7 +194,7 @@ extend class Actor
Actor owner = (flags & MSF_DontHurt) ? target : self;
aimtarget.Height = Height;
bool shootmode = ((flags & MSF_Classic) || // Flag explicitely set, or no flags and compat options
bool shootmode = ((flags & MSF_Classic) || // Flag explicitly set, or no flags and compat options
(flags == 0 && CurState.bDehacked && compat_mushroom));
for (i = -numspawns; i <= numspawns; i += 8)

View file

@ -224,7 +224,7 @@ class HornRodFX2 : Actor
RainTracker tracker;
if (target == null || target.health <= 0)
{ // Shooter is dead or nonexistant
{ // Shooter is dead or nonexistent
return;
}

View file

@ -347,7 +347,6 @@ class ArtiPoisonBag3 : ArtiPoisonBag
// is as set by the projectile. To accommodate self with a proper trajectory, we
// aim the projectile ~20 degrees higher than we're looking at and increase the
// speed we fire at accordingly.
double orgpitch = -Owner.Pitch;
double modpitch = clamp(-Owner.Pitch + 20, -89., 89.);
double ang = mo.angle;
double speed = (mo.Speed, 4.).Length();

View file

@ -1038,7 +1038,7 @@ class SorcFX3 : Actor
mo.Destroy ();
}
else if (target != null)
{ // [RH] Make the new bishops inherit the Heriarch's target
{ // [RH] Make the new bishops inherit the Heresiarch's target
mo.CopyFriendliness (target, true);
mo.master = target;
}

View file

@ -4,7 +4,7 @@
**
**---------------------------------------------------------------------------
** Copyright 2000-2016 Randy Heit
** Copyright 2006-2017 Cheistoph Oelckers
** Copyright 2006-2017 Christoph Oelckers
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without

View file

@ -827,7 +827,7 @@ class Inventory : Actor native
}
/*
else if ((ItemFlags & IF_FANCYPICKUPSOUND) &&
(toucher == NULL || toucher->CheckLocalView(consoeplayer)))
(toucher == NULL || toucher->CheckLocalView(consoleplayer)))
{
atten = ATTN_NONE;
}

View file

@ -3,7 +3,7 @@
** Implements generic weapon pieces
**
**---------------------------------------------------------------------------
** Copyright 2006-2016 Cheistoph Oelckers
** Copyright 2006-2016 Christoph Oelckers
** Copyright 2006-2016 Randy Heit
** All rights reserved.
**

View file

@ -1109,7 +1109,7 @@ class LevelCompatibility play
break;
}
case 'D67CECE3F60083383DF992B8C824E4AC': // Icarus: Alien Vanuguard MAP13
case 'D67CECE3F60083383DF992B8C824E4AC': // Icarus: Alien Vanguard MAP13
{
// Moves sector special to platform with Berserk powerup. The
// map's only secret can now be scored.
@ -1118,7 +1118,7 @@ class LevelCompatibility play
break;
}
case '61373587339A768854E2912CC99A4781': // Icarus: Alien Vanuguard MAP15
case '61373587339A768854E2912CC99A4781': // Icarus: Alien Vanguard MAP15
{
// Can press use on the lift to reveal the secret Shotgun,
// making 100% secrets possible.
@ -1128,7 +1128,7 @@ class LevelCompatibility play
break;
}
case '9F66B0797925A09D4DC0725540F8EEF7': // Icarus: Alien Vanuguard MAP16
case '9F66B0797925A09D4DC0725540F8EEF7': // Icarus: Alien Vanguard MAP16
{
// Can press use on the walls at the secret Rocket Launcher in
// case of getting stuck.

View file

@ -157,7 +157,7 @@ struct Line native play
native uint activation; // activation type
native int special;
native int args[5]; // <--- hexen-style arguments (expanded to ZDoom's full width)
native double alpha; // <--- translucency (0=invisibile, FRACUNIT=opaque)
native double alpha; // <--- translucency (0=invisible, FRACUNIT=opaque)
native readonly Side sidedef[2];
native readonly double bbox[4]; // bounding box, for the extent of the LineDef.
native readonly Sector frontsector, backsector;

View file

@ -1,6 +1,6 @@
/*
** messagebox.cpp
** Confirmation, notification screns
** Confirmation, notification screens
**
**---------------------------------------------------------------------------
** Copyright 2010-2017 Christoph Oelckers

View file

@ -46,7 +46,7 @@ class BridgeBall : Actor
{
if (target == NULL)
{ // Don't crash if somebody spawned this into the world
// independantly of a Bridge actor.
// independently of a Bridge actor.
return;
}
// Set default values

View file

@ -1,6 +1,6 @@
/*
** a_soundsequence.cpp
** Actors for independantly playing sound sequences in a map.
** Actors for independently playing sound sequences in a map.
**
**---------------------------------------------------------------------------
** Copyright 1998-2006 Randy Heit

View file

@ -205,7 +205,7 @@ class BaseStatusBar native ui
DI_ITEM_VMASK = 0x180000,
DI_ITEM_LEFT = 0x200000,
DI_ITEM_HCENTER = 0, // this is the deafault horizontal alignment
DI_ITEM_HCENTER = 0, // this is the default horizontal alignment
DI_ITEM_RIGHT = 0x400000,
DI_ITEM_HOFFSET = 0x600000,
DI_ITEM_HMASK = 0x600000,
@ -1140,7 +1140,7 @@ class LinearValueInterpolator : Object
mCurrentValue = value;
}
// This must be called peroiodically in the status bar's Tick function.
// This must be called periodically in the status bar's Tick function.
// Do not call this in the Draw function because that may skip some frames!
void Update(int destvalue)
{
@ -1184,7 +1184,7 @@ class DynamicValueInterpolator : Object
mCurrentValue = value;
}
// This must be called peroiodically in the status bar's Tick function.
// This must be called periodically in the status bar's Tick function.
// Do not call this in the Draw function because that may skip some frames!
void Update(int destvalue)
{

View file

@ -38,7 +38,7 @@ extend class Actor
}
// A Cloud used for varius explosions ---------------------------------------
// A Cloud used for various explosions --------------------------------------
// This actor has no direct equivalent in strife. To create this, Strife
// spawned a spark and then changed its state to that of this explosion
// cloud. Weird.

View file

@ -204,7 +204,7 @@ class PhosphorousGrenade : Actor
}
}
// Fire from the Phoshorous Grenade -----------------------------------------
// Fire from the Phosphorous Grenade ----------------------------------------
class PhosphorousFire : Actor
{