maintenance: string search methods

This commit is contained in:
tmj-fstate
2021-05-27 14:23:00 +02:00
parent b3940d47cb
commit 7b816594ba
23 changed files with 120 additions and 106 deletions

View File

@@ -1141,8 +1141,9 @@ texture_manager::unit( GLint const Textureunit ) {
texture_handle
texture_manager::create( std::string Filename, bool const Loadnow, GLint Formathint ) {
if( Filename.find( '|' ) != std::string::npos )
if( contains( Filename, '|' ) ) {
Filename.erase( Filename.find( '|' ) ); // po | może być nazwa kolejnej tekstury
}
std::pair<std::string, std::string> locator; // resource name, resource type
std::string traits;
@@ -1181,8 +1182,8 @@ texture_manager::create( std::string Filename, bool const Loadnow, GLint Formath
replace_slashes( Filename );
erase_leading_slashes( Filename );
// temporary code for legacy assets -- textures with names beginning with # are to be sharpened
if( ( Filename.front() == '#' )
|| ( Filename.find( "/#" ) != std::string::npos ) ) {
if( ( starts_with( Filename, "#" ) )
|| ( contains( Filename, "/#" ) ) ) {
traits += '#';
}
}