summaryrefslogtreecommitdiff
path: root/include/SComponent
diff options
context:
space:
mode:
authorLC <mathew1800@gmail.com>2021-01-26 21:29:28 -0500
committerGitHub <noreply@github.com>2021-01-26 21:29:28 -0500
commitc37cd04585e37911acf972ef88b81c554ef72082 (patch)
treeb4599399bd7bc704cbdca07ebfe33e6c474b822b /include/SComponent
parent1e105b87f104badeadcb1d2b0ddbdff1310eb5be (diff)
c_m3d: Make use of forward declarations (#104)
Some inline helper function of the included files in the header make use of functions defined within it. This can cause a circular dependency cycle if said helper functions are ever defined within the classes. To break this potential cycle, we can use forward declarations. This also has the benefit of reducing preprocessing overhead a little bit.
Diffstat (limited to 'include/SComponent')
-rw-r--r--include/SComponent/c_cc_d/c_cc_d.h5
-rw-r--r--include/SComponent/c_m3d.h22
2 files changed, 15 insertions, 12 deletions
diff --git a/include/SComponent/c_cc_d/c_cc_d.h b/include/SComponent/c_cc_d/c_cc_d.h
index 98668656d1..3783bc0c37 100644
--- a/include/SComponent/c_cc_d/c_cc_d.h
+++ b/include/SComponent/c_cc_d/c_cc_d.h
@@ -1,8 +1,9 @@
#ifndef C_CC_D_H_
#define C_CC_D_H_
-#include "SComponent/c_m3d.h"
-#include "global.h"
+#include "SComponent/c_m3d_g_aab.h"
+#include "SComponent/c_m3d_g_cps.h"
+#include "SComponent/c_m3d_g_cyl.h"
class cCcD_ShapeAttr {
public:
diff --git a/include/SComponent/c_m3d.h b/include/SComponent/c_m3d.h
index e467d442f3..8eacd15bfc 100644
--- a/include/SComponent/c_m3d.h
+++ b/include/SComponent/c_m3d.h
@@ -1,18 +1,20 @@
#ifndef C_M3D_H_
#define C_M3D_H_
-#include "SComponent/c_m3d_g_aab.h"
-#include "SComponent/c_m3d_g_cps.h"
-#include "SComponent/c_m3d_g_cyl.h"
-#include "SComponent/c_m3d_g_lin.h"
-#include "SComponent/c_m3d_g_pla.h"
-#include "SComponent/c_m3d_g_sph.h"
-#include "SComponent/c_m3d_g_tri.h"
-#include "SComponent/c_sxyz.h"
-#include "SComponent/c_xyz.h"
-#include "global.h"
+#include "dolphin/types.h"
+
+class cM3dGAab;
+class cM3dGCps;
+class cM3dGCyl;
+class cM3dGLin;
+class cM3dGPla;
+class cM3dGSph;
+class cM3dGTri;
+class csXyz;
+class cXyz;
struct cM3d_Range;
+struct Vec;
void cM3d_InDivPos1(const Vec*, const Vec*, f32, Vec*);
void cM3d_InDivPos2(const Vec*, const Vec*, f32, Vec*);