From 266aa14daf36efacb3c9058a83d61b2e19187a3a Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 16 Sep 2024 20:13:13 +0200 Subject: [PATCH 1/6] Clamp rover->alpha levels --- src/hardware/hw_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index ed62ac236..aa40e2a23 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1762,7 +1762,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (rover->alpha < 256 || rover->blend) { blendmode = HWR_GetBlendModeFlag(rover->blend); - Surf.PolyColor.s.alpha = (UINT8)(rover->alpha-1); + Surf.PolyColor.s.alpha = max(0, min(rover->alpha-1, 255)); } } @@ -1891,7 +1891,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (rover->alpha < 256 || rover->blend) { blendmode = HWR_GetBlendModeFlag(rover->blend); - Surf.PolyColor.s.alpha = (UINT8)(rover->alpha-1); + Surf.PolyColor.s.alpha = max(0, min(rover->alpha-1, 255)); } } @@ -2636,7 +2636,7 @@ static void HWR_Subsector(size_t num) false, *rover->bottomheight, *gl_frontsector->lightlist[light].lightlevel, - rover->alpha-1, rover->master->frontsector, blendmode, + max(0, min(rover->alpha-1, 255)), rover->master->frontsector, blendmode, false, *gl_frontsector->lightlist[light].extra_colormap); } else @@ -2684,7 +2684,7 @@ static void HWR_Subsector(size_t num) true, *rover->topheight, *gl_frontsector->lightlist[light].lightlevel, - rover->alpha-1, rover->master->frontsector, blendmode, + max(0, min(rover->alpha-1, 255)), rover->master->frontsector, blendmode, false, *gl_frontsector->lightlist[light].extra_colormap); } else From fed0d3626b447f6f5bbaab4ab3a276e7063f9cbc Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 5 Nov 2024 20:47:24 +0100 Subject: [PATCH 2/6] remove subtract by one --- src/hardware/hw_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index aa40e2a23..cae9b14d2 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1762,7 +1762,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (rover->alpha < 256 || rover->blend) { blendmode = HWR_GetBlendModeFlag(rover->blend); - Surf.PolyColor.s.alpha = max(0, min(rover->alpha-1, 255)); + Surf.PolyColor.s.alpha = max(0, min(rover->alpha, 255)); } } @@ -1891,7 +1891,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (rover->alpha < 256 || rover->blend) { blendmode = HWR_GetBlendModeFlag(rover->blend); - Surf.PolyColor.s.alpha = max(0, min(rover->alpha-1, 255)); + Surf.PolyColor.s.alpha = max(0, min(rover->alpha, 255)); } } @@ -2636,7 +2636,7 @@ static void HWR_Subsector(size_t num) false, *rover->bottomheight, *gl_frontsector->lightlist[light].lightlevel, - max(0, min(rover->alpha-1, 255)), rover->master->frontsector, blendmode, + max(0, min(rover->alpha, 255)), rover->master->frontsector, blendmode, false, *gl_frontsector->lightlist[light].extra_colormap); } else @@ -2684,7 +2684,7 @@ static void HWR_Subsector(size_t num) true, *rover->topheight, *gl_frontsector->lightlist[light].lightlevel, - max(0, min(rover->alpha-1, 255)), rover->master->frontsector, blendmode, + max(0, min(rover->alpha, 255)), rover->master->frontsector, blendmode, false, *gl_frontsector->lightlist[light].extra_colormap); } else From 20d4c8510baea88dc8beb48eee79c965daad23c6 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 5 Nov 2024 21:03:33 +0100 Subject: [PATCH 3/6] Make FOF fades use 0-255 alpha, not 1-256 --- src/p_spec.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index f7f46b4e0..3a7cd7eed 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3853,19 +3853,18 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha foundrover = true; // If fading an invisible FOF whose render flags we did not yet set, - // initialize its alpha to 1 - // for relative alpha calc + // initialize its alpha to 0 for relative alpha calculation if (!(args[3] & TMST_DONTDOTRANSLUCENT) && // do translucent (rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE !(rover->spawnflags & FOF_RENDERSIDES) && !(rover->spawnflags & FOF_RENDERPLANES) && !(rover->fofflags & FOF_RENDERALL)) - rover->alpha = 1; + rover->alpha = 0; P_RemoveFakeFloorFader(rover); P_FadeFakeFloor(rover, rover->alpha, - max(1, min(256, (args[3] & TMST_RELATIVE) ? rover->alpha + destvalue : destvalue)), + max(0, min(255, (args[3] & TMST_RELATIVE) ? rover->alpha + destvalue : destvalue)), 0, // set alpha immediately false, NULL, // tic-based logic false, // do not handle FOF_EXISTS @@ -3939,19 +3938,18 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha else { // If fading an invisible FOF whose render flags we did not yet set, - // initialize its alpha to 1 - // for relative alpha calc + // initialize its alpha to 0 for relative alpha calculation if (!(args[4] & TMFT_DONTDOTRANSLUCENT) && // do translucent (rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE !(rover->spawnflags & FOF_RENDERSIDES) && !(rover->spawnflags & FOF_RENDERPLANES) && !(rover->fofflags & FOF_RENDERALL)) - rover->alpha = 1; + rover->alpha = 0; P_RemoveFakeFloorFader(rover); P_FadeFakeFloor(rover, rover->alpha, - max(1, min(256, (args[4] & TMFT_RELATIVE) ? rover->alpha + destvalue : destvalue)), + max(0, min(255, (args[4] & TMFT_RELATIVE) ? rover->alpha + destvalue : destvalue)), 0, // set alpha immediately false, NULL, // tic-based logic !(args[4] & TMFT_DONTDOEXISTS), // do not handle FOF_EXISTS @@ -8505,15 +8503,14 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval if (rover->master->special == 258) // Laser block return false; - // If fading an invisible FOF whose render flags we did not yet set, - // initialize its alpha to 1 + // If fading an invisible FOF whose render flags we did not yet set, initialize its alpha to 0 if (dotranslucent && (rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE !(rover->fofflags & FOF_FOG) && // do not include fog !(rover->spawnflags & FOF_RENDERSIDES) && !(rover->spawnflags & FOF_RENDERPLANES) && !(rover->fofflags & FOF_RENDERALL)) - rover->alpha = 1; + rover->alpha = 0; if (fadingdata) alpha = fadingdata->alpha; @@ -8599,7 +8596,7 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval { if (doexists && !(rover->spawnflags & FOF_BUSTUP)) { - if (alpha <= 1) + if (alpha <= 0) rover->fofflags &= ~FOF_EXISTS; else rover->fofflags |= FOF_EXISTS; @@ -8611,7 +8608,7 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval if (dotranslucent && !(rover->fofflags & FOF_FOG)) { - if (alpha >= 256) + if (alpha >= 255) { if (!(rover->fofflags & FOF_CUTSOLIDS) && (rover->spawnflags & FOF_CUTSOLIDS)) @@ -8711,11 +8708,11 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval else // clamp fadingdata->alpha to software's alpha levels { if (alpha < 12) - rover->alpha = destvalue < 12 ? destvalue : 1; // Don't even draw it + rover->alpha = destvalue < 12 ? destvalue : 0; // Don't even draw it else if (alpha < 38) rover->alpha = destvalue >= 12 && destvalue < 38 ? destvalue : 25; else if (alpha < 64) - rover->alpha = destvalue >=38 && destvalue < 64 ? destvalue : 51; + rover->alpha = destvalue >= 38 && destvalue < 64 ? destvalue : 51; else if (alpha < 89) rover->alpha = destvalue >= 64 && destvalue < 89 ? destvalue : 76; else if (alpha < 115) @@ -8731,7 +8728,7 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval else if (alpha < 243) rover->alpha = destvalue >= 217 && destvalue < 243 ? destvalue : 230; else // Opaque - rover->alpha = destvalue >= 243 ? destvalue : 256; + rover->alpha = destvalue >= 243 ? destvalue : 255; } } @@ -8761,17 +8758,16 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor { fade_t *d; - // If fading an invisible FOF whose render flags we did not yet set, - // initialize its alpha to 1 + // If fading an invisible FOF whose render flags we did not yet set, initialize its alpha to 0 if (dotranslucent && (rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE !(rover->spawnflags & FOF_RENDERSIDES) && !(rover->spawnflags & FOF_RENDERPLANES) && !(rover->fofflags & FOF_RENDERALL)) - rover->alpha = 1; + rover->alpha = 0; // already equal, nothing to do - if (rover->alpha == max(1, min(256, relative ? rover->alpha + destvalue : destvalue))) + if (rover->alpha == max(0, min(255, relative ? rover->alpha + destvalue : destvalue))) return; d = Z_Malloc(sizeof *d, PU_LEVSPEC, NULL); @@ -8782,7 +8778,7 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor d->ffloornum = (UINT32)ffloornum; d->alpha = d->sourcevalue = rover->alpha; - d->destvalue = max(1, min(256, relative ? rover->alpha + destvalue : destvalue)); // rover->alpha is 1-256 + d->destvalue = max(0, min(255, relative ? rover->alpha + destvalue : destvalue)); // rover->alpha is 0-255 if (ticbased) { From 2a74dbee0d5f6f27ff7ed184ef9d5390d327a04b Mon Sep 17 00:00:00 2001 From: Logan Aerl Arias Date: Thu, 13 Feb 2025 22:35:15 +0000 Subject: [PATCH 4/6] fix Debian testing GCC job --- .gitlab/ci/jobs/debian-testing-gcc-amd64.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab/ci/jobs/debian-testing-gcc-amd64.yml b/.gitlab/ci/jobs/debian-testing-gcc-amd64.yml index 8332ac862..7afdaa871 100644 --- a/.gitlab/ci/jobs/debian-testing-gcc-amd64.yml +++ b/.gitlab/ci/jobs/debian-testing-gcc-amd64.yml @@ -17,9 +17,12 @@ Debian testing GCC: name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-testing-gcc" variables: - CC: gcc - CXX: g++ - LDFLAGS: -Wl,-fuse-ld=gold + CC: /usr/bin/x86_64-linux-gnu-gcc + CXX: /usr/bin/x86_64-linux-gnu-g++ + OBJCOPY: /usr/bin/x86_64-linux-gnu-objcopy + OBJDUMP: /usr/bin/x86_64-linux-gnu-objdump + PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig + LD: /usr/bin/x86_64-linux-gnu-ld script: - - | From b8ec197b2aae23a3236f5aa867b1335e1da3d656 Mon Sep 17 00:00:00 2001 From: "Spring E. Thing" Date: Thu, 13 Feb 2025 19:04:58 +0000 Subject: [PATCH 5/6] player->whip is now readable & writable through Lua --- src/lua_playerlib.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index ee0dc0ebe..ee56da06f 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -684,6 +684,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->griefWarned); else if (fastcmp(field,"splitscreenindex")) lua_pushinteger(L, plr->splitscreenindex); + else if (fastcmp(field,"whip")) + LUA_PushUserdata(L, plr->whip, META_MOBJ); #ifdef HWRENDER else if (fastcmp(field,"fovadd")) lua_pushfixed(L, plr->fovadd); @@ -1241,6 +1243,13 @@ static int player_set(lua_State *L) plr->griefWarned = luaL_checkinteger(L, 3); else if (fastcmp(field,"splitscreenindex")) return NOSET; + else if (fastcmp(field,"whip")) + { + mobj_t *mo = NULL; + if (!lua_isnil(L, 3)) + mo = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ)); + P_SetTarget(&plr->whip, mo); + } #ifdef HWRENDER else if (fastcmp(field,"fovadd")) plr->fovadd = luaL_checkfixed(L, 3); From 23100cc8d88499e509e59585a9c9ac65d1a06ad5 Mon Sep 17 00:00:00 2001 From: Logan Aerl Arias Date: Thu, 13 Feb 2025 23:53:44 +0000 Subject: [PATCH 6/6] Windows job take too long --- .gitlab/ci/jobs/windows-x64.yml | 2 ++ .gitlab/ci/jobs/windows-x86.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitlab/ci/jobs/windows-x64.yml b/.gitlab/ci/jobs/windows-x64.yml index a200606da..8286178d3 100644 --- a/.gitlab/ci/jobs/windows-x64.yml +++ b/.gitlab/ci/jobs/windows-x64.yml @@ -5,6 +5,8 @@ Windows x64: when: manual + timeout: 2h + allow_failure: true artifacts: diff --git a/.gitlab/ci/jobs/windows-x86.yml b/.gitlab/ci/jobs/windows-x86.yml index 5ecfac6eb..882772802 100644 --- a/.gitlab/ci/jobs/windows-x86.yml +++ b/.gitlab/ci/jobs/windows-x86.yml @@ -5,6 +5,8 @@ Windows x86: when: on_success + timeout: 2h + cache: - key: ccache-$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG fallback_keys: