Fix compilation with GCC

- GCC is pickier than Visual C++. GCC requires that structs with constructors, etc that are
  used in a union must be defined outside the union. VC++ lets you do it inline.
This commit is contained in:
Randy Heit 2016-04-23 20:58:09 -05:00
parent 991f49e321
commit 3cabd5f0ed
2 changed files with 12 additions and 13 deletions

View File

@ -678,7 +678,7 @@ void R_DrawVisVoxel(vissprite_t *spr, int minslabz, int maxslabz, short *cliptop
}
// Render the voxel, either directly to the screen or offscreen.
R_DrawVoxel(spr->vpos, spr->vang, spr->gpos, spr->angle,
R_DrawVoxel(spr->pa.vpos, spr->pa.vang, spr->gpos, spr->angle,
spr->xscale, FLOAT2FIXED(spr->yscale), spr->voxel, spr->Style.colormap, cliptop, clipbot,
minslabz, maxslabz, flags);
@ -1033,8 +1033,8 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
vis->angle -= ang.BAMs();
}
vis->vpos = { (float)ViewPos.X, (float)ViewPos.Y, (float)ViewPos.Z };
vis->vang = FAngle((float)ViewAngle.Degrees);
vis->pa.vpos = { (float)ViewPos.X, (float)ViewPos.Y, (float)ViewPos.Z };
vis->pa.vang = FAngle((float)ViewAngle.Degrees);
}
// killough 3/27/98: save sector for special clipping later
@ -1292,7 +1292,7 @@ void R_DrawPSprite (pspdef_t* psp, int pspnum, AActor *owner, double sx, double
if (avisp[0] == NULL)
{
for (int i = 0; i < countof(avis); ++i)
for (unsigned i = 0; i < countof(avis); ++i)
{
avisp[i] = &avis[i];
}

View File

@ -31,6 +31,12 @@
struct vissprite_t
{
struct posang
{
FVector3 vpos; // view origin
FAngle vang; // view angle
};
short x1, x2;
FVector3 gpos; // origin in world coordinates
union
@ -61,16 +67,9 @@ struct vissprite_t
fixed_t xiscale; // negative if flipped
};
// Used by wall sprites
struct
{
FWallCoords wallc;
};
// Used by voxels
struct
{
FVector3 vpos; // view origin
FAngle vang; // view angle
};
posang pa;
};
sector_t *heightsec; // killough 3/27/98: height sector for underwater/fake ceiling
sector_t *sector; // [RH] sector this sprite is in