diff options
author | Lenny Maiorani <lenny@serenityos.org> | 2022-01-23 12:39:16 -0700 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-01-23 20:42:07 +0000 |
commit | 0da3a2dddef981d7f3902f6f8e5e4d0ae2aeb109 (patch) | |
tree | fb47086bb1afc6251b23ac59c52438f112a327c9 | |
parent | 66216d3af682328ca0a019d93ec988b3b6e40ab7 (diff) | |
download | serenity-0da3a2dddef981d7f3902f6f8e5e4d0ae2aeb109.zip |
LibSoftGPU: Switch to using east const in Clipper.[h,cpp]
-rw-r--r-- | Userland/Libraries/LibSoftGPU/Clipper.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibSoftGPU/Clipper.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibSoftGPU/Clipper.cpp b/Userland/Libraries/LibSoftGPU/Clipper.cpp index 9db116e884..c61facf9f4 100644 --- a/Userland/Libraries/LibSoftGPU/Clipper.cpp +++ b/Userland/Libraries/LibSoftGPU/Clipper.cpp @@ -11,7 +11,7 @@ namespace SoftGPU { -bool Clipper::point_within_clip_plane(const FloatVector4& vertex, ClipPlane plane) +bool Clipper::point_within_clip_plane(FloatVector4 const& vertex, ClipPlane plane) { switch (plane) { case ClipPlane::LEFT: @@ -31,7 +31,7 @@ bool Clipper::point_within_clip_plane(const FloatVector4& vertex, ClipPlane plan return false; } -Vertex Clipper::clip_intersection_point(const Vertex& p1, const Vertex& p2, ClipPlane plane_index) +Vertex Clipper::clip_intersection_point(Vertex const& p1, Vertex const& p2, ClipPlane plane_index) { // See https://www.microsoft.com/en-us/research/wp-content/uploads/1978/01/p245-blinn.pdf // "Clipping Using Homogeneous Coordinates" Blinn/Newell, 1978 @@ -65,8 +65,8 @@ void Clipper::clip_triangle_against_frustum(Vector<Vertex>& input_verts) write_to->clear_with_capacity(); // Save me, C++23 for (size_t i = 0; i < read_from->size(); i++) { - const auto& curr_vec = read_from->at((i + 1) % read_from->size()); - const auto& prev_vec = read_from->at(i); + auto const& curr_vec = read_from->at((i + 1) % read_from->size()); + auto const& prev_vec = read_from->at(i); if (point_within_clip_plane(curr_vec.clip_coordinates, static_cast<ClipPlane>(plane))) { if (!point_within_clip_plane(prev_vec.clip_coordinates, static_cast<ClipPlane>(plane))) { diff --git a/Userland/Libraries/LibSoftGPU/Clipper.h b/Userland/Libraries/LibSoftGPU/Clipper.h index 7bf46e8d35..458d0363c5 100644 --- a/Userland/Libraries/LibSoftGPU/Clipper.h +++ b/Userland/Libraries/LibSoftGPU/Clipper.h @@ -49,8 +49,8 @@ public: void clip_triangle_against_frustum(Vector<Vertex>& input_vecs); private: - bool point_within_clip_plane(const FloatVector4& vertex, ClipPlane plane); - Vertex clip_intersection_point(const Vertex& vec, const Vertex& prev_vec, ClipPlane plane_index); + bool point_within_clip_plane(FloatVector4 const& vertex, ClipPlane plane); + Vertex clip_intersection_point(Vertex const& vec, Vertex const& prev_vec, ClipPlane plane_index); Vector<Vertex> list_a; Vector<Vertex> list_b; }; |