Update to ZDoom r1814:

- Look for files in Mac-like places on Macs.
- Fixed: The non-Windows CreatePath can fail if part of the path already
  exists, because mkdir will return an error code for trying to recreate
  an existing directory.
- Because entryway timed it, here is a new version of R_PointToAngle2 that is
  closer to the original. The old code was shorter but a little slower. The
  new code is a bit faster than the original with VC++ and about the same
  with GCC. Interestingly, GCC produces code for Killough's version that
  performs about the same as the original, but when compiled with VC++,
  Killough's is notably worse.
- moved ENDOOM lump name definition into gameinfo.
- moved default item drop style into gameinfo.
- moved default respawn time into gameinfo.
- moved default inventory max amount into gameinfo.
- turned Heretic's blocking of the sector for LS_Plat_RaiseAndStayTx0 into
  a parameter instead of having the game mode decide. 
- Applied vertical SBARINFO inventory bar patch.
- moved definition of games' default armor icons into gameinfo definition.
- fixed: The PNG loader for true color textures overwrote the IDAT size with
  the IDAT id when reading the image.


git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@450 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2009-09-10 22:20:46 +00:00
parent 7514215c55
commit 0e0da97bbe
33 changed files with 270 additions and 173 deletions

View file

@ -223,6 +223,27 @@ static bool NoInterpolateView;
// CODE --------------------------------------------------------------------
//==========================================================================
//
// SlopeDiv
//
// Utility function, called by R_PointToAngle.
//
//==========================================================================
angle_t SlopeDiv (unsigned int num, unsigned den)
{
unsigned int ans;
if (den < 512)
return (ANG45 - 1); //tantoangle[SLOPERANGE]
ans = (num << 3) / (den >> 8);
return ans <= SLOPERANGE ? tantoangle[ans] : (ANG45 - 1);
}
//==========================================================================
//
// R_PointToAngle
@ -248,65 +269,56 @@ angle_t R_PointToAngle2 (fixed_t x1, fixed_t y1, fixed_t x, fixed_t y)
return 0;
}
fixed_t ax = abs (x);
fixed_t ay = abs (y);
int div;
angle_t angle;
if (ax > ay)
{
swap (ax, ay);
}
div = SlopeDiv (ax, ay);
angle = tantoangle[div];
if (x >= 0)
{
if (y >= 0)
{
if (x > y)
{ // octant 0
return angle;
return SlopeDiv(y, x);
}
else
{ // octant 1
return ANG90 - 1 - angle;
return ANG90 - 1 - SlopeDiv(x, y);
}
}
else // y < 0
{
if (x > -y)
y = -y;
if (x > y)
{ // octant 8
return (angle_t)-(SDWORD)angle;
return 0 - SlopeDiv(y, x);
}
else
{ // octant 7
return ANG270 + angle;
return ANG270 + SlopeDiv(x, y);
}
}
}
else // x < 0
{
x = -x;
if (y >= 0)
{
if (-x > y)
if (x > y)
{ // octant 3
return ANG180 - 1 - angle;
return ANG180 - 1 - SlopeDiv(y, x);
}
else
{ // octant 2
return ANG90 + angle;
return ANG90 + SlopeDiv(x, y);
}
}
else // y < 0
{
if (x < y)
y = -y;
if (x > y)
{ // octant 4
return ANG180 + angle;
return ANG180 + SlopeDiv(y, x);
}
else
{ // octant 5
return ANG270 - 1 - angle;
return ANG270 - 1 - SlopeDiv(x, y);
}
}
}