Merge branch 'master' of https://github.com/raa-eruanna/qzdoom into qzdoom

This commit is contained in:
Magnus Norddahl 2017-02-09 12:19:33 +01:00
commit ff4de4a744
6 changed files with 21 additions and 5 deletions

View file

@ -2817,6 +2817,13 @@ void PClass::StaticShutdown ()
// This flags DObject::Destroy not to call any scripted OnDestroy methods anymore. // This flags DObject::Destroy not to call any scripted OnDestroy methods anymore.
bVMOperational = false; bVMOperational = false;
// PendingWeapon must be cleared manually because it is not subjected to the GC if it contains WP_NOCHANGE, which is just RUNTIME_CLASS(AWWeapon).
// But that will get cleared here, confusing the GC if the value is left in.
for (auto &p : players)
{
p.PendingWeapon = nullptr;
}
// Unless something went wrong, anything left here should be class and type objects only, which do not own any scripts. // Unless something went wrong, anything left here should be class and type objects only, which do not own any scripts.
bShutdown = true; bShutdown = true;
TypeTable.Clear(); TypeTable.Clear();

View file

@ -787,6 +787,10 @@ void gl_InitModels()
map[c]=1; map[c]=1;
} }
} }
else if (sc.Compare("dontcullbackfaces"))
{
smf.flags |= MDL_DONTCULLBACKFACES;
}
else else
{ {
sc.ScriptMessage("Unrecognized string \"%s\"", sc.String); sc.ScriptMessage("Unrecognized string \"%s\"", sc.String);
@ -949,8 +953,9 @@ void gl_RenderModel(GLSprite * spr)
gl_RenderState.EnableTexture(true); gl_RenderState.EnableTexture(true);
// [BB] In case the model should be rendered translucent, do back face culling. // [BB] In case the model should be rendered translucent, do back face culling.
// This solves a few of the problems caused by the lack of depth sorting. // This solves a few of the problems caused by the lack of depth sorting.
// [Nash] Don't do back face culling if explicitly specified in MODELDEF
// TO-DO: Implement proper depth sorting. // TO-DO: Implement proper depth sorting.
if (!( spr->actor->RenderStyle == LegacyRenderStyles[STYLE_Normal] )) if (!(spr->actor->RenderStyle == LegacyRenderStyles[STYLE_Normal]) && !(smf->flags & MDL_DONTCULLBACKFACES))
{ {
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
glFrontFace(GL_CW); glFrontFace(GL_CW);
@ -1012,6 +1017,9 @@ void gl_RenderModel(GLSprite * spr)
// Model space => World space // Model space => World space
gl_RenderState.mModelMatrix.translate(spr->x, spr->z, spr->y ); gl_RenderState.mModelMatrix.translate(spr->x, spr->z, spr->y );
// [Nash] take SpriteRotation into account
angle += spr->actor->SpriteRotation.Degrees;
if (spr->actor->renderflags & RF_INTERPOLATEANGLES) if (spr->actor->renderflags & RF_INTERPOLATEANGLES)
{ {
// [Nash] use interpolated angles // [Nash] use interpolated angles

View file

@ -370,6 +370,7 @@ enum
MDL_USEACTORPITCH = 32, MDL_USEACTORPITCH = 32,
MDL_USEACTORROLL = 64, MDL_USEACTORROLL = 64,
MDL_BADROTATION = 128, MDL_BADROTATION = 128,
MDL_DONTCULLBACKFACES = 256,
}; };
struct FSpriteModelFrame struct FSpriteModelFrame

View file

@ -5012,7 +5012,7 @@ enum T_Flags
DEFINE_ACTION_FUNCTION(AActor, A_Teleport) DEFINE_ACTION_FUNCTION(AActor, A_Teleport)
{ {
PARAM_ACTION_PROLOGUE(AActor); PARAM_ACTION_PROLOGUE(AActor);
PARAM_STATE_DEF (teleport_state) PARAM_STATE_ACTION_DEF (teleport_state)
PARAM_CLASS_DEF (target_type, ASpecialSpot) PARAM_CLASS_DEF (target_type, ASpecialSpot)
PARAM_CLASS_DEF (fog_type, AActor) PARAM_CLASS_DEF (fog_type, AActor)
PARAM_INT_DEF (flags) PARAM_INT_DEF (flags)
@ -5449,7 +5449,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Warp)
PARAM_FLOAT_DEF(zofs) PARAM_FLOAT_DEF(zofs)
PARAM_ANGLE_DEF(angle) PARAM_ANGLE_DEF(angle)
PARAM_INT_DEF(flags) PARAM_INT_DEF(flags)
PARAM_STATE_DEF(success_state) PARAM_STATE_ACTION_DEF(success_state)
PARAM_FLOAT_DEF(heightoffset) PARAM_FLOAT_DEF(heightoffset)
PARAM_FLOAT_DEF(radiusoffset) PARAM_FLOAT_DEF(radiusoffset)
PARAM_ANGLE_DEF(pitch) PARAM_ANGLE_DEF(pitch)

View file

@ -771,7 +771,7 @@ bool AActor::GiveInventory(PClassActor *type, int amount, bool givecheat)
{ {
bool result = true; bool result = true;
if (type != nullptr || !type->IsDescendantOf(RUNTIME_CLASS(AInventory))) return false; if (type == nullptr || !type->IsDescendantOf(RUNTIME_CLASS(AInventory))) return false;
AWeapon *savedPendingWeap = player != NULL ? player->PendingWeapon : NULL; AWeapon *savedPendingWeap = player != NULL ? player->PendingWeapon : NULL;
bool hadweap = player != NULL ? player->ReadyWeapon != NULL : true; bool hadweap = player != NULL ? player->ReadyWeapon != NULL : true;

View file

@ -7863,7 +7863,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx)
return x->Resolve(ctx); return x->Resolve(ctx);
} }
if (Self->ValueType->IsKindOf(RUNTIME_CLASS(PPointer))) if (Self->ValueType->IsKindOf(RUNTIME_CLASS(PPointer)) && !Self->ValueType->IsKindOf(RUNTIME_CLASS(PClassPointer)))
{ {
auto ptype = static_cast<PPointer *>(Self->ValueType)->PointedType; auto ptype = static_cast<PPointer *>(Self->ValueType)->PointedType;
if (ptype->IsKindOf(RUNTIME_CLASS(PStruct))) if (ptype->IsKindOf(RUNTIME_CLASS(PStruct)))