From 348ed1e43f1f5c5bccd7ac7e3c79c63657fa43c0 Mon Sep 17 00:00:00 2001 From: MPC Date: Sun, 9 Dec 2018 19:34:17 -0300 Subject: [PATCH 01/10] Large room fix --- src/m_fixed.c | 7 +++++ src/m_fixed.h | 11 +++++++ src/p_setup.c | 30 +++++++----------- src/r_bsp.c | 86 +++++++++++++++------------------------------------ src/r_defs.h | 1 + src/r_main.c | 23 ++++++++++++++ src/r_main.h | 1 + src/r_segs.c | 41 +++++++++++++++++++++--- src/tables.c | 9 ++++++ src/tables.h | 2 ++ 10 files changed, 128 insertions(+), 83 deletions(-) diff --git a/src/m_fixed.c b/src/m_fixed.c index d45bb70b..412494e3 100644 --- a/src/m_fixed.c +++ b/src/m_fixed.c @@ -121,6 +121,13 @@ fixed_t FixedHypot(fixed_t x, fixed_t y) return FixedMul(ax, yx1); // |x|*((1 + (x/y)^2)^1/2) } +fixed_t FixedEuclidean(fixed_t x2, fixed_t y2, fixed_t x1, fixed_t y1) +{ + INT64 dx = x2-x1; + INT64 dy = y2-y1; + return (fixed_t)llrint(sqrt(dx*dx+dy*dy)); +} + vector2_t *FV2_Load(vector2_t *vec, fixed_t x, fixed_t y) { vec->x = x; diff --git a/src/m_fixed.h b/src/m_fixed.h index 4609913b..281802fb 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -237,6 +237,17 @@ FUNCMATH fixed_t FixedSqrt(fixed_t x); */ FUNCMATH fixed_t FixedHypot(fixed_t x, fixed_t y); +/** \brief The FixedEuclidean function + + \param x fixed_t number + \param y fixed_t number + + \return sqrt(x*x+y*y) + + +*/ +fixed_t FixedEuclidean(fixed_t x2, fixed_t y2, fixed_t x1, fixed_t y1); + /** \brief The FixedFloor function \param x fixed_t number diff --git a/src/p_setup.c b/src/p_setup.c index 93eb7558..8e7b205a 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -380,30 +380,24 @@ static inline void P_LoadVertexes(lumpnum_t lumpnum) Z_Free(data); } - -// -// Computes the line length in fracunits, the OpenGL render needs this -// - /** Computes the length of a seg in fracunits. - * This is needed for splats. * * \param seg Seg to compute length for. * \return Length in fracunits. */ fixed_t P_SegLength(seg_t *seg) { - fixed_t dx, dy; - - // make a vector (start at origin) - dx = seg->v2->x - seg->v1->x; - dy = seg->v2->y - seg->v1->y; - - return FixedHypot(dx, dy); + return FixedEuclidean(seg->v2->x,seg->v2->y,seg->v1->x,seg->v1->y); } #ifdef HWRENDER -static inline float P_SegLengthf(seg_t *seg) +/** Computes the length of a seg as a float. + * This is needed for OpenGL. + * + * \param seg Seg to compute length for. + * \return Length as a float. + */ +static inline float P_SegLengthFloat(seg_t *seg) { float dx, dy; @@ -439,11 +433,11 @@ static void P_LoadRawSegs(UINT8 *data, size_t i) li->v1 = &vertexes[SHORT(ml->v1)]; li->v2 = &vertexes[SHORT(ml->v2)]; -#ifdef HWRENDER // not win32 only 19990829 by Kin - // used for the hardware render - if (rendermode != render_soft && rendermode != render_none) + li->length = P_SegLength(li); +#ifdef HWRENDER + if (rendermode == render_opengl) { - li->flength = P_SegLengthf(li); + li->flength = P_SegLengthFloat(li); //Hurdler: 04/12/2000: for now, only used in hardware mode li->lightmaps = NULL; // list of static lightmap for this seg } diff --git a/src/r_bsp.c b/src/r_bsp.c index 35543827..23a65520 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -403,17 +403,17 @@ static void R_AddLine(seg_t *line) { INT32 x1, x2; angle_t angle1, angle2, span, tspan; - static sector_t tempsec; // ceiling/water hack + static sector_t tempsec; + + portalline = false; if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; + // big room fix + angle1 = R_PointToAngleEx(viewx, viewy, line->v1->x, line->v1->y); + angle2 = R_PointToAngleEx(viewx, viewy, line->v2->x, line->v2->y); curline = line; - portalline = false; - - // OPTIMIZE: quickly reject orthogonal back sides. - angle1 = R_PointToAngle(line->v1->x, line->v1->y); - angle2 = R_PointToAngle(line->v2->x, line->v2->y); // Clip to view edges. span = angle1 - angle2; @@ -592,69 +592,35 @@ INT32 checkcoord[12][4] = {2, 1, 3, 0} }; -static boolean R_CheckBBox(fixed_t *bspcoord) +static boolean R_CheckBBox(const fixed_t *bspcoord) { - INT32 boxpos, sx1, sx2; - fixed_t px1, py1, px2, py2; - angle_t angle1, angle2, span, tspan; + angle_t angle1, angle2; + INT32 sx1, sx2, boxpos; + const INT32* check; cliprange_t *start; // Find the corners of the box that define the edges from current viewpoint. - if (viewx <= bspcoord[BOXLEFT]) - boxpos = 0; - else if (viewx < bspcoord[BOXRIGHT]) - boxpos = 1; - else - boxpos = 2; - - if (viewy >= bspcoord[BOXTOP]) - boxpos |= 0; - else if (viewy > bspcoord[BOXBOTTOM]) - boxpos |= 1<<2; - else - boxpos |= 2<<2; - - if (boxpos == 5) + if ((boxpos = (viewx <= bspcoord[BOXLEFT] ? 0 : viewx < bspcoord[BOXRIGHT] ? 1 : 2) + (viewy >= bspcoord[BOXTOP] ? 0 : viewy > bspcoord[BOXBOTTOM] ? 4 : 8)) == 5) return true; - px1 = bspcoord[checkcoord[boxpos][0]]; - py1 = bspcoord[checkcoord[boxpos][1]]; - px2 = bspcoord[checkcoord[boxpos][2]]; - py2 = bspcoord[checkcoord[boxpos][3]]; + check = checkcoord[boxpos]; - // check clip list for an open space - angle1 = R_PointToAngle2(viewx>>1, viewy>>1, px1>>1, py1>>1) - viewangle; - angle2 = R_PointToAngle2(viewx>>1, viewy>>1, px2>>1, py2>>1) - viewangle; + // big room fix + angle1 = R_PointToAngleEx(viewx, viewy, bspcoord[check[0]], bspcoord[check[1]]) - viewangle; + angle2 = R_PointToAngleEx(viewx, viewy, bspcoord[check[2]], bspcoord[check[3]]) - viewangle; - span = angle1 - angle2; - - // Sitting on a line? - if (span >= ANGLE_180) - return true; - - tspan = angle1 + clipangle; - - if (tspan > doubleclipangle) + if ((signed)angle1 < (signed)angle2) { - tspan -= doubleclipangle; - - // Totally off the left edge? - if (tspan >= span) - return false; - - angle1 = clipangle; + if ((angle1 >= ANGLE_180) && (angle1 < ANGLE_270)) + angle1 = ANGLE_180-1; + else + angle2 = -ANGLE_180; } - tspan = clipangle - angle2; - if (tspan > doubleclipangle) - { - tspan -= doubleclipangle; - // Totally off the left edge? - if (tspan >= span) - return false; - - angle2 = -(signed)clipangle; - } + if ((signed)angle2 >= (signed)clipangle) return false; + if ((signed)angle1 <= -(signed)clipangle) return false; + if ((signed)angle1 >= (signed)clipangle) angle1 = clipangle; + if ((signed)angle2 <= -(signed)clipangle) angle2 = 0-clipangle; // Find the first clippost that touches the source post (adjacent pixels are touching). angle1 = (angle1+ANGLE_90)>>ANGLETOFINESHIFT; @@ -663,9 +629,7 @@ static boolean R_CheckBBox(fixed_t *bspcoord) sx2 = viewangletox[angle2]; // Does not cross a pixel. - if (sx1 == sx2) - return false; - sx2--; + if (sx1 >= sx2) return false; start = solidsegs; while (start->last < sx2) diff --git a/src/r_defs.h b/src/r_defs.h index b936c7e7..1cb4e081 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -573,6 +573,7 @@ typedef struct seg_s sector_t *frontsector; sector_t *backsector; + fixed_t length; // precalculated seg length #ifdef HWRENDER // new pointers so that AdjustSegs doesn't mess with v1/v2 void *pv1; // polyvertex_t diff --git a/src/r_main.c b/src/r_main.c index 23eff452..cd17f642 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -355,6 +355,29 @@ fixed_t R_PointToDist(fixed_t x, fixed_t y) return R_PointToDist2(viewx, viewy, x, y); } +angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1) +{ + INT64 dx = x1-x2; + INT64 dy = y1-y2; + if (dx < INT32_MIN || dx > INT32_MAX || dy < INT32_MIN || dy > INT32_MAX) + { + x1 = (int)(dx / 2 + x2); + y1 = (int)(dy / 2 + y2); + } + return (y1 -= y2, (x1 -= x2) || y1) ? + x1 >= 0 ? + y1 >= 0 ? + (x1 > y1) ? tantoangle[SlopeDivEx(y1,x1)] : // octant 0 + ANGLE_90-tantoangle[SlopeDivEx(x1,y1)] : // octant 1 + x1 > (y1 = -y1) ? 0-tantoangle[SlopeDivEx(y1,x1)] : // octant 8 + ANGLE_270+tantoangle[SlopeDivEx(x1,y1)] : // octant 7 + y1 >= 0 ? (x1 = -x1) > y1 ? ANGLE_180-tantoangle[SlopeDivEx(y1,x1)] : // octant 3 + ANGLE_90 + tantoangle[SlopeDivEx(x1,y1)] : // octant 2 + (x1 = -x1) > (y1 = -y1) ? ANGLE_180+tantoangle[SlopeDivEx(y1,x1)] : // octant 4 + ANGLE_270-tantoangle[SlopeDivEx(x1,y1)] : // octant 5 + 0; +} + // // R_ScaleFromGlobalAngle // Returns the texture mapping scale for the current line (horizontal span) diff --git a/src/r_main.h b/src/r_main.h index 81fa13de..6ae5aa22 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -58,6 +58,7 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node); INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line); angle_t R_PointToAngle(fixed_t x, fixed_t y); angle_t R_PointToAngle2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1); +angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1); fixed_t R_PointToDist(fixed_t x, fixed_t y); fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1); diff --git a/src/r_segs.c b/src/r_segs.c index 2122cba1..66ec71db 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1674,6 +1674,23 @@ static void R_RenderSegLoop (void) } } +// Uses precalculated seg->length +static INT64 R_CalcSegDist(seg_t* seg, INT64 x2, INT64 y2) +{ + if (!seg->linedef->dy) + return abs(y2 - seg->v1->y); + else if (!seg->linedef->dx) + return abs(x2 - seg->v1->x); + else + { + INT64 dx = (seg->v2->x)-(seg->v1->x); + INT64 dy = (seg->v2->y)-(seg->v1->y); + INT64 vdx = x2-(seg->v1->x); + INT64 vdy = y2-(seg->v1->y); + return ((dy*vdx)-(dx*vdy))/(seg->length); + } +} + // // R_StoreWallRange // A wall segment will be drawn @@ -1684,6 +1701,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) fixed_t hyp; fixed_t sineval; angle_t distangle, offsetangle; + boolean longboi; #ifndef ESLOPE fixed_t vtop; #endif @@ -1729,10 +1747,15 @@ void R_StoreWallRange(INT32 start, INT32 stop) offsetangle = ANGLE_90; distangle = ANGLE_90 - offsetangle; - hyp = R_PointToDist (curline->v1->x, curline->v1->y); sineval = FINESINE(distangle>>ANGLETOFINESHIFT); - rw_distance = FixedMul (hyp, sineval); + hyp = R_PointToDist(curline->v1->x, curline->v1->y); + rw_distance = FixedMul(hyp, sineval); + longboi = (hyp >= INT32_MAX); + + // big room fix + if (longboi) + rw_distance = (fixed_t)R_CalcSegDist(curline,viewx,viewy); ds_p->x1 = rw_x = start; ds_p->x2 = stop; @@ -2589,8 +2612,18 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (offsetangle > ANGLE_90) offsetangle = ANGLE_90; - sineval = FINESINE(offsetangle >>ANGLETOFINESHIFT); - rw_offset = FixedMul (hyp, sineval); + sineval = FINESINE(offsetangle>>ANGLETOFINESHIFT); + rw_offset = FixedMul(hyp, sineval); + + // big room fix + if (longboi) + { + INT64 dx = (curline->v2->x)-(curline->v1->x); + INT64 dy = (curline->v2->y)-(curline->v1->y); + INT64 vdx = viewx-(curline->v1->x); + INT64 vdy = viewy-(curline->v1->y); + rw_offset = ((dx*vdx-dy*vdy))/(curline->length); + } if (rw_normalangle-rw_angle1 < ANGLE_180) rw_offset = -rw_offset; diff --git a/src/tables.c b/src/tables.c index d4e0e5df..7d513707 100644 --- a/src/tables.c +++ b/src/tables.c @@ -37,6 +37,15 @@ unsigned SlopeDiv(unsigned num, unsigned den) return ans <= SLOPERANGE ? ans : SLOPERANGE; } +UINT64 SlopeDivEx(unsigned int num, unsigned int den) +{ + UINT64 ans; + if (den < 512) + return SLOPERANGE; + ans = ((UINT64)num<<3)/(den>>8); + return ans <= SLOPERANGE ? ans : SLOPERANGE; +} + fixed_t AngleFixed(angle_t af) { angle_t wa = ANGLE_180; diff --git a/src/tables.h b/src/tables.h index 1ea49a62..e82b147d 100644 --- a/src/tables.h +++ b/src/tables.h @@ -83,6 +83,8 @@ extern angle_t tantoangle[SLOPERANGE+1]; // Utility function, called by R_PointToAngle. FUNCMATH unsigned SlopeDiv(unsigned num, unsigned den); +// Only called by R_PointToAngleEx +UINT64 SlopeDivEx(unsigned int num, unsigned int den); // 360 - angle_t(ANGLE_45) = ANGLE_315 FUNCMATH FUNCINLINE static ATTRINLINE angle_t InvAngle(angle_t a) From 5b285a60a273fcd8e130870d4963bdba853dbddc Mon Sep 17 00:00:00 2001 From: Jimita <16945067+monster-psychic-cat@users.noreply.github.com> Date: Thu, 20 Dec 2018 16:15:19 -0300 Subject: [PATCH 02/10] Update r_segs.c --- src/r_segs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index bdc463da..6d6ba1ef 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1651,9 +1651,9 @@ static void R_RenderSegLoop (void) static INT64 R_CalcSegDist(seg_t* seg, INT64 x2, INT64 y2) { if (!seg->linedef->dy) - return abs(y2 - seg->v1->y); + return llabs(y2 - seg->v1->y); else if (!seg->linedef->dx) - return abs(x2 - seg->v1->x); + return llabs(x2 - seg->v1->x); else { INT64 dx = (seg->v2->x)-(seg->v1->x); From fcb65951b86c3aa207a344f24101fe1d2099c26b Mon Sep 17 00:00:00 2001 From: MPC Date: Thu, 20 Dec 2018 17:37:06 -0300 Subject: [PATCH 03/10] change implementation of square root --- src/m_fixed.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/m_fixed.c b/src/m_fixed.c index 412494e3..bfbe81f9 100644 --- a/src/m_fixed.c +++ b/src/m_fixed.c @@ -125,7 +125,10 @@ fixed_t FixedEuclidean(fixed_t x2, fixed_t y2, fixed_t x1, fixed_t y1) { INT64 dx = x2-x1; INT64 dy = y2-y1; - return (fixed_t)llrint(sqrt(dx*dx+dy*dy)); + union {INT64 i; float x;} u; + u.x = (dx*dx+dy*dy); + u.i = (1<<29) + (u.i >> 1) - (1<<22); + return (fixed_t)llrintf(u.x); } vector2_t *FV2_Load(vector2_t *vec, fixed_t x, fixed_t y) From 9d93f54b67400dca78f60267c38cd9bf0e401ed0 Mon Sep 17 00:00:00 2001 From: MPC Date: Thu, 20 Dec 2018 18:52:51 -0300 Subject: [PATCH 04/10] bland --- src/m_fixed.c | 10 ---------- src/m_fixed.h | 11 ----------- src/p_setup.c | 8 +++++--- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/m_fixed.c b/src/m_fixed.c index bfbe81f9..d45bb70b 100644 --- a/src/m_fixed.c +++ b/src/m_fixed.c @@ -121,16 +121,6 @@ fixed_t FixedHypot(fixed_t x, fixed_t y) return FixedMul(ax, yx1); // |x|*((1 + (x/y)^2)^1/2) } -fixed_t FixedEuclidean(fixed_t x2, fixed_t y2, fixed_t x1, fixed_t y1) -{ - INT64 dx = x2-x1; - INT64 dy = y2-y1; - union {INT64 i; float x;} u; - u.x = (dx*dx+dy*dy); - u.i = (1<<29) + (u.i >> 1) - (1<<22); - return (fixed_t)llrintf(u.x); -} - vector2_t *FV2_Load(vector2_t *vec, fixed_t x, fixed_t y) { vec->x = x; diff --git a/src/m_fixed.h b/src/m_fixed.h index 281802fb..4609913b 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -237,17 +237,6 @@ FUNCMATH fixed_t FixedSqrt(fixed_t x); */ FUNCMATH fixed_t FixedHypot(fixed_t x, fixed_t y); -/** \brief The FixedEuclidean function - - \param x fixed_t number - \param y fixed_t number - - \return sqrt(x*x+y*y) - - -*/ -fixed_t FixedEuclidean(fixed_t x2, fixed_t y2, fixed_t x1, fixed_t y1); - /** \brief The FixedFloor function \param x fixed_t number diff --git a/src/p_setup.c b/src/p_setup.c index f018b663..45bfb616 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -389,7 +389,9 @@ static inline void P_LoadVertexes(lumpnum_t lumpnum) */ fixed_t P_SegLength(seg_t *seg) { - return FixedEuclidean(seg->v2->x,seg->v2->y,seg->v1->x,seg->v1->y); + INT64 dx = (seg->v2->x - seg->v1->x)>>1; + INT64 dy = (seg->v2->y - seg->v1->y)>>1; + return FixedHypot(dx, dy)<<1; } #ifdef HWRENDER @@ -2626,7 +2628,7 @@ static boolean P_CanSave(void) { // Saving is completely ignored under these conditions: if ((cursaveslot < 0) // Playing without saving - || (!modifiedgame || savemoddata) // Game is modified + || (!modifiedgame || savemoddata) // Game is modified || (netgame || multiplayer) // Not in single-player || (demoplayback || demorecording || metalrecording) // Currently in demo || (players[consoleplayer].lives <= 0) // Completely dead @@ -2637,7 +2639,7 @@ static boolean P_CanSave(void) return true; // Saving should ALWAYS happen! else if (mapheaderinfo[gamemap-1]->saveoverride == SAVE_NEVER) return false; // Saving should NEVER happen! - + // Default condition: In a non-hidden map, at the beginning of a zone or on a completed save-file, and not on save reload. return (!(mapheaderinfo[gamemap-1]->menuflags & LF2_HIDEINMENU) && (mapheaderinfo[gamemap-1]->actnum < 2 || gamecomplete) From 1291d35e08c057c9b52a863afbf28c7168696dce Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 22:06:56 -0400 Subject: [PATCH 05/10] Don't allow non-keyboard keys to screenshot/gif in menus --- src/m_misc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/m_misc.c b/src/m_misc.c index a4f53c71..80c58d64 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1531,6 +1531,10 @@ boolean M_ScreenshotResponder(event_t *ev) return false; ch = ev->data1; + + if (ch >= KEY_MOUSE1 && menuactive) // If it's not a keyboard key, then don't allow it in the menus! + return false; + if (ch == KEY_F8 || ch == gamecontrol[gc_screenshot][0] || ch == gamecontrol[gc_screenshot][1]) // remappable F8 M_ScreenShot(); else if (ch == KEY_F9 || ch == gamecontrol[gc_recordgif][0] || ch == gamecontrol[gc_recordgif][1]) // remappable F9 From cb619e0353cd45b6c040f7a87f36089fef8f5be2 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 22 Dec 2018 01:20:24 -0500 Subject: [PATCH 06/10] Don't create movement events from joy or mouse when menu is active --- src/g_input.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/g_input.c b/src/g_input.c index 95664e2d..584eff3a 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -98,6 +98,8 @@ void G_MapEventsToControls(event_t *ev) break; case ev_mouse: // buttons are virtual keys + if (menuactive || CON_Ready()) + break; mousex = (INT32)(ev->data2*((cv_mousesens.value*cv_mousesens.value)/110.0f + 0.1f)); mousey = (INT32)(ev->data3*((cv_mousesens.value*cv_mousesens.value)/110.0f + 0.1f)); mlooky = (INT32)(ev->data3*((cv_mouseysens.value*cv_mousesens.value)/110.0f + 0.1f)); @@ -105,7 +107,7 @@ void G_MapEventsToControls(event_t *ev) case ev_joystick: // buttons are virtual keys i = ev->data1; - if (i >= JOYAXISSET) + if (i >= JOYAXISSET || menuactive || CON_Ready()) break; if (ev->data2 != INT32_MAX) joyxmove[i] = ev->data2; if (ev->data3 != INT32_MAX) joyymove[i] = ev->data3; @@ -113,13 +115,15 @@ void G_MapEventsToControls(event_t *ev) case ev_joystick2: // buttons are virtual keys i = ev->data1; - if (i >= JOYAXISSET) + if (i >= JOYAXISSET || menuactive || CON_Ready()) break; if (ev->data2 != INT32_MAX) joy2xmove[i] = ev->data2; if (ev->data3 != INT32_MAX) joy2ymove[i] = ev->data3; break; case ev_mouse2: // buttons are virtual keys + if (menuactive || CON_Ready()) + break; mouse2x = (INT32)(ev->data2*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f)); mouse2y = (INT32)(ev->data3*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f)); mlook2y = (INT32)(ev->data3*((cv_mouseysens2.value*cv_mousesens2.value)/110.0f + 0.1f)); From 8707b2f40ac9ae47dbb2956435a5fbf4904cc88a Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 22 Dec 2018 01:43:58 -0500 Subject: [PATCH 07/10] Center window on current monitor during vidmode change --- src/sdl/i_video.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 2c199c2d..dad3b941 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -200,7 +200,10 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) } // Reposition window only in windowed mode SDL_SetWindowSize(window, width, height); - SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); + SDL_SetWindowPosition(window, + SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)), + SDL_WINDOWPOS_CENTERED_DISPLAY(SDL_GetWindowDisplayIndex(window)) + ); } } else From aa77038dfc4aad87815dadab7c743e635fa98e3a Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 23 Dec 2018 02:38:30 -0500 Subject: [PATCH 08/10] Add chat_on to non-key move event checks --- src/g_input.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/g_input.c b/src/g_input.c index 584eff3a..8c650aa3 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -98,7 +98,7 @@ void G_MapEventsToControls(event_t *ev) break; case ev_mouse: // buttons are virtual keys - if (menuactive || CON_Ready()) + if (menuactive || CON_Ready() || chat_on) break; mousex = (INT32)(ev->data2*((cv_mousesens.value*cv_mousesens.value)/110.0f + 0.1f)); mousey = (INT32)(ev->data3*((cv_mousesens.value*cv_mousesens.value)/110.0f + 0.1f)); @@ -107,7 +107,7 @@ void G_MapEventsToControls(event_t *ev) case ev_joystick: // buttons are virtual keys i = ev->data1; - if (i >= JOYAXISSET || menuactive || CON_Ready()) + if (i >= JOYAXISSET || menuactive || CON_Ready() || chat_on) break; if (ev->data2 != INT32_MAX) joyxmove[i] = ev->data2; if (ev->data3 != INT32_MAX) joyymove[i] = ev->data3; @@ -115,14 +115,14 @@ void G_MapEventsToControls(event_t *ev) case ev_joystick2: // buttons are virtual keys i = ev->data1; - if (i >= JOYAXISSET || menuactive || CON_Ready()) + if (i >= JOYAXISSET || menuactive || CON_Ready() || chat_on) break; if (ev->data2 != INT32_MAX) joy2xmove[i] = ev->data2; if (ev->data3 != INT32_MAX) joy2ymove[i] = ev->data3; break; case ev_mouse2: // buttons are virtual keys - if (menuactive || CON_Ready()) + if (menuactive || CON_Ready() || chat_on) break; mouse2x = (INT32)(ev->data2*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f)); mouse2y = (INT32)(ev->data3*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f)); From 2d675750cfab406d56a36b9486b353693e5a214c Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 23 Dec 2018 21:52:49 +0000 Subject: [PATCH 09/10] fix inconsistent "tabbing" in the VS project files from when I added in lua_blockmaplib.c --- src/sdl/Srb2SDL-vc10.vcxproj | 2 +- src/win32/Srb2win-vc10.vcxproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index 3e4a9ebb..00ed0db3 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -297,7 +297,7 @@ - + diff --git a/src/win32/Srb2win-vc10.vcxproj b/src/win32/Srb2win-vc10.vcxproj index 5bfa29b8..ed6b46b8 100644 --- a/src/win32/Srb2win-vc10.vcxproj +++ b/src/win32/Srb2win-vc10.vcxproj @@ -132,7 +132,7 @@ - + From c0c05043e64dc14db49dede53a1c00d6750c3aaa Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 23 Dec 2018 17:57:50 -0500 Subject: [PATCH 10/10] Revert "Merge branch 'menu-mpjoy-fix' into 'next'" This reverts commit b5d4bb3530101643712b2c0c6110ec5ad4b77e74, reversing changes made to 2d675750cfab406d56a36b9486b353693e5a214c. --- src/g_input.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/g_input.c b/src/g_input.c index 8c650aa3..95664e2d 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -98,8 +98,6 @@ void G_MapEventsToControls(event_t *ev) break; case ev_mouse: // buttons are virtual keys - if (menuactive || CON_Ready() || chat_on) - break; mousex = (INT32)(ev->data2*((cv_mousesens.value*cv_mousesens.value)/110.0f + 0.1f)); mousey = (INT32)(ev->data3*((cv_mousesens.value*cv_mousesens.value)/110.0f + 0.1f)); mlooky = (INT32)(ev->data3*((cv_mouseysens.value*cv_mousesens.value)/110.0f + 0.1f)); @@ -107,7 +105,7 @@ void G_MapEventsToControls(event_t *ev) case ev_joystick: // buttons are virtual keys i = ev->data1; - if (i >= JOYAXISSET || menuactive || CON_Ready() || chat_on) + if (i >= JOYAXISSET) break; if (ev->data2 != INT32_MAX) joyxmove[i] = ev->data2; if (ev->data3 != INT32_MAX) joyymove[i] = ev->data3; @@ -115,15 +113,13 @@ void G_MapEventsToControls(event_t *ev) case ev_joystick2: // buttons are virtual keys i = ev->data1; - if (i >= JOYAXISSET || menuactive || CON_Ready() || chat_on) + if (i >= JOYAXISSET) break; if (ev->data2 != INT32_MAX) joy2xmove[i] = ev->data2; if (ev->data3 != INT32_MAX) joy2ymove[i] = ev->data3; break; case ev_mouse2: // buttons are virtual keys - if (menuactive || CON_Ready() || chat_on) - break; mouse2x = (INT32)(ev->data2*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f)); mouse2y = (INT32)(ev->data3*((cv_mousesens2.value*cv_mousesens2.value)/110.0f + 0.1f)); mlook2y = (INT32)(ev->data3*((cv_mouseysens2.value*cv_mousesens2.value)/110.0f + 0.1f));