From c8b3d95d6f3cc699956d90e0b16cf01a57419504 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Jan 2023 17:04:00 +0100 Subject: [PATCH] - backend update from Raze. --- src/common/filesystem/file_zip.cpp | 2 ++ src/common/objects/dobjtype.cpp | 1 + src/common/statusbar/base_sbar.cpp | 9 ++++++--- src/common/utility/basics.h | 5 +++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/common/filesystem/file_zip.cpp b/src/common/filesystem/file_zip.cpp index bd0d76624..e14305b52 100644 --- a/src/common/filesystem/file_zip.cpp +++ b/src/common/filesystem/file_zip.cpp @@ -266,6 +266,8 @@ bool FZipFile::Open(bool quiet, LumpFilterInfo* filter) continue; // 'filter' is a reserved name of the file system. if (name.IndexOf("__macosx") == 0) continue; // skip Apple garbage. At this stage only the root folder matters. + if (name.IndexOf(".bat") >= 0 || name.IndexOf(".exe") >= 0) + continue; // also ignore executables for this. if (!foundprefix) { // check for special names, if one of these gets found this must be treated as a normal zip. diff --git a/src/common/objects/dobjtype.cpp b/src/common/objects/dobjtype.cpp index fde9ea0e3..0ac7bc8ad 100644 --- a/src/common/objects/dobjtype.cpp +++ b/src/common/objects/dobjtype.cpp @@ -252,6 +252,7 @@ void PClass::StaticShutdown () // Make a full garbage collection here so that all destroyed but uncollected higher level objects // that still exist are properly taken down before the low level data is deleted. GC::FullGC(); + GC::FullGC(); Namespaces.ReleaseSymbols(); diff --git a/src/common/statusbar/base_sbar.cpp b/src/common/statusbar/base_sbar.cpp index e7cab98d2..b1fb2d79a 100644 --- a/src/common/statusbar/base_sbar.cpp +++ b/src/common/statusbar/base_sbar.cpp @@ -47,6 +47,7 @@ #include "v_text.h" #include "vm.h" #include "i_interface.h" +#include "r_videoscale.h" FGameTexture* CrosshairImage; static int CrosshairNum; @@ -367,9 +368,11 @@ void DStatusBarCore::SetScale() double screenaspect = w / double(h); double aspectscale = 1.0; + double ViewportAspect = ViewportPixelAspect(); + if ((horz == 320 && vert == 200) || (horz == 640 && vert == 400)) { - refaspect = 1.333; + refaspect = (4. / 3.); if (!hud_aspectscale) aspectscale = 1 / 1.2; } @@ -384,9 +387,9 @@ void DStatusBarCore::SetScale() refw = h * refaspect; } refw *= hud_scalefactor; - refh *= hud_scalefactor * aspectscale; + refh *= hud_scalefactor * aspectscale / ViewportAspect; - int sby = vert - int(RelTop * hud_scalefactor * aspectscale); + int sby = vert - int(RelTop * hud_scalefactor * aspectscale / ViewportAspect); // Use full pixels for destination size. ST_X = xs_CRoundToInt((w - refw) / 2); diff --git a/src/common/utility/basics.h b/src/common/utility/basics.h index 4ebc2cc88..6655ede2c 100644 --- a/src/common/utility/basics.h +++ b/src/common/utility/basics.h @@ -3,6 +3,7 @@ #include #include #include +#include "xs_Float.h" #define MAXWIDTH 12000 #define MAXHEIGHT 5000 @@ -103,12 +104,12 @@ inline double RAD2DEG(double rad) inline angle_t RAD2BAM(float rad) { - return angle_t(rad * float(0x80000000u / M_PI)); + return angle_t(xs_RoundToUInt(rad * float(0x80000000u / M_PI))); } inline angle_t RAD2BAM(double rad) { - return angle_t(rad * (0x80000000u / M_PI)); + return angle_t(xs_RoundToUInt(rad * (0x80000000u / M_PI))); }