* Updated to ZDoom r2739:

- Added Entryway's AM_Rotate optimization.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@947 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2010-09-11 12:48:38 +00:00
parent b5921fb5ce
commit 26a3adc3b7
3 changed files with 16 additions and 8 deletions

View file

@ -1940,12 +1940,20 @@ void AM_drawWalls (bool allmap)
void AM_rotate(fixed_t *xp, fixed_t *yp, angle_t a)
{
static angle_t angle_saved = 0;
static double sinrot = 0;
static double cosrot = 1;
if (angle_saved != a)
{
angle_saved = a;
double rot = (double)a / (double)(1u << 31) * (double)M_PI;
sinrot = sin(rot);
cosrot = cos(rot);
}
double x = FIXED2FLOAT(*xp);
double y = FIXED2FLOAT(*yp);
double rot = (double)a / (double)(1u << 31) * (double)M_PI;
double sinrot = sin(rot);
double cosrot = cos(rot);
double tmpx = (x * cosrot) - (y * sinrot);
y = (x * sinrot) + (y * cosrot);
x = tmpx;