From b2f45986ad2adce76cb41ef1428340ebe3386559 Mon Sep 17 00:00:00 2001
From: Jaime Passos <lazymyuutsu@gmail.com>
Date: Sat, 10 Oct 2020 18:53:05 -0300
Subject: [PATCH] Add r_patchrotation.h

---
 src/CMakeLists.txt    |  1 +
 src/r_patch.h         |  2 --
 src/r_patchrotation.c |  9 ++-------
 src/r_patchrotation.h | 21 +++++++++++++++++++++
 src/r_things.c        |  1 +
 5 files changed, 25 insertions(+), 9 deletions(-)
 create mode 100644 src/r_patchrotation.h

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9c2326399f..819b9cc352 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -148,6 +148,7 @@ set(SRB2_CORE_RENDER_SOURCES
 	r_things.h
 	r_textures.h
 	r_patch.h
+	r_patchrotation.h
 	r_picformats.h
 	r_portal.h
 )
diff --git a/src/r_patch.h b/src/r_patch.h
index 71f185c9d8..6991d36377 100644
--- a/src/r_patch.h
+++ b/src/r_patch.h
@@ -31,8 +31,6 @@ void *Patch_CreateGL(patch_t *patch);
 void Patch_Rotate(patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip);
 patch_t *Patch_GetRotated(patch_t *patch, INT32 angle, boolean flip);
 patch_t *Patch_GetRotatedSprite(spriteframe_t *sprite, size_t frame, size_t spriteangle, boolean flip, void *info, INT32 rotationangle);INT32 R_GetRollAngle(angle_t rollangle);
-extern fixed_t rollcosang[ROTANGLES];
-extern fixed_t rollsinang[ROTANGLES];
 #endif
 
 #endif // __R_PATCH__
diff --git a/src/r_patchrotation.c b/src/r_patchrotation.c
index 77544c3ac2..83eb4eeba0 100644
--- a/src/r_patchrotation.c
+++ b/src/r_patchrotation.c
@@ -1,6 +1,6 @@
 // SONIC ROBO BLAST 2
 //-----------------------------------------------------------------------------
-// Copyright (C) 2018-2020 by Jaime "Lactozilla" Passos.
+// Copyright (C) 2020 by Jaime "Lactozilla" Passos.
 //
 // This program is free software distributed under the
 // terms of the GNU General Public License, version 2.
@@ -9,17 +9,12 @@
 /// \file  r_patchrotation.c
 /// \brief Patch rotation.
 
-#include "r_patch.h"
-#include "r_picformats.h"
+#include "r_patchrotation.h"
 #include "r_things.h" // FEETADJUST
 #include "z_zone.h"
 #include "w_wad.h"
 
 #ifdef ROTSPRITE
-
-static rotsprite_t *RotatedPatch_Create(INT32 numangles);
-static void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip);
-
 fixed_t rollcosang[ROTANGLES];
 fixed_t rollsinang[ROTANGLES];
 
diff --git a/src/r_patchrotation.h b/src/r_patchrotation.h
new file mode 100644
index 0000000000..2744f71d25
--- /dev/null
+++ b/src/r_patchrotation.h
@@ -0,0 +1,21 @@
+// SONIC ROBO BLAST 2
+//-----------------------------------------------------------------------------
+// Copyright (C) 2020 by Jaime "Lactozilla" Passos.
+//
+// This program is free software distributed under the
+// terms of the GNU General Public License, version 2.
+// See the 'LICENSE' file for more details.
+//-----------------------------------------------------------------------------
+/// \file  r_patchrotation.h
+/// \brief Patch rotation.
+
+#include "r_patch.h"
+#include "r_picformats.h"
+
+#ifdef ROTSPRITE
+rotsprite_t *RotatedPatch_Create(INT32 numangles);
+void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip);
+
+extern fixed_t rollcosang[ROTANGLES];
+extern fixed_t rollsinang[ROTANGLES];
+#endif
diff --git a/src/r_things.c b/src/r_things.c
index b7d7302f82..33b9820c81 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -25,6 +25,7 @@
 #include "i_system.h"
 #include "r_things.h"
 #include "r_patch.h"
+#include "r_patchrotation.h"
 #include "r_picformats.h"
 #include "r_plane.h"
 #include "r_portal.h"
-- 
GitLab