@@ -1361,7 +1361,7 @@ namespace Ogre{
1361
1361
AbstractNodeList::const_iterator i0 = getNodeAt(prop->values, 0), i1 = getNodeAt(prop->values, 1);
1362
1362
String name, value;
1363
1363
if(getString(*i0, &name) && getString(*i1, &value))
1364
- mTextureAliases.emplace(name, value);
1364
+ mTextureAliases.emplace( name, value );
1365
1365
else
1366
1366
compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
1367
1367
"set_texture_alias must have 2 string argument");
@@ -2399,10 +2399,11 @@ namespace Ogre{
2399
2399
}
2400
2400
else
2401
2401
{
2402
- AbstractNodeList::const_iterator i1 = getNodeAt(prop->values, 1), i2 = getNodeAt(prop->values, 2) ;
2402
+ AbstractNodeList::const_iterator i1 = getNodeAt(prop->values, 1);
2403
2403
bool val = false;
2404
2404
if(getBoolean(prop->values.front(), &val))
2405
2405
{
2406
+ AbstractNodeList::const_iterator i2 = getNodeAt( prop->values, 2 );
2406
2407
FogMode mode = FOG_NONE;
2407
2408
ColourValue clr = ColourValue::White;
2408
2409
Real dens = Real( 0.001 ), start = 0.0f, end = 1.0f;
@@ -4685,7 +4686,7 @@ namespace Ogre{
4685
4686
//-------------------------------------------------------------------------
4686
4687
void GpuProgramTranslator::translateGpuProgram(ScriptCompiler *compiler, ObjectAbstractNode *obj)
4687
4688
{
4688
- list <std::pair<String,String> >::type customParameters;
4689
+ vector <std::pair<String,String> >::type customParameters;
4689
4690
String syntax, source;
4690
4691
AbstractNodePtr params;
4691
4692
for(AbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
@@ -4740,7 +4741,7 @@ namespace Ogre{
4740
4741
value += ((AtomAbstractNode*)(*it).get())->value;
4741
4742
}
4742
4743
}
4743
- customParameters.emplace_back(name, value);
4744
+ customParameters.emplace_back( name, value );
4744
4745
}
4745
4746
}
4746
4747
else if((*i)->type == ANT_OBJECT)
@@ -4790,7 +4791,7 @@ namespace Ogre{
4790
4791
prog->_notifyOrigin(obj->file);
4791
4792
4792
4793
// Set the custom parameters
4793
- for(list <std::pair<String,String> >::type::iterator i = customParameters.begin(); i != customParameters.end(); ++i)
4794
+ for(vector <std::pair<String,String> >::type::iterator i = customParameters.begin(); i != customParameters.end(); ++i)
4794
4795
prog->setParameter(i->first, i->second);
4795
4796
4796
4797
// Set up default parameters
@@ -4803,7 +4804,7 @@ namespace Ogre{
4803
4804
//-------------------------------------------------------------------------
4804
4805
void GpuProgramTranslator::translateUnifiedGpuProgram(ScriptCompiler *compiler, ObjectAbstractNode *obj)
4805
4806
{
4806
- list <std::pair<String,String> >::type customParameters;
4807
+ vector <std::pair<String,String> >::type customParameters;
4807
4808
AbstractNodePtr params;
4808
4809
for(AbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
4809
4810
{
@@ -4818,7 +4819,7 @@ namespace Ogre{
4818
4819
4819
4820
ProcessResourceNameScriptCompilerEvent evt(ProcessResourceNameScriptCompilerEvent::GPU_PROGRAM, value);
4820
4821
compiler->_fireEvent(&evt, 0);
4821
- customParameters.emplace_back("delegate", evt.mName);
4822
+ customParameters.emplace_back( "delegate", evt.mName );
4822
4823
}
4823
4824
else
4824
4825
{
@@ -4835,7 +4836,7 @@ namespace Ogre{
4835
4836
value += ((AtomAbstractNode*)(*it).get())->value;
4836
4837
}
4837
4838
}
4838
- customParameters.emplace_back(name, value);
4839
+ customParameters.emplace_back( name, value );
4839
4840
}
4840
4841
}
4841
4842
else if((*i)->type == ANT_OBJECT)
@@ -4874,7 +4875,7 @@ namespace Ogre{
4874
4875
prog->_notifyOrigin(obj->file);
4875
4876
4876
4877
// Set the custom parameters
4877
- for(list <std::pair<String,String> >::type::iterator i = customParameters.begin(); i != customParameters.end(); ++i)
4878
+ for(vector <std::pair<String,String> >::type::iterator i = customParameters.begin(); i != customParameters.end(); ++i)
4878
4879
prog->setParameter(i->first, i->second);
4879
4880
4880
4881
// Set up default parameters
@@ -4900,7 +4901,7 @@ namespace Ogre{
4900
4901
return;
4901
4902
}
4902
4903
4903
- list <std::pair<String,String> >::type customParameters;
4904
+ vector <std::pair<String,String> >::type customParameters;
4904
4905
String source;
4905
4906
AbstractNodePtr params;
4906
4907
for(AbstractNodeList::iterator i = obj->children.begin(); i != obj->children.end(); ++i)
@@ -4949,7 +4950,7 @@ namespace Ogre{
4949
4950
}
4950
4951
}
4951
4952
}
4952
- customParameters.emplace_back(name, value);
4953
+ customParameters.emplace_back( name, value );
4953
4954
}
4954
4955
}
4955
4956
else if((*i)->type == ANT_OBJECT)
@@ -4991,7 +4992,7 @@ namespace Ogre{
4991
4992
prog->_notifyOrigin(obj->file);
4992
4993
4993
4994
// Set the custom parameters
4994
- for(list <std::pair<String,String> >::type::iterator i = customParameters.begin(); i != customParameters.end(); ++i)
4995
+ for(vector <std::pair<String,String> >::type::iterator i = customParameters.begin(); i != customParameters.end(); ++i)
4995
4996
prog->setParameter(i->first, i->second);
4996
4997
4997
4998
// Set up default parameters
@@ -5003,7 +5004,7 @@ namespace Ogre{
5003
5004
5004
5005
}
5005
5006
//-------------------------------------------------------------------------
5006
- uint32 parseProgramParameterDimensions(String& declarator, String type)
5007
+ uint32 parseProgramParameterDimensions(const String& declarator, const String& type)
5007
5008
{
5008
5009
// Assume 1 unless otherwise specified
5009
5010
uint32 dimensions = 1;
@@ -5012,7 +5013,7 @@ namespace Ogre{
5012
5013
5013
5014
if (start != String::npos)
5014
5015
{
5015
- size_t end = declarator.find_first_of("[" , start);
5016
+ size_t end = declarator.find_first_of('[' , start);
5016
5017
5017
5018
// int1, int2, etc.
5018
5019
if (end != start)
@@ -5025,10 +5026,10 @@ namespace Ogre{
5025
5026
// C-style array
5026
5027
while (start != String::npos)
5027
5028
{
5028
- end = declarator.find_first_of("]" , start);
5029
+ end = declarator.find_first_of(']' , start);
5029
5030
dimensions *= StringConverter::parseUnsignedInt(
5030
5031
declarator.substr(start + 1, end - start - 1));
5031
- start = declarator.find_first_of("[" , end);
5032
+ start = declarator.find_first_of('[' , end);
5032
5033
}
5033
5034
}
5034
5035
@@ -7702,7 +7703,7 @@ namespace Ogre{
7702
7703
else
7703
7704
{
7704
7705
AbstractNodeList::const_iterator it1 = prop->values.begin();
7705
- AbstractNodeList::const_iterator it0 = it1++ ;
7706
+ AbstractNodeList::const_iterator it0 = std::next( it1 ) ;
7706
7707
7707
7708
uint32 outChannel;
7708
7709
IdString bufferName;
@@ -8627,7 +8628,7 @@ namespace Ogre{
8627
8628
uint32 colourIdx;
8628
8629
LoadAction::LoadAction loadAction;
8629
8630
AbstractNodeList::const_iterator it1 = prop->values.begin();
8630
- AbstractNodeList::const_iterator it0 = it1++ ;
8631
+ AbstractNodeList::const_iterator it0 = std::next( it1 ) ;
8631
8632
if( getUInt( *it0, &colourIdx ) && getLoadAction( *it1, &loadAction ) )
8632
8633
{
8633
8634
if( colourIdx < OGRE_MAX_MULTIPLE_RENDER_TARGETS )
@@ -8912,7 +8913,7 @@ namespace Ogre{
8912
8913
uint32 colourIdx;
8913
8914
StoreAction::StoreAction storeAction;
8914
8915
AbstractNodeList::const_iterator it1 = prop->values.begin();
8915
- AbstractNodeList::const_iterator it0 = it1++ ;
8916
+ AbstractNodeList::const_iterator it0 = std::next( it1 ) ;
8916
8917
if( getUInt( *it0, &colourIdx ) && getStoreAction( *it1, &storeAction ) )
8917
8918
{
8918
8919
if( colourIdx < OGRE_MAX_MULTIPLE_RENDER_TARGETS )
@@ -9307,8 +9308,8 @@ namespace Ogre{
9307
9308
else
9308
9309
{
9309
9310
AbstractNodeList::const_iterator it2 = prop->values.begin();
9310
- AbstractNodeList::const_iterator it0 = it2++ ;
9311
- AbstractNodeList::const_iterator it1 = it2++ ;
9311
+ AbstractNodeList::const_iterator it0 = std::next( it2 ) ;
9312
+ AbstractNodeList::const_iterator it1 = std::next( it2, 2 ) ;
9312
9313
9313
9314
uint32 id;
9314
9315
String name;
@@ -9717,9 +9718,9 @@ namespace Ogre{
9717
9718
gbuffer.resize( 2 );
9718
9719
9719
9720
AbstractNodeList::const_iterator it3 = prop->values.begin();
9720
- AbstractNodeList::const_iterator it0 = it3++ ;
9721
- AbstractNodeList::const_iterator it1 = it3++ ;
9722
- AbstractNodeList::const_iterator it2 = it3++ ;
9721
+ AbstractNodeList::const_iterator it0 = std::next( it3 ) ;
9722
+ AbstractNodeList::const_iterator it1 = std::next( it3, 2 ) ;
9723
+ AbstractNodeList::const_iterator it2 = std::next( it3, 3 ) ;
9723
9724
9724
9725
if( !getIdString( *it0, &gbuffer[0] ) ||
9725
9726
!getIdString( *it1, &gbuffer[1] ) ||
@@ -9766,7 +9767,7 @@ namespace Ogre{
9766
9767
IdString depthTexture, refractions;
9767
9768
9768
9769
AbstractNodeList::const_iterator it1 = prop->values.begin();
9769
- AbstractNodeList::const_iterator it0 = it1++ ;
9770
+ AbstractNodeList::const_iterator it0 = std::next( it1 ) ;
9770
9771
9771
9772
if( !getIdString( *it0, &depthTexture ) || !getIdString( *it1, &refractions ) )
9772
9773
{
@@ -9812,7 +9813,7 @@ namespace Ogre{
9812
9813
else
9813
9814
{
9814
9815
AbstractNodeList::const_iterator it1 = prop->values.begin();
9815
- AbstractNodeList::const_iterator it0 = it1++ ;
9816
+ AbstractNodeList::const_iterator it0 = std::next( it1 ) ;
9816
9817
9817
9818
if( !getReal( *it0, &passScene->mUvBakingOffset.x ) ||
9818
9819
!getReal( *it1, &passScene->mUvBakingOffset.y ) )
@@ -9943,10 +9944,6 @@ namespace Ogre{
9943
9944
}
9944
9945
9945
9946
AbstractNodeList::const_iterator it0 = prop->values.begin();
9946
- AbstractNodeList::const_iterator it1 = it0;
9947
- if( prop->values.size() > 1 )
9948
- ++it1;
9949
-
9950
9947
String str;
9951
9948
if( getString( *it0, &str ) )
9952
9949
{
@@ -10719,8 +10716,8 @@ namespace Ogre{
10719
10716
else
10720
10717
{
10721
10718
AbstractNodeList::const_iterator it2 = prop->values.begin();
10722
- AbstractNodeList::const_iterator it0 = it2++ ;
10723
- AbstractNodeList::const_iterator it1 = it2++ ;
10719
+ AbstractNodeList::const_iterator it0 = std::next( it2 ) ;
10720
+ AbstractNodeList::const_iterator it1 = std::next( it2, 2 ) ;
10724
10721
10725
10722
uint32 id;
10726
10723
String name;
@@ -10772,6 +10769,7 @@ namespace Ogre{
10772
10769
else if((*i)->type == ANT_PROPERTY)
10773
10770
{
10774
10771
PropertyAbstractNode *prop = reinterpret_cast<PropertyAbstractNode*>((*i).get());
10772
+ const AbstractNodePtr beginNode = prop->values.front();
10775
10773
switch(prop->id)
10776
10774
{
10777
10775
case ID_MIPMAP_METHOD:
@@ -10786,9 +10784,9 @@ namespace Ogre{
10786
10784
}
10787
10785
else
10788
10786
{
10789
- if(prop->values.front()-> type == ANT_ATOM)
10787
+ if( beginNode-> type == ANT_ATOM )
10790
10788
{
10791
- AtomAbstractNode *atom = (AtomAbstractNode*)prop->values.front() .get();
10789
+ AtomAbstractNode *atom = (AtomAbstractNode *)beginNode .get();
10792
10790
switch(atom->id)
10793
10791
{
10794
10792
case ID_API_DEFAULT:
@@ -10802,14 +10800,14 @@ namespace Ogre{
10802
10800
break;
10803
10801
default:
10804
10802
compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
10805
- prop->values.front() ->getValue() +
10803
+ beginNode ->getValue() +
10806
10804
" is not a valid miprmap_method (api_default, compute, or compute_hq)");
10807
10805
}
10808
10806
}
10809
10807
else
10810
10808
{
10811
10809
compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
10812
- prop->values.front() ->getValue() +
10810
+ beginNode ->getValue() +
10813
10811
" is not a valid miprmap_method (api_default, compute, or compute_hq)");
10814
10812
}
10815
10813
}
@@ -10827,10 +10825,10 @@ namespace Ogre{
10827
10825
else
10828
10826
{
10829
10827
int value = 8;
10830
- if( !getInt( prop->values.front() , &value ) )
10828
+ if( !getInt( beginNode , &value ) )
10831
10829
{
10832
10830
compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
10833
- prop->values.front()-> getValue() + " is not a valid integer argument");
10831
+ beginNode-> getValue() + " is not a valid integer argument" );
10834
10832
}
10835
10833
else
10836
10834
{
@@ -10850,10 +10848,10 @@ namespace Ogre{
10850
10848
}
10851
10849
else
10852
10850
{
10853
- if( !getFloat( prop->values.front() , &passMipmap->mGaussianDeviationFactor ) )
10851
+ if( !getFloat( beginNode , &passMipmap->mGaussianDeviationFactor ) )
10854
10852
{
10855
10853
compiler->addError(ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
10856
- prop->values.front()-> getValue() + " is not a valid integer argument");
10854
+ beginNode-> getValue() + " is not a valid integer argument" );
10857
10855
}
10858
10856
}
10859
10857
break;
0 commit comments