diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index f3adcc6b7..dd149e1ff 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -510,22 +510,6 @@ void dragpoint(walltype* startwall, const DVector2& pos) // //========================================================================== -DVector2 rotatepoint(const DVector2& pivot, const DVector2& point, DAngle angle) -{ - auto cosang = angle.Cos(); - auto sinang = angle.Sin(); - auto p = point - pivot; - return { - p.X * cosang - p.Y * sinang + pivot.X, - p.Y * cosang + p.X * sinang + pivot.Y }; -} - -//========================================================================== -// -// -// -//========================================================================== - int inside(double x, double y, const sectortype* sect) { if (sect) diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index b34305152..95d9a09e9 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -282,7 +282,6 @@ void checkRotatedWalls(); bool sectorsConnected(int sect1, int sect2); void dragpoint(walltype* wal, int newx, int newy); void dragpoint(walltype* wal, const DVector2& pos); -DVector2 rotatepoint(const DVector2& pivot, const DVector2& point, DAngle angle); int32_t inside(double x, double y, const sectortype* sect); void getcorrectzsofslope(int sectnum, int dax, int day, int* ceilz, int* florz); int getceilzofslopeptr(const sectortype* sec, int dax, int day); @@ -328,6 +327,11 @@ inline double getflorzofslopeptrf(const sectortype* sec, const DVector2& pos) return getflorzofslopeptr(sec, pos.X * worldtoint, pos.Y * worldtoint) * zinttoworld; } +inline DVector2 rotatepoint(const DVector2& pivot, const DVector2& point, DAngle angle) +{ + return (point - pivot).Rotated(angle) + pivot; +} + enum EFindNextSector {