From f5bf80cc6306398d33bb8702eff82f9807b5b6cf Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 27 Sep 2024 05:19:52 +0200 Subject: [PATCH] use qs22j here again it is really faster thought it wasnt in this case --- src/d_net.c | 8 ++++---- src/hardware/hw_main.c | 3 +-- src/p_polyobj.c | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index ad031a76b..a8602f567 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -1446,13 +1446,13 @@ void Command_Ping_f(void) } } - if (f_width < 10) f_width = 1; + if (f_width < 10) f_width = 1; else if (f_width < 100) f_width = 2; - else f_width = 3; + else f_width = 3; - if (ms_width < 10) ms_width = 1; + if (ms_width < 10) ms_width = 1; else if (ms_width < 100) ms_width = 2; - else ms_width = 3; + else ms_width = 3; qsort(pingv, pingc, sizeof (struct pingcell), &pingcellcmp); diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 107417005..00e60c875 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -12,7 +12,6 @@ /// \brief hardware renderer, using the standard HardWareRender driver DLL for SRB2 #include -#include // qsort #include "../doomstat.h" #include "../doomdef.h" @@ -4252,7 +4251,7 @@ static void HWR_SortVisSprites(void) gr_vsprorder[i] = HWR_GetVisSprite(i); } - qsort(gr_vsprorder, gr_visspritecount, sizeof(gr_vissprite_t*), CompareVisSprites); + qs22j(gr_vsprorder, gr_visspritecount, sizeof(gr_vissprite_t*), CompareVisSprites); } // A drawnode is something that points to a 3D floor, 3D side, or masked diff --git a/src/p_polyobj.c b/src/p_polyobj.c index 7a21497e3..f890b0bd0 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -28,6 +28,7 @@ #include "r_main.h" #include "r_state.h" #include "r_defs.h" +#include "qs22j.h" /* @@ -580,7 +581,7 @@ static void Polyobj_findExplicit(polyobj_t *po) // sort the array if necessary if (numSegItems >= 2) - qsort(segitems, numSegItems, sizeof(segitem_t), Polyobj_segCompare); + qs22j(segitems, numSegItems, sizeof(segitem_t), Polyobj_segCompare); // second loop: put the sorted segs into the polyobject for (i = 0; i < numSegItems; ++i)