mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
Replace MERGE_NODES macro with vsmerge() function
git-svn-id: https://svn.eduke32.com/eduke32@8715 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/build/src/polymost.cpp
This commit is contained in:
parent
05b59467f5
commit
8def930980
1 changed files with 15 additions and 19 deletions
|
@ -611,16 +611,7 @@ static inline void yax_vsp_finalize_init(int32_t const yaxbunch, int32_t const v
|
|||
#define COMBINE_STRIPS
|
||||
|
||||
#ifdef COMBINE_STRIPS
|
||||
|
||||
#define MERGE_NODES(i, ni) \
|
||||
do \
|
||||
{ \
|
||||
vsp[i].cy[1] = vsp[ni].cy[1]; \
|
||||
vsp[i].fy[1] = vsp[ni].fy[1]; \
|
||||
vsdel(ni); \
|
||||
} while (0);
|
||||
|
||||
static inline void vsdel(int32_t const i)
|
||||
static inline void vsdel(int const i)
|
||||
{
|
||||
//Delete i
|
||||
int const pi = vsp[i].p;
|
||||
|
@ -635,8 +626,16 @@ static inline void vsdel(int32_t const i)
|
|||
vsp[vsp[VSPMAX-1].n].p = i;
|
||||
vsp[VSPMAX-1].n = i;
|
||||
}
|
||||
|
||||
static inline void vsmerge(int const i, int const ni)
|
||||
{
|
||||
vsp[i].cy[1] = vsp[ni].cy[1];
|
||||
vsp[i].fy[1] = vsp[ni].fy[1];
|
||||
vsdel(ni);
|
||||
}
|
||||
|
||||
# ifdef YAX_ENABLE
|
||||
static inline void yax_vsdel(int32_t const yaxbunch, int32_t const i)
|
||||
static inline void yax_vsdel(int const yaxbunch, int const i)
|
||||
{
|
||||
//Delete i
|
||||
int const pi = yax_vsp[yaxbunch][i].p;
|
||||
|
@ -654,7 +653,7 @@ static inline void yax_vsdel(int32_t const yaxbunch, int32_t const i)
|
|||
# endif
|
||||
#endif
|
||||
|
||||
static inline int32_t vsinsaft(int32_t const i)
|
||||
static inline int32_t vsinsaft(int const i)
|
||||
{
|
||||
//i = next element from empty list
|
||||
int32_t const r = vsp[VSPMAX-1].n;
|
||||
|
@ -671,9 +670,7 @@ static inline int32_t vsinsaft(int32_t const i)
|
|||
}
|
||||
|
||||
#ifdef YAX_ENABLE
|
||||
|
||||
|
||||
static inline int32_t yax_vsinsaft(int32_t const yaxbunch, int32_t const i)
|
||||
static inline int32_t yax_vsinsaft(int const yaxbunch, int const i)
|
||||
{
|
||||
//i = next element from empty list
|
||||
int32_t const r = yax_vsp[yaxbunch][VSPMAX - 1].n;
|
||||
|
@ -1146,7 +1143,7 @@ skip: ;
|
|||
{
|
||||
if ((vsp[i].ctag == vsp[ni].ctag) && (vsp[i].ftag == vsp[ni].ftag))
|
||||
{
|
||||
MERGE_NODES(i, ni);
|
||||
vsmerge(i, ni);
|
||||
continue;
|
||||
}
|
||||
if (vsp[ni].x - vsp[i].x < DOMOST_OFFSET)
|
||||
|
@ -1156,7 +1153,7 @@ skip: ;
|
|||
vsp[i].fy[0] = vsp[ni].fy[0];
|
||||
vsp[i].ctag = vsp[ni].ctag;
|
||||
vsp[i].ftag = vsp[ni].ftag;
|
||||
MERGE_NODES(i, ni);
|
||||
vsmerge(i, ni);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -3333,7 +3330,7 @@ void polymost_drawrooms()
|
|||
|
||||
if (Bfabsf(cslop[0]*dx-cslop[1]*dx2) < 0.001f && Bfabsf(fslop[0]*dx-fslop[1]*dx2) < 0.001f)
|
||||
{
|
||||
MERGE_NODES(i, ni);
|
||||
vsmerge(i, ni);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -3341,7 +3338,6 @@ void polymost_drawrooms()
|
|||
i = ni;
|
||||
}
|
||||
while (i);
|
||||
#undef MERGE_NODES
|
||||
#endif
|
||||
}
|
||||
//else if (!g_nodraw) { videoEndDrawing(); return; }
|
||||
|
|
Loading…
Reference in a new issue