summaryrefslogtreecommitdiff
path: root/Userland/Applications/3DFileViewer
diff options
context:
space:
mode:
authorPedro Pereira <pmh.pereira@gmail.com>2021-11-05 12:50:54 +0000
committerAndreas Kling <kling@serenityos.org>2021-11-13 12:52:22 +0100
commit15bc043114f711b07982840e14e15724c06102b8 (patch)
treec0e524ab9da4503f65b3b32b7674f584521c07ea /Userland/Applications/3DFileViewer
parented41f48ea403c05b10c280986534cee8163802b6 (diff)
downloadserenity-15bc043114f711b07982840e14e15724c06102b8.zip
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.
Diffstat (limited to 'Userland/Applications/3DFileViewer')
-rw-r--r--Userland/Applications/3DFileViewer/Mesh.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/Userland/Applications/3DFileViewer/Mesh.cpp b/Userland/Applications/3DFileViewer/Mesh.cpp
index d4970281bb..a8722fd7d0 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();
}