From 2d5673a1d42ed9f03dc25ff27546cc30e7d34f9c Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 26 Apr 2022 19:22:45 +0000 Subject: [PATCH] Switch SMaterial to default copy constructor and assignment operator It's not 100% identical to what we had as I only copied up to MATERIAL_MAX_TEXTURES_USED before, but I think that was rather premature optimiziation. (the cost for the extra textures is really in other places, don't think the copy here ever matters). Was a bit based on Mintest patch, but they messed it up: https://github.com/minetest/irrlicht/commit/4931b346253c64069d45947960405c8f6afc0b55 (because they didn't notice the difference between MATERIAL_MAX_TEXTURES_USED and MATERIAL_MAX_TEXTURES). git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6363 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/SMaterial.h | 62 ++-------------------------------- tests/tests-last-passed-at.txt | 2 +- 2 files changed, 3 insertions(+), 61 deletions(-) diff --git a/include/SMaterial.h b/include/SMaterial.h index 9d775c86..788c8986 100644 --- a/include/SMaterial.h +++ b/include/SMaterial.h @@ -289,9 +289,8 @@ namespace video We (mostly) avoid dynamic memory in SMaterial, so the extra memory will still be allocated. But by lowering MATERIAL_MAX_TEXTURES_USED the - material comparisons and assignments can be faster. Also several other - places in the engine can be faster when reducing this value to the limit - you need. + material comparisons can be faster. Also several other places in the + engine can be faster when reducing this value to the limit you need. NOTE: This should only be changed once and before any call to createDevice. NOTE: Do not set it below 1 or above the value of _IRR_MATERIAL_MAX_TEXTURES_. @@ -318,63 +317,6 @@ namespace video FogEnable(false), NormalizeNormals(false), UseMipMaps(true) { } - //! Copy constructor - /** \param other Material to copy from. */ - SMaterial(const SMaterial& other) - { - // These pointers are checked during assignment - for (u32 i=0; i