summaryrefslogtreecommitdiff
path: root/src/wieldmesh.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-21 23:40:48 +0200
committerGitHub <noreply@github.com>2017-04-21 23:40:48 +0200
commitdc0e9097d3144a3dda81039f666ee43ba29cbc36 (patch)
tree25f9db4f6357826bfb5456a642b522bb0b235d6f /src/wieldmesh.h
parentf151b2322003bbc89c2cd3c603ef1e1ab9d46439 (diff)
downloadminetest-dc0e9097d3144a3dda81039f666ee43ba29cbc36.tar.gz
minetest-dc0e9097d3144a3dda81039f666ee43ba29cbc36.tar.bz2
minetest-dc0e9097d3144a3dda81039f666ee43ba29cbc36.zip
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
Diffstat (limited to 'src/wieldmesh.h')
-rw-r--r--src/wieldmesh.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/wieldmesh.h b/src/wieldmesh.h
index c98b469d9..ef164c11f 100644
--- a/src/wieldmesh.h
+++ b/src/wieldmesh.h
@@ -31,7 +31,8 @@ struct ContentFeatures;
/*!
* Holds color information of an item mesh's buffer.
*/
-struct ItemPartColor {
+struct ItemPartColor
+{
/*!
* If this is false, the global base color of the item
* will be used instead of the specific color of the
@@ -43,15 +44,12 @@ struct ItemPartColor {
*/
video::SColor color;
- ItemPartColor():
- override_base(false),
- color(0)
- {}
+ ItemPartColor() : override_base(false), color(0) {}
- ItemPartColor(bool override, video::SColor color):
- override_base(override),
- color(color)
- {}
+ ItemPartColor(bool override, video::SColor color)
+ : override_base(override), color(color)
+ {
+ }
};
struct ItemMesh
@@ -75,8 +73,7 @@ public:
s32 id = -1, bool lighting = false);
virtual ~WieldMeshSceneNode();
- void setCube(const ContentFeatures &f, v3f wield_scale,
- ITextureSource *tsrc);
+ void setCube(const ContentFeatures &f, v3f wield_scale, ITextureSource *tsrc);
void setExtruded(const std::string &imagename, v3f wield_scale,
ITextureSource *tsrc, u8 num_frames);
void setItem(const ItemStack &item, Client *client);
@@ -133,7 +130,7 @@ scene::SMesh *getExtrudedMesh(ITextureSource *tsrc, const std::string &imagename
* be NULL to leave the original material.
* \param colors returns the colors of the mesh buffers in the mesh.
*/
-void postProcessNodeMesh(scene::SMesh *mesh, const ContentFeatures &f,
- bool use_shaders, bool set_material, video::E_MATERIAL_TYPE *mattype,
- std::vector<ItemPartColor> *colors);
+void postProcessNodeMesh(scene::SMesh *mesh, const ContentFeatures &f, bool use_shaders,
+ bool set_material, video::E_MATERIAL_TYPE *mattype,
+ std::vector<ItemPartColor> *colors);
#endif