[qfvis] Add set debug prints (disabled)

They were useful for narrowing down why mightsee wasn't being updated.
This commit is contained in:
Bill Currie 2021-03-28 21:11:13 +09:00
parent 9f42943589
commit 634219ea06
2 changed files with 14 additions and 0 deletions

View File

@ -73,6 +73,7 @@ extern pthread_rwlock_t *portal_locks;
#endif
#include "QF/cmem.h"
#include "QF/dstring.h"
#include "QF/set.h"
#include "QF/simd/vec4f.h"
@ -174,6 +175,7 @@ typedef struct threaddata_s {
sep_t *sep_freelist; ///< per-thread list of free separators
winding_t *winding_freelist; ///< per-thread list of free windings
memsuper_t *memsuper; ///< per-thread memory pool
dstring_t *str;
set_pool_t set_pool;
int id;
int winding_id;

View File

@ -474,6 +474,16 @@ PortalCompleted (threaddata_t *thread, portal_t *completed)
continue;
set_assign (changed, portal->mightsee);
set_difference (changed, portal->visbits);
#if 0
dstring_copystr (thread->str, "mightsee: ");
set_as_string_r (thread->str, portal->mightsee);
dstring_appendstr (thread->str, "\nvisbits: ");
set_as_string_r (thread->str, portal->visbits);
dstring_appendstr (thread->str, "\nchanged: ");
set_as_string_r (thread->str, changed);
dstring_appendstr (thread->str, "\n");
write (0, thread->str->str, thread->str->size - 1);
#endif
for (j = 0; j < cluster->numportals; j++) {
if (j == i)
continue;
@ -550,6 +560,7 @@ LeafThread (void *_thread)
set_pool_init (&data.set_pool);
data.id = thread;
data.memsuper = new_memsuper ();
data.str = dstring_new ();
do {
portal = GetNextPortal (1);
if (!portal)
@ -593,6 +604,7 @@ LeafThread (void *_thread)
if (working)
working[thread] = -1;
delete_memsuper (data.memsuper);
dstring_delete (data.str);
return NULL;
}