mirror of
https://github.com/DrBeef/Raze.git
synced 2025-03-11 03:31:43 +00:00
- clean up angle math in wall drawer.
This commit is contained in:
parent
7a9f89b95d
commit
9d1edf9cc5
1 changed files with 5 additions and 6 deletions
|
@ -61,15 +61,14 @@ static walltype* IsOnWall(tspritetype* tspr, int height, DVector2& outpos)
|
|||
for(auto& wal : wallsofsector(sect))
|
||||
{
|
||||
// Intentionally include two sided walls. Even on them the sprite should be projected onto the wall for better results.
|
||||
auto d = wal.int_delta();
|
||||
int walang = getangle(d.X, d.Y);
|
||||
int deltaang = abs((((walang - tspr->int_ang()) & 2047) << 21) >> 21);
|
||||
const int maxangdelta = 1;
|
||||
auto d = wal.delta();
|
||||
auto deltaang = absangle(VecToAngle(d), tspr->angle);
|
||||
const DAngle maxangdelta = DAngle360 / 2048;
|
||||
|
||||
// angle of the sprite must either be the wall's normal or the negative wall's normal to be aligned.
|
||||
if (deltaang >= 512 - maxangdelta && deltaang <= 512 + maxangdelta)
|
||||
if (deltaang >= DAngle90 - maxangdelta && deltaang <= DAngle90 + maxangdelta)
|
||||
{
|
||||
if (!((tspr->int_ang()) & 510))
|
||||
if (!((tspr->angle.Buildang()) & 510))
|
||||
{
|
||||
// orthogonal lines do not check the actual position so that certain off-sector sprites get handled properly.
|
||||
// In Wanton Destruction's airplane level there's such a sprite assigned to the wrong sector.
|
||||
|
|
Loading…
Reference in a new issue