From a7dc20e7d2d53dad20f41884f382bfedf8f1d44e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 29 Aug 2016 22:42:06 +0100 Subject: [PATCH 01/11] Upper Unpegged on an FOF's control linedef now enables skewing of walls with respect to slopes Skewing direction is decided per in-level wall by the Lower Unpegged flag on in-level linedefs themselves, since they already decide the stuff for FOF wall pegging as it is. That is unless Transfer Line is involved which moves everything to the control sector linedefs instead... --- src/r_segs.c | 73 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 502ff3304..fff98dbf2 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -743,6 +743,12 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) // Render FOF sides kinda like normal sides, with the frac and step and everything // NOTE: INT64 instead of fixed_t because overflow concerns INT64 top_frac, top_step, bottom_frac, bottom_step; + // skew FOF walls with slopes? + boolean slopeskew = false; + fixed_t ffloortextureslide = 0; + INT32 oldx = -1; + fixed_t left_top, left_bottom; // needed here for slope skewing + pslope_t *skewslope = NULL; #endif void (*colfunc_2s) (column_t *); @@ -966,21 +972,68 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) mceilingclip = ds->sprtopclip; dc_texheight = textureheight[texnum]>>FRACBITS; +#ifdef ESLOPE + // calculate both left ends + if (*pfloor->t_slope) + left_top = P_GetZAt(*pfloor->t_slope, ds->leftpos.x, ds->leftpos.y) - viewz; + else + left_top = *pfloor->topheight - viewz; + + if (*pfloor->b_slope) + left_bottom = P_GetZAt(*pfloor->b_slope, ds->leftpos.x, ds->leftpos.y) - viewz; + else + left_bottom = *pfloor->bottomheight - viewz; + dc_texturemid = left_top; + skewslope = *pfloor->t_slope; // skew using top slope by default +#else dc_texturemid = *pfloor->topheight - viewz; +#endif if (newline) { offsetvalue = sides[newline->sidenum[0]].rowoffset; if (newline->flags & ML_DONTPEGBOTTOM) +#ifdef ESLOPE + { + dc_texturemid = left_bottom; + skewslope = *pfloor->b_slope; // skew using bottom slope + } +#else offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; +#endif +#ifdef ESLOPE + if (newline->flags & ML_DONTPEGTOP) + slopeskew = true; +#endif } else { offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset; if (curline->linedef->flags & ML_DONTPEGBOTTOM) +#ifdef ESLOPE + { + dc_texturemid = left_bottom; + skewslope = *pfloor->b_slope; // skew using bottom slope + } +#else offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; +#endif +#ifdef ESLOPE + if (pfloor->master->flags & ML_DONTPEGTOP) // use control linedef's flags + slopeskew = true; +#endif } +#ifdef ESLOPE + if (slopeskew) + { + angle_t lineangle = R_PointToAngle2(curline->v1->x, curline->v1->y, curline->v2->x, curline->v2->y); + + if (skewslope) + ffloortextureslide = FixedMul(skewslope->zdelta, FINECOSINE((lineangle-skewslope->xydirection)>>ANGLETOFINESHIFT)); + } +#endif + dc_texturemid += offsetvalue; // Texture must be cached before setting colfunc_2s, @@ -999,23 +1052,18 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) #ifdef ESLOPE // Set heights according to plane, or slope, whichever { - fixed_t left_top, right_top, left_bottom, right_bottom; + fixed_t right_top, right_bottom; + // calculate right ends now if (*pfloor->t_slope) - { - left_top = P_GetZAt(*pfloor->t_slope, ds->leftpos.x, ds->leftpos.y) - viewz; right_top = P_GetZAt(*pfloor->t_slope, ds->rightpos.x, ds->rightpos.y) - viewz; - } else - left_top = right_top = *pfloor->topheight - viewz; + right_top = *pfloor->topheight - viewz; if (*pfloor->b_slope) - { - left_bottom = P_GetZAt(*pfloor->b_slope, ds->leftpos.x, ds->leftpos.y) - viewz; right_bottom = P_GetZAt(*pfloor->b_slope, ds->rightpos.x, ds->rightpos.y) - viewz; - } else - left_bottom = right_bottom = *pfloor->bottomheight - viewz; + right_bottom = *pfloor->bottomheight - viewz; // using INT64 to avoid 32bit overflow top_frac = (INT64)centeryfrac - (((INT64)left_top * ds->scale1) >> FRACBITS); @@ -1039,6 +1087,13 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) { if (maskedtexturecol[dc_x] != INT16_MAX) { +#ifdef ESLOPE + if (ffloortextureslide) { // skew FOF walls + if (oldx != -1) + dc_texturemid += FixedMul(ffloortextureslide, (maskedtexturecol[oldx]-maskedtexturecol[dc_x])< Date: Mon, 29 Aug 2016 23:21:57 +0100 Subject: [PATCH 02/11] If NOT skewing FOF walls, make sure dc_texturemid reverts to using unsloped FOF topheight/bottomheight rather than actual left side top/bottom heights --- src/r_segs.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index fff98dbf2..0d3a6430e 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -983,45 +983,45 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) left_bottom = P_GetZAt(*pfloor->b_slope, ds->leftpos.x, ds->leftpos.y) - viewz; else left_bottom = *pfloor->bottomheight - viewz; - dc_texturemid = left_top; skewslope = *pfloor->t_slope; // skew using top slope by default -#else - dc_texturemid = *pfloor->topheight - viewz; + if (newline && newline->flags & ML_DONTPEGTOP) + slopeskew = true; + else if (pfloor->master->flags & ML_DONTPEGTOP) + slopeskew = true; + + if (slopeskew) + dc_texturemid = left_top; + else #endif + dc_texturemid = *pfloor->topheight - viewz; if (newline) { offsetvalue = sides[newline->sidenum[0]].rowoffset; if (newline->flags & ML_DONTPEGBOTTOM) -#ifdef ESLOPE { - dc_texturemid = left_bottom; - skewslope = *pfloor->b_slope; // skew using bottom slope - } -#else - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; -#endif #ifdef ESLOPE - if (newline->flags & ML_DONTPEGTOP) - slopeskew = true; + skewslope = *pfloor->b_slope; // skew using bottom slope + if (slopeskew) + dc_texturemid = left_bottom; + else #endif + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + } } else { offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset; if (curline->linedef->flags & ML_DONTPEGBOTTOM) -#ifdef ESLOPE { - dc_texturemid = left_bottom; - skewslope = *pfloor->b_slope; // skew using bottom slope - } -#else - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; -#endif #ifdef ESLOPE - if (pfloor->master->flags & ML_DONTPEGTOP) // use control linedef's flags - slopeskew = true; + skewslope = *pfloor->b_slope; // skew using bottom slope + if (slopeskew) + dc_texturemid = left_bottom; + else #endif + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + } } #ifdef ESLOPE From 40cb22a130be5dc06b22a280b44588430f5a8610 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 29 Aug 2016 23:24:59 +0100 Subject: [PATCH 03/11] probably best if we did this instead actually --- src/r_segs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 0d3a6430e..b997c2a88 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -984,8 +984,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else left_bottom = *pfloor->bottomheight - viewz; skewslope = *pfloor->t_slope; // skew using top slope by default - if (newline && newline->flags & ML_DONTPEGTOP) - slopeskew = true; + if (newline) + { + if (newline->flags & ML_DONTPEGTOP) + slopeskew = true; + } else if (pfloor->master->flags & ML_DONTPEGTOP) slopeskew = true; From 872e2f82c154359ac5f8e33e5c9ffeeef5a84017 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 28 Sep 2018 17:02:02 +0100 Subject: [PATCH 04/11] Redo OpenGL skewing support, so that it now itself supports the lower unpegged effect for FOFs in OpenGL! --- src/hardware/hw_main.c | 46 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index d7c73415a..92925c9bf 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2183,6 +2183,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) else if (drawtextured) { fixed_t texturevpeg; + boolean attachtobottom = false; +#ifdef ESLOPE + boolean slopeskew = false; // skew FOF walls with slopes? +#endif // Wow, how was this missing from OpenGL for so long? // ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software @@ -2190,24 +2194,50 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) if (newline) { texturevpeg = sides[newline->sidenum[0]].rowoffset; - if (newline->flags & ML_DONTPEGBOTTOM) - texturevpeg -= *rover->topheight - *rover->bottomheight; + attachtobottom = !!(newline->flags & ML_DONTPEGBOTTOM); +#ifdef ESLOPE + slopeskew = !!(newline->flags & ML_DONTPEGTOP); +#endif } else { texturevpeg = sides[rover->master->sidenum[0]].rowoffset; - if (gr_linedef->flags & ML_DONTPEGBOTTOM) - texturevpeg -= *rover->topheight - *rover->bottomheight; + attachtobottom = !!(gr_linedef->flags & ML_DONTPEGBOTTOM); +#ifdef ESLOPE + slopeskew = !!(rover->master->flags & ML_DONTPEGTOP); +#endif } grTex = HWR_GetTexture(texnum); #ifdef ESLOPE - wallVerts[3].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY; - wallVerts[2].t = (*rover->topheight - hS + texturevpeg) * grTex->scaleY; - wallVerts[0].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY; - wallVerts[1].t = (*rover->topheight - lS + texturevpeg) * grTex->scaleY; + if (!slopeskew) // no skewing + { + if (attachtobottom) + texturevpeg -= *rover->topheight - *rover->bottomheight; + wallVerts[3].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY; + wallVerts[2].t = (*rover->topheight - hS + texturevpeg) * grTex->scaleY; + wallVerts[0].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY; + wallVerts[1].t = (*rover->topheight - lS + texturevpeg) * grTex->scaleY; + } + else + { + if (!attachtobottom) // skew by top + { + wallVerts[3].t = wallVerts[2].t = texturevpeg * grTex->scaleY; + wallVerts[0].t = (h - l + texturevpeg) * grTex->scaleY; + wallVerts[1].t = (hS - lS + texturevpeg) * grTex->scaleY; + } + else // skew by bottom + { + wallVerts[0].t = wallVerts[1].t = texturevpeg * grTex->scaleY; + wallVerts[3].t = wallVerts[0].t - (h - l) * grTex->scaleY; + wallVerts[2].t = wallVerts[1].t - (hS - lS) * grTex->scaleY; + } + } #else + if (attachtobottom) + texturevpeg -= *rover->topheight - *rover->bottomheight; wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY; wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY; #endif From 930835f1a2bd189f9bd73c5eba3459282720f0e5 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 25 Nov 2018 21:47:56 -0500 Subject: [PATCH 05/11] Dummy out OpenGL loading screen; fix console toggle so it doesn't actually show --- src/d_netcmd.c | 5 ++++- src/hardware/hw_bsp.c | 2 ++ src/hardware/hw_glob.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e5ef3e1ce..16788baeb 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1796,6 +1796,10 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) mapname, resetplayer, lastgametype, gametype, chmappending)); CONS_Printf(M_GetText("Speeding off to level...\n")); } + + CON_ToggleOff(); + CON_ClearHUD(); + if (demoplayback && !timingdemo) precache = false; @@ -1812,7 +1816,6 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) G_InitNew(ultimatemode, mapname, resetplayer, skipprecutscene); if (demoplayback && !timingdemo) precache = true; - CON_ToggleOff(); if (timingdemo) G_DoneLevelLoad(); diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c index fa5bce308..a180697d5 100644 --- a/src/hardware/hw_bsp.c +++ b/src/hardware/hw_bsp.c @@ -633,6 +633,7 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b HWR_SubsecPoly(bspnum&(~NF_SUBSECTOR), poly); //Hurdler: implement a loading status +#ifdef HWR_LOADING_SCREEN if (ls_count-- <= 0) { char s[16]; @@ -657,6 +658,7 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b I_UpdateNoVsync(); } +#endif } M_ClearBox(bbox); poly = extrasubsectors[bspnum&~NF_SUBSECTOR].planepoly; diff --git a/src/hardware/hw_glob.h b/src/hardware/hw_glob.h index fea06caff..bdf219464 100644 --- a/src/hardware/hw_glob.h +++ b/src/hardware/hw_glob.h @@ -27,6 +27,9 @@ // the original aspect ratio of Doom graphics isn't square #define ORIGINAL_ASPECT (320.0f/200.0f) +// Uncomment this to enable the OpenGL loading screen +//#define HWR_LOADING_SCREEN + // ----------- // structures // ----------- From ac2ec6c98288077e64fb4f285512315b075146cb Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 26 Nov 2018 19:01:40 -0500 Subject: [PATCH 06/11] Makefile: disable some warnings for GCC 8.x --- .travis.yml | 2 +- src/Makefile.cfg | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8a137d9d8..e64619da5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,7 +85,7 @@ matrix: - p7zip-full - gcc-8 compiler: gcc-8 - env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3" + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-error=format-overflow" #gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0 - os: linux compiler: clang diff --git a/src/Makefile.cfg b/src/Makefile.cfg index b6928f1f9..2e300115a 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -222,6 +222,14 @@ endif ifdef GCC61 WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare endif +ifdef GCC80 + WFLAGS+=-Wno-error=format-overflow + WFLAGS+=-Wno-error=stringop-truncation + WFLAGS+=-Wno-error=stringop-overflow + WFLAGS+=-Wno-format-overflow + WFLAGS+=-Wno-stringop-truncation + WFLAGS+=-Wno-stringop-overflow +endif #indicate platform and what interface use with From fd12e8569798d45c1bae01b92bdc2ce2191114ac Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 26 Nov 2018 19:20:12 -0500 Subject: [PATCH 07/11] TravisCi: remove WFLAGS --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e64619da5..22a6244ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,6 @@ matrix: - p7zip-full - gcc-7 compiler: gcc-7 - env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3" #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 - os: linux addons: @@ -85,7 +84,6 @@ matrix: - p7zip-full - gcc-8 compiler: gcc-8 - env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-error=format-overflow" #gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0 - os: linux compiler: clang From 5a3f4695936edbe8b21bd6c533793bfca77995cc Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 26 Nov 2018 19:28:55 -0500 Subject: [PATCH 08/11] Makefile: skip implicit-fallthroug warnings --- src/Makefile.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 2e300115a..70e300ef7 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -222,6 +222,10 @@ endif ifdef GCC61 WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare endif +ifdef GCC72 + WFLAGS+=-Wno-error=implicit-fallthroug + WFLAGS+=-Wno-implicit-fallthroug +endif ifdef GCC80 WFLAGS+=-Wno-error=format-overflow WFLAGS+=-Wno-error=stringop-truncation From 78a1931bdf051eb0cab44eb0f969393067bffc29 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 26 Nov 2018 19:37:07 -0500 Subject: [PATCH 09/11] Makefile: disable implicit-fallthroug warnings --- src/Makefile.cfg | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 70e300ef7..20219168f 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -190,9 +190,6 @@ endif ifdef GCC46 WFLAGS+=-Wno-suggest-attribute=noreturn endif -ifdef GCC71 -WFLAGS+=-Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -endif ifndef MINGW ifdef GCC45 @@ -222,9 +219,9 @@ endif ifdef GCC61 WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare endif -ifdef GCC72 - WFLAGS+=-Wno-error=implicit-fallthroug - WFLAGS+=-Wno-implicit-fallthroug +ifdef GCC71 + WFLAGS+=-Wno-error=implicit-fallthrough + WFLAGS+=-Wno-implicit-fallthrough endif ifdef GCC80 WFLAGS+=-Wno-error=format-overflow From 5ba788e089c0c18e5ab574aa6523ef084e88babf Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 26 Nov 2018 19:38:30 -0500 Subject: [PATCH 10/11] Revert "TravisCi: remove WFLAGS" This reverts commit fd12e8569798d45c1bae01b92bdc2ce2191114ac. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 22a6244ef..e64619da5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,6 +70,7 @@ matrix: - p7zip-full - gcc-7 compiler: gcc-7 + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3" #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 - os: linux addons: @@ -84,6 +85,7 @@ matrix: - p7zip-full - gcc-8 compiler: gcc-8 + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-error=format-overflow" #gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0 - os: linux compiler: clang From 776e92089580868fcc2a52829f6e0a04629bbdba Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 26 Nov 2018 19:39:36 -0500 Subject: [PATCH 11/11] TravisCI: need WFLAGS for cmake builds --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e64619da5..3166ed783 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,7 @@ matrix: - p7zip-full - gcc-7 compiler: gcc-7 - env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3" + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough" #gcc-7 (Ubuntu 7.2.0-1ubuntu1~14.04) 7.2.0 20170802 - os: linux addons: @@ -85,7 +85,7 @@ matrix: - p7zip-full - gcc-8 compiler: gcc-8 - env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wimplicit-fallthrough=3 -Wno-error=format-overflow" + env: WFLAGS="-Wno-tautological-compare -Wno-error=implicit-fallthrough -Wno-implicit-fallthrough -Wno-error=format-overflow" #gcc-8 (Ubuntu 7.2.0-1ubuntu1~14.04) 8.1.0 - os: linux compiler: clang