diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 9cdc7aa03c..b33a59344e 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -802,16 +802,14 @@ void Actor::HandleCommand( const CStringArray &asTokens ) { CString sError = ssprintf( "Actor::HandleCommand: Unrecognized command name '%s'.", sName.c_str() ); LOG->Warn( sError ); - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( sError ); + HOOKS->MessageBoxOK( sError ); } if( iMaxIndexAccessed != (int)asTokens.size()-1 ) { CString sError = ssprintf( "Actor::HandleCommand: Wrong number of parameters in command '%s'. Expected %d but there are %d.", join(",",asTokens).c_str(), iMaxIndexAccessed+1, (int)asTokens.size() ); LOG->Warn( sError ); - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( sError ); + HOOKS->MessageBoxOK( sError ); } } diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 24bb0d8631..c001280d8e 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -133,8 +133,7 @@ void IncorrectActorParametersWarning( const CStringArray &asTokens, int iMaxInde const CString sError = ssprintf( "Actor::HandleCommand: Wrong number of parameters in command '%s'. Expected %d but there are %d.", join(",",asTokens).c_str(), iMaxIndexAccessed+1, size ); LOG->Warn( sError ); - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( sError ); + HOOKS->MessageBoxOK( sError ); } void UtilSetXY( Actor& actor, CString sClassName ) diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index 62371147cd..6eea237a9b 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -472,9 +472,8 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) } else if( sFile == "" ) { - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( ssprintf( - "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.c_str(), sLayer.c_str() ) ); + HOOKS->MessageBoxOK( ssprintf( + "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.c_str(), sLayer.c_str() ) ); } @@ -486,8 +485,7 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) if(asElementPaths.size() == 0) { CString sError = ssprintf("In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.c_str(), sFile.c_str()); - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( sError ); + HOOKS->MessageBoxOK( sError ); LOG->Warn( sError ); return; } @@ -497,8 +495,7 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) "There is more than one file that matches " "'%s/%s'. Please remove all but one of these matches.", sAniDir.c_str(), sFile.c_str() ); - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( sError ); + HOOKS->MessageBoxOK( sError ); LOG->Warn( sError ); } sPath = asElementPaths[0]; diff --git a/stepmania/src/DifficultyIcon.cpp b/stepmania/src/DifficultyIcon.cpp index 292438cb28..44d97e1eec 100644 --- a/stepmania/src/DifficultyIcon.cpp +++ b/stepmania/src/DifficultyIcon.cpp @@ -26,8 +26,7 @@ bool DifficultyIcon::Load( CString sPath ) Sprite::Load( sPath ); int iStates = GetNumStates(); if( iStates != 5 && iStates != 10 ) - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( ssprintf("The difficulty icon graphic '%s' must have 5 or 10 frames. It has %d states.", sPath.c_str(), iStates) ); + HOOKS->MessageBoxOK( ssprintf("The difficulty icon graphic '%s' must have 5 or 10 frames. It has %d states.", sPath.c_str(), iStates) ); StopAnimating(); return true; } diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index 861eba141c..adb20aeead 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -543,11 +543,23 @@ void NoteField::DrawPrimitives() bool bIsAddition = (tn == TAP_ADDITION); bool bIsMine = (tn == TAP_MINE); + bool bIsAttack = (tn==TAP_ATTACK); - SearchForBeat( CurDisplay, NextDisplay, NoteRowToBeat(i) ); - - NoteDisplayCols *nd = CurDisplay->second; - nd->display[c].DrawTap( c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, bIsAddition, bIsMine, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, 1, m_fYReverseOffsetPixels ); + if( bIsAttack ) + { + const AttackNote* pA = GetAttackNoteAt( c, i ); + Sprite sprite; + sprite.Load( THEME->GetPathToG("NoteField attack "+pA->sModifiers) ); + SearchForBeat( CurDisplay, NextDisplay, NoteRowToBeat(i) ); + NoteDisplayCols *nd = CurDisplay->second; + nd->display[c].DrawActor( &sprite, c, NoteRowToBeat(i), bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, 1, m_fYReverseOffsetPixels ); + } + else + { + SearchForBeat( CurDisplay, NextDisplay, NoteRowToBeat(i) ); + NoteDisplayCols *nd = CurDisplay->second; + nd->display[c].DrawTap( c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, bIsAddition, bIsMine, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, 1, m_fYReverseOffsetPixels ); + } } g_NoteFieldMode[m_PlayerNumber].EndDrawTrack(c); diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index cec0d3a8b1..8838e21def 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -280,8 +280,7 @@ CString NoteSkinManager::GetPathTo( CString sDir, CString sFileName ) if( matches.size() > 1 ) { CString sError = "Multiple files match '"+sDir+sFileName+"'. Please remove all but one of these files."; - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( sError ); + HOOKS->MessageBoxOK( sError ); } CString sPath = matches[0]; diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index bb38623123..06ce47a4b1 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -346,8 +346,7 @@ apply_color_key: fBetterSourceWidth, fBetterSourceHeight, fBetterFrameWidth, fBetterFrameHeight ); LOG->Warn( sWarning ); - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( sWarning, "FRAME_DIMENSIONS_WARNING" ); + HOOKS->MessageBoxOK( sWarning, "FRAME_DIMENSIONS_WARNING" ); } } diff --git a/stepmania/src/RageException.cpp b/stepmania/src/RageException.cpp index 1e8ea4dafa..1897958865 100644 --- a/stepmania/src/RageException.cpp +++ b/stepmania/src/RageException.cpp @@ -13,6 +13,11 @@ #include "RageException.h" #include "RageUtil.h" #include "RageLog.h" +#include "RageLog.h" + +#if defined(WIN32) && defined(DEBUG) +#include "windows.h" +#endif RageException::RageException( const char *fmt, ...) { diff --git a/stepmania/src/RageMath.cpp b/stepmania/src/RageMath.cpp index 6ac197d83e..f2addd3921 100644 --- a/stepmania/src/RageMath.cpp +++ b/stepmania/src/RageMath.cpp @@ -248,8 +248,7 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat ) { CString sError = ssprintf( "MatrixCommand: Unrecognized matrix command name '%s' in command string '%s'.", sName.c_str(), sCommandString.c_str() ); LOG->Warn( sError ); - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( sError ); + HOOKS->MessageBoxOK( sError ); continue; } @@ -258,8 +257,7 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat ) { CString sError = ssprintf( "MatrixCommand: Wrong number of parameters in command '%s'. Expected %d but there are %d.", join(",",asTokens).c_str(), iMaxIndexAccessed+1, (int)asTokens.size() ); LOG->Warn( sError ); - if( DISPLAY->IsWindowed() ) - HOOKS->MessageBoxOK( sError ); + HOOKS->MessageBoxOK( sError ); continue; } diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 0ccd116488..f6acf56f7b 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -244,9 +244,8 @@ try_element_again: "'%s/%s/%s'. Please remove all but one of these matches.", sThemeName.c_str(), sCategory.c_str(), sFileName.c_str() ); - if( DISPLAY->IsWindowed() ) - if( ArchHooks::retry == HOOKS->MessageBoxRetryCancel(message) ) - goto try_element_again; + if( ArchHooks::retry == HOOKS->MessageBoxRetryCancel(message) ) + goto try_element_again; RageException::Throw( message ); } @@ -292,9 +291,8 @@ try_element_again: "Verify that this redirect is correct.", sPath.c_str(), sNewFileName.c_str()); - if( DISPLAY->IsWindowed() ) - if( ArchHooks::retry == HOOKS->MessageBoxAbortRetryIgnore(message) ) - goto try_element_again; + if( ArchHooks::retry == HOOKS->MessageBoxAbortRetryIgnore(message) ) + goto try_element_again; RageException::Throw( "%s", message.c_str() ); } @@ -339,24 +337,23 @@ try_element_again: CString sCategory = ELEMENT_CATEGORY_STRING[category]; -#if defined(DEBUG) && defined(WIN32) CString sMessage = "The theme element '" + sCategory + SLASH + sFileName +"' is missing."; - switch( MessageBox(NULL, sMessage, "ThemeManager", MB_RETRYCANCEL ) ) + switch( HOOKS->MessageBoxRetryCancel(sMessage) ) { - case IDRETRY: + case ArchHooks::retry: FlushDirCache(); g_ThemePathCache[category].clear(); - goto try_element_again; - case IDCANCEL: + case ArchHooks::cancel: RageException::Throw( "Theme element '%s" SLASH "%s' could not be found in '%s' or '%s'.", sCategory.c_str(), sFileName.c_str(), GetThemeDirFromName(m_sCurThemeName).c_str(), GetThemeDirFromName(BASE_THEME_NAME).c_str() ); break; + default: + ASSERT(0); } -#endif LOG->Warn( "Theme element '%s" SLASH "%s' could not be found in '%s' or '%s'.", @@ -424,22 +421,19 @@ try_metric_again: if( m_pIniMetrics->GetValue(sClassName,sValueName,sValue) ) return sValue; - if( DISPLAY->IsWindowed() ) + CString sMessage = ssprintf( "The theme metric '%s-%s' is missing. Correct this and click Retry, or Cancel to break.",sClassName.c_str(),sValueName.c_str() ); + switch( HOOKS->MessageBoxAbortRetryIgnore(sMessage) ) { - CString sMessage = ssprintf( "The theme metric '%s-%s' is missing. Correct this and click Retry, or Cancel to break.",sClassName.c_str(),sValueName.c_str() ); - switch( HOOKS->MessageBoxAbortRetryIgnore(sMessage) ) - { - case ArchHooks::abort: - break; // fall through - case ArchHooks::retry: - FlushDirCache(); - ReloadMetrics(); - goto try_metric_again; - case ArchHooks::ignore: - return ""; - default: - ASSERT(0); - } + case ArchHooks::abort: + break; // fall through + case ArchHooks::retry: + FlushDirCache(); + ReloadMetrics(); + goto try_metric_again; + case ArchHooks::ignore: + return ""; + default: + ASSERT(0); } RageException::Throw( "Theme metric '%s : %s' could not be found in '%s' or '%s'.",