Remove unnecessary Z_Calloc from HWR_AddPolyObjectSegs
https://github.com/Indev450/SRB2Kart-Saturn/pull/78
This commit is contained in:
parent
e6913db517
commit
7a186c057d
1 changed files with 11 additions and 16 deletions
|
|
@ -2438,9 +2438,9 @@ static boolean HWR_CheckBBox(const fixed_t *bspcoord)
|
|||
static inline void HWR_AddPolyObjectSegs(void)
|
||||
{
|
||||
size_t i, j;
|
||||
seg_t *gl_fakeline = Z_Calloc(sizeof(seg_t), PU_STATIC, NULL);
|
||||
polyvertex_t *pv1 = Z_Calloc(sizeof(polyvertex_t), PU_STATIC, NULL);
|
||||
polyvertex_t *pv2 = Z_Calloc(sizeof(polyvertex_t), PU_STATIC, NULL);
|
||||
seg_t gl_fakeline;
|
||||
polyvertex_t pv1;
|
||||
polyvertex_t pv2;
|
||||
|
||||
// Sort through all the polyobjects
|
||||
for (i = 0; i < numpolys; ++i)
|
||||
|
|
@ -2449,25 +2449,20 @@ static inline void HWR_AddPolyObjectSegs(void)
|
|||
for (j = 0; j < po_ptrs[i]->segCount; ++j)
|
||||
{
|
||||
// Copy the info of a polyobject's seg, then convert it to OpenGL floating point
|
||||
M_Memcpy(gl_fakeline, po_ptrs[i]->segs[j], sizeof(seg_t));
|
||||
M_Memcpy(&gl_fakeline, po_ptrs[i]->segs[j], sizeof(seg_t));
|
||||
|
||||
// Now convert the line to float and add it to be rendered
|
||||
pv1->x = FIXED_TO_FLOAT(gl_fakeline->v1->x);
|
||||
pv1->y = FIXED_TO_FLOAT(gl_fakeline->v1->y);
|
||||
pv2->x = FIXED_TO_FLOAT(gl_fakeline->v2->x);
|
||||
pv2->y = FIXED_TO_FLOAT(gl_fakeline->v2->y);
|
||||
pv1.x = FIXED_TO_FLOAT(gl_fakeline.v1->x);
|
||||
pv1.y = FIXED_TO_FLOAT(gl_fakeline.v1->y);
|
||||
pv2.x = FIXED_TO_FLOAT(gl_fakeline.v2->x);
|
||||
pv2.y = FIXED_TO_FLOAT(gl_fakeline.v2->y);
|
||||
|
||||
gl_fakeline->pv1 = pv1;
|
||||
gl_fakeline->pv2 = pv2;
|
||||
gl_fakeline.pv1 = &pv1;
|
||||
gl_fakeline.pv2 = &pv2;
|
||||
|
||||
HWR_AddLine(gl_fakeline);
|
||||
HWR_AddLine(&gl_fakeline);
|
||||
}
|
||||
}
|
||||
|
||||
// Free temporary data no longer needed
|
||||
Z_Free(pv2);
|
||||
Z_Free(pv1);
|
||||
Z_Free(gl_fakeline);
|
||||
}
|
||||
|
||||
static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t fixedheight,
|
||||
|
|
|
|||
Loading…
Reference in a new issue