diff --git a/Components/Hlms/Pbs/src/Cubemaps/OgreCubemapProbe.cpp b/Components/Hlms/Pbs/src/Cubemaps/OgreCubemapProbe.cpp index 1edbde42ae5..4bc78e60aed 100644 --- a/Components/Hlms/Pbs/src/Cubemaps/OgreCubemapProbe.cpp +++ b/Components/Hlms/Pbs/src/Cubemaps/OgreCubemapProbe.cpp @@ -115,11 +115,14 @@ namespace Ogre { if( !mCreator->getAutomaticMode() ) { - const bool useManual = mTexture->getNumMipmaps() > 1u; - if( useManual ) + if( mTexture ) { - TextureGpu *channel = mWorkspace->getExternalRenderTargets()[0]; - mCreator->releaseTmpRtt( channel ); + const bool useManual = mTexture->getNumMipmaps() > 1u; + if( useManual ) + { + TextureGpu *channel = mWorkspace->getExternalRenderTargets()[0]; + mCreator->releaseTmpRtt( channel ); + } } } diff --git a/Components/Hlms/Pbs/src/Vct/OgreVoxelizedMeshCache.cpp b/Components/Hlms/Pbs/src/Vct/OgreVoxelizedMeshCache.cpp index 91f8bdbde9a..93993206e5b 100644 --- a/Components/Hlms/Pbs/src/Vct/OgreVoxelizedMeshCache.cpp +++ b/Components/Hlms/Pbs/src/Vct/OgreVoxelizedMeshCache.cpp @@ -276,7 +276,7 @@ namespace Ogre } } - itor = mMeshes.insert( std::pair( meshName, voxelizedMesh ) ).first; + itor = mMeshes.emplace( meshName, voxelizedMesh ).first; sceneManager->destroyItem( tmpItem ); } diff --git a/Components/MeshLodGenerator/src/OgreLodCollapseCost.cpp b/Components/MeshLodGenerator/src/OgreLodCollapseCost.cpp index 3af59183765..ee8d2759eac 100644 --- a/Components/MeshLodGenerator/src/OgreLodCollapseCost.cpp +++ b/Components/MeshLodGenerator/src/OgreLodCollapseCost.cpp @@ -85,8 +85,7 @@ namespace Ogre computeVertexCollapseCost( data, vertexi, collapseCost, collapseToi ); vertex->collapseToi = collapseToi; - vertex->costHeapPosition = data->mCollapseCostHeap.insert( - LodData::CollapseCostHeap::value_type( collapseCost, vertexi ) ); + vertex->costHeapPosition = data->mCollapseCostHeap.emplace( collapseCost, vertexi ); } void LodCollapseCost::updateVertexCollapseCost( LodData *data, LodData::VertexI vertexi ) @@ -103,8 +102,7 @@ namespace Ogre if( collapseCost != LodData::UNINITIALIZED_COLLAPSE_COST ) { vertex->collapseToi = collapseToi; - vertex->costHeapPosition = data->mCollapseCostHeap.insert( - LodData::CollapseCostHeap::value_type( collapseCost, vertexi ) ); + vertex->costHeapPosition = data->mCollapseCostHeap.emplace( collapseCost, vertexi ); } else { diff --git a/Components/MeshLodGenerator/src/OgreLodCollapseCostProfiler.cpp b/Components/MeshLodGenerator/src/OgreLodCollapseCostProfiler.cpp index 79997ded50f..722565166fe 100644 --- a/Components/MeshLodGenerator/src/OgreLodCollapseCostProfiler.cpp +++ b/Components/MeshLodGenerator/src/OgreLodCollapseCostProfiler.cpp @@ -101,7 +101,7 @@ namespace Ogre e.cost = it->cost; OgreAssert( e.cost >= 0 && e.cost != LodData::UNINITIALIZED_COLLAPSE_COST, "Invalid collapse cost" ); - mProfileLookup.insert( ProfileLookup::value_type( *src, e ) ); + mProfileLookup.emplace( *src, e ); } } diff --git a/Components/MeshLodGenerator/src/OgreLodOutsideMarker.cpp b/Components/MeshLodGenerator/src/OgreLodOutsideMarker.cpp index 0556e0c17fb..3698cf06a77 100644 --- a/Components/MeshLodGenerator/src/OgreLodOutsideMarker.cpp +++ b/Components/MeshLodGenerator/src/OgreLodOutsideMarker.cpp @@ -317,11 +317,11 @@ namespace Ogre // because those are not on the horizon. if( a <= b ) { - edges.push_back( CHEdgeList::value_type( a, b ) ); + edges.emplace_back( a, b ); } else { - edges.push_back( CHEdgeList::value_type( b, a ) ); + edges.emplace_back( b, a ); } } diff --git a/Components/Overlay/include/OgreFont.h b/Components/Overlay/include/OgreFont.h index 138e549118a..e02f13cfdce 100644 --- a/Components/Overlay/include/OgreFont.h +++ b/Components/Overlay/include/OgreFont.h @@ -308,9 +308,8 @@ namespace Ogre } else { - mCodePointMap.insert( CodePointMap::value_type( - id, GlyphInfo( id, UVRect( u1, v1, u2, v2 ), - textureAspect * ( u2 - u1 ) / ( v2 - v1 ) ) ) ); + mCodePointMap.emplace( id, GlyphInfo( id, UVRect( u1, v1, u2, v2 ), + textureAspect * ( u2 - u1 ) / ( v2 - v1 ) ) ); } } /** Gets the aspect ratio (width / height) of this character. */ diff --git a/Components/Overlay/src/OgreOverlayContainer.cpp b/Components/Overlay/src/OgreOverlayContainer.cpp index 3953fd570f0..91102490bd6 100644 --- a/Components/Overlay/src/OgreOverlayContainer.cpp +++ b/Components/Overlay/src/OgreOverlayContainer.cpp @@ -82,7 +82,7 @@ namespace Ogre "OverlayContainer::addChild" ); } - mChildren.insert( ChildMap::value_type( name, elem ) ); + mChildren.emplace( name, elem ); // tell child about parent & Z-order elem->_notifyParent( this, mOverlay ); elem->_notifyViewport(); @@ -113,7 +113,7 @@ namespace Ogre */ // Now add to specific map too - mChildContainers.insert( ChildContainerMap::value_type( cont->getName(), cont ) ); + mChildContainers.emplace( cont->getName(), cont ); } //--------------------------------------------------------------------- void OverlayContainer::removeChild( const String &name ) diff --git a/Components/Overlay/src/OgreOverlayManager.cpp b/Components/Overlay/src/OgreOverlayManager.cpp index 1dd37b07af7..eb7ae6637aa 100644 --- a/Components/Overlay/src/OgreOverlayManager.cpp +++ b/Components/Overlay/src/OgreOverlayManager.cpp @@ -564,7 +564,7 @@ namespace Ogre OverlayElement *newElem = createOverlayElementFromFactory( typeName, instanceName ); // Register - elementMap.insert( ElementMap::value_type( instanceName, newElem ) ); + elementMap.emplace( instanceName, newElem ); return newElem; } diff --git a/OgreMain/include/OgreRenderSystemCapabilitiesSerializer.h b/OgreMain/include/OgreRenderSystemCapabilitiesSerializer.h index bfd061a4961..6cb26a3dc77 100644 --- a/OgreMain/include/OgreRenderSystemCapabilitiesSerializer.h +++ b/OgreMain/include/OgreRenderSystemCapabilitiesSerializer.h @@ -114,7 +114,7 @@ namespace Ogre inline void addCapabilitiesMapping( String name, Capabilities cap ) { - mCapabilitiesMap.insert( CapabilitiesMap::value_type( name, cap ) ); + mCapabilitiesMap.emplace( name, cap ); } // capabilities lines for parsing are collected along with their line numbers for debugging @@ -135,7 +135,7 @@ namespace Ogre inline void addKeywordType( String keyword, CapabilityKeywordType type ) { - mKeywordTypeMap.insert( KeywordTypeMap::value_type( keyword, type ) ); + mKeywordTypeMap.emplace( keyword, type ); } inline CapabilityKeywordType getKeywordType( const String &keyword ) const @@ -152,8 +152,7 @@ namespace Ogre inline void addSetStringMethod( String keyword, SetStringMethod method ) { - mSetStringMethodDispatchTable.insert( - SetStringMethodDispatchTable::value_type( keyword, method ) ); + mSetStringMethodDispatchTable.emplace( keyword, method ); } inline void callSetStringMethod( String &keyword, String &val ) @@ -173,8 +172,7 @@ namespace Ogre inline void addSetIntMethod( String keyword, SetIntMethod method ) { - mSetIntMethodDispatchTable.insert( - SetIntMethodDispatchTable::value_type( keyword, method ) ); + mSetIntMethodDispatchTable.emplace( keyword, method ); } inline void callSetIntMethod( String &keyword, ushort val ) @@ -193,8 +191,7 @@ namespace Ogre inline void addSetBoolMethod( String keyword, SetBoolMethod method ) { - mSetBoolMethodDispatchTable.insert( - SetBoolMethodDispatchTable::value_type( keyword, method ) ); + mSetBoolMethodDispatchTable.emplace( keyword, method ); } inline void callSetBoolMethod( String &keyword, bool val ) @@ -214,8 +211,7 @@ namespace Ogre inline void addSetRealMethod( String keyword, SetRealMethod method ) { - mSetRealMethodDispatchTable.insert( - SetRealMethodDispatchTable::value_type( keyword, method ) ); + mSetRealMethodDispatchTable.emplace( keyword, method ); } inline void callSetRealMethod( String &keyword, Real val ) diff --git a/OgreMain/src/Animation/OgreSkeletonAnimationDef.cpp b/OgreMain/src/Animation/OgreSkeletonAnimationDef.cpp index ca8489b63f6..d0f3f404c40 100644 --- a/OgreMain/src/Animation/OgreSkeletonAnimationDef.cpp +++ b/OgreMain/src/Animation/OgreSkeletonAnimationDef.cpp @@ -106,9 +106,7 @@ namespace Ogre TimestampsPerBlock::iterator itKeyframes = timestampsByBlock.find( blockIdx ); if( itKeyframes == timestampsByBlock.end() ) { - itKeyframes = - timestampsByBlock.insert( std::make_pair( (size_t)blockIdx, emptyVec ) ) - .first; + itKeyframes = timestampsByBlock.emplace( (size_t)blockIdx, emptyVec ).first; } itKeyframes->second.reserve( track->getNumKeyFrames() + (size_t)extraKeyFrameAtEnd ); diff --git a/OgreMain/src/OgreAnimationState.cpp b/OgreMain/src/OgreAnimationState.cpp index 564c9e4b1fd..7578b75c09a 100644 --- a/OgreMain/src/OgreAnimationState.cpp +++ b/OgreMain/src/OgreAnimationState.cpp @@ -49,7 +49,10 @@ namespace Ogre mParent->_notifyDirty(); } //--------------------------------------------------------------------- - AnimationState::~AnimationState() {} + AnimationState::~AnimationState() + { + destroyBlendMask(); + } //--------------------------------------------------------------------- AnimationState::AnimationState( const String &animName, AnimationStateSet *parent, Real timePos, Real length, Real weight, bool enabled ) : diff --git a/OgreMain/src/OgreArchiveManager.cpp b/OgreMain/src/OgreArchiveManager.cpp index de622dd6f6a..4029bc280db 100644 --- a/OgreMain/src/OgreArchiveManager.cpp +++ b/OgreMain/src/OgreArchiveManager.cpp @@ -130,7 +130,7 @@ namespace Ogre //----------------------------------------------------------------------- void ArchiveManager::addArchiveFactory( ArchiveFactory *factory ) { - mArchFactories.insert( ArchiveFactoryMap::value_type( factory->getType(), factory ) ); + mArchFactories.emplace( factory->getType(), factory ); LogManager::getSingleton().logMessage( "ArchiveFactory for archive type " + factory->getType() + " registered." ); } diff --git a/OgreMain/src/OgreConvexBody.cpp b/OgreMain/src/OgreConvexBody.cpp index c2b5a97d307..c2e53b9f68a 100644 --- a/OgreMain/src/OgreConvexBody.cpp +++ b/OgreMain/src/OgreConvexBody.cpp @@ -900,7 +900,7 @@ namespace Ogre const Vector3 &a = p.getVertex( j ); const Vector3 &b = p.getVertex( ( j + 1 ) % p.getVertexCount() ); - edgeMap.insert( Polygon::Edge( a, b ) ); + edgeMap.emplace( a, b ); } } @@ -1112,8 +1112,7 @@ namespace Ogre // insert intersection polygon only, if there are two vertices present if( pIntersect->getVertexCount() == 2 ) { - intersectionEdges.insert( - Polygon::Edge( pIntersect->getVertex( 0 ), pIntersect->getVertex( 1 ) ) ); + intersectionEdges.emplace( pIntersect->getVertex( 0 ), pIntersect->getVertex( 1 ) ); } // delete intersection polygon diff --git a/OgreMain/src/OgreEdgeListBuilder.cpp b/OgreMain/src/OgreEdgeListBuilder.cpp index c5594bbc934..56a2703cbc7 100644 --- a/OgreMain/src/OgreEdgeListBuilder.cpp +++ b/OgreMain/src/OgreEdgeListBuilder.cpp @@ -367,10 +367,9 @@ namespace Ogre else { // Not found, create new edge - mEdgeMap.insert( EdgeMap::value_type( - std::pair( sharedVertIndex0, sharedVertIndex1 ), - std::pair( vertexSet, - mEdgeData->edgeGroups[vertexSet].edges.size() ) ) ); + mEdgeMap.emplace( std::pair( sharedVertIndex0, sharedVertIndex1 ), + std::pair( + vertexSet, mEdgeData->edgeGroups[vertexSet].edges.size() ) ); EdgeData::Edge e; e.degenerate = true; // initialise as degenerate @@ -392,7 +391,7 @@ namespace Ogre // the common vertex by EXACT same position. // Hint: We can use quantize method for welding almost same position vertex fastest. std::pair inserted = - mCommonVertexMap.insert( CommonVertexMap::value_type( vec, mVertices.size() ) ); + mCommonVertexMap.emplace( vec, mVertices.size() ); if( !inserted.second ) { // Already existing, return old one diff --git a/OgreMain/src/OgreEntity.cpp b/OgreMain/src/OgreEntity.cpp index 0740dbb14d6..d16fd8df3f0 100644 --- a/OgreMain/src/OgreEntity.cpp +++ b/OgreMain/src/OgreEntity.cpp @@ -1387,10 +1387,7 @@ namespace Ogre if( it == mSchemeHardwareAnim.end() ) { // evaluate the animation hardware value - it = mSchemeHardwareAnim - .insert( - SchemeHardwareAnimMap::value_type( schemeIndex, calcVertexProcessing() ) ) - .first; + it = mSchemeHardwareAnim.emplace( schemeIndex, calcVertexProcessing() ).first; } return it->second; } diff --git a/OgreMain/src/OgreGpuProgramManager.cpp b/OgreMain/src/OgreGpuProgramManager.cpp index baf6ea0a859..394c609cee1 100644 --- a/OgreMain/src/OgreGpuProgramManager.cpp +++ b/OgreMain/src/OgreGpuProgramManager.cpp @@ -280,7 +280,7 @@ namespace Ogre MicrocodeMap::iterator foundIter = mMicrocodeCache.find( hash ); if( foundIter == mMicrocodeCache.end() ) { - mMicrocodeCache.insert( std::make_pair( hash, microcode ) ); + mMicrocodeCache.emplace( hash, microcode ); // if cache is modified, mark it as dirty. mCacheDirty = true; } @@ -362,7 +362,7 @@ namespace Ogre microcodeOfShader->seek( 0 ); stream->read( microcodeOfShader->getPtr(), microcodeLength ); - mMicrocodeCache.insert( std::make_pair( shaderHash, microcodeOfShader ) ); + mMicrocodeCache.emplace( shaderHash, microcodeOfShader ); } // if cache is not modified, mark it as clean. diff --git a/OgreMain/src/OgreGpuProgramParams.cpp b/OgreMain/src/OgreGpuProgramParams.cpp index 222dfbbc5d3..b6e6c8c2fb7 100644 --- a/OgreMain/src/OgreGpuProgramParams.cpp +++ b/OgreMain/src/OgreGpuProgramParams.cpp @@ -222,7 +222,7 @@ namespace Ogre for( size_t i = 0; i < maxArrayIndex; i++ ) { arrayName = paramName + "[" + StringConverter::toString( i ) + "]"; - map.insert( GpuConstantDefinitionMap::value_type( arrayName, arrayDef ) ); + map.emplace( arrayName, arrayDef ); // increment location arrayDef.physicalIndex += arrayDef.elementSize; } @@ -3314,7 +3314,7 @@ namespace Ogre //--------------------------------------------------------------------- void GpuProgramParameters::setSubroutine( size_t index, const String &subroutine ) { - mSubroutineMap.insert( std::make_pair( index, subroutine ) ); + mSubroutineMap.emplace( index, subroutine ); } //--------------------------------------------------------------------------- void GpuProgramParameters::setNamedAutoConstant( const String &name, AutoConstantType acType, diff --git a/OgreMain/src/OgreHardwareBufferManager.cpp b/OgreMain/src/OgreHardwareBufferManager.cpp index e2539b73efc..56b5220a09e 100644 --- a/OgreMain/src/OgreHardwareBufferManager.cpp +++ b/OgreMain/src/OgreHardwareBufferManager.cpp @@ -164,8 +164,7 @@ namespace Ogre { OGRE_LOCK_MUTEX( mTempBuffersMutex ); // Add copy to free temporary vertex buffers - mFreeTempVertexBufferMap.insert( - FreeTemporaryVertexBufferMap::value_type( sourceBuffer.get(), copy ) ); + mFreeTempVertexBufferMap.emplace( sourceBuffer.get(), copy ); } //----------------------------------------------------------------------- HardwareVertexBufferSharedPtr HardwareBufferManagerBase::allocateVertexBufferCopy( @@ -205,9 +204,9 @@ namespace Ogre } // Insert copy into licensee list - mTempVertexBufferLicenses.insert( TemporaryVertexBufferLicenseMap::value_type( + mTempVertexBufferLicenses.emplace( vbuf.get(), VertexBufferLicense( sourceBuffer.get(), licenseType, - EXPIRED_DELAY_FRAME_THRESHOLD, vbuf, licensee ) ) ); + EXPIRED_DELAY_FRAME_THRESHOLD, vbuf, licensee ) ); return vbuf; } } @@ -225,8 +224,7 @@ namespace Ogre vbl.licensee->licenseExpired( vbl.buffer.get() ); - mFreeTempVertexBufferMap.insert( - FreeTemporaryVertexBufferMap::value_type( vbl.originalBufferPtr, vbl.buffer ) ); + mFreeTempVertexBufferMap.emplace( vbl.originalBufferPtr, vbl.buffer ); mTempVertexBufferLicenses.erase( i ); } } @@ -298,8 +296,7 @@ namespace Ogre { vbl.licensee->licenseExpired( vbl.buffer.get() ); - mFreeTempVertexBufferMap.insert( - FreeTemporaryVertexBufferMap::value_type( vbl.originalBufferPtr, vbl.buffer ) ); + mFreeTempVertexBufferMap.emplace( vbl.originalBufferPtr, vbl.buffer ); mTempVertexBufferLicenses.erase( icur ); } } diff --git a/OgreMain/src/OgreHlms.cpp b/OgreMain/src/OgreHlms.cpp index bd74a703a77..eb744f18005 100644 --- a/OgreMain/src/OgreHlms.cpp +++ b/OgreMain/src/OgreHlms.cpp @@ -1021,7 +1021,7 @@ namespace Ogre bool syntaxError = false; outArgs.clear(); - outArgs.push_back( String() ); + outArgs.emplace_back(); String::const_iterator it = subString.begin(); String::const_iterator en = subString.end(); @@ -1042,7 +1042,7 @@ namespace Ogre else if( c == ',' ) { expressionState = 0; - outArgs.push_back( String() ); + outArgs.emplace_back(); } else { diff --git a/OgreMain/src/OgreLodStrategyManager.cpp b/OgreMain/src/OgreLodStrategyManager.cpp index b7de0874879..f5fc6062640 100644 --- a/OgreMain/src/OgreLodStrategyManager.cpp +++ b/OgreMain/src/OgreLodStrategyManager.cpp @@ -80,7 +80,7 @@ namespace Ogre } // Insert the strategy into the map with its name as the key - mStrategies.insert( std::make_pair( strategy->getName(), strategy ) ); + mStrategies.emplace( strategy->getName(), strategy ); } //----------------------------------------------------------------------- LodStrategy *LodStrategyManager::removeStrategy( const String &name ) diff --git a/OgreMain/src/OgreLogManager.cpp b/OgreMain/src/OgreLogManager.cpp index ef4153302b2..b4535d392b7 100644 --- a/OgreMain/src/OgreLogManager.cpp +++ b/OgreMain/src/OgreLogManager.cpp @@ -69,7 +69,7 @@ namespace Ogre mDefaultLog = newLog; } - mLogs.insert( LogList::value_type( name, newLog ) ); + mLogs.emplace( name, newLog ); return newLog; } diff --git a/OgreMain/src/OgreMaterialSerializer.cpp b/OgreMain/src/OgreMaterialSerializer.cpp index 0f71bdcd9d8..e0f04f6d32d 100644 --- a/OgreMain/src/OgreMaterialSerializer.cpp +++ b/OgreMain/src/OgreMaterialSerializer.cpp @@ -676,7 +676,7 @@ namespace Ogre writeTessellationHullProgramRef( pPass ); } - if( pPass->hasTessellationHullProgram() ) + if( pPass->hasTessellationDomainProgram() ) { writeTessellationDomainProgramRef( pPass ); } diff --git a/OgreMain/src/OgreMesh.cpp b/OgreMain/src/OgreMesh.cpp index a36b286c2bb..7a65eee5f29 100644 --- a/OgreMain/src/OgreMesh.cpp +++ b/OgreMain/src/OgreMesh.cpp @@ -715,8 +715,7 @@ namespace Ogre //----------------------------------------------------------------------- void Mesh::addBoneAssignment( const VertexBoneAssignment &vertBoneAssign ) { - mBoneAssignments.insert( - VertexBoneAssignmentList::value_type( vertBoneAssign.vertexIndex, vertBoneAssign ) ); + mBoneAssignments.emplace( vertBoneAssign.vertexIndex, vertBoneAssign ); mBoneAssignmentsOutOfDate = true; } //----------------------------------------------------------------------- diff --git a/OgreMain/src/OgreOldNode.cpp b/OgreMain/src/OgreOldNode.cpp index aad24a9d43f..d2f51e2e038 100644 --- a/OgreMain/src/OgreOldNode.cpp +++ b/OgreMain/src/OgreOldNode.cpp @@ -285,7 +285,7 @@ namespace Ogre "OldNode::addChild" ); } - mChildren.insert( ChildOldNodeMap::value_type( child->getName(), child ) ); + mChildren.emplace( child->getName(), child ); child->setParent( this ); } //----------------------------------------------------------------------- diff --git a/OgreMain/src/OgreRenderSystemCapabilitiesManager.cpp b/OgreMain/src/OgreRenderSystemCapabilitiesManager.cpp index 579033e664a..880f57fb3fe 100644 --- a/OgreMain/src/OgreRenderSystemCapabilitiesManager.cpp +++ b/OgreMain/src/OgreRenderSystemCapabilitiesManager.cpp @@ -93,7 +93,7 @@ namespace Ogre { /** Method used by RenderSystemCapabilitiesSerializer::parseScript */ void RenderSystemCapabilitiesManager::_addRenderSystemCapabilities(const String& name, RenderSystemCapabilities* caps) { - mCapabilitiesMap.insert(CapabilitiesMap::value_type(name, caps)); + mCapabilitiesMap.emplace( name, caps ); } } diff --git a/OgreMain/src/OgreRenderSystemCapabilitiesSerializer.cpp b/OgreMain/src/OgreRenderSystemCapabilitiesSerializer.cpp index 8ae1e705fc3..497d593c5d9 100644 --- a/OgreMain/src/OgreRenderSystemCapabilitiesSerializer.cpp +++ b/OgreMain/src/OgreRenderSystemCapabilitiesSerializer.cpp @@ -305,7 +305,7 @@ namespace Ogre } else - capabilitiesLines.push_back(CapabilitiesLinesList::value_type(line, mCurrentLineNumber)); + capabilitiesLines.emplace_back( line, mCurrentLineNumber ); break; } diff --git a/OgreMain/src/OgreResourceGroupManager.cpp b/OgreMain/src/OgreResourceGroupManager.cpp index a8d9505f55b..78d2c81b8b7 100644 --- a/OgreMain/src/OgreResourceGroupManager.cpp +++ b/OgreMain/src/OgreResourceGroupManager.cpp @@ -97,7 +97,7 @@ namespace Ogre grp->groupStatus = ResourceGroup::UNINITIALSED; grp->name = name; grp->inGlobalPool = inGlobalPool; - mResourceGroupMap.insert( ResourceGroupMap::value_type( name, grp ) ); + mResourceGroupMap.emplace( name, grp ); } //----------------------------------------------------------------------- class ScopedCLocale @@ -1022,7 +1022,7 @@ namespace Ogre { OGRE_LOCK_AUTO_MUTEX; - mScriptLoaderOrderMap.insert( ScriptLoaderOrderMap::value_type( su->getLoadingOrder(), su ) ); + mScriptLoaderOrderMap.emplace( su->getLoadingOrder(), su ); } //----------------------------------------------------------------------- void ResourceGroupManager::_unregisterScriptLoader( ScriptLoader *su ) diff --git a/OgreMain/src/OgreResourceManager.cpp b/OgreMain/src/OgreResourceManager.cpp index b39c1c3ecfb..9022e3ba42d 100644 --- a/OgreMain/src/OgreResourceManager.cpp +++ b/OgreMain/src/OgreResourceManager.cpp @@ -114,7 +114,7 @@ namespace Ogre std::pair result; if( ResourceGroupManager::getSingleton().isResourceGroupInGlobalPool( res->getGroup() ) ) { - result = mResources.insert( ResourceMap::value_type( res->getName(), res ) ); + result = mResources.emplace( res->getName(), res ); } else { @@ -124,7 +124,7 @@ namespace Ogre if( itGroup == mResourcesWithGroup.end() ) { ResourceMap dummy; - mResourcesWithGroup.insert( ResourceWithGroupMap::value_type( res->getGroup(), dummy ) ); + mResourcesWithGroup.emplace( res->getGroup(), dummy ); itGroup = mResourcesWithGroup.find( res->getGroup() ); } result = itGroup->second.insert( ResourceMap::value_type( res->getName(), res ) ); @@ -144,8 +144,7 @@ namespace Ogre if( ResourceGroupManager::getSingleton().isResourceGroupInGlobalPool( res->getGroup() ) ) { - insertResult = - mResources.insert( ResourceMap::value_type( res->getName(), res ) ); + insertResult = mResources.emplace( res->getName(), res ); } else { @@ -162,8 +161,7 @@ namespace Ogre } std::pair resultHandle = - mResourcesByHandle.insert( - ResourceHandleMap::value_type( res->getHandle(), res ) ); + mResourcesByHandle.emplace( res->getHandle(), res ); if( !resultHandle.second ) { OGRE_EXCEPT( Exception::ERR_DUPLICATE_ITEM, @@ -179,7 +177,7 @@ namespace Ogre { // Insert the handle std::pair resultHandle = - mResourcesByHandle.insert( ResourceHandleMap::value_type( res->getHandle(), res ) ); + mResourcesByHandle.emplace( res->getHandle(), res ); if( !resultHandle.second ) { OGRE_EXCEPT( Exception::ERR_DUPLICATE_ITEM, @@ -496,9 +494,7 @@ namespace Ogre ResourcePoolMap::iterator i = mResourcePoolMap.find( name ); if( i == mResourcePoolMap.end() ) { - i = mResourcePoolMap - .insert( ResourcePoolMap::value_type( name, OGRE_NEW ResourcePool( name ) ) ) - .first; + i = mResourcePoolMap.emplace( name, OGRE_NEW ResourcePool( name ) ).first; } return i->second; } diff --git a/OgreMain/src/OgreResourceTransition.cpp b/OgreMain/src/OgreResourceTransition.cpp index ec77296a7fd..b94014583e4 100644 --- a/OgreMain/src/OgreResourceTransition.cpp +++ b/OgreMain/src/OgreResourceTransition.cpp @@ -156,7 +156,7 @@ namespace Ogre status.layout = newLayout; status.access = access; status.stageMask = stageMask; - mResourceStatus.insert( ResourceStatusMap::value_type( texture, status ) ); + mResourceStatus.emplace( texture, status ); ResourceTransition resTrans; resTrans.resource = texture; @@ -234,7 +234,7 @@ namespace Ogre status.layout = ResourceLayout::Undefined; status.access = access; status.stageMask = stageMask; - mResourceStatus.insert( ResourceStatusMap::value_type( bufferRes, status ) ); + mResourceStatus.emplace( bufferRes, status ); // No transition. There's nothing to wait for and unlike textures, // buffers have no layout to transition to diff --git a/OgreMain/src/OgreSceneManager.cpp b/OgreMain/src/OgreSceneManager.cpp index 579592b95fc..8033a4f0dc7 100644 --- a/OgreMain/src/OgreSceneManager.cpp +++ b/OgreMain/src/OgreSceneManager.cpp @@ -3359,9 +3359,7 @@ namespace Ogre if( ci == mLightClippingInfoMap.end() ) { // create new entry - ci = mLightClippingInfoMap - .insert( LightClippingInfoMap::value_type( l, LightClippingInfo() ) ) - .first; + ci = mLightClippingInfoMap.emplace( l, LightClippingInfo() ).first; } if( !ci->second.scissorValid ) { @@ -3585,9 +3583,7 @@ namespace Ogre if( ci == mLightClippingInfoMap.end() ) { // create new entry - ci = mLightClippingInfoMap - .insert( LightClippingInfoMap::value_type( l, LightClippingInfo() ) ) - .first; + ci = mLightClippingInfoMap.emplace( l, LightClippingInfo() ).first; } if( !ci->second.clipPlanesValid ) { diff --git a/OgreMain/src/OgreScriptCompiler.cpp b/OgreMain/src/OgreScriptCompiler.cpp index 7a4a811dd16..6a4b87f885a 100644 --- a/OgreMain/src/OgreScriptCompiler.cpp +++ b/OgreMain/src/OgreScriptCompiler.cpp @@ -98,10 +98,7 @@ namespace Ogre String ObjectAbstractNode::getValue() const { return cls; } - void ObjectAbstractNode::addVariable( const Ogre::String &inName ) - { - mEnv.insert( std::make_pair( inName, "" ) ); - } + void ObjectAbstractNode::addVariable( const Ogre::String &inName ) { mEnv.emplace( inName, "" ); } void ObjectAbstractNode::setVariable( const Ogre::String &inName, const Ogre::String &value ) { @@ -498,7 +495,7 @@ namespace Ogre processObjects( importedNodes.get(), importedNodes ); } if( importedNodes && !importedNodes->empty() ) - mImports.insert( std::make_pair( import->source, importedNodes ) ); + mImports.emplace( import->source, importedNodes ); } // Handle the target request now @@ -508,7 +505,7 @@ namespace Ogre { mImportRequests.erase( mImportRequests.lower_bound( import->source ), mImportRequests.upper_bound( import->source ) ); - mImportRequests.insert( std::make_pair( import->source, "*" ) ); + mImportRequests.emplace( import->source, "*" ); } else { @@ -516,7 +513,7 @@ namespace Ogre end = mImportRequests.upper_bound( import->source ); if( iter == end || iter->second != "*" ) { - mImportRequests.insert( std::make_pair( import->source, import->target ) ); + mImportRequests.emplace( import->source, import->target ); } } @@ -1485,7 +1482,7 @@ namespace Ogre } else { - mCompiler->mEnv.insert( std::make_pair( name, value ) ); + mCompiler->mEnv.emplace( name, value ); } } // variable = $*, no children diff --git a/OgreMain/src/OgreScriptTranslator.cpp b/OgreMain/src/OgreScriptTranslator.cpp index e8efc2e114a..fa76f18d0d6 100644 --- a/OgreMain/src/OgreScriptTranslator.cpp +++ b/OgreMain/src/OgreScriptTranslator.cpp @@ -1361,7 +1361,7 @@ namespace Ogre{ AbstractNodeList::const_iterator i0 = getNodeAt(prop->values, 0), i1 = getNodeAt(prop->values, 1); String name, value; if(getString(*i0, &name) && getString(*i1, &value)) - mTextureAliases.emplace(name, value); + mTextureAliases.emplace( name, value ); else compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line, "set_texture_alias must have 2 string argument"); @@ -4741,7 +4741,7 @@ namespace Ogre{ value += ((AtomAbstractNode*)(*it).get())->value; } } - customParameters.emplace_back(name, value); + customParameters.emplace_back( name, value ); } } else if((*i)->type == ANT_OBJECT) @@ -4819,7 +4819,7 @@ namespace Ogre{ ProcessResourceNameScriptCompilerEvent evt(ProcessResourceNameScriptCompilerEvent::GPU_PROGRAM, value); compiler->_fireEvent(&evt, 0); - customParameters.emplace_back("delegate", evt.mName); + customParameters.emplace_back( "delegate", evt.mName ); } else { @@ -4836,7 +4836,7 @@ namespace Ogre{ value += ((AtomAbstractNode*)(*it).get())->value; } } - customParameters.emplace_back(name, value); + customParameters.emplace_back( name, value ); } } else if((*i)->type == ANT_OBJECT) @@ -4950,7 +4950,7 @@ namespace Ogre{ } } } - customParameters.emplace_back(name, value); + customParameters.emplace_back( name, value ); } } else if((*i)->type == ANT_OBJECT) diff --git a/OgreMain/src/OgreShaderParams.cpp b/OgreMain/src/OgreShaderParams.cpp index 102c8dd4e0a..1a87dbc391a 100644 --- a/OgreMain/src/OgreShaderParams.cpp +++ b/OgreMain/src/OgreShaderParams.cpp @@ -171,9 +171,9 @@ namespace Ogre this->isEx = false; this->isDirty = true; mp.elementType = ElementFloat; - mp.dataSizeBytes = sizeof( float ) * 2u; + mp.dataSizeBytes = sizeof( float ) * 2; #if !OGRE_DOUBLE_PRECISION - memcpy( mp.dataBytes, value.ptr(), sizeof( float ) * 2u ); + memcpy( mp.dataBytes, value.ptr(), sizeof( float ) * 2 ); #else for( int i = 0; i < 2; ++i ) reinterpret_cast( mp.dataBytes )[i] = static_cast( value[i] ); @@ -186,9 +186,9 @@ namespace Ogre this->isEx = false; this->isDirty = true; mp.elementType = ElementFloat; - mp.dataSizeBytes = sizeof( float ) * 3u; + mp.dataSizeBytes = sizeof( float ) * 3; #if !OGRE_DOUBLE_PRECISION - memcpy( mp.dataBytes, value.ptr(), sizeof( float ) * 3u ); + memcpy( mp.dataBytes, value.ptr(), sizeof( float ) * 3 ); #else for( int i = 0; i < 3; ++i ) reinterpret_cast( mp.dataBytes )[i] = static_cast( value[i] ); @@ -201,9 +201,9 @@ namespace Ogre this->isEx = false; this->isDirty = true; mp.elementType = ElementFloat; - mp.dataSizeBytes = sizeof( float ) * 4u; + mp.dataSizeBytes = sizeof( float ) * 4; #if !OGRE_DOUBLE_PRECISION - memcpy( mp.dataBytes, value.ptr(), sizeof( float ) * 4u ); + memcpy( mp.dataBytes, value.ptr(), sizeof( float ) * 4 ); #else for( int i = 0; i < 4; ++i ) reinterpret_cast( mp.dataBytes )[i] = static_cast( value[i] ); diff --git a/OgreMain/src/OgreString.cpp b/OgreMain/src/OgreString.cpp index 648913524d0..751031aeb8a 100644 --- a/OgreMain/src/OgreString.cpp +++ b/OgreMain/src/OgreString.cpp @@ -90,7 +90,7 @@ namespace Ogre else if( pos == String::npos || ( maxSplits && numSplits == maxSplits ) ) { // Copy the rest of the string - ret.push_back( str.substr( start ) ); + ret.emplace_back( str.begin() + start, str.end() ); break; } else @@ -107,7 +107,7 @@ namespace Ogre if( delimPos == String::npos ) { // Copy the rest of the string - ret.push_back( str.substr( delimStart ) ); + ret.emplace_back( str.begin() + delimStart, str.end() ); } else { @@ -168,7 +168,7 @@ namespace Ogre // Missing closer. Warn or throw exception? } // Copy the rest of the string - ret.push_back( str.substr( start ) ); + ret.emplace_back( str.begin() + start, str.end() ); break; } else diff --git a/OgreMain/src/OgreStringInterface.cpp b/OgreMain/src/OgreStringInterface.cpp index dc85cf4af3c..ce680ae5d86 100644 --- a/OgreMain/src/OgreStringInterface.cpp +++ b/OgreMain/src/OgreStringInterface.cpp @@ -58,8 +58,7 @@ namespace Ogre if( it == msDictionary.end() ) { - mParamDict = - &msDictionary.insert( std::make_pair( className, ParamDictionary() ) ).first->second; + mParamDict = &msDictionary.emplace( className, ParamDictionary() ).first->second; mParamDictName = className; return true; } diff --git a/OgreMain/src/OgreSubMesh.cpp b/OgreMain/src/OgreSubMesh.cpp index c33590e0beb..195a996df88 100644 --- a/OgreMain/src/OgreSubMesh.cpp +++ b/OgreMain/src/OgreSubMesh.cpp @@ -119,8 +119,7 @@ namespace Ogre "must assign bones to the Mesh, not the SubMesh", "SubMesh.addBoneAssignment" ); } - mBoneAssignments.insert( - VertexBoneAssignmentList::value_type( vertBoneAssign.vertexIndex, vertBoneAssign ) ); + mBoneAssignments.emplace( vertBoneAssign.vertexIndex, vertBoneAssign ); mBoneAssignmentsOutOfDate = true; } //----------------------------------------------------------------------- @@ -570,8 +569,7 @@ namespace Ogre assignment.vertexIndex = itor->vertexIndex; assignment.boneIndex = itor->boneIndex; assignment.weight = itor->weight; - mBoneAssignments.insert( - VertexBoneAssignmentList::value_type( itor->vertexIndex, assignment ) ); + mBoneAssignments.emplace( itor->vertexIndex, assignment ); ++itor; } } diff --git a/OgreMain/src/OgreTextureUnitState.cpp b/OgreMain/src/OgreTextureUnitState.cpp index 75fb01b59ab..f522bbaf139 100644 --- a/OgreMain/src/OgreTextureUnitState.cpp +++ b/OgreMain/src/OgreTextureUnitState.cpp @@ -633,7 +633,7 @@ namespace Ogre } // Record new effect - mEffects.insert( EffectMap::value_type( effect.type, effect ) ); + mEffects.emplace( effect.type, effect ); } //----------------------------------------------------------------------- void TextureUnitState::removeAllEffects() diff --git a/OgreMain/src/OgreWindowEventUtilities.cpp b/OgreMain/src/OgreWindowEventUtilities.cpp index 542b8302ab9..8ca7160decd 100644 --- a/OgreMain/src/OgreWindowEventUtilities.cpp +++ b/OgreMain/src/OgreWindowEventUtilities.cpp @@ -144,7 +144,7 @@ namespace Ogre //--------------------------------------------------------------------------------// void WindowEventUtilities::addWindowEventListener( Window *window, WindowEventListener *listener ) { - _msListeners.insert( std::make_pair( window, listener ) ); + _msListeners.emplace( window, listener ); } //--------------------------------------------------------------------------------// diff --git a/OgreMain/src/OgreWorkQueue.cpp b/OgreMain/src/OgreWorkQueue.cpp index c310ab117ab..ab46c728760 100644 --- a/OgreMain/src/OgreWorkQueue.cpp +++ b/OgreMain/src/OgreWorkQueue.cpp @@ -45,7 +45,7 @@ namespace Ogre ChannelMap::iterator i = mChannelMap.find( channelName ); if( i == mChannelMap.end() ) { - i = mChannelMap.insert( ChannelMap::value_type( channelName, mNextChannel++ ) ).first; + i = mChannelMap.emplace( channelName, mNextChannel++ ).first; } return i->second; } @@ -131,9 +131,7 @@ namespace Ogre RequestHandlerListByChannel::iterator i = mRequestHandlers.find( channel ); if( i == mRequestHandlers.end() ) - i = mRequestHandlers - .insert( RequestHandlerListByChannel::value_type( channel, RequestHandlerList() ) ) - .first; + i = mRequestHandlers.emplace( channel, RequestHandlerList() ).first; RequestHandlerList &handlers = i->second; bool duplicate = false; @@ -175,9 +173,7 @@ namespace Ogre { ResponseHandlerListByChannel::iterator i = mResponseHandlers.find( channel ); if( i == mResponseHandlers.end() ) - i = mResponseHandlers - .insert( ResponseHandlerListByChannel::value_type( channel, ResponseHandlerList() ) ) - .first; + i = mResponseHandlers.emplace( channel, ResponseHandlerList() ).first; ResponseHandlerList &handlers = i->second; if( std::find( handlers.begin(), handlers.end(), rh ) == handlers.end() ) diff --git a/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp b/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp index 748b69c7b1a..bd84004c09c 100644 --- a/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp +++ b/RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp @@ -1168,8 +1168,8 @@ namespace Ogre // Only parse if is used if( mVarDescPointer[pointerCount - 1].uFlags & D3D_SVF_USED ) { - mSlotMap.insert( std::make_pair( mVarDescPointer[pointerCount - 1].Name, - mInterfaceSlots[interCount - 1] ) ); + mSlotMap.emplace( mVarDescPointer[pointerCount - 1].Name, + mInterfaceSlots[interCount - 1] ); /* D3D11_SHADER_TYPE_DESC typeDesc; diff --git a/RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp b/RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp index 2647abd451f..5f6baca4296 100644 --- a/RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp +++ b/RenderSystems/Direct3D11/src/OgreD3D11RenderSystem.cpp @@ -335,7 +335,7 @@ namespace Ogre for( unsigned j = 0; j < driverList->count(); j++ ) { D3D11Driver *driver = driverList->item( j ); - optDevice.possibleValues.push_back( driver->DriverDescription() ); + optDevice.possibleValues.emplace_back( driver->DriverDescription() ); } optDevice.immutable = false; @@ -540,7 +540,7 @@ namespace Ogre for( unsigned k = 0; k < driver->getVideoModeList()->count(); k++ ) { videoMode = driver->getVideoModeList()->item( k ); - optVideoMode->possibleValues.push_back( videoMode->getDescription() ); + optVideoMode->possibleValues.emplace_back( videoMode->getDescription() ); } // Reset video mode to default if previous doesn't avail in new possible values @@ -3506,7 +3506,7 @@ namespace Ogre } // Store class instance - mInstanceMap.insert( std::make_pair( subroutineName, instance ) ); + mInstanceMap.emplace( subroutineName, instance ); } else { diff --git a/RenderSystems/Direct3D11/src/OgreMonitorInfo.cpp b/RenderSystems/Direct3D11/src/OgreMonitorInfo.cpp index fc0b81d1fd7..1e2287b287f 100644 --- a/RenderSystems/Direct3D11/src/OgreMonitorInfo.cpp +++ b/RenderSystems/Direct3D11/src/OgreMonitorInfo.cpp @@ -51,7 +51,7 @@ namespace Ogre _In_ LPRECT lprcMonitor, _In_ LPARAM dwData ) { MonitorInfo *_this = (MonitorInfo *)dwData; - _this->mMapMonitors.insert( std::make_pair( hMonitor, _this->mCurrentMonitor++ ) ); + _this->mMapMonitors.emplace( hMonitor, _this->mCurrentMonitor++ ); return true; } diff --git a/RenderSystems/Direct3D11/src/Windowing/WIN32/OgreD3D11WindowHwnd.cpp b/RenderSystems/Direct3D11/src/Windowing/WIN32/OgreD3D11WindowHwnd.cpp index d8b45ed7f3f..4f5248aa26c 100644 --- a/RenderSystems/Direct3D11/src/Windowing/WIN32/OgreD3D11WindowHwnd.cpp +++ b/RenderSystems/Direct3D11/src/Windowing/WIN32/OgreD3D11WindowHwnd.cpp @@ -559,7 +559,7 @@ namespace Ogre else { SetWindowPos( mHwnd, HWND_TOPMOST, 0, 0, width, height, SWP_NOACTIVATE ); - SetWindowLong( mHwnd, GWL_STYLE, dwStyle ); + SetWindowLongPtr( mHwnd, GWL_STYLE, dwStyle ); SetWindowPos( mHwnd, 0, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER ); } @@ -570,7 +570,7 @@ namespace Ogre winWidth = mRequestedWidth; winHeight = mRequestedHeight; adjustWindow( mRequestedWidth, mRequestedHeight, &winWidth, &winHeight ); - SetWindowLong( mHwnd, GWL_STYLE, getWindowStyle( mRequestedFullscreenMode ) ); + SetWindowLongPtr( mHwnd, GWL_STYLE, getWindowStyle( mRequestedFullscreenMode ) ); SetWindowPos( mHwnd, HWND_NOTOPMOST, 0, 0, winWidth, winHeight, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOACTIVATE ); updateWindowRect(); @@ -604,7 +604,7 @@ namespace Ogre { HWND currentWindowHandle = mHwnd; while( ( visible = ( IsIconic( currentWindowHandle ) == false ) ) && - ( GetWindowLong( currentWindowHandle, GWL_STYLE ) & WS_CHILD ) != 0 ) + ( GetWindowLongPtr( currentWindowHandle, GWL_STYLE ) & WS_CHILD ) != 0 ) { currentWindowHandle = GetParent( currentWindowHandle ); } diff --git a/RenderSystems/GL3Plus/src/GLSL/OgreGLSLProgram.cpp b/RenderSystems/GL3Plus/src/GLSL/OgreGLSLProgram.cpp index c24b1b04592..0a528371530 100644 --- a/RenderSystems/GL3Plus/src/GLSL/OgreGLSLProgram.cpp +++ b/RenderSystems/GL3Plus/src/GLSL/OgreGLSLProgram.cpp @@ -63,15 +63,15 @@ namespace Ogre } // Initialize the attribute to semantic map - mSemanticTypeMap.insert( SemanticToStringMap::value_type( "vertex", VES_POSITION ) ); - mSemanticTypeMap.insert( SemanticToStringMap::value_type( "blendWeights", VES_BLEND_WEIGHTS ) ); - mSemanticTypeMap.insert( SemanticToStringMap::value_type( "normal", VES_NORMAL ) ); - mSemanticTypeMap.insert( SemanticToStringMap::value_type( "colour", VES_DIFFUSE ) ); - mSemanticTypeMap.insert( SemanticToStringMap::value_type( "secondary_colour", VES_SPECULAR ) ); - mSemanticTypeMap.insert( SemanticToStringMap::value_type( "blendIndices", VES_BLEND_INDICES ) ); - mSemanticTypeMap.insert( SemanticToStringMap::value_type( "tangent", VES_TANGENT ) ); - mSemanticTypeMap.insert( SemanticToStringMap::value_type( "binormal", VES_BINORMAL ) ); - mSemanticTypeMap.insert( SemanticToStringMap::value_type( "uv", VES_TEXTURE_COORDINATES ) ); + mSemanticTypeMap.emplace( "vertex", VES_POSITION ); + mSemanticTypeMap.emplace( "blendWeights", VES_BLEND_WEIGHTS ); + mSemanticTypeMap.emplace( "normal", VES_NORMAL ); + mSemanticTypeMap.emplace( "colour", VES_DIFFUSE ); + mSemanticTypeMap.emplace( "secondary_colour", VES_SPECULAR ); + mSemanticTypeMap.emplace( "blendIndices", VES_BLEND_INDICES ); + mSemanticTypeMap.emplace( "tangent", VES_TANGENT ); + mSemanticTypeMap.emplace( "binormal", VES_BINORMAL ); + mSemanticTypeMap.emplace( "uv", VES_TEXTURE_COORDINATES ); } GLSLProgram::~GLSLProgram() diff --git a/RenderSystems/GL3Plus/src/GLSL/OgreGLSLProgramManager.cpp b/RenderSystems/GL3Plus/src/GLSL/OgreGLSLProgramManager.cpp index 9f0f6a9ca4a..8c386269af0 100644 --- a/RenderSystems/GL3Plus/src/GLSL/OgreGLSLProgramManager.cpp +++ b/RenderSystems/GL3Plus/src/GLSL/OgreGLSLProgramManager.cpp @@ -56,166 +56,137 @@ namespace Ogre mGLSupport( support ) { // Fill in the relationship between type names and enums - mTypeEnumMap.insert( StringToEnumMap::value_type( "float", GL_FLOAT ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "vec2", GL_FLOAT_VEC2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "vec3", GL_FLOAT_VEC3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "vec4", GL_FLOAT_VEC4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "sampler1D", GL_SAMPLER_1D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "sampler2D", GL_SAMPLER_2D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "sampler3D", GL_SAMPLER_3D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "samplerCube", GL_SAMPLER_CUBE ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "sampler1DShadow", GL_SAMPLER_1D_SHADOW ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "sampler2DShadow", GL_SAMPLER_2D_SHADOW ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "int", GL_INT ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "ivec2", GL_INT_VEC2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "ivec3", GL_INT_VEC3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "ivec4", GL_INT_VEC4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "bool", GL_BOOL ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "bvec2", GL_BOOL_VEC2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "bvec3", GL_BOOL_VEC3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "bvec4", GL_BOOL_VEC4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat2", GL_FLOAT_MAT2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat3", GL_FLOAT_MAT3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat4", GL_FLOAT_MAT4 ) ); + mTypeEnumMap.emplace( "float", GL_FLOAT ); + mTypeEnumMap.emplace( "vec2", GL_FLOAT_VEC2 ); + mTypeEnumMap.emplace( "vec3", GL_FLOAT_VEC3 ); + mTypeEnumMap.emplace( "vec4", GL_FLOAT_VEC4 ); + mTypeEnumMap.emplace( "sampler1D", GL_SAMPLER_1D ); + mTypeEnumMap.emplace( "sampler2D", GL_SAMPLER_2D ); + mTypeEnumMap.emplace( "sampler3D", GL_SAMPLER_3D ); + mTypeEnumMap.emplace( "samplerCube", GL_SAMPLER_CUBE ); + mTypeEnumMap.emplace( "sampler1DShadow", GL_SAMPLER_1D_SHADOW ); + mTypeEnumMap.emplace( "sampler2DShadow", GL_SAMPLER_2D_SHADOW ); + mTypeEnumMap.emplace( "int", GL_INT ); + mTypeEnumMap.emplace( "ivec2", GL_INT_VEC2 ); + mTypeEnumMap.emplace( "ivec3", GL_INT_VEC3 ); + mTypeEnumMap.emplace( "ivec4", GL_INT_VEC4 ); + mTypeEnumMap.emplace( "bool", GL_BOOL ); + mTypeEnumMap.emplace( "bvec2", GL_BOOL_VEC2 ); + mTypeEnumMap.emplace( "bvec3", GL_BOOL_VEC3 ); + mTypeEnumMap.emplace( "bvec4", GL_BOOL_VEC4 ); + mTypeEnumMap.emplace( "mat2", GL_FLOAT_MAT2 ); + mTypeEnumMap.emplace( "mat3", GL_FLOAT_MAT3 ); + mTypeEnumMap.emplace( "mat4", GL_FLOAT_MAT4 ); // GL 2.1 - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat2x2", GL_FLOAT_MAT2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat3x3", GL_FLOAT_MAT3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat4x4", GL_FLOAT_MAT4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat2x3", GL_FLOAT_MAT2x3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat3x2", GL_FLOAT_MAT3x2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat3x4", GL_FLOAT_MAT3x4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat4x3", GL_FLOAT_MAT4x3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat2x4", GL_FLOAT_MAT2x4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "mat4x2", GL_FLOAT_MAT4x2 ) ); + mTypeEnumMap.emplace( "mat2x2", GL_FLOAT_MAT2 ); + mTypeEnumMap.emplace( "mat3x3", GL_FLOAT_MAT3 ); + mTypeEnumMap.emplace( "mat4x4", GL_FLOAT_MAT4 ); + mTypeEnumMap.emplace( "mat2x3", GL_FLOAT_MAT2x3 ); + mTypeEnumMap.emplace( "mat3x2", GL_FLOAT_MAT3x2 ); + mTypeEnumMap.emplace( "mat3x4", GL_FLOAT_MAT3x4 ); + mTypeEnumMap.emplace( "mat4x3", GL_FLOAT_MAT4x3 ); + mTypeEnumMap.emplace( "mat2x4", GL_FLOAT_MAT2x4 ); + mTypeEnumMap.emplace( "mat4x2", GL_FLOAT_MAT4x2 ); // GL 3.0 - mTypeEnumMap.insert( StringToEnumMap::value_type( "uint", GL_UNSIGNED_INT ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "uvec2", GL_UNSIGNED_INT_VEC2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "uvec3", GL_UNSIGNED_INT_VEC3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "uvec4", GL_UNSIGNED_INT_VEC4 ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "samplerCubeShadow", GL_SAMPLER_CUBE_SHADOW ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "sampler1DArray", GL_SAMPLER_1D_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "sampler2DArray", GL_SAMPLER_2D_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "sampler1DArrayShadow", GL_SAMPLER_1D_ARRAY_SHADOW ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "sampler2DArrayShadow", GL_SAMPLER_2D_ARRAY_SHADOW ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "isampler1D", GL_INT_SAMPLER_1D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "isampler2D", GL_INT_SAMPLER_2D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "isampler3D", GL_INT_SAMPLER_3D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "isamplerCube", GL_INT_SAMPLER_CUBE ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "isampler1DArray", GL_INT_SAMPLER_1D_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "isampler2DArray", GL_INT_SAMPLER_2D_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "usampler1D", GL_UNSIGNED_INT_SAMPLER_1D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "usampler2D", GL_UNSIGNED_INT_SAMPLER_2D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "usampler3D", GL_UNSIGNED_INT_SAMPLER_3D ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "usamplerCube", GL_UNSIGNED_INT_SAMPLER_CUBE ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "usampler1DArray", GL_UNSIGNED_INT_SAMPLER_1D_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "usampler2DArray", GL_UNSIGNED_INT_SAMPLER_2D_ARRAY ) ); + mTypeEnumMap.emplace( "uint", GL_UNSIGNED_INT ); + mTypeEnumMap.emplace( "uvec2", GL_UNSIGNED_INT_VEC2 ); + mTypeEnumMap.emplace( "uvec3", GL_UNSIGNED_INT_VEC3 ); + mTypeEnumMap.emplace( "uvec4", GL_UNSIGNED_INT_VEC4 ); + mTypeEnumMap.emplace( "samplerCubeShadow", GL_SAMPLER_CUBE_SHADOW ); + mTypeEnumMap.emplace( "sampler1DArray", GL_SAMPLER_1D_ARRAY ); + mTypeEnumMap.emplace( "sampler2DArray", GL_SAMPLER_2D_ARRAY ); + mTypeEnumMap.emplace( "sampler1DArrayShadow", GL_SAMPLER_1D_ARRAY_SHADOW ); + mTypeEnumMap.emplace( "sampler2DArrayShadow", GL_SAMPLER_2D_ARRAY_SHADOW ); + mTypeEnumMap.emplace( "isampler1D", GL_INT_SAMPLER_1D ); + mTypeEnumMap.emplace( "isampler2D", GL_INT_SAMPLER_2D ); + mTypeEnumMap.emplace( "isampler3D", GL_INT_SAMPLER_3D ); + mTypeEnumMap.emplace( "isamplerCube", GL_INT_SAMPLER_CUBE ); + mTypeEnumMap.emplace( "isampler1DArray", GL_INT_SAMPLER_1D_ARRAY ); + mTypeEnumMap.emplace( "isampler2DArray", GL_INT_SAMPLER_2D_ARRAY ); + mTypeEnumMap.emplace( "usampler1D", GL_UNSIGNED_INT_SAMPLER_1D ); + mTypeEnumMap.emplace( "usampler2D", GL_UNSIGNED_INT_SAMPLER_2D ); + mTypeEnumMap.emplace( "usampler3D", GL_UNSIGNED_INT_SAMPLER_3D ); + mTypeEnumMap.emplace( "usamplerCube", GL_UNSIGNED_INT_SAMPLER_CUBE ); + mTypeEnumMap.emplace( "usampler1DArray", GL_UNSIGNED_INT_SAMPLER_1D_ARRAY ); + mTypeEnumMap.emplace( "usampler2DArray", GL_UNSIGNED_INT_SAMPLER_2D_ARRAY ); // GL 3.1 - mTypeEnumMap.insert( StringToEnumMap::value_type( "sampler2DRect", GL_SAMPLER_2D_RECT ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "sampler2DRectShadow", GL_SAMPLER_2D_RECT_SHADOW ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "isampler2DRect", GL_INT_SAMPLER_2D_RECT ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "usampler2DRect", GL_UNSIGNED_INT_SAMPLER_2D_RECT ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "samplerBuffer", GL_SAMPLER_BUFFER ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "isamplerBuffer", GL_INT_SAMPLER_BUFFER ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "usamplerBuffer", GL_UNSIGNED_INT_SAMPLER_BUFFER ) ); + mTypeEnumMap.emplace( "sampler2DRect", GL_SAMPLER_2D_RECT ); + mTypeEnumMap.emplace( "sampler2DRectShadow", GL_SAMPLER_2D_RECT_SHADOW ); + mTypeEnumMap.emplace( "isampler2DRect", GL_INT_SAMPLER_2D_RECT ); + mTypeEnumMap.emplace( "usampler2DRect", GL_UNSIGNED_INT_SAMPLER_2D_RECT ); + mTypeEnumMap.emplace( "samplerBuffer", GL_SAMPLER_BUFFER ); + mTypeEnumMap.emplace( "isamplerBuffer", GL_INT_SAMPLER_BUFFER ); + mTypeEnumMap.emplace( "usamplerBuffer", GL_UNSIGNED_INT_SAMPLER_BUFFER ); // GL 3.2 - mTypeEnumMap.insert( StringToEnumMap::value_type( "sampler2DMS", GL_SAMPLER_2D_MULTISAMPLE ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "isampler2DMS", GL_INT_SAMPLER_2D_MULTISAMPLE ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "usampler2DMS", GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "sampler2DMSArray", GL_SAMPLER_2D_MULTISAMPLE_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "isampler2DMSArray", GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( - "usampler2DMSArray", GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY ) ); + mTypeEnumMap.emplace( "sampler2DMS", GL_SAMPLER_2D_MULTISAMPLE ); + mTypeEnumMap.emplace( "isampler2DMS", GL_INT_SAMPLER_2D_MULTISAMPLE ); + mTypeEnumMap.emplace( "usampler2DMS", GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE ); + mTypeEnumMap.emplace( "sampler2DMSArray", GL_SAMPLER_2D_MULTISAMPLE_ARRAY ); + mTypeEnumMap.emplace( "isampler2DMSArray", GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY ); + mTypeEnumMap.emplace( "usampler2DMSArray", GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY ); // GL 4.0 - mTypeEnumMap.insert( StringToEnumMap::value_type( "double", GL_DOUBLE ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat2", GL_DOUBLE_MAT2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat3", GL_DOUBLE_MAT3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat4", GL_DOUBLE_MAT4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat2x2", GL_DOUBLE_MAT2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat3x3", GL_DOUBLE_MAT3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat4x4", GL_DOUBLE_MAT4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat2x3", GL_DOUBLE_MAT2x3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat3x2", GL_DOUBLE_MAT3x2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat3x4", GL_DOUBLE_MAT3x4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat4x3", GL_DOUBLE_MAT4x3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat2x4", GL_DOUBLE_MAT2x4 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dmat4x2", GL_DOUBLE_MAT4x2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dvec2", GL_DOUBLE_VEC2 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dvec3", GL_DOUBLE_VEC3 ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "dvec4", GL_DOUBLE_VEC4 ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "samplerCubeArray", GL_SAMPLER_CUBE_MAP_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "samplerCubeArrayShadow", GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "isamplerCubeArray", GL_INT_SAMPLER_CUBE_MAP_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "usamplerCubeArray", GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY ) ); - - mTypeEnumMap.insert( StringToEnumMap::value_type( "image1D", GL_IMAGE_1D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "iimage1D", GL_INT_IMAGE_1D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "uimage1D", GL_UNSIGNED_INT_IMAGE_1D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "image2D", GL_IMAGE_2D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "iimage2D", GL_INT_IMAGE_2D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "uimage2D", GL_UNSIGNED_INT_IMAGE_2D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "image3D", GL_IMAGE_3D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "iimage3D", GL_INT_IMAGE_3D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "uimage3D", GL_UNSIGNED_INT_IMAGE_3D ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "image2DRect", GL_IMAGE_2D_RECT ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "iimage2DRect", GL_INT_IMAGE_2D_RECT ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "uimage2DRect", GL_UNSIGNED_INT_IMAGE_2D_RECT ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "imageCube", GL_IMAGE_CUBE ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "iimageCube", GL_INT_IMAGE_CUBE ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "uimageCube", GL_UNSIGNED_INT_IMAGE_CUBE ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "imageBuffer", GL_IMAGE_BUFFER ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "iimageBuffer", GL_INT_IMAGE_BUFFER ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "uimageBuffer", GL_UNSIGNED_INT_IMAGE_BUFFER ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "image1DArray", GL_IMAGE_1D_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "iimage1DArray", GL_INT_IMAGE_1D_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "uimage1DArray", GL_UNSIGNED_INT_IMAGE_1D_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "image2DArray", GL_IMAGE_2D_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "iimage2DArray", GL_INT_IMAGE_2D_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "uimage2DArray", GL_UNSIGNED_INT_IMAGE_2D_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "imageCubeArray", GL_IMAGE_CUBE_MAP_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "iimageCubeArray", GL_INT_IMAGE_CUBE_MAP_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "uimageCubeArray", GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "image2DMS", GL_IMAGE_2D_MULTISAMPLE ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "iimage2DMS", GL_INT_IMAGE_2D_MULTISAMPLE ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "uimage2DMS", GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "image2DMSArray", GL_IMAGE_2D_MULTISAMPLE_ARRAY ) ); - mTypeEnumMap.insert( - StringToEnumMap::value_type( "iimage2DMSArray", GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY ) ); - mTypeEnumMap.insert( StringToEnumMap::value_type( "uimage2DMSArray", - GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY ) ); + mTypeEnumMap.emplace( "double", GL_DOUBLE ); + mTypeEnumMap.emplace( "dmat2", GL_DOUBLE_MAT2 ); + mTypeEnumMap.emplace( "dmat3", GL_DOUBLE_MAT3 ); + mTypeEnumMap.emplace( "dmat4", GL_DOUBLE_MAT4 ); + mTypeEnumMap.emplace( "dmat2x2", GL_DOUBLE_MAT2 ); + mTypeEnumMap.emplace( "dmat3x3", GL_DOUBLE_MAT3 ); + mTypeEnumMap.emplace( "dmat4x4", GL_DOUBLE_MAT4 ); + mTypeEnumMap.emplace( "dmat2x3", GL_DOUBLE_MAT2x3 ); + mTypeEnumMap.emplace( "dmat3x2", GL_DOUBLE_MAT3x2 ); + mTypeEnumMap.emplace( "dmat3x4", GL_DOUBLE_MAT3x4 ); + mTypeEnumMap.emplace( "dmat4x3", GL_DOUBLE_MAT4x3 ); + mTypeEnumMap.emplace( "dmat2x4", GL_DOUBLE_MAT2x4 ); + mTypeEnumMap.emplace( "dmat4x2", GL_DOUBLE_MAT4x2 ); + mTypeEnumMap.emplace( "dvec2", GL_DOUBLE_VEC2 ); + mTypeEnumMap.emplace( "dvec3", GL_DOUBLE_VEC3 ); + mTypeEnumMap.emplace( "dvec4", GL_DOUBLE_VEC4 ); + mTypeEnumMap.emplace( "samplerCubeArray", GL_SAMPLER_CUBE_MAP_ARRAY ); + mTypeEnumMap.emplace( "samplerCubeArrayShadow", GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW ); + mTypeEnumMap.emplace( "isamplerCubeArray", GL_INT_SAMPLER_CUBE_MAP_ARRAY ); + mTypeEnumMap.emplace( "usamplerCubeArray", GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY ); + + mTypeEnumMap.emplace( "image1D", GL_IMAGE_1D ); + mTypeEnumMap.emplace( "iimage1D", GL_INT_IMAGE_1D ); + mTypeEnumMap.emplace( "uimage1D", GL_UNSIGNED_INT_IMAGE_1D ); + mTypeEnumMap.emplace( "image2D", GL_IMAGE_2D ); + mTypeEnumMap.emplace( "iimage2D", GL_INT_IMAGE_2D ); + mTypeEnumMap.emplace( "uimage2D", GL_UNSIGNED_INT_IMAGE_2D ); + mTypeEnumMap.emplace( "image3D", GL_IMAGE_3D ); + mTypeEnumMap.emplace( "iimage3D", GL_INT_IMAGE_3D ); + mTypeEnumMap.emplace( "uimage3D", GL_UNSIGNED_INT_IMAGE_3D ); + mTypeEnumMap.emplace( "image2DRect", GL_IMAGE_2D_RECT ); + mTypeEnumMap.emplace( "iimage2DRect", GL_INT_IMAGE_2D_RECT ); + mTypeEnumMap.emplace( "uimage2DRect", GL_UNSIGNED_INT_IMAGE_2D_RECT ); + mTypeEnumMap.emplace( "imageCube", GL_IMAGE_CUBE ); + mTypeEnumMap.emplace( "iimageCube", GL_INT_IMAGE_CUBE ); + mTypeEnumMap.emplace( "uimageCube", GL_UNSIGNED_INT_IMAGE_CUBE ); + mTypeEnumMap.emplace( "imageBuffer", GL_IMAGE_BUFFER ); + mTypeEnumMap.emplace( "iimageBuffer", GL_INT_IMAGE_BUFFER ); + mTypeEnumMap.emplace( "uimageBuffer", GL_UNSIGNED_INT_IMAGE_BUFFER ); + mTypeEnumMap.emplace( "image1DArray", GL_IMAGE_1D_ARRAY ); + mTypeEnumMap.emplace( "iimage1DArray", GL_INT_IMAGE_1D_ARRAY ); + mTypeEnumMap.emplace( "uimage1DArray", GL_UNSIGNED_INT_IMAGE_1D_ARRAY ); + mTypeEnumMap.emplace( "image2DArray", GL_IMAGE_2D_ARRAY ); + mTypeEnumMap.emplace( "iimage2DArray", GL_INT_IMAGE_2D_ARRAY ); + mTypeEnumMap.emplace( "uimage2DArray", GL_UNSIGNED_INT_IMAGE_2D_ARRAY ); + mTypeEnumMap.emplace( "imageCubeArray", GL_IMAGE_CUBE_MAP_ARRAY ); + mTypeEnumMap.emplace( "iimageCubeArray", GL_INT_IMAGE_CUBE_MAP_ARRAY ); + mTypeEnumMap.emplace( "uimageCubeArray", GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY ); + mTypeEnumMap.emplace( "image2DMS", GL_IMAGE_2D_MULTISAMPLE ); + mTypeEnumMap.emplace( "iimage2DMS", GL_INT_IMAGE_2D_MULTISAMPLE ); + mTypeEnumMap.emplace( "uimage2DMS", GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE ); + mTypeEnumMap.emplace( "image2DMSArray", GL_IMAGE_2D_MULTISAMPLE_ARRAY ); + mTypeEnumMap.emplace( "iimage2DMSArray", GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY ); + mTypeEnumMap.emplace( "uimage2DMSArray", GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY ); // GL 4.2 - mTypeEnumMap.insert( - StringToEnumMap::value_type( "atomic_uint", GL_UNSIGNED_INT_ATOMIC_COUNTER ) ); + mTypeEnumMap.emplace( "atomic_uint", GL_UNSIGNED_INT_ATOMIC_COUNTER ); } void GLSLProgramManager::convertGLUniformtoOgreType( GLenum gltype, @@ -839,7 +810,7 @@ namespace Ogre LogManager::getSingleton().logMessage( "Could not parse type of GLSL Uniform: '" + line + "' in file " + filename ); } - defs.map.insert( GpuConstantDefinitionMap::value_type( paramName, def ) ); + defs.map.emplace( paramName, def ); // Generate array accessors defs.generateConstantDefinitionArrayEntries( paramName, def ); diff --git a/RenderSystems/GL3Plus/src/GLSL/OgreGLSLShaderManager.cpp b/RenderSystems/GL3Plus/src/GLSL/OgreGLSLShaderManager.cpp index 4bb74aea12c..68019cb4162 100644 --- a/RenderSystems/GL3Plus/src/GLSL/OgreGLSLShaderManager.cpp +++ b/RenderSystems/GL3Plus/src/GLSL/OgreGLSLShaderManager.cpp @@ -49,7 +49,7 @@ namespace Ogre bool GLSLShaderManager::registerShaderFactory( const String &syntaxCode, CreateGpuProgramCallback createFn ) { - return mShaderMap.insert( ShaderMap::value_type( syntaxCode, createFn ) ).second; + return mShaderMap.emplace( syntaxCode, createFn ).second; } bool GLSLShaderManager::unregisterShaderFactory( const String &syntaxCode ) diff --git a/RenderSystems/GL3Plus/src/windowing/win32/OgreWin32GLSupport.cpp b/RenderSystems/GL3Plus/src/windowing/win32/OgreWin32GLSupport.cpp index 33118d783d1..d398644d871 100644 --- a/RenderSystems/GL3Plus/src/windowing/win32/OgreWin32GLSupport.cpp +++ b/RenderSystems/GL3Plus/src/windowing/win32/OgreWin32GLSupport.cpp @@ -114,7 +114,7 @@ namespace Ogre mDevModes.push_back( DevMode ); StringStream str; str << DevMode.dmPelsWidth << " x " << DevMode.dmPelsHeight; - optVideoMode.possibleValues.push_back( str.str() ); + optVideoMode.possibleValues.emplace_back( str.str() ); } remove_duplicates( optVideoMode.possibleValues ); optVideoMode.currentValue = optVideoMode.possibleValues.front(); diff --git a/RenderSystems/GL3Plus/src/windowing/win32/OgreWin32Window.cpp b/RenderSystems/GL3Plus/src/windowing/win32/OgreWin32Window.cpp index 14d27a4f690..295e04c1b95 100644 --- a/RenderSystems/GL3Plus/src/windowing/win32/OgreWin32Window.cpp +++ b/RenderSystems/GL3Plus/src/windowing/win32/OgreWin32Window.cpp @@ -847,7 +847,7 @@ namespace Ogre mTop = monitorInfo.rcMonitor.top; mLeft = monitorInfo.rcMonitor.left; - SetWindowLong( mHwnd, GWL_STYLE, getWindowStyle( mRequestedFullscreenMode ) ); + SetWindowLongPtr( mHwnd, GWL_STYLE, getWindowStyle( mRequestedFullscreenMode ) ); SetWindowPos( mHwnd, HWND_TOPMOST, mLeft, mTop, width, height, SWP_NOACTIVATE ); setFinalResolution( width, height ); } @@ -873,7 +873,7 @@ namespace Ogre int left = ( screenw > (int)winWidth ) ? ( ( screenw - (int)winWidth ) / 2 ) : 0; int top = ( screenh > (int)winHeight ) ? ( ( screenh - (int)winHeight ) / 2 ) : 0; - SetWindowLong( mHwnd, GWL_STYLE, getWindowStyle( mRequestedFullscreenMode ) ); + SetWindowLongPtr( mHwnd, GWL_STYLE, getWindowStyle( mRequestedFullscreenMode ) ); SetWindowPos( mHwnd, HWND_NOTOPMOST, left, top, winWidth, winHeight, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOACTIVATE ); mLeft = left; @@ -910,7 +910,7 @@ namespace Ogre { HWND currentWindowHandle = mHwnd; while( ( visible = ( IsIconic( currentWindowHandle ) == false ) ) && - ( GetWindowLong( currentWindowHandle, GWL_STYLE ) & WS_CHILD ) != 0 ) + ( GetWindowLongPtr( currentWindowHandle, GWL_STYLE ) & WS_CHILD ) != 0 ) { currentWindowHandle = GetParent( currentWindowHandle ); } diff --git a/RenderSystems/Vulkan/src/OgreVulkanHardwareIndexBuffer.cpp b/RenderSystems/Vulkan/src/OgreVulkanHardwareIndexBuffer.cpp index 91288026d92..043ae8c0eeb 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanHardwareIndexBuffer.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanHardwareIndexBuffer.cpp @@ -44,7 +44,7 @@ namespace Ogre IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage, bool useShadowBuffer ) : - HardwareIndexBuffer( mgr, idxType, numIndexes, usage, false, false ), + HardwareIndexBuffer( mgr, idxType, numIndexes, usage, false, useShadowBuffer ), mVulkanHardwareBufferCommon( mSizeInBytes, usage, OGRE_VHIB_ALIGNMENT, mgr->_getDiscardBufferManager(), mgr->_getDiscardBufferManager()->getDevice() ) diff --git a/RenderSystems/Vulkan/src/OgreVulkanHardwareVertexBuffer.cpp b/RenderSystems/Vulkan/src/OgreVulkanHardwareVertexBuffer.cpp index 8bc34a475e7..65aac6bb6dc 100644 --- a/RenderSystems/Vulkan/src/OgreVulkanHardwareVertexBuffer.cpp +++ b/RenderSystems/Vulkan/src/OgreVulkanHardwareVertexBuffer.cpp @@ -49,7 +49,7 @@ namespace Ogre size_t vertexSize, size_t numVertices, HardwareBuffer::Usage usage, bool useShadowBuffer ) : - HardwareVertexBuffer( mgr, vertexSize, numVertices, usage, false, false ), + HardwareVertexBuffer( mgr, vertexSize, numVertices, usage, false, useShadowBuffer ), mVulkanHardwareBufferCommon( mSizeInBytes, usage, OGRE_VHVB_ALIGNMENT, mgr->_getDiscardBufferManager(), diff --git a/Tools/CmgenToCubemap/main.cpp b/Tools/CmgenToCubemap/main.cpp index aba0108c39a..7e4fe23db43 100644 --- a/Tools/CmgenToCubemap/main.cpp +++ b/Tools/CmgenToCubemap/main.cpp @@ -143,7 +143,7 @@ int main( int argc, const char *argv[] ) } const uint32_t width = faceImage.getWidth(); - const uint32_t height = faceImage.getWidth(); + const uint32_t height = faceImage.getHeight(); const PixelFormatGpu pixelFormat = faceImage.getPixelFormat(); uint8_t numMipmaps = PixelFormatGpuUtils::getMaxMipmapCount( width, height );