tweak StringOutputStream use

auto str = StringOutputStream()(bla) use form was not doing copy elision or move, but copy
This commit is contained in:
Garux
2024-01-29 16:54:08 +06:00
parent b4e44bc8ed
commit df02774ff5
122 changed files with 984 additions and 1204 deletions

View File

@@ -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();
}
}