16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-17 23:39:18 +02:00

Replace starts_with and ends_with with string class methods

This commit is contained in:
docentYT
2026-05-01 17:31:11 +02:00
parent 9c27b54960
commit ec1dfae953
15 changed files with 29 additions and 50 deletions

View File

@@ -288,7 +288,7 @@ bool TAnimModel::Load(cParser *parser, bool ter)
{ // gdy brak modelu
if (ter) // jeśli teren
{
if( ends_with( name, ".t3d" ) ) {
if( name.ends_with(".t3d") ) {
name[ name.length() - 3 ] = 'e';
}
#ifdef EU07_USE_OLD_TERRAINCODE

View File

@@ -2215,13 +2215,13 @@ void TSubModel::BinInit(TSubModel *s, float4x4 *m, std::vector<std::string> *t,
if (!pName.empty())
{ // jeśli dany submodel jest zgaszonym światłem, to
// domyślnie go ukrywamy
if (starts_with(pName, "Light_On"))
if (pName.starts_with("Light_On"))
{ // jeśli jest światłem numerowanym
iVisible = 0; // to domyślnie wyłączyć, żeby się nie nakładało z obiektem "Light_Off"
}
else if (dynamic)
{ // inaczej wyłączało smugę w latarniach
if (ends_with(pName, "_on"))
if (pName.ends_with("_on"))
{
// jeśli jest kontrolką w stanie zapalonym to domyślnie wyłączyć,
// żeby się nie nakładało z obiektem "_off"

View File

@@ -1324,8 +1324,7 @@ texture_manager::create( std::string Filename, bool const Loadnow, GLint Formath
erase_leading_slashes( Filename );
Filename = ToLower( Filename );
// temporary code for legacy assets -- textures with names beginning with # are to be sharpened
if( ( starts_with( Filename, "#" ) )
|| ( contains( Filename, "/#" ) ) ) {
if( Filename.starts_with("#") || contains( Filename, "/#" ) ) {
traits += '#';
}
}