From 8a15b5e64039aaba7bdb4a7d2fe17db54ecaed24 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 20 Nov 2024 23:44:35 +0100 Subject: [PATCH 1/4] last attempt at fixing those things --- src/hardware/hw_defs.h | 1 - src/hardware/hw_main.c | 11 +---------- src/hardware/hw_shaders.c | 4 ---- src/hardware/hw_shaders.h | 4 ---- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index 85261c859..5d23099cb 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -171,7 +171,6 @@ enum { SHADER_NONE = -1, SHADER_FLOOR = 0, - SHADER_SHADOW, SHADER_WALL, SHADER_SPRITE, SHADER_MODEL, diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 8c10f1eec..d0f3d17b7 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3218,8 +3218,6 @@ static void HWR_DrawSpriteShadow(gl_vissprite_t *spr, GLPatch_t *gpatch) pslope_t *floorslope; fixed_t slopez; float offset = 0; - - INT32 shader = SHADER_NONE; // technically this_scale gets multiplied and added to sprite y/x scale, but this thing needs it for some crap so ill just throw it in here again const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->flags & SF_HIRES); @@ -3376,14 +3374,7 @@ static void HWR_DrawSpriteShadow(gl_vissprite_t *spr, GLPatch_t *gpatch) if (sSurf.PolyColor.s.alpha > floorheight/4) { sSurf.PolyColor.s.alpha = (UINT8)(sSurf.PolyColor.s.alpha - floorheight/4); - - if (HWR_UseShader()) - { - shader = SHADER_SHADOW; - blendmode |= PF_ColorMapped; - } - - HWR_ProcessPolygon(&sSurf, swallVerts, 4, blendmode|PF_Translucent|PF_Modulated, shader, false); + HWR_ProcessPolygon(&sSurf, swallVerts, 4, blendmode|PF_Translucent|PF_Modulated, SHADER_NONE, false); } } diff --git a/src/hardware/hw_shaders.c b/src/hardware/hw_shaders.c index 3046b902e..d73efaa37 100644 --- a/src/hardware/hw_shaders.c +++ b/src/hardware/hw_shaders.c @@ -29,9 +29,6 @@ static struct { // Floor shader {GLSL_DEFAULT_VERTEX_SHADER, GLSL_FLOOR_FRAGMENT_SHADER}, - // Shadow shader - {GLSL_DEFAULT_VERTEX_SHADER, GLSL_SHADOW_FRAGMENT_SHADER}, - // Wall shader {GLSL_DEFAULT_VERTEX_SHADER, GLSL_WALL_FRAGMENT_SHADER}, @@ -432,7 +429,6 @@ static inline UINT16 HWR_FindShaderDefs(UINT16 wadnum) customshaderxlat_t shaderxlat[] = { {"Flat", SHADER_FLOOR}, - {"Shadow", SHADER_SHADOW}, {"WallTexture", SHADER_WALL}, {"Sprite", SHADER_SPRITE}, {"Model", SHADER_MODEL}, diff --git a/src/hardware/hw_shaders.h b/src/hardware/hw_shaders.h index 77a93eb2e..b540d4ac3 100644 --- a/src/hardware/hw_shaders.h +++ b/src/hardware/hw_shaders.h @@ -211,10 +211,6 @@ GLSL_WALL_FUDGES \ GLSL_SOFTWARE_FRAGMENT_SHADER -#define GLSL_SHADOW_FRAGMENT_SHADER \ - GLSL_FLOOR_FUDGES \ - GLSL_SOFTWARE_FRAGMENT_SHADER_NOPAL - // // Water surface shader // From e2222f66a9848de1035a16d3f174b3143deb9925 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 21 Nov 2024 02:10:57 +0100 Subject: [PATCH 2/4] those should be SHORT i think? --- src/r_patch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/r_patch.c b/src/r_patch.c index c9ff704a7..37e7a2321 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -842,8 +842,8 @@ patch_t *Patch_GetRotatedSprite(spriteframe_t *sprite, size_t frame, size_t spri } else { - xpivot = patch->leftoffset; - ypivot = patch->height / 2; + xpivot = SHORT(patch->leftoffset); + ypivot = SHORT(patch->height) / 2; } RotatedPatch_DoRotation(rotsprite, patch, rotationangle, xpivot, ypivot, flip); @@ -902,9 +902,9 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle size_t size; INT32 bflip = (flip != 0x00); - INT32 width = patch->width; - INT32 height = patch->height; - INT32 leftoffset = patch->leftoffset; + INT32 width = SHORT(patch->width); + INT32 height = SHORT(patch->height); + INT32 leftoffset = SHORT(patch->leftoffset); INT32 newwidth, newheight; fixed_t ca = rollcosang[angle]; @@ -975,7 +975,7 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle } ox = (newwidth / 2) + (leftoffset - xpivot); - oy = (newheight / 2) + (patch->topoffset - ypivot); + oy = (newheight / 2) + (SHORT(patch->topoffset) - ypivot); width = (maxx - minx); height = (maxy - miny); From 1659c2e75332ca4e135ada40a3daad28c3c60e79 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 21 Nov 2024 02:11:40 +0100 Subject: [PATCH 3/4] try to make shadows not so offset on slopes with rotation enabled lmaos --- src/hardware/hw_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index d0f3d17b7..e96c9e36a 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4590,6 +4590,14 @@ static void HWR_ProjectSprite(mobj_t *thing) else rollsum = rollangle; + // this is kinda dumb lkmao, but try to mitigate shadows being weirdly offset on slopes + if (thing->type == MT_SHADOW) + { + sprinfo->available = true; // < lmao + sprinfo->pivot[(thing->frame & FF_FRAMEMASK)].x = spr_offset>>FRACBITS; + sprinfo->pivot[(thing->frame & FF_FRAMEMASK)].y = -8; // noones gonna replace shadow sprite anyways, right? that random value ftw, otherwise this clips into the ground Zzz... + } + rollangle = R_GetRollAngle(rollsum); rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle); From e1cb858d9ab8d8b3404aa3b78c0fe873b21465d4 Mon Sep 17 00:00:00 2001 From: Indev Date: Thu, 21 Nov 2024 22:02:25 +0300 Subject: [PATCH 4/4] Players that get 'NO CONTEST' can save replays too now --- src/p_user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index 4041c17d6..f8e4de294 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4213,6 +4213,8 @@ void P_DoTimeOver(player_t *player) player->pflags |= PF_TIMEOVER; + demo.savebutton = leveltime; + if (P_IsLocalPlayer(player) && !demo.playback) legitimateexit = true; // SRB2kart: losing a race is still seeing it through to the end :p