From c92432984302cadeace9dc289d72e88b5f6e0033 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 7 May 2022 14:35:03 +0900 Subject: [PATCH] [scene] Use same id for entity queue test and add This fixes the multiple draws of the same entity. Should be a small speedup for all renderers :) --- include/QF/scene/entity.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/QF/scene/entity.h b/include/QF/scene/entity.h index 2345ac3e2..373c81f1a 100644 --- a/include/QF/scene/entity.h +++ b/include/QF/scene/entity.h @@ -113,9 +113,10 @@ ENTINLINE void EntQueue_AddEntity (entqueue_t *queue, entity_t *ent, int queue_num) { - if (!set_is_member (queue->queued_ents, ent->id)) { + int id = -ent->id;//FIXME use ~ + if (!set_is_member (queue->queued_ents, id)) { // entity ids are negative (ones-complement) - set_add (queue->queued_ents, -ent->id);//FIXME use ~ + set_add (queue->queued_ents, id); DARRAY_APPEND (&queue->ent_queues[queue_num], ent); } }