]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - meshqueue.c
nothing to see here, move along...
[xonotic/darkplaces.git] / meshqueue.c
index fdbb60e9a7b5db9e0734ea72f1aa09f1a324e4dc..f313154442e6922c8b25f19ffe25810bb1dc6ff2 100644 (file)
@@ -21,17 +21,14 @@ meshqueue_t *mq_array, *mqt_array, *mq_listhead;
 int mq_count, mqt_count;
 int mq_total, mqt_total;
 
-mempool_t *meshqueuemempool;
-
 void R_MeshQueue_Init(void)
 {
        Cvar_RegisterVariable(&r_meshqueue_entries);
        Cvar_RegisterVariable(&r_meshqueue_immediaterender);
        Cvar_RegisterVariable(&r_meshqueue_sort);
 
-       meshqueuemempool = Mem_AllocPool("R_MeshQueue");
        mq_total = 0;
-       mqt_total = 1000;
+       mqt_total = 0;
        mq_array = NULL;
        mqt_array = NULL;
 }
@@ -50,7 +47,7 @@ void R_MeshQueue_Render(void)
 static void R_MeshQueue_EnlargeTransparentArray(int newtotal)
 {
        meshqueue_t *newarray;
-       newarray = Mem_Alloc(meshqueuemempool, newtotal * sizeof(meshqueue_t));
+       newarray = Mem_Alloc(cl_mempool, newtotal * sizeof(meshqueue_t));
        if (mqt_array)
        {
                memcpy(newarray, mqt_array, mqt_total * sizeof(meshqueue_t));
@@ -112,7 +109,7 @@ void R_MeshQueue_AddTransparent(const vec3_t center, void (*callback)(const void
        mq->callback = callback;
        mq->data1 = data1;
        mq->data2 = data2;
-       mq->dist = DotProduct(center, vpn) - mqt_viewplanedist;
+       mq->dist = DotProduct(center, r_viewforward) - mqt_viewplanedist;
        mq->next = NULL;
 }
 
@@ -158,16 +155,16 @@ void R_MeshQueue_BeginScene(void)
                mq_total = r_meshqueue_entries.integer;
                if (mq_array)
                        Mem_Free(mq_array);
-               mq_array = Mem_Alloc(meshqueuemempool, mq_total * sizeof(meshqueue_t));
+               mq_array = Mem_Alloc(cl_mempool, mq_total * sizeof(meshqueue_t));
        }
 
        if (mqt_array == NULL)
-               mqt_array = Mem_Alloc(meshqueuemempool, mqt_total * sizeof(meshqueue_t));
+               mqt_array = Mem_Alloc(cl_mempool, mqt_total * sizeof(meshqueue_t));
 
        mq_count = 0;
        mqt_count = 0;
        mq_listhead = NULL;
-       mqt_viewplanedist = DotProduct(r_origin, vpn);
+       mqt_viewplanedist = DotProduct(r_vieworigin, r_viewforward);
 }
 
 void R_MeshQueue_EndScene(void)