Merge remote-tracking branch 'gzdoom/master' into big_beautiful_merge

This commit is contained in:
Magnus Norddahl 2025-08-06 21:06:53 +02:00
commit 3fdd22ef91
1433 changed files with 484787 additions and 9566 deletions

View file

@ -560,9 +560,9 @@ static const char *LightTags[]=
"noshadowmap",
"dontlightothers",
"dontlightmap",
"intensity",
"trace",
"shadowminquality",
"intensity",
"softshadowradius",
"linearity",
nullptr
@ -591,9 +591,9 @@ enum {
LIGHTTAG_NOSHADOWMAP,
LIGHTTAG_DONTLIGHTOTHERS,
LIGHTTAG_DONTLIGHTMAP,
LIGHTTAG_INTENSITY,
LIGHTTAG_TRACE,
LIGHTTAG_SHADOW_MINQUALITY,
LIGHTTAG_INTENSITY,
LIGHTTAG_SOFTSHADOWRADIUS,
LIGHTTAG_LINEARITY,
};

View file

@ -266,12 +266,23 @@ void RenderHUDModel(FModelRenderer *renderer, DPSprite *psp, FVector3 translatio
// but we need to position it correctly in the world for light to work properly.
VSMatrix objectToWorldMatrix = renderer->GetViewToWorldMatrix();
// [Nash] Optional scale weapon FOV
float fovscale = 1.0f;
if (smf_flags & MDL_SCALEWEAPONFOV)
if (smf->viewModelFOV <= 0.0f)
{
fovscale = tan(players[consoleplayer].DesiredFOV * (0.5f * M_PI / 180.f));
fovscale = 1.f + (fovscale - 1.f) * cl_scaleweaponfov;
if (smf->viewModelFOV < 0.0f)
fovscale = 1.0f / fabs(smf->viewModelFOV);
// [Nash] Optional scale weapon FOV
if (smf_flags & MDL_SCALEWEAPONFOV)
{
float newScale = tan(players[consoleplayer].DesiredFOV * (0.5f * M_PI / 180.f));
newScale = 1.f + (newScale - 1.f) * cl_scaleweaponfov;
fovscale *= newScale;
}
}
else if (players[consoleplayer].DesiredFOV != smf->viewModelFOV)
{
fovscale = tan(players[consoleplayer].DesiredFOV * (0.5f * M_PI / 180.f)) / tan(smf->viewModelFOV * (0.5f * M_PI / 180.f));
}
// Scaling model (y scale for a sprite means height, i.e. z in the world!).
@ -563,7 +574,7 @@ bool CalcModelOverrides(int i, const FSpriteModelFrame *smf, DActorModelData* da
out.skinid = smf->skinIDs[i];
}
return (out.modelid >= 0 && out.modelid < Models.size());
return (out.modelid >= 0 && out.modelid < Models.SSize());
}
@ -951,6 +962,13 @@ void ParseModelDefLump(int Lump)
{
smf.flags |= MDL_MODELSAREATTACHMENTS;
}
else if (sc.Compare("viewmodelfov"))
{
sc.MustGetFloat();
smf.viewModelFOV = sc.Float;
if (smf.viewModelFOV > 0.0f)
smf.viewModelFOV = min<float>(smf.viewModelFOV, 175.0f);
}
else if (sc.Compare("rotating"))
{
smf.flags |= MDL_ROTATING;
@ -1279,4 +1297,4 @@ bool IsHUDModelForPlayerAvailable (player_t * player)
unsigned int FSpriteModelFrame::getFlags(class DActorModelData * defs) const
{
return (defs && defs->flags & MODELDATA_OVERRIDE_FLAGS)? (flags | defs->overrideFlagsSet) & ~(defs->overrideFlagsClear) : flags;
}
}

View file

@ -712,7 +712,6 @@ public:
dest.sector = &Level->sectors[group.groupedSections[0].section->sectorindex];
dest.mapsection = (short)group.groupedSections[0].section->mapsection;
dest.hacked = false;
dest.lighthead = nullptr;
dest.validcount = 0;
dest.segments.Set(&output.allLines[numsegments], group.segments.Size());
dest.sides.Set(&output.allSides[numsides], group.sideMap.CountUsed());

View file

@ -113,7 +113,6 @@ struct FSection
TArrayView<side_t *> sides; // contains all sidedefs, including the internal ones that do not make up the outer shape.
TArrayView<subsector_t *> subsectors; // contains all subsectors making up this section
sector_t *sector;
FLightNode *lighthead; // Light nodes (blended and additive)
BoundingRect bounds;
int vertexindex; // This is relative to the start of the entire sector's vertex plane data because it needs to be used with different sources.
int vertexcount;

View file

@ -228,7 +228,7 @@ FTranslationID CreateBloodTranslation(PalEntry color)
void R_InitTranslationTables ()
{
int i;
unsigned int i;
// Each player gets two translations. Doom and Strife don't use the
// extra ones, but Heretic and Hexen do. These are set up during