mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-28 18:00:40 +00:00
- avoid using widthBits and heightBits outside of engine code.
This commit is contained in:
parent
f24786af71
commit
51115e75df
1 changed files with 24 additions and 24 deletions
|
@ -280,34 +280,34 @@ void DoSectorPanning(void)
|
||||||
if (pXSector->panFloor) // Floor
|
if (pXSector->panFloor) // Floor
|
||||||
{
|
{
|
||||||
int nTile = pSector->floorpicnum;
|
int nTile = pSector->floorpicnum;
|
||||||
int px = (pSector->floorxpanning<<8)+pXSector->floorXPanFrac;
|
int px = (pSector->floorxpanning << 8) + pXSector->floorXPanFrac;
|
||||||
int py = (pSector->floorypanning<<8)+pXSector->floorYPanFrac;
|
int py = (pSector->floorypanning << 8) + pXSector->floorYPanFrac;
|
||||||
if (pSector->floorstat&64)
|
if (pSector->floorstat & 64)
|
||||||
angle -= 512;
|
angle -= 512;
|
||||||
int xBits = (widthBits(nTile))-((pSector->floorstat&8)!=0);
|
int xBits = tileWidth(nTile) >> int((pSector->floorstat & 8) != 0);
|
||||||
px += mulscale30(speed<<2, Cos(angle))>>xBits;
|
px += mulscale30(speed << 2, Cos(angle)) / xBits;
|
||||||
int yBits = (heightBits(nTile))-((pSector->floorstat&8)!=0);
|
int yBits = tileHeight(nTile) >> int((pSector->floorstat & 8) != 0);
|
||||||
py -= mulscale30(speed<<2, Sin(angle))>>yBits;
|
py -= mulscale30(speed << 2, Sin(angle)) / yBits;
|
||||||
pSector->floorxpanning = px>>8;
|
pSector->floorxpanning = px >> 8;
|
||||||
pSector->floorypanning = py>>8;
|
pSector->floorypanning = py >> 8;
|
||||||
pXSector->floorXPanFrac = px&255;
|
pXSector->floorXPanFrac = px & 255;
|
||||||
pXSector->floorYPanFrac = py&255;
|
pXSector->floorYPanFrac = py & 255;
|
||||||
}
|
}
|
||||||
if (pXSector->panCeiling) // Ceiling
|
if (pXSector->panCeiling) // Ceiling
|
||||||
{
|
{
|
||||||
int nTile = pSector->ceilingpicnum;
|
int nTile = pSector->ceilingpicnum;
|
||||||
int px = (pSector->ceilingxpanning<<8)+pXSector->ceilXPanFrac;
|
int px = (pSector->ceilingxpanning << 8) + pXSector->ceilXPanFrac;
|
||||||
int py = (pSector->ceilingypanning<<8)+pXSector->ceilYPanFrac;
|
int py = (pSector->ceilingypanning << 8) + pXSector->ceilYPanFrac;
|
||||||
if (pSector->ceilingstat&64)
|
if (pSector->ceilingstat & 64)
|
||||||
angle -= 512;
|
angle -= 512;
|
||||||
int xBits = (widthBits(nTile))-((pSector->ceilingstat&8)!=0);
|
int xBits = tileWidth(nTile) >> int((pSector->floorstat & 8) != 0);
|
||||||
px += mulscale30(speed<<2, Cos(angle))>>xBits;
|
px += mulscale30(speed << 2, Cos(angle)) / xBits;
|
||||||
int yBits = (heightBits(nTile))-((pSector->ceilingstat&8)!=0);
|
int yBits = tileHeight(nTile) >> int((pSector->floorstat & 8) != 0);
|
||||||
py -= mulscale30(speed<<2, Sin(angle))>>yBits;
|
py -= mulscale30(speed << 2, Sin(angle)) / yBits;
|
||||||
pSector->ceilingxpanning = px>>8;
|
pSector->ceilingxpanning = px >> 8;
|
||||||
pSector->ceilingypanning = py>>8;
|
pSector->ceilingypanning = py >> 8;
|
||||||
pXSector->ceilXPanFrac = px&255;
|
pXSector->ceilXPanFrac = px & 255;
|
||||||
pXSector->ceilYPanFrac = py&255;
|
pXSector->ceilYPanFrac = py & 255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,8 +329,8 @@ void DoSectorPanning(void)
|
||||||
int nTile = wall[nWall].picnum;
|
int nTile = wall[nWall].picnum;
|
||||||
int px = (wall[nWall].xpanning<<8)+pXWall->xpanFrac;
|
int px = (wall[nWall].xpanning<<8)+pXWall->xpanFrac;
|
||||||
int py = (wall[nWall].ypanning<<8)+pXWall->ypanFrac;
|
int py = (wall[nWall].ypanning<<8)+pXWall->ypanFrac;
|
||||||
px += (psx << 2) >> widthBits(nTile);
|
px += (psx << 2) / tileWidth(nTile);
|
||||||
py += (psy << 2) >> heightBits(nTile);
|
py += (psy << 2) / tileHeight(nTile);
|
||||||
wall[nWall].xpanning = px>>8;
|
wall[nWall].xpanning = px>>8;
|
||||||
wall[nWall].ypanning = py>>8;
|
wall[nWall].ypanning = py>>8;
|
||||||
pXWall->xpanFrac = px&255;
|
pXWall->xpanFrac = px&255;
|
||||||
|
|
Loading…
Reference in a new issue