From 15bc043114f711b07982840e14e15724c06102b8 Mon Sep 17 00:00:00 2001 From: Pedro Pereira Date: Fri, 5 Nov 2021 12:50:54 +0000 Subject: [PATCH] 3DFileViewer: Clean some code for increased readability on Mesh This replaces all usages of 'm_triangle_list[i]' with 'triangle' in order to improve readability of the code. --- Userland/Applications/3DFileViewer/Mesh.cpp | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Userland/Applications/3DFileViewer/Mesh.cpp b/Userland/Applications/3DFileViewer/Mesh.cpp index d4970281bb5..a8722fd7d04 100644 --- a/Userland/Applications/3DFileViewer/Mesh.cpp +++ b/Userland/Applications/3DFileViewer/Mesh.cpp @@ -92,31 +92,31 @@ void Mesh::draw(float uv_scale) glColor4f(color.x(), color.y(), color.z(), color.w()); if (is_textured()) - glTexCoord2f(m_tex_coords.at(m_triangle_list[i].tex_coord_index0).u * uv_scale, (1.0f - m_tex_coords.at(m_triangle_list[i].tex_coord_index0).v) * uv_scale); + glTexCoord2f(m_tex_coords.at(triangle.tex_coord_index0).u * uv_scale, (1.0f - m_tex_coords.at(triangle.tex_coord_index0).v) * uv_scale); // Vertex 1 glVertex3f( - m_vertex_list.at(m_triangle_list[i].a).x, - m_vertex_list.at(m_triangle_list[i].a).y, - m_vertex_list.at(m_triangle_list[i].a).z); + m_vertex_list.at(triangle.a).x, + m_vertex_list.at(triangle.a).y, + m_vertex_list.at(triangle.a).z); if (is_textured()) - glTexCoord2f(m_tex_coords.at(m_triangle_list[i].tex_coord_index1).u * uv_scale, (1.0f - m_tex_coords.at(m_triangle_list[i].tex_coord_index1).v) * uv_scale); + glTexCoord2f(m_tex_coords.at(triangle.tex_coord_index1).u * uv_scale, (1.0f - m_tex_coords.at(triangle.tex_coord_index1).v) * uv_scale); // Vertex 2 glVertex3f( - m_vertex_list.at(m_triangle_list[i].b).x, - m_vertex_list.at(m_triangle_list[i].b).y, - m_vertex_list.at(m_triangle_list[i].b).z); + m_vertex_list.at(triangle.b).x, + m_vertex_list.at(triangle.b).y, + m_vertex_list.at(triangle.b).z); if (is_textured()) - glTexCoord2f(m_tex_coords.at(m_triangle_list[i].tex_coord_index2).u * uv_scale, (1.0f - m_tex_coords.at(m_triangle_list[i].tex_coord_index2).v) * uv_scale); + glTexCoord2f(m_tex_coords.at(triangle.tex_coord_index2).u * uv_scale, (1.0f - m_tex_coords.at(triangle.tex_coord_index2).v) * uv_scale); // Vertex 3 glVertex3f( - m_vertex_list.at(m_triangle_list[i].c).x, - m_vertex_list.at(m_triangle_list[i].c).y, - m_vertex_list.at(m_triangle_list[i].c).z); + m_vertex_list.at(triangle.c).x, + m_vertex_list.at(triangle.c).y, + m_vertex_list.at(triangle.c).z); glEnd(); }