tweak StringOutputStream use
auto str = StringOutputStream()(bla) use form was not doing copy elision or move, but copy
This commit is contained in:
@@ -18,24 +18,20 @@
|
||||
|
||||
|
||||
CopiedString GetCommonShader( const char* name ){
|
||||
StringOutputStream sstream( 128 );
|
||||
sstream << "shader_" << name;
|
||||
const char* gotShader = g_pGameDescription->getKeyValue( sstream.c_str() );
|
||||
const char* gotShader = g_pGameDescription->getKeyValue( StringStream<32>( "shader_", name ) );
|
||||
if( !string_empty( gotShader ) ){
|
||||
return gotShader;
|
||||
}
|
||||
else{
|
||||
sstream.clear();
|
||||
if( string_empty( g_pGameDescription->getKeyValue( "show_wads" ) ) ){
|
||||
const char* commonDir = g_pGameDescription->getKeyValue( "common_shaders_dir" );
|
||||
if( string_empty( commonDir ) )
|
||||
commonDir = "common/";
|
||||
sstream << "textures/" << commonDir << name;
|
||||
return StringStream<64>( "textures/", commonDir, name ).c_str();
|
||||
}
|
||||
else{
|
||||
sstream << "textures/" << name;
|
||||
return StringStream<64>( "textures/", name ).c_str();
|
||||
}
|
||||
return sstream.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user