From 4fd17489a5e7d98ad2712409b6cde3c2f3feb6e3 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 24 Apr 2023 15:14:17 -0700 Subject: [PATCH 1/2] debugwaypoints: cull debug mobjs outside of drawdist --- src/k_waypoint.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/k_waypoint.cpp b/src/k_waypoint.cpp index 191a751ba..0e6919915 100644 --- a/src/k_waypoint.cpp +++ b/src/k_waypoint.cpp @@ -650,6 +650,13 @@ void K_DebugWaypointsVisualise(void) // Hunt through the waypointcap so we can show all waypoint mobjs and not just ones that were able to be graphed for (waypointmobj = waypointcap; waypointmobj != NULL; waypointmobj = waypointmobj->tracer) { + // If this waypoint is outside of draw distance, don't spawn all the debug crap because it is SLOW + if (cv_drawdist.value != 0 && + R_PointToDist(waypointmobj->x, waypointmobj->y) > cv_drawdist.value * mapobjectscale) + { + continue; + } + waypoint = K_SearchWaypointHeapForMobj(waypointmobj); debugmobj = P_SpawnMobj(waypointmobj->x, waypointmobj->y, waypointmobj->z, MT_SPARK); From 3272b3a284c15931d3a0b4790c4728ccdee10977 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 24 Apr 2023 15:35:02 -0700 Subject: [PATCH 2/2] Do not include MT_SPARK in netsave --- src/deh_tables.c | 2 +- src/info.h | 2 +- src/p_saveg.c | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index b5746272d..b0a8492d7 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5300,7 +5300,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_SKYBOX", // Debris - "MT_SPARK", //spark + "MT_SPARK", //spark, only used for debugging, actually "MT_EXPLODE", // Robot Explosion "MT_UWEXPLODE", // Underwater Explosion "MT_DUST", diff --git a/src/info.h b/src/info.h index d80c9798a..62fbbc8b4 100644 --- a/src/info.h +++ b/src/info.h @@ -6381,7 +6381,7 @@ typedef enum mobj_type MT_SKYBOX, // Debris - MT_SPARK, //spark + MT_SPARK, //spark, only used for debugging, actually MT_EXPLODE, // Robot Explosion MT_UWEXPLODE, // Underwater Explosion MT_DUST, diff --git a/src/p_saveg.c b/src/p_saveg.c index b80b86c62..e4813b3a1 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2283,6 +2283,10 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8 if (mobj->type == MT_HOOPCENTER && mobj->threshold == 4242) return; + // MT_SPARK: used for debug stuff + if (mobj->type == MT_SPARK) + return; + if (mobj->spawnpoint) { // spawnpoint is not modified but we must save it since it is an identifier @@ -4815,7 +4819,9 @@ static void P_RelinkPointers(void) mobj = (mobj_t *)currentthinker; - if (mobj->type == MT_HOOP || mobj->type == MT_HOOPCOLLIDE || mobj->type == MT_HOOPCENTER) + if (mobj->type == MT_HOOP || mobj->type == MT_HOOPCOLLIDE || mobj->type == MT_HOOPCENTER + // MT_SPARK: used for debug stuff + || mobj->type == MT_SPARK) continue; if (mobj->tracer) @@ -5537,7 +5543,9 @@ void P_SaveNetGame(savebuffer_t *save, boolean resending) continue; mobj = (mobj_t *)th; - if (mobj->type == MT_HOOP || mobj->type == MT_HOOPCOLLIDE || mobj->type == MT_HOOPCENTER) + if (mobj->type == MT_HOOP || mobj->type == MT_HOOPCOLLIDE || mobj->type == MT_HOOPCENTER + // MT_SPARK: used for debug stuff + || mobj->type == MT_SPARK) continue; mobj->mobjnum = i++; }