- if (!mq_count)
- return;
- for (mq = mq_listhead;mq;mq = mq->next)
- mq->callback(mq->data1, mq->data2);
- mq_count = 0;
- mq_listhead = NULL;
-}
-
-static void R_MeshQueue_EnlargeTransparentArray(int newtotal)
-{
- meshqueue_t *newarray;
- newarray = Mem_Alloc(meshqueuemempool, newtotal * sizeof(meshqueue_t));
- if (mqt_array)
- {
- memcpy(newarray, mqt_array, mqt_total * sizeof(meshqueue_t));
- Mem_Free(mqt_array);
- }
- mqt_array = newarray;
- mqt_total = newtotal;
-}
-
-void R_MeshQueue_Add(void (*callback)(const void *data1, int data2), const void *data1, int data2)
-{
- meshqueue_t *mq, **mqnext;
- if (r_meshqueue_immediaterender.integer)
- {
- callback(data1, data2);
- return;
- }
- if (mq_count >= mq_total)
- R_MeshQueue_Render();
- mq = &mq_array[mq_count++];
- mq->callback = callback;
- mq->data1 = data1;
- mq->data2 = data2;
-
- if (r_meshqueue_sort.integer)