From f28cfd0b9d51b8690b15c6b92efed908b1ed264d Mon Sep 17 00:00:00 2001 From: Joilnen Date: Tue, 2 Jan 2024 19:35:53 -0300 Subject: [PATCH] Samples: range loop refactoring (#2993) --- Samples/Simple/include/Dot3Bump.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Samples/Simple/include/Dot3Bump.h b/Samples/Simple/include/Dot3Bump.h index f1ed3843c3a..e6fc3fcc4b3 100644 --- a/Samples/Simple/include/Dot3Bump.h +++ b/Samples/Simple/include/Dot3Bump.h @@ -128,10 +128,10 @@ class _OgreSampleClassExport Sample_Dot3Bump : public SdkSample mPossibilities["athene.mesh"] = matNames; - for (std::map::iterator it = mPossibilities.begin(); it != mPossibilities.end(); it++) + for (const auto& p : mPossibilities) { // load each mesh with non-default hardware buffer usage options - MeshPtr mesh = MeshManager::getSingleton().load(it->first, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, + MeshPtr mesh = MeshManager::getSingleton().load(p.first, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY); // build tangent vectors for our mesh @@ -141,7 +141,7 @@ class _OgreSampleClassExport Sample_Dot3Bump : public SdkSample // create an entity from the mesh and set the first available material Entity* ent = mSceneMgr->createEntity(mesh->getName(), mesh->getName()); - ent->setMaterialName(it->second.front()); + ent->setMaterialName(p.second.front()); } } @@ -192,8 +192,8 @@ class _OgreSampleClassExport Sample_Dot3Bump : public SdkSample // create a menu to choose the model displayed mMeshMenu = mTrayMgr->createLongSelectMenu(TL_BOTTOM, "Mesh", "Mesh", 370, 290, 10); - for (std::map::iterator it = mPossibilities.begin(); it != mPossibilities.end(); it++) - mMeshMenu->addItem(it->first); + for (const auto& p : mPossibilities) + mMeshMenu->addItem(p.first); // create a menu to choose the material used by the model mMaterialMenu = mTrayMgr->createLongSelectMenu(TL_BOTTOM, "Material", "Material", 370, 290, 10);