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. // 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, spr->xscale, FLOAT2FIXED(spr->yscale), spr->voxel, spr->Style.colormap, cliptop, clipbot,
minslabz, maxslabz, flags); minslabz, maxslabz, flags);
@ -1033,8 +1033,8 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
vis->angle -= ang.BAMs(); vis->angle -= ang.BAMs();
} }
vis->vpos = { (float)ViewPos.X, (float)ViewPos.Y, (float)ViewPos.Z }; vis->pa.vpos = { (float)ViewPos.X, (float)ViewPos.Y, (float)ViewPos.Z };
vis->vang = FAngle((float)ViewAngle.Degrees); vis->pa.vang = FAngle((float)ViewAngle.Degrees);
} }
// killough 3/27/98: save sector for special clipping later // 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) if (avisp[0] == NULL)
{ {
for (int i = 0; i < countof(avis); ++i) for (unsigned i = 0; i < countof(avis); ++i)
{ {
avisp[i] = &avis[i]; avisp[i] = &avis[i];
} }

View file

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