Merge remote-tracking branch 'remotes/ZDoom/gzdoom/staging' into gzd_staging

This commit is contained in:
nashmuhandes 2023-08-22 09:09:51 +08:00
commit 9e0bf90be6
177 changed files with 4290 additions and 12626 deletions

View file

@ -86,7 +86,8 @@ void HWDrawInfo::StartScene(FRenderViewpoint &parentvp, HWViewpointUniforms *uni
mClipper = &drawctx->staticClipper;
Viewpoint = parentvp;
lightmode = Level->lightMode;
lightmode = getRealLightmode(Level, true);
if (uniforms)
{
VPUniforms = *uniforms;
@ -100,7 +101,7 @@ void HWDrawInfo::StartScene(FRenderViewpoint &parentvp, HWViewpointUniforms *uni
VPUniforms.mViewMatrix.loadIdentity();
VPUniforms.mNormalViewMatrix.loadIdentity();
VPUniforms.mViewHeight = viewheight;
if (gl_lightmode == 5)
if (lightmode == ELightMode::Build)
{
VPUniforms.mGlobVis = 1 / 64.f;
VPUniforms.mPalLightLevels = 32 | (static_cast<int>(gl_fogmode) << 8) | ((int)lightmode << 16);

View file

@ -477,7 +477,7 @@ bool HWSprite::CalculateVertices(HWDrawInfo *di, FVector3 *v, DVector3 *vp)
// which is nicer in VR
float xrel = xcenter - vp->X;
float yrel = ycenter - vp->Y;
float absAngleDeg = RAD2DEG(atan2(-yrel, xrel));
float absAngleDeg = atan2(-yrel, xrel) * (180 / M_PI);
float counterRotationDeg = 270. - HWAngles.Yaw.Degrees(); // counteracts existing sprite rotation
float relAngleDeg = counterRotationDeg + absAngleDeg;