declare pv1 and pv2 properly as polyvertex_t
this most likely was done due to issues with header includes this saves an absolute crapton of pointless casts and type conversions
This commit is contained in:
1 parent
10df0789e7
commit
abb4aa7af6
4 files changed
+26
-25
No files matched your search
@@ -70,7 +70,7 @@ static INT32 totalsubsecpolys = 0;
|
||||
static poly_t *HWR_AllocPoly(INT32 numpts)
|
||||
{
|
||||
poly_t *p;
|
||||
size_t size = sizeof (poly_t) + sizeof (polyvertex_t) * numpts;
|
||||
size_t size = sizeof(poly_t) + sizeof(polyvertex_t) * numpts;
|
||||
p = Z_Malloc(size, PU_HWRPLANE, NULL);
|
||||
p->numpts = numpts;
|
||||
return p;
|
||||
@@ -79,7 +79,7 @@ static poly_t *HWR_AllocPoly(INT32 numpts)
|
||||
static polyvertex_t *HWR_AllocVertex(void)
|
||||
{
|
||||
polyvertex_t *p;
|
||||
size_t size = sizeof (polyvertex_t);
|
||||
size_t size = sizeof(polyvertex_t);
|
||||
p = Z_Malloc(size, PU_HWRPLANE, NULL);
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef _HWR_DEFS_
|
||||
#define _HWR_DEFS_
|
||||
#include "../doomtype.h"
|
||||
#include "../r_defs.h"
|
||||
#include "../m_fixed.h"
|
||||
|
||||
#define ZCLIP_PLANE 4.0f // Used for the actual game drawing
|
||||
#define NZCLIP_PLANE 0.9f // Seems to be only used for the HUD and screen textures
|
||||
|
||||
+20
-20
@@ -787,8 +787,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
|
||||
if (line->pv1)
|
||||
{
|
||||
x1 = ((polyvertex_t *)line->pv1)->x;
|
||||
y1 = ((polyvertex_t *)line->pv1)->y;
|
||||
x1 = line->pv1->x;
|
||||
y1 = line->pv1->y;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -797,8 +797,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
|
||||
if (line->pv2)
|
||||
{
|
||||
xd = ((polyvertex_t *)line->pv2)->x - x1;
|
||||
yd = ((polyvertex_t *)line->pv2)->y - y1;
|
||||
xd = line->pv2->x - x1;
|
||||
yd = line->pv2->y - y1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -868,11 +868,11 @@ static void HWR_DrawSegsSplats(FSurfaceInfo * pSurf)
|
||||
|
||||
M_ClearBox(segbbox);
|
||||
M_AddToBox(segbbox,
|
||||
FloatToFixed(((polyvertex_t *)gl_curline->pv1)->x),
|
||||
FloatToFixed(((polyvertex_t *)gl_curline->pv1)->y));
|
||||
FloatToFixed(gl_curline->pv1->x),
|
||||
FloatToFixed(gl_curline->pv1->y));
|
||||
M_AddToBox(segbbox,
|
||||
FloatToFixed(((polyvertex_t *)gl_curline->pv2)->x),
|
||||
FloatToFixed(((polyvertex_t *)gl_curline->pv2)->y));
|
||||
FloatToFixed(gl_curline->pv2->x),
|
||||
FloatToFixed(gl_curline->pv2->y));
|
||||
|
||||
splat = (wallsplat_t *)gl_curline->linedef->splats;
|
||||
for (; splat; splat = splat->next)
|
||||
@@ -1369,8 +1369,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
|
||||
if (LIKELY(gl_curline->pv1))
|
||||
{
|
||||
vs.x = ((polyvertex_t *)gl_curline->pv1)->x;
|
||||
vs.y = ((polyvertex_t *)gl_curline->pv1)->y;
|
||||
vs.x = gl_curline->pv1->x;
|
||||
vs.y = gl_curline->pv1->y;
|
||||
v1x = FloatToFixed(vs.x);
|
||||
v1y = FloatToFixed(vs.y);
|
||||
}
|
||||
@@ -1384,8 +1384,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
||||
|
||||
if (LIKELY(gl_curline->pv2))
|
||||
{
|
||||
ve.x = ((polyvertex_t *)gl_curline->pv2)->x;
|
||||
ve.y = ((polyvertex_t *)gl_curline->pv2)->y;
|
||||
ve.x = gl_curline->pv2->x;
|
||||
ve.y = gl_curline->pv2->y;
|
||||
v2x = FloatToFixed(ve.x);
|
||||
v2y = FloatToFixed(ve.y);
|
||||
}
|
||||
@@ -2248,8 +2248,8 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector)
|
||||
|
||||
if (LIKELY(gl_curline->pv1))
|
||||
{
|
||||
v1x = FloatToFixed(((polyvertex_t *)gl_curline->pv1)->x);
|
||||
v1y = FloatToFixed(((polyvertex_t *)gl_curline->pv1)->y);
|
||||
v1x = FloatToFixed(gl_curline->pv1->x);
|
||||
v1y = FloatToFixed(gl_curline->pv1->y);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2259,8 +2259,8 @@ static boolean CheckClip(sector_t * afrontsector, sector_t * abacksector)
|
||||
|
||||
if (LIKELY(gl_curline->pv2))
|
||||
{
|
||||
v2x = FloatToFixed(((polyvertex_t *)gl_curline->pv2)->x);
|
||||
v2y = FloatToFixed(((polyvertex_t *)gl_curline->pv2)->y);
|
||||
v2x = FloatToFixed(gl_curline->pv2->x);
|
||||
v2y = FloatToFixed(gl_curline->pv2->y);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2476,8 +2476,8 @@ static void HWR_AddLine(seg_t *line)
|
||||
|
||||
if (LIKELY(gl_curline->pv1))
|
||||
{
|
||||
v1x = FloatToFixed(((polyvertex_t *)gl_curline->pv1)->x);
|
||||
v1y = FloatToFixed(((polyvertex_t *)gl_curline->pv1)->y);
|
||||
v1x = FloatToFixed(gl_curline->pv1->x);
|
||||
v1y = FloatToFixed(gl_curline->pv1->y);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2487,8 +2487,8 @@ static void HWR_AddLine(seg_t *line)
|
||||
|
||||
if (LIKELY(gl_curline->pv2))
|
||||
{
|
||||
v2x = FloatToFixed(((polyvertex_t *)gl_curline->pv2)->x);
|
||||
v2y = FloatToFixed(((polyvertex_t *)gl_curline->pv2)->y);
|
||||
v2x = FloatToFixed(gl_curline->pv2->x);
|
||||
v2y = FloatToFixed(gl_curline->pv2->y);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+3
-2
@@ -15,6 +15,7 @@
|
||||
#define __R_DEFS__
|
||||
|
||||
// Some more or less basic data types we depend on.
|
||||
#include "hardware/hw_defs.h"
|
||||
#include "m_fixed.h"
|
||||
|
||||
// We rely on the thinker data struct to handle sound origins in sectors.
|
||||
@@ -545,8 +546,8 @@ typedef struct seg_s
|
||||
fixed_t length; // precalculated seg length
|
||||
#ifdef HWRENDER
|
||||
// new pointers so that AdjustSegs doesn't mess with v1/v2
|
||||
void *pv1; // polyvertex_t
|
||||
void *pv2; // polyvertex_t
|
||||
polyvertex_t *pv1; // polyvertex_t
|
||||
polyvertex_t *pv2; // polyvertex_t
|
||||
float flength; // length of the seg, used by hardware renderer
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user