rString gfx::MaterialBank::GetDir(rString& filename) { bool found = false; for (int i = static_cast<int>(filename.size()); i > 0; i--) { if (filename.c_str()[i] == '/' || filename.c_str()[i] == '\\' ) found = true; if (!found) { filename.erase(i); } } return filename; }
rString gfx::ShaderProgram::GetDir ( rString filename ) { bool found = false; for ( int i = static_cast<int> ( filename.size() ); i > 0; i-- ) { if ( filename.c_str() [i] == '/' ) { found = true; } if ( !found ) { filename.erase ( i ); } } return filename; }
rString gfx::TextureAtlas::GetDir ( rString str ) { bool found = false; for ( int i = static_cast<int> ( str.size() ); i > 0; i-- ) { if ( str.c_str() [i] == '/' ) { found = true; } if ( !found ) { str.erase ( i ); } } return str; }