Skip to content

Commit

Permalink
KFL: Remove centralized PreDeclare.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
gongminmin committed Nov 10, 2023
1 parent 24012b9 commit dd7141a
Show file tree
Hide file tree
Showing 56 changed files with 113 additions and 154 deletions.
1 change: 0 additions & 1 deletion KFL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ SET(BASE_HEADER_FILES
${KFL_PROJECT_DIR}/include/KFL/Noncopyable.hpp
${KFL_PROJECT_DIR}/include/KFL/Operators.hpp
${KFL_PROJECT_DIR}/include/KFL/Platform.hpp
${KFL_PROJECT_DIR}/include/KFL/PreDeclare.hpp
${KFL_PROJECT_DIR}/include/KFL/ResIdentifier.hpp
${KFL_PROJECT_DIR}/include/KFL/SmartPtrHelper.hpp
${KFL_PROJECT_DIR}/include/KFL/StringUtil.hpp
Expand Down
4 changes: 2 additions & 2 deletions KFL/include/KFL/AABBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>

#include <KFL/Bound.hpp>
#include <KFL/Operators.hpp>

Expand Down Expand Up @@ -125,6 +123,8 @@ namespace KlayGE
private:
Vector_T<T, 3> min_, max_;
};

using AABBox = AABBox_T<float>;
}

#endif // _KFL_AABBOX_HPP
2 changes: 2 additions & 0 deletions KFL/include/KFL/Bound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ namespace KlayGE
virtual bool VecInBound(Vector_T<T, 3> const & v) const noexcept = 0;
virtual T MaxRadiusSq() const noexcept = 0;
};

using Bound = Bound_T<float>;
}

#endif // _KFL_BOUND_HPP
4 changes: 2 additions & 2 deletions KFL/include/KFL/Color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>

#include <KFL/Operators.hpp>
#include <KFL/Vector.hpp>

Expand Down Expand Up @@ -185,6 +183,8 @@ namespace KlayGE
private:
Vector_T<T, elem_num> col_;
};

using Color = Color_T<float>;
}

#endif // _KFL_COLOR_HPP
3 changes: 2 additions & 1 deletion KFL/include/KFL/Frustum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>
#include <array>

namespace KlayGE
Expand Down Expand Up @@ -89,6 +88,8 @@ namespace KlayGE
std::array<Plane_T<T>, 6> planes_;
std::array<Vector_T<T, 3>, 8> corners_;
};

using Frustum = Frustum_T<float>;
}

#endif // _KFL_FRUSTUM_HPP
5 changes: 2 additions & 3 deletions KFL/include/KFL/Hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@

#pragma once

#include <KFL/PreDeclare.hpp>
#include <KFL/CXX20/span.hpp>

#include <string>
#include <string_view>

#include <KFL/CXX20/span.hpp>

namespace KlayGE
{
#define PRIME_NUM 0x9e3779b9
Expand Down
3 changes: 3 additions & 0 deletions KFL/include/KFL/JsonDom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@

namespace KlayGE
{
class JsonValue;
class XMLDocument;

enum class JsonValueType
{
Null,
Expand Down
1 change: 0 additions & 1 deletion KFL/include/KFL/KFL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@

#include <boost/assert.hpp>

#include <KFL/PreDeclare.hpp>
#include <KFL/Util.hpp>
#include <KFL/Math.hpp>
23 changes: 21 additions & 2 deletions KFL/include/KFL/Math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>

#include <limits>
#include <cstdlib>
#include <cmath>
Expand All @@ -43,6 +41,27 @@

namespace KlayGE
{
template <typename T, int N>
class Vector_T;
template <typename T>
class Matrix4_T;
template <typename T>
class Quaternion_T;
template <typename T>
class Plane_T;
template <typename T>
class Color_T;
template <typename T>
class Size_T;
template <typename T>
class Sphere_T;
template <typename T>
class AABBox_T;
template <typename T>
class Frustum_T;
template <typename T>
class OBBox_T;

// 常量定义
/////////////////////////////////////////////////////////////////////////////////
float constexpr PI = 3.141592f; // PI
Expand Down
4 changes: 2 additions & 2 deletions KFL/include/KFL/Matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>

#include <KFL/Operators.hpp>
#include <KFL/Vector.hpp>

Expand Down Expand Up @@ -163,6 +161,8 @@ namespace KlayGE
private:
Vector_T<Vector_T<T, col_num>, row_num> m_;
};

using float4x4 = Matrix4_T<float>;
}

#endif // _KFL_MATRIX_HPP
4 changes: 2 additions & 2 deletions KFL/include/KFL/OBBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>

#include <KFL/Bound.hpp>
#include <KFL/Operators.hpp>

Expand Down Expand Up @@ -110,6 +108,8 @@ namespace KlayGE
Quaternion_T<T> rotation_;
Vector_T<T, 3> extent_;
};

using OBBox = OBBox_T<float>;
}

#endif // _KFL_OBBOX_HPP
2 changes: 2 additions & 0 deletions KFL/include/KFL/Plane.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ namespace KlayGE
private:
Vector_T<T, elem_num> plane_;
};

using Plane = Plane_T<float>;
}

#endif // _KFL_PLANE_HPP
118 changes: 0 additions & 118 deletions KFL/include/KFL/PreDeclare.hpp

This file was deleted.

2 changes: 2 additions & 0 deletions KFL/include/KFL/Quaternion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ namespace KlayGE
private:
Vector_T<T, elem_num> quat_;
};

using Quaternion = Quaternion_T<float>;
}

#endif // _KFL_QUATERNION_HPP
6 changes: 4 additions & 2 deletions KFL/include/KFL/Rect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>

#include <KFL/Operators.hpp>
#include <KFL/Size.hpp>
#include <KFL/Vector.hpp>
Expand Down Expand Up @@ -186,6 +184,10 @@ namespace KlayGE
private:
Vector_T<T, elem_num> rect_;
};

using Rect = Rect_T<float>;
using IRect = Rect_T<int32_t>;
using UIRect = Rect_T<uint32_t>;
}

#endif // _KFL_RECT_HPP
4 changes: 3 additions & 1 deletion KFL/include/KFL/ResIdentifier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

#pragma once

#include <KFL/PreDeclare.hpp>
#include <istream>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
Expand Down Expand Up @@ -119,6 +119,8 @@ namespace KlayGE
std::shared_ptr<std::istream> istream_;
std::shared_ptr<std::streambuf> streambuf_;
};

using ResIdentifierPtr = std::shared_ptr<ResIdentifier>;
}

#endif // _KFL_RESIDENTIFIER_HPP
2 changes: 0 additions & 2 deletions KFL/include/KFL/SIMDMath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>

#if defined(KLAYGE_SSE_SUPPORT)
#define SIMD_MATH_SSE
#include <xmmintrin.h>
Expand Down
6 changes: 4 additions & 2 deletions KFL/include/KFL/Size.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>

#include <KFL/Operators.hpp>
#include <KFL/Vector.hpp>

Expand Down Expand Up @@ -145,6 +143,10 @@ namespace KlayGE
private:
Vector_T<T, elem_num> size_;
};

using Size = Size_T<float>;
using ISize = Size_T<int32_t>;
using UISize = Size_T<uint32_t>;
}

#endif // _KFL_SIZE_HPP
4 changes: 2 additions & 2 deletions KFL/include/KFL/Sphere.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

#pragma once

#include <KFL/PreDeclare.hpp>

#include <KFL/Operators.hpp>
#include <KFL/Bound.hpp>

Expand Down Expand Up @@ -107,6 +105,8 @@ namespace KlayGE
Vector_T<T, 3> center_;
T radius_;
};

using Sphere = Sphere_T<float>;
}

#endif // _KFL_SPHERE_HPP
Loading

0 comments on commit dd7141a

Please sign in to comment.