From 5d6463fafc1fb16930f23f8bd314a41d690bc565 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 13 Aug 2016 13:39:24 +0100 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] @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 7/9] 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 8/9] 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 9/9] 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)