From d2e4939b37e7b3115a02d168834f00bcee9c855a Mon Sep 17 00:00:00 2001 From: GenericHeroGuy <86008856+GenericHeroGuy@users.noreply.github.com> Date: Thu, 21 Mar 2024 21:56:18 +0100 Subject: [PATCH 1/7] Fix VHS timescale issues ...it was already uncapped in vanilla --- src/v_video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/v_video.c b/src/v_video.c index 09f7ac5ff..180424934 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -19,6 +19,7 @@ #include "hu_stuff.h" #include "r_draw.h" #include "r_main.h" +#include "r_fps.h" #include "console.h" #include "i_video.h" // rendermode @@ -1412,7 +1413,7 @@ void V_DrawVhsEffect(boolean rewind) if (rewind) V_DrawVhsEffect(false); // experimentation - fixed_t frac = cv_uncappedhud.value ? FixedMul(renderdeltatics, cv_timescale.value) : (renderisnewtic ? FRACUNIT : 0); + fixed_t frac = R_UsingFrameInterpolation() ? renderdeltatics : FRACUNIT; upbary -= frac * (vid.dupy * (rewind ? 3 : 1.8f)); downbary += frac * (vid.dupy * (rewind ? 2 : 1)); From e63ba0cb7b590cf578adfcfa33f27a80e454fc8a Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 22 Mar 2024 13:09:55 +0100 Subject: [PATCH 2/7] hacky hires scale "fix" for waiting screen --- src/f_finale.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/f_finale.c b/src/f_finale.c index cd72cc122..77172111e 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -64,6 +64,7 @@ static patch_t *ttkflash; // flash screen static patch_t *driver[2]; // Driving character on the waiting screen static UINT8 *waitcolormap; // colormap for the spinning character +static INT32 waitscale = 1<>1))<>1))<width / 2, 150<width / 2, 150< Date: Thu, 21 Mar 2024 12:52:40 +0100 Subject: [PATCH 3/7] this can be just M_PI --- src/hardware/hw_clip.c | 2 +- src/hardware/r_opengl/r_opengl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_clip.c b/src/hardware/hw_clip.c index 926f68fc6..623527549 100644 --- a/src/hardware/hw_clip.c +++ b/src/hardware/hw_clip.c @@ -333,7 +333,7 @@ angle_t gld_FrustumAngle(angle_t tiltangle) // ok, this is a gross hack that barely works... // but at least it doesn't overestimate too much... - clipfov = atan(1 / projMatrix[0]) * 360 / M_PIl; + clipfov = atan(1 / projMatrix[0]) * 360 / M_PI; floatangle = 2.0f + (45.0f + (tilt / 1.9f)) * clipfov / 90.0f; if (floatangle >= 180.0) return 0xffffffff; diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index b11a29cbf..9fcf90a62 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2780,7 +2780,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform) if (special_splitscreen) { - used_fov = atan(tan(used_fov*M_PIl/360)*0.8)*360/M_PIl; + used_fov = (float)(atan(tan(used_fov*M_PI/360)*0.8)*360/M_PI); GLPerspective((GLfloat)used_fov, 2*ASPECT_RATIO); } else From dd1428c77086d5f63ab6505f63c318778ac3ed04 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 22 Mar 2024 13:18:49 +0100 Subject: [PATCH 4/7] oops --- src/f_finale.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 77172111e..49bf89254 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1166,13 +1166,12 @@ void F_StartWaitingPlayers(void) { INT32 i; INT32 randskin; - boolean waithires = skins[randskin].flags && SF_HIRES; spriteframe_t *sprframe; - wipegamestate = GS_TITLESCREEN; // technically wiping from title screen finalecount = 0; randskin = M_RandomKey(numskins); + boolean waithires = skins[randskin].flags && SF_HIRES; if (waitcolormap) Z_Free(waitcolormap); From be8397901657a8906ea0b9785d7b17a1cea3b57c Mon Sep 17 00:00:00 2001 From: Indev Date: Fri, 22 Mar 2024 21:50:38 +0300 Subject: [PATCH 5/7] Fix own nametags being always shown in netgames --- src/k_kart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index ac7155180..9ba12edff 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9080,9 +9080,9 @@ static void K_drawNameTags(void) continue; if (!players[i].mo || P_MobjWasRemoved(players[i].mo) || players[i].spectator || !playeringame[i]) continue; - if (i == stplyrnum && !cv_showownnametag.value && !(leveltime < 130)) + if (i == displayplayers[stplyrnum] && !cv_showownnametag.value && !(leveltime < 130)) continue; - if (i != stplyrnum && leveltime < starttime) + if (i != displayplayers[stplyrnum] && leveltime < starttime) continue; if (players[i].kartstuff[k_hyudorotimer]) // player is invisible continue; From aa723f7a2bf3caf19907188fa1737f03defbde50 Mon Sep 17 00:00:00 2001 From: Indev Date: Sat, 23 Mar 2024 00:46:08 +0300 Subject: [PATCH 6/7] Fix NOHW compilation (1 error and 1 warning) --- src/r_patch.c | 7 ++++++- src/w_wad.c | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/r_patch.c b/src/r_patch.c index f69be9de3..597a1a0de 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -896,7 +896,12 @@ static patch_t *R_CreateHardwarePatch(patch_t *patch) void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip) { UINT32 i; - patch_t *rotated, *hwpatch; + patch_t *rotated; + +#ifdef HWRENDER + patch_t *hwpatch; +#endif + UINT16 *rawdst, *rawconv; size_t size; INT32 bflip = (flip != 0x00); diff --git a/src/w_wad.c b/src/w_wad.c index 4c0676024..86536c03f 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -820,9 +820,11 @@ UINT16 W_InitFile(const char *filename, boolean local) wadfiles[numwadfiles] = wadfile; numwadfiles++; // must come BEFORE W_LoadDehackedLumps, so any addfile called by COM_BufInsertText called by Lua doesn't overwrite what we just loaded - // Read shaders from file - if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED)) - HWR_LoadCustomShadersFromFile(numwadfiles - 1, (type == RET_PK3)); +#ifdef HWRENDER + // Read shaders from file + if (rendermode == render_opengl && (vid.glstate == VID_GL_LIBRARY_LOADED)) + HWR_LoadCustomShadersFromFile(numwadfiles - 1, (type == RET_PK3)); +#endif // TODO: HACK ALERT - Load Lua & SOC stuff right here. I feel like this should be out of this place, but... Let's stick with this for now. switch (wadfile->type) From 2348e3b73e4382f4afb285cabb1dd572ea000d6e Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 23 Mar 2024 18:06:53 +0100 Subject: [PATCH 7/7] changable scaling for high resolutions range from 0.8 - 1.2 only for higher resolutions since it literally breaks things visually on resolutions that already have a rather high scale --- src/screen.c | 18 ++++++++++++++++++ src/screen.h | 1 + 2 files changed, 19 insertions(+) diff --git a/src/screen.c b/src/screen.c index 949adc525..738c70c35 100644 --- a/src/screen.c +++ b/src/screen.c @@ -68,6 +68,15 @@ consvar_t cv_renderview = {"renderview", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, consvar_t cv_vhseffect = {"vhspause", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_shittyscreen = {"televisionsignal", "Okay", CV_NOSHOWHELP, shittyscreen_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +static void Highreshudscale_OnChange(void); +static CV_PossibleValue_t highreshudscale_cons_t[] = {{4*FRACUNIT/5, "MIN"}, {6*FRACUNIT/5, "MAX"}, {0, NULL}}; +consvar_t cv_highreshudscale = {"highreshudscale", "1", CV_SAVE|CV_FLOAT|CV_CALL|CV_NOINIT|CV_NOSHOWHELP, highreshudscale_cons_t, Highreshudscale_OnChange, 0, NULL, NULL, 0, 0, NULL}; + +static void Highreshudscale_OnChange(void) +{ + SCR_Recalc(); +} + static void SCR_ChangeFullscreen (void); consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL}; @@ -178,6 +187,7 @@ void SCR_Startup(void) vid.baseratio = FRACUNIT; V_Init(); + CV_RegisterVar(&cv_highreshudscale); CV_RegisterVar(&cv_ticrate); CV_RegisterVar(&cv_accuratefps); CV_RegisterVar(&cv_menucaps); @@ -228,6 +238,14 @@ void SCR_Recalc(void) vid.fdupx = FixedDiv(vid.width*FRACUNIT, BASEVIDWIDTH*FRACUNIT); vid.fdupy = FixedDiv(vid.height*FRACUNIT, BASEVIDHEIGHT*FRACUNIT); + if ((vid.width > 720) && (vid.height > 1280)) // ehhhh well this thing has so many issues, so ill lock it to higher resolutions instead + { + vid.dupx = FixedDiv(vid.dupx, cv_highreshudscale.value); + vid.dupy = FixedDiv(vid.dupy, cv_highreshudscale.value); + vid.fdupx = FixedDiv(vid.fdupx, cv_highreshudscale.value); + vid.fdupy = FixedDiv(vid.fdupy, cv_highreshudscale.value); + } + #ifdef HWRENDER //if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl // 13/11/18: diff --git a/src/screen.h b/src/screen.h index 1af085b1a..a6a0eb477 100644 --- a/src/screen.h +++ b/src/screen.h @@ -145,6 +145,7 @@ extern INT32 scr_bpp; extern UINT8 *scr_borderpatch; // patch used to fill the view borders extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_fullscreen, cv_vhseffect, cv_shittyscreen; +extern consvar_t cv_highreshudscale; // wait for page flipping to end or not extern consvar_t cv_vidwait; extern consvar_t cv_timescale;