From dc765cde2c2d72d63b89cbd5e7154dbfacfe5350 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 24 Jul 2016 18:54:01 +0100 Subject: [PATCH 01/12] Fix R_DrawColumnShadowed_8 crash encountered in FuriousFox's map If you want more specifics, sloped FOFs are to blame it turns out: sometimes the bottom of an FOF wall blocking a segment of an in-level wall column can be considered ABOVE the top part of the FOF there (yikes), and then the dc_y* values go offscreen, and then BOOM --- src/r_draw8.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/r_draw8.c b/src/r_draw8.c index 9f5ab62cd..39585f587 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -1363,7 +1363,19 @@ void R_DrawColumnShadowed_8(void) height = dc_lightlist[i].height >> LIGHTSCALESHIFT; if (solid) + { bheight = dc_lightlist[i].botheight >> LIGHTSCALESHIFT; + if (bheight < height) + { + // confounded slopes sometimes allow partial invertedness, + // even including cases where the top and bottom heights + // should actually be the same! + // swap the height values as a workaround for this quirk + INT32 temp = height; + height = bheight; + bheight = temp; + } + } if (height <= dc_yl) { dc_colormap = dc_lightlist[i].rcolormap; From 2870e19f7f6526b7a68b94cf2492fd58564fa072 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 27 Jul 2016 19:56:21 +0100 Subject: [PATCH 02/12] Take out fixedheight-based hacks for checking if floor or ceiling! Use an "isceiling" boolean for that instead This apparently fixes most of the issues with ceiling slopes in Boinciel's SUGOI map --- src/hardware/hw_main.c | 70 ++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index ca4e000bb..5251e0b30 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -66,9 +66,9 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing); #endif #ifdef SORTING -void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, fixed_t fixedheight, +void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap); -void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, fixed_t fixedheight, +void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap); #else static void HWR_Add3DWater(lumpnum_t lumpnum, extrasubsector_t *xsub, fixed_t fixedheight, @@ -521,7 +521,7 @@ static UINT8 HWR_FogBlockAlpha(INT32 light, UINT32 color, UINT32 fadecolor) // L // -----------------+ // HWR_RenderPlane : Render a floor or ceiling convex polygon // -----------------+ -static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, fixed_t fixedheight, +static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, FBITFIELD PolyFlags, INT32 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector, UINT8 alpha, boolean fogplane, extracolormap_t *planecolormap) { polyvertex_t * pv; @@ -554,17 +554,16 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, fixed_t fi // Get the slope pointer to simplify future code if (FOFsector) { - if (FOFsector->f_slope && FOFsector->floorheight == fixedheight) + if (FOFsector->f_slope && !isceiling) slope = FOFsector->f_slope; - else if (FOFsector->c_slope && FOFsector->ceilingheight == fixedheight) + else if (FOFsector->c_slope && isceiling) slope = FOFsector->c_slope; } else { - // Use fixedheight to determine whether to check floor or ceiling because I hate my life - if (gr_frontsector->f_slope && gr_frontsector->floorheight == fixedheight) + if (gr_frontsector->f_slope && !isceiling) slope = gr_frontsector->f_slope; - else if (gr_frontsector->c_slope && gr_frontsector->ceilingheight == fixedheight) + else if (gr_frontsector->c_slope && isceiling) slope = gr_frontsector->c_slope; } @@ -638,12 +637,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, fixed_t fi if (FOFsector != NULL) { -#ifdef ESLOPE - if ((slope && slope == FOFsector->f_slope) - || fixedheight == FOFsector->floorheight) // it's a floor -#else - if (fixedheight == FOFsector->floorheight) // it's a floor -#endif + if (!isceiling) // it's a floor { scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize; @@ -658,12 +652,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, fixed_t fi } else if (gr_frontsector) { -#ifdef ESLOPE - if ((slope && slope == gr_frontsector->f_slope) - || fixedheight == gr_frontsector->floorheight) // it's a floor -#else - if (fixedheight < dup_viewz) // it's a floor -#endif + if (!isceiling) // it's a floor { scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize; @@ -3111,7 +3100,7 @@ static inline void HWR_AddPolyObjectSegs(void) } #ifdef POLYOBJECTS_PLANES -static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, fixed_t fixedheight, +static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, FBITFIELD blendmode, UINT8 lightlevel, lumpnum_t lumpnum, sector_t *FOFsector, UINT8 alpha, extracolormap_t *planecolormap) { @@ -3195,7 +3184,7 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, fixed_t fixedheight if (FOFsector != NULL) { - if (fixedheight == FOFsector->floorheight) // it's a floor + if (!isceiling) // it's a floor { scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize; @@ -3210,7 +3199,7 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, fixed_t fixedheight } else if (gr_frontsector) { - if (fixedheight < dup_viewz) // it's a floor + if (!isceiling) // it's a floor { scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize; @@ -3303,13 +3292,13 @@ static void HWR_AddPolyObjectPlanes(void) { FSurfaceInfo Surf; FBITFIELD blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf); - HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->floorpic].lumpnum, po_ptrs[i], polyobjsector->floorheight, + HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->floorpic].lumpnum, po_ptrs[i], false, polyobjsector->floorheight, polyobjsector->lightlevel, Surf.FlatColor.s.alpha, polyobjsector, blendmode, NULL); } else { HWR_GetFlat(levelflats[polyobjsector->floorpic].lumpnum); - HWR_RenderPolyObjectPlane(po_ptrs[i], polyobjsector->floorheight, PF_Occlude, + HWR_RenderPolyObjectPlane(po_ptrs[i], false, polyobjsector->floorheight, PF_Occlude, polyobjsector->lightlevel, levelflats[polyobjsector->floorpic].lumpnum, polyobjsector, 255, NULL); } @@ -3325,13 +3314,13 @@ static void HWR_AddPolyObjectPlanes(void) FBITFIELD blendmode; memset(&Surf, 0x00, sizeof(Surf)); blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf); - HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->ceilingpic].lumpnum, po_ptrs[i], polyobjsector->ceilingheight, + HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->ceilingpic].lumpnum, po_ptrs[i], true, polyobjsector->ceilingheight, polyobjsector->lightlevel, Surf.FlatColor.s.alpha, polyobjsector, blendmode, NULL); } else { HWR_GetFlat(levelflats[polyobjsector->ceilingpic].lumpnum); - HWR_RenderPolyObjectPlane(po_ptrs[i], polyobjsector->ceilingheight, PF_Occlude, + HWR_RenderPolyObjectPlane(po_ptrs[i], true, polyobjsector->ceilingheight, PF_Occlude, polyobjsector->lightlevel, levelflats[polyobjsector->floorpic].lumpnum, polyobjsector, 255, NULL); } @@ -3485,7 +3474,7 @@ static void HWR_Subsector(size_t num) if (sub->validcount != validcount) { HWR_GetFlat(levelflats[gr_frontsector->floorpic].lumpnum); - HWR_RenderPlane(gr_frontsector, &extrasubsectors[num], + HWR_RenderPlane(gr_frontsector, &extrasubsectors[num], false, // Hack to make things continue to work around slopes. locFloorHeight == cullFloorHeight ? locFloorHeight : gr_frontsector->floorheight, // We now return you to your regularly scheduled rendering. @@ -3507,7 +3496,7 @@ static void HWR_Subsector(size_t num) if (sub->validcount != validcount) { HWR_GetFlat(levelflats[gr_frontsector->ceilingpic].lumpnum); - HWR_RenderPlane(NULL, &extrasubsectors[num], + HWR_RenderPlane(NULL, &extrasubsectors[num], true, // Hack to make things continue to work around slopes. locCeilingHeight == cullCeilingHeight ? locCeilingHeight : gr_frontsector->ceilingheight, // We now return you to your regularly scheduled rendering. @@ -3576,6 +3565,7 @@ static void HWR_Subsector(size_t num) HWR_AddTransparentFloor(0, &extrasubsectors[num], + false, *rover->bottomheight, *gr_frontsector->lightlist[light].lightlevel, alpha, rover->master->frontsector, PF_Translucent|PF_NoTexture, @@ -3593,6 +3583,7 @@ static void HWR_Subsector(size_t num) #else HWR_AddTransparentFloor(levelflats[*rover->bottompic].lumpnum, &extrasubsectors[num], + false, *rover->bottomheight, *gr_frontsector->lightlist[light].lightlevel, rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector, PF_Translucent, @@ -3603,7 +3594,7 @@ static void HWR_Subsector(size_t num) { HWR_GetFlat(levelflats[*rover->bottompic].lumpnum); light = R_GetPlaneLight(gr_frontsector, centerHeight, dup_viewz < cullHeight ? true : false); - HWR_RenderPlane(NULL, &extrasubsectors[num], *rover->bottomheight, PF_Occlude, *gr_frontsector->lightlist[light].lightlevel, levelflats[*rover->bottompic].lumpnum, + HWR_RenderPlane(NULL, &extrasubsectors[num], false, *rover->bottomheight, PF_Occlude, *gr_frontsector->lightlist[light].lightlevel, levelflats[*rover->bottompic].lumpnum, rover->master->frontsector, 255, false, gr_frontsector->lightlist[light].extra_colormap); } } @@ -3637,6 +3628,7 @@ static void HWR_Subsector(size_t num) HWR_AddTransparentFloor(0, &extrasubsectors[num], + true, *rover->topheight, *gr_frontsector->lightlist[light].lightlevel, alpha, rover->master->frontsector, PF_Translucent|PF_NoTexture, @@ -3654,6 +3646,7 @@ static void HWR_Subsector(size_t num) #else HWR_AddTransparentFloor(levelflats[*rover->toppic].lumpnum, &extrasubsectors[num], + true, *rover->topheight, *gr_frontsector->lightlist[light].lightlevel, rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector, PF_Translucent, @@ -3665,7 +3658,7 @@ static void HWR_Subsector(size_t num) { HWR_GetFlat(levelflats[*rover->toppic].lumpnum); light = R_GetPlaneLight(gr_frontsector, centerHeight, dup_viewz < cullHeight ? true : false); - HWR_RenderPlane(NULL, &extrasubsectors[num], *rover->topheight, PF_Occlude, *gr_frontsector->lightlist[light].lightlevel, levelflats[*rover->toppic].lumpnum, + HWR_RenderPlane(NULL, &extrasubsectors[num], true, *rover->topheight, PF_Occlude, *gr_frontsector->lightlist[light].lightlevel, levelflats[*rover->toppic].lumpnum, rover->master->frontsector, 255, false, gr_frontsector->lightlist[light].extra_colormap); } } @@ -4592,6 +4585,7 @@ static void HWR_RenderWall(wallVert3D *wallVerts, FSurfaceInfo *pSurf, FBITFIE typedef struct { extrasubsector_t *xsub; + boolean isceiling; fixed_t fixedheight; INT32 lightlevel; lumpnum_t lumpnum; @@ -4609,6 +4603,7 @@ static planeinfo_t *planeinfo = NULL; typedef struct { polyobj_t *polysector; + boolean isceiling; fixed_t fixedheight; INT32 lightlevel; lumpnum_t lumpnum; @@ -4644,7 +4639,7 @@ static INT32 drawcount = 0; #define MAX_TRANSPARENTFLOOR 512 // This will likely turn into a copy of HWR_Add3DWater and replace it. -void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, +void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, boolean fogplane, extracolormap_t *planecolormap) { static size_t allocedplanes = 0; @@ -4659,6 +4654,7 @@ void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, Z_Realloc(planeinfo, allocedplanes * sizeof (*planeinfo), PU_LEVEL, &planeinfo); } + planeinfo[numplanes].isceiling = isceiling; planeinfo[numplanes].fixedheight = fixedheight; planeinfo[numplanes].lightlevel = lightlevel; planeinfo[numplanes].lumpnum = lumpnum; @@ -4669,12 +4665,13 @@ void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, planeinfo[numplanes].fogplane = fogplane; planeinfo[numplanes].planecolormap = planecolormap; planeinfo[numplanes].drawcount = drawcount++; + numplanes++; } // Adding this for now until I can create extrasubsector info for polyobjects // When that happens it'll just be done through HWR_AddTransparentFloor and HWR_RenderPlane -void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, +void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap) { static size_t allocedpolyplanes = 0; @@ -4689,6 +4686,7 @@ void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, Z_Realloc(polyplaneinfo, allocedpolyplanes * sizeof (*polyplaneinfo), PU_LEVEL, &polyplaneinfo); } + polyplaneinfo[numpolyplanes].isceiling = isceiling; polyplaneinfo[numpolyplanes].fixedheight = fixedheight; polyplaneinfo[numpolyplanes].lightlevel = lightlevel; polyplaneinfo[numpolyplanes].lumpnum = lumpnum; @@ -4854,7 +4852,7 @@ static void HWR_CreateDrawNodes(void) if (!(sortnode[sortindex[i]].plane->blend & PF_NoTexture)) HWR_GetFlat(sortnode[sortindex[i]].plane->lumpnum); - HWR_RenderPlane(NULL, sortnode[sortindex[i]].plane->xsub, sortnode[sortindex[i]].plane->fixedheight, sortnode[sortindex[i]].plane->blend, sortnode[sortindex[i]].plane->lightlevel, + HWR_RenderPlane(NULL, sortnode[sortindex[i]].plane->xsub, sortnode[sortindex[i]].plane->isceiling, sortnode[sortindex[i]].plane->fixedheight, sortnode[sortindex[i]].plane->blend, sortnode[sortindex[i]].plane->lightlevel, sortnode[sortindex[i]].plane->lumpnum, sortnode[sortindex[i]].plane->FOFSector, sortnode[sortindex[i]].plane->alpha, sortnode[sortindex[i]].plane->fogplane, sortnode[sortindex[i]].plane->planecolormap); } else if (sortnode[sortindex[i]].polyplane) @@ -4864,7 +4862,7 @@ static void HWR_CreateDrawNodes(void) if (!(sortnode[sortindex[i]].polyplane->blend & PF_NoTexture)) HWR_GetFlat(sortnode[sortindex[i]].polyplane->lumpnum); - HWR_RenderPolyObjectPlane(sortnode[sortindex[i]].polyplane->polysector, sortnode[sortindex[i]].polyplane->fixedheight, sortnode[sortindex[i]].polyplane->blend, sortnode[sortindex[i]].polyplane->lightlevel, + HWR_RenderPolyObjectPlane(sortnode[sortindex[i]].polyplane->polysector, sortnode[sortindex[i]].polyplane->isceiling, sortnode[sortindex[i]].polyplane->fixedheight, sortnode[sortindex[i]].polyplane->blend, sortnode[sortindex[i]].polyplane->lightlevel, sortnode[sortindex[i]].polyplane->lumpnum, sortnode[sortindex[i]].polyplane->FOFSector, sortnode[sortindex[i]].polyplane->alpha, sortnode[sortindex[i]].polyplane->planecolormap); } else if (sortnode[sortindex[i]].wall) @@ -6161,7 +6159,7 @@ static void HWR_Render3DWater(void) for (i = 0; i < numfloors; i++) { HWR_GetFlat(planeinfo[i].lumpnum); - HWR_RenderPlane(NULL, planeinfo[i].xsub, planeinfo[i].fixedheight, PF_Translucent, planeinfo[i].lightlevel, planeinfo[i].lumpnum, + HWR_RenderPlane(NULL, planeinfo[i].xsub, planeinfo[i].isceiling, planeinfo[i].fixedheight, PF_Translucent, planeinfo[i].lightlevel, planeinfo[i].lumpnum, planeinfo[i].FOFSector, planeinfo[i].alpha, planeinfo[i].fogplane, planeinfo[i].planecolormap); } numfloors = 0; From 5d6463fafc1fb16930f23f8bd314a41d690bc565 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 13 Aug 2016 13:39:24 +0100 Subject: [PATCH 03/12] Fixed Knuckles being able to climb in space in OpenGL. To understand: look at AjustSegs(void) in hw_bsp.c. It reallocates the vetex_t pointers for lines as POLYVERTEX_T pointers, and of COURSE things are gonna get wacky when you're casting pointers. I dunno how resilient the FLOAT_TO_FIXED solution is or whether it'll be netgame compatible (yayyy float precision loss) but it's not like our builds are netgame compatible with themselves --- src/r_main.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/r_main.c b/src/r_main.c index 1ad125cd0..4c81b9d8c 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -33,6 +33,7 @@ #ifdef HWRENDER #include "hardware/hw_main.h" +#include "hardware/hw_glob.h" // polyvertex_t #endif //profile stuff --------------------------------------------------------- @@ -268,10 +269,28 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node) // killough 5/2/98: reformatted INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line) { - fixed_t lx = line->v1->x; - fixed_t ly = line->v1->y; - fixed_t ldx = line->v2->x - lx; - fixed_t ldy = line->v2->y - ly; + fixed_t lx, ly, ldx, ldy; + +#ifdef HWRENDER // how did nobody notice this for years + // used for the hardware render + if (rendermode != render_soft && rendermode != render_none) + { + lx = FLOAT_TO_FIXED(((polyvertex_t *)line->v1)->x); + ly = FLOAT_TO_FIXED(((polyvertex_t *)line->v1)->y); + ldx = FLOAT_TO_FIXED(((polyvertex_t *)line->v2)->x); + ldy = FLOAT_TO_FIXED(((polyvertex_t *)line->v2)->y); + } + else +#endif + { + lx = line->v1->x; + ly = line->v1->y; + ldx = line->v2->x; + ldy = line->v2->y; + } + + ldx -= lx; + ldy -= ly; if (!ldx) return x <= lx ? ldy > 0 : ldy < 0; From 612575620be9a98c4d42806617e8a7b44a26cacc Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 13 Aug 2016 14:16:06 +0100 Subject: [PATCH 04/12] Solved the climbing-on-one-sided-lines problem another way, using the last touched line's attributes. (After talking to Alam, we can't have floats anywhere near P_ functions, so.) --- src/p_map.c | 2 +- src/p_user.c | 23 ++++++++++------------- src/r_main.c | 27 ++++----------------------- 3 files changed, 15 insertions(+), 37 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 1f2d903e8..48f4cca23 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2657,7 +2657,7 @@ isblocking: // see about climbing on the wall if (!(checkline->flags & ML_NOCLIMB)) { - boolean canclimb; // FUCK C90 + boolean canclimb; angle_t climbangle, climbline; INT32 whichside = P_PointOnLineSide(slidemo->x, slidemo->y, li); diff --git a/src/p_user.c b/src/p_user.c index 9cd6aa401..f390650f4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2276,25 +2276,24 @@ static void P_DoClimbing(player_t *player) fixed_t platy; subsector_t *glidesector; boolean climb = true; + boolean onesided = ((player->lastsidehit != -1 && player->lastlinehit != -1) && !(lines[player->lastlinehit].backsector)); platx = P_ReturnThrustX(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale)); platy = P_ReturnThrustY(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale)); - glidesector = R_IsPointInSubsector(player->mo->x + platx, player->mo->y + platy); + glidesector = R_PointInSubsector(player->mo->x + platx, player->mo->y + platy); - if (!glidesector || glidesector->sector != player->mo->subsector->sector) + if (onesided || glidesector->sector != player->mo->subsector->sector) { - boolean floorclimb; - boolean thrust; - boolean boostup; - boolean skyclimber; + boolean floorclimb = false; + boolean thrust = false; + boolean boostup = false; + boolean skyclimber = false; fixed_t floorheight, ceilingheight; // ESLOPE - thrust = false; - floorclimb = false; - boostup = false; - skyclimber = false; - if (glidesector) + if (onesided) + floorclimb = true; + else { #ifdef ESLOPE floorheight = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y) @@ -2589,8 +2588,6 @@ static void P_DoClimbing(player_t *player) } } } - else - floorclimb = true; if (player->lastsidehit != -1 && player->lastlinehit != -1) { diff --git a/src/r_main.c b/src/r_main.c index 4c81b9d8c..1ad125cd0 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -33,7 +33,6 @@ #ifdef HWRENDER #include "hardware/hw_main.h" -#include "hardware/hw_glob.h" // polyvertex_t #endif //profile stuff --------------------------------------------------------- @@ -269,28 +268,10 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node) // killough 5/2/98: reformatted INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line) { - fixed_t lx, ly, ldx, ldy; - -#ifdef HWRENDER // how did nobody notice this for years - // used for the hardware render - if (rendermode != render_soft && rendermode != render_none) - { - lx = FLOAT_TO_FIXED(((polyvertex_t *)line->v1)->x); - ly = FLOAT_TO_FIXED(((polyvertex_t *)line->v1)->y); - ldx = FLOAT_TO_FIXED(((polyvertex_t *)line->v2)->x); - ldy = FLOAT_TO_FIXED(((polyvertex_t *)line->v2)->y); - } - else -#endif - { - lx = line->v1->x; - ly = line->v1->y; - ldx = line->v2->x; - ldy = line->v2->y; - } - - ldx -= lx; - ldy -= ly; + fixed_t lx = line->v1->x; + fixed_t ly = line->v1->y; + fixed_t ldx = line->v2->x - lx; + fixed_t ldy = line->v2->y - ly; if (!ldx) return x <= lx ? ldy > 0 : ldy < 0; From be973d6990039eaec8b0fcec460d8cac72a1f273 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 13 Aug 2016 15:07:40 +0100 Subject: [PATCH 05/12] expanded comment for future generations --- src/r_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_main.c b/src/r_main.c index 1ad125cd0..498f4dab8 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -771,7 +771,7 @@ subsector_t *R_PointInSubsector(fixed_t x, fixed_t y) } // -// R_IsPointInSubsector, same as above but returns 0 if not in subsector +// R_IsPointInSubsector, same as above but returns 0 if not in subsector - this does not work in opengl because of polyvertex_t // subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y) { From 758c77fe53a90a6013801f754bb083c851c99d8c Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Sat, 13 Aug 2016 17:43:22 -0500 Subject: [PATCH 06/12] Fixed non-players having fucked slope stepup/down --- src/p_map.c | 8 ++++++-- src/p_mobj.c | 6 ++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 1f2d903e8..245736056 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1970,8 +1970,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) } // Ramp test - if (thing->player && maxstep > 0 - && !(P_PlayerTouchingSectorSpecial(thing->player, 1, 14) || GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 14)) + if (maxstep > 0 && !( + thing->player && ( + P_PlayerTouchingSectorSpecial(thing->player, 1, 14) + || GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 14) + ) + ) { // If the floor difference is MAXSTEPMOVE or less, and the sector isn't Section1:14, ALWAYS // step down! Formerly required a Section1:13 sector for the full MAXSTEPMOVE, but no more. diff --git a/src/p_mobj.c b/src/p_mobj.c index 62dee0a67..77dfd1923 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1650,8 +1650,6 @@ void P_XYMovement(mobj_t *mo) I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); - moved = true; - // if it's stopped if (!mo->momx && !mo->momy) { @@ -1708,9 +1706,9 @@ void P_XYMovement(mobj_t *mo) if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true) && !(mo->eflags & MFE_SPRUNG)) { // blocked move + moved = false; if (player) { - moved = false; if (player->bot) B_MoveBlocked(player); } @@ -1815,7 +1813,7 @@ void P_XYMovement(mobj_t *mo) else mo->momx = mo->momy = 0; } - else if (player) + else moved = true; if (P_MobjWasRemoved(mo)) // MF_SPECIAL touched a player! O_o;; From 55b8ef9f641947d68e6ce40bd7b03f775ed984fd Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Sun, 14 Aug 2016 00:03:00 -0500 Subject: [PATCH 07/12] More stepping upward fixing ugh --- src/p_mobj.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 77dfd1923..1eb503238 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2373,6 +2373,12 @@ static boolean P_ZMovement(mobj_t *mo) mo->z = mo->floorz; #ifdef ESLOPE + if (mo->standingslope) // You're still on the ground; why are we here? + { + mo->momz = 0; + return; + } + P_CheckPosition(mo, mo->x, mo->y); // Sets mo->standingslope correctly if (((mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope) && (mo->type != MT_STEAM)) { From 0264fd24ae541adaa8d261e6ebe4690470c84d00 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 14 Aug 2016 10:43:44 -0400 Subject: [PATCH 08/12] @MonsterIestyn: Should probably be returning true then --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 1eb503238..e1a1820af 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2376,7 +2376,7 @@ static boolean P_ZMovement(mobj_t *mo) if (mo->standingslope) // You're still on the ground; why are we here? { mo->momz = 0; - return; + return true; } P_CheckPosition(mo, mo->x, mo->y); // Sets mo->standingslope correctly From 3d9fe7c899d7c63c91f8605fe6e503b68201540c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 19 Aug 2016 00:06:12 +0100 Subject: [PATCH 09/12] The ability to disable weapon rings, as heavily requested by Lat and Speedwagon for their high effort character .wads and selfishly also desired to make thokker less hacky. --- src/lua_hud.h | 3 +++ src/lua_hudlib.c | 3 +++ src/st_stuff.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/src/lua_hud.h b/src/lua_hud.h index 799ce2fbf..80e8ae03e 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -18,6 +18,9 @@ enum hud { hud_time, hud_rings, hud_lives, + // Match + hud_weaponrings, + hud_powerstones, // NiGHTS mode hud_nightslink, hud_nightsdrill, diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 31549afa7..7aadd9c0e 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -44,6 +44,9 @@ static const char *const hud_disable_options[] = { "rings", "lives", + "weaponrings", + "powerstones", + "nightslink", "nightsdrill", "nightsrings", diff --git a/src/st_stuff.c b/src/st_stuff.c index aac6b09d2..ca315ce27 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1385,6 +1385,10 @@ static void ST_drawMatchHUD(void) if (G_TagGametype() && !(stplyr->pflags & PF_TAGIT)) return; +#ifdef HAVE_BLUA + if (LUA_HudEnabled(hud_weaponrings)) { +#endif + if (stplyr->powers[pw_infinityring]) ST_drawWeaponRing(pw_infinityring, 0, 0, offset, infinityring); else if (stplyr->health > 1) @@ -1408,6 +1412,12 @@ static void ST_drawMatchHUD(void) offset += 20; ST_drawWeaponRing(pw_railring, RW_RAIL, WEP_RAIL, offset, railring); +#ifdef HAVE_BLUA + } + + if (LUA_HudEnabled(hud_powerstones)) { +#endif + // Power Stones collected offset = 136; // Used for Y now @@ -1439,6 +1449,10 @@ static void ST_drawMatchHUD(void) if (stplyr->powers[pw_emeralds] & EMERALD7) V_DrawScaledPatch(28, STRINGY(offset), V_SNAPTOLEFT, tinyemeraldpics[6]); + +#ifdef HAVE_BLUA + } +#endif } static inline void ST_drawRaceHUD(void) From 3db3433a513b84ddd26774490e4f51f6c8758c09 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 19 Aug 2016 00:07:32 +0100 Subject: [PATCH 10/12] More consistent comment. --- src/lua_hud.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_hud.h b/src/lua_hud.h index 80e8ae03e..ba0a1d894 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -18,7 +18,7 @@ enum hud { hud_time, hud_rings, hud_lives, - // Match + // Match / CTF / Tag / Ringslinger hud_weaponrings, hud_powerstones, // NiGHTS mode From e5c44de6cafb93080ca8a5cbe62f3b5387381cb0 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 18 Aug 2016 19:38:21 -0400 Subject: [PATCH 11/12] travis: cut down on osx builds --- .travis.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index d728758ed..e5dbb58e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -162,28 +162,28 @@ matrix: - clang-3.8 compiler: clang-3.8 #clang version 3.8.1-svn271127-1~exp1 (branches/release_38) - - os: osx - osx_image: beta-xcode6.1 - #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) - - os: osx - osx_image: beta-xcode6.2 - compiler: gcc - #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) # - os: osx -# osx_image: beta-xcode6.3 -# #I think xcode.6.3 VM is broken, it does not boot - - os: osx - osx_image: xcode6.4 - #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) - - os: osx - osx_image: xcode7 - #Apple LLVM version 7.0.0 (clang-700.0.72) - - os: osx - osx_image: xcode7.1 - #Apple LLVM version 7.0.0 (clang-700.1.76) - - os: osx - osx_image: xcode7.2 - #Apple LLVM version 7.0.2 (clang-700.1.81) +# osx_image: beta-xcode6.1 +# #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) +# - os: osx +# osx_image: beta-xcode6.2 +# compiler: gcc +# #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) +## - os: osx +## osx_image: beta-xcode6.3 +## #I think xcode.6.3 VM is broken, it does not boot +# - os: osx +# osx_image: xcode6.4 +# #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) +# - os: osx +# osx_image: xcode7 +# #Apple LLVM version 7.0.0 (clang-700.0.72) +# - os: osx +# osx_image: xcode7.1 +# #Apple LLVM version 7.0.0 (clang-700.1.76) +# - os: osx +# osx_image: xcode7.2 +# #Apple LLVM version 7.0.2 (clang-700.1.81) - os: osx osx_image: xcode7.3 #Apple LLVM version 7.3.0 (clang-703.0.31) From 8a244c181603fe6acfcf54c3a3d99dd668bdb20e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 26 Aug 2016 16:09:43 +0100 Subject: [PATCH 12/12] Nev3r helped me discover a crash caused by NAMEcLcR not loading patches into every angle lump slot. This is the smallest possible change that fixes the crash. --- src/r_things.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index 108589493..b2575be26 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -145,7 +145,7 @@ static void R_InstallSpriteLump(UINT16 wad, // graphics patch if (sprtemp[frame].rotate == (SRF_3D|SRF_2D)) sprtemp[frame].rotate = SRF_2D; // SRF_3D|SRF_2D being enabled at the same time doesn't HURT in the current sprite angle implementation, but it DOES mean more to check in some of the helper functions. Let's not allow this scenario to happen. - for (r = 1; r < 4; r++) // Don't set for front/back frames + for (r = 0; r < 4; r++) // Thanks to R_PrecacheLevel, we can't leave sprtemp[*].lumppat[*] == LUMPERROR... so we load into the front/back angle too. { sprtemp[frame].lumppat[r + rightfactor] = lumppat; sprtemp[frame].lumpid[r + rightfactor] = lumpid;