1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Fix various performance issues reported by cppcheck + code style (CI) (#5635)

* Make CI happy with code style on master
* guiFileSelectMenu: remove useless includes
* some performance fixes pointed by cppcheck
* remove some useless casts
* TextDest: remove unused setFormSpec function
This commit is contained in:
Loïc Blot 2017-04-21 23:40:48 +02:00 committed by GitHub
parent f151b23220
commit dc0e9097d3
7 changed files with 70 additions and 67 deletions

View file

@ -391,7 +391,7 @@ scene::IMeshBuffer* cloneMeshBuffer(scene::IMeshBuffer *mesh_buffer)
switch (mesh_buffer->getVertexType()) {
case video::EVT_STANDARD: {
video::S3DVertex *v = (video::S3DVertex *) mesh_buffer->getVertices();
u16 *indices = (u16*) mesh_buffer->getIndices();
u16 *indices = mesh_buffer->getIndices();
scene::SMeshBuffer *temp_buf = new scene::SMeshBuffer();
temp_buf->append(v, mesh_buffer->getVertexCount(), indices,
mesh_buffer->getIndexCount());
@ -401,7 +401,7 @@ scene::IMeshBuffer* cloneMeshBuffer(scene::IMeshBuffer *mesh_buffer)
case video::EVT_2TCOORDS: {
video::S3DVertex2TCoords *v =
(video::S3DVertex2TCoords *) mesh_buffer->getVertices();
u16 *indices = (u16*) mesh_buffer->getIndices();
u16 *indices = mesh_buffer->getIndices();
scene::SMeshBufferTangents *temp_buf = new scene::SMeshBufferTangents();
temp_buf->append(v, mesh_buffer->getVertexCount(), indices,
mesh_buffer->getIndexCount());
@ -410,7 +410,7 @@ scene::IMeshBuffer* cloneMeshBuffer(scene::IMeshBuffer *mesh_buffer)
case video::EVT_TANGENTS: {
video::S3DVertexTangents *v =
(video::S3DVertexTangents *) mesh_buffer->getVertices();
u16 *indices = (u16*) mesh_buffer->getIndices();
u16 *indices = mesh_buffer->getIndices();
scene::SMeshBufferTangents *temp_buf = new scene::SMeshBufferTangents();
temp_buf->append(v, mesh_buffer->getVertexCount(), indices,
mesh_buffer->getIndexCount());
@ -447,7 +447,7 @@ scene::IMesh* convertNodeboxesToMesh(const std::vector<aabb3f> &boxes,
buf->drop();
}
video::SColor c(255,255,255,255);
video::SColor c(255,255,255,255);
for (std::vector<aabb3f>::const_iterator
i = boxes.begin();
@ -534,7 +534,7 @@ scene::IMesh* convertNodeboxesToMesh(const std::vector<aabb3f> &boxes,
buf->append(vertices + j, 4, indices, 6);
}
}
return dst_mesh;
return dst_mesh;
}
struct vcache