diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index 8fc75df713..b19c0d4068 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -133,7 +133,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( const CString& sPath ) Effect effect = EFFECT_CENTER; for( int i=0; iSetEffectRainbow( 5 ); - if( sHint.Find("cyclealpha") != -1 ) + if( sHint.find("cyclealpha") != CString::npos ) for( unsigned i=0; iSetEffectDiffuseShift( 2, RageColor(1,1,1,1), RageColor(1,1,1,0) ); - if( sHint.Find("startonrandomframe") != -1 ) + if( sHint.find("startonrandomframe") != CString::npos ) for( unsigned i=0; iSetState( rand()%m_SubActors[i]->GetNumStates() ); - if( sHint.Find("dontanimate") != -1 ) + if( sHint.find("dontanimate") != CString::npos ) for( unsigned i=0; iStopAnimating(); - if( sHint.Find("add") != -1 ) + if( sHint.find("add") != CString::npos ) for( unsigned i=0; iSetBlendMode( BLEND_ADD ); } diff --git a/stepmania/src/GradeDisplay.cpp b/stepmania/src/GradeDisplay.cpp index b7b45f8945..7ecec18c74 100644 --- a/stepmania/src/GradeDisplay.cpp +++ b/stepmania/src/GradeDisplay.cpp @@ -30,7 +30,7 @@ void GradeDisplay::Load( RageTextureID ID ) Sprite::StopAnimating(); bool bWarn = Sprite::GetNumStates() != 8 && Sprite::GetNumStates() != 16; - if( ID.filename.Find("_blank") != -1 ) + if( ID.filename.find("_blank") != CString::npos ) bWarn = false; if( bWarn ) { @@ -74,7 +74,7 @@ void GradeDisplay::Update( float fDeltaTime ) int GradeDisplay::GetFrameIndex( PlayerNumber pn, Grade g ) { - if( this->m_pTexture->GetID().filename.Find("_blank") != -1 ) + if( this->m_pTexture->GetID().filename.find("_blank") != string::npos ) return 0; // either 8, or 16 states diff --git a/stepmania/src/ModelTypes.cpp b/stepmania/src/ModelTypes.cpp index 03de793bf7..935e3628dc 100644 --- a/stepmania/src/ModelTypes.cpp +++ b/stepmania/src/ModelTypes.cpp @@ -31,8 +31,8 @@ void AnimatedTexture::Load( CString sTexOrIniPath ) { ASSERT( vFrames.empty() ); // don't load more than once - m_bSphereMapped = sTexOrIniPath.Find("sphere") != -1; - if( sTexOrIniPath.Find("add") != -1 ) + m_bSphereMapped = sTexOrIniPath.find("sphere") != CString::npos; + if( sTexOrIniPath.find("add") != string::npos ) m_BlendMode = BLEND_ADD; else m_BlendMode = BLEND_NORMAL; diff --git a/stepmania/src/NetworkSyncManager.cpp b/stepmania/src/NetworkSyncManager.cpp index fe7cc54849..3587e4533f 100644 --- a/stepmania/src/NetworkSyncManager.cpp +++ b/stepmania/src/NetworkSyncManager.cpp @@ -125,8 +125,8 @@ void NetworkSyncManager::PostStartUp(const CString& ServerIP) CString sAddress; short iPort; - int cLoc = ServerIP.Find( ":" ); - if ( ServerIP.Find( ":" ) > 0 ) + size_t cLoc = ServerIP.find( ':' ); + if( ServerIP.find( ':' ) != CString::npos ) { iPort = (short) atoi( ServerIP.substr( cLoc + 1 ).c_str() ); sAddress = ServerIP.substr( 0, cLoc ); diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index 96d99117c6..d0f2022398 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -94,21 +94,21 @@ void RageBitmapTexture::Create() CString sHintString = GetID().filename + actualID.AdditionalTextureHints; sHintString.MakeLower(); - if( sHintString.Find("32bpp") != -1 ) actualID.iColorDepth = 32; - else if( sHintString.Find("16bpp") != -1 ) actualID.iColorDepth = 16; - if( sHintString.Find("dither") != -1 ) actualID.bDither = true; - if( sHintString.Find("stretch") != -1 ) actualID.bStretch = true; - if( sHintString.Find("mipmaps") != -1 ) actualID.bMipMaps = true; - if( sHintString.Find("nomipmaps") != -1 ) actualID.bMipMaps = false; // check for "nomipmaps" after "mipmaps" + if( sHintString.find("32bpp") != string::npos ) actualID.iColorDepth = 32; + else if( sHintString.find("16bpp") != string::npos ) actualID.iColorDepth = 16; + if( sHintString.find("dither") != string::npos ) actualID.bDither = true; + if( sHintString.find("stretch") != string::npos ) actualID.bStretch = true; + if( sHintString.find("mipmaps") != string::npos ) actualID.bMipMaps = true; + if( sHintString.find("nomipmaps") != string::npos ) actualID.bMipMaps = false; // check for "nomipmaps" after "mipmaps" /* If the image is marked grayscale, then use all bits not used for alpha * for the intensity. This way, if an image has no alpha, you get an 8-bit * grayscale; if it only has boolean transparency, you get a 7-bit grayscale. */ - if( sHintString.Find("grayscale") != -1 ) actualID.iGrayscaleBits = 8-actualID.iAlphaBits; + if( sHintString.find("grayscale") != string::npos ) actualID.iGrayscaleBits = 8-actualID.iAlphaBits; /* This indicates that the only component in the texture is alpha; assume all * color is white. */ - if( sHintString.Find("alphamap") != -1 ) actualID.iGrayscaleBits = 0; + if( sHintString.find("alphamap") != string::npos ) actualID.iGrayscaleBits = 0; /* No iGrayscaleBits for images that are already paletted. We don't support * that; and that hint is intended for use on images that are already grayscale, diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 24b5c76820..ba32f4d96c 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -897,7 +897,7 @@ RageSoundParams::StopMode_t RageSound::GetStopMode() const if( m_Param.StopMode != RageSoundParams::M_AUTO ) return m_Param.StopMode; - if( m_sFilePath.Find("loop") != -1 ) + if( m_sFilePath.find("loop") != string::npos ) return RageSoundParams::M_LOOP; else return RageSoundParams::M_STOP;