int surfacenumber;
const rtlight_t *rtlight;
float dist;
- meshqueue_sortcategory_t category;
+ dptransparentsortcategory_t category;
}
meshqueue_t;
mqt_viewmaxdist = 0;
}
-void R_MeshQueue_AddTransparent(meshqueue_sortcategory_t category, const vec3_t center, void (*callback)(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist), const entity_render_t *ent, int surfacenumber, const rtlight_t *rtlight)
+void R_MeshQueue_AddTransparent(dptransparentsortcategory_t category, const vec3_t center, void (*callback)(const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist), const entity_render_t *ent, int surfacenumber, const rtlight_t *rtlight)
{
meshqueue_t *mq;
if (mqt_count >= mqt_total || !mqt_array)
trans_sortarraysize = r_transparent_sortarraysize.integer;
if (trans_hash)
Mem_Free(trans_hash);
- trans_hash = (meshqueue_t **)Mem_Alloc(cls.permanentmempool, sizeof(trans_hash) * trans_sortarraysize);
+ trans_hash = (meshqueue_t **)Mem_Alloc(cls.permanentmempool, sizeof(meshqueue_t *) * trans_sortarraysize);
if (trans_hashpointer)
Mem_Free(trans_hashpointer);
- trans_hashpointer = (meshqueue_t ***)Mem_Alloc(cls.permanentmempool, sizeof(trans_hashpointer) * trans_sortarraysize);
+ trans_hashpointer = (meshqueue_t ***)Mem_Alloc(cls.permanentmempool, sizeof(meshqueue_t **) * trans_sortarraysize);
}
// build index
- memset(trans_hash, 0, sizeof(trans_hash) * trans_sortarraysize);
+ memset(trans_hash, 0, sizeof(meshqueue_t *) * trans_sortarraysize);
for (i = 0; i < trans_sortarraysize; i++)
trans_hashpointer[i] = &trans_hash[i];
distscale = (trans_sortarraysize - 1) / min(mqt_viewmaxdist, r_transparent_sortmaxdist.integer);
switch(mqt->category)
{
default:
- case MESHQUEUE_SORT_HUD:
+ case TRANSPARENTSORT_HUD:
hashindex = 0;
break;
- case MESHQUEUE_SORT_DISTANCE:
+ case TRANSPARENTSORT_DISTANCE:
// this could use a reduced range if we need more categories
hashindex = bound(0, (int)(bound(0, mqt->dist - r_transparent_sortmindist.integer, r_transparent_sortmaxdist.integer) * distscale), maxhashindex);
break;
- case MESHQUEUE_SORT_SKY:
+ case TRANSPARENTSORT_SKY:
hashindex = maxhashindex;
break;
}