From cf9b808ea32b74c9c233ee931581dc6613a4e516 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 27 Jun 2002 17:49:10 +0000 Subject: [PATCH] no message --- stepmania/src/ArrowEffects.cpp | 2 +- stepmania/src/Background.cpp | 45 +++-- stepmania/src/DifficultyIcon.h | 22 +-- stepmania/src/FootMeter.cpp | 21 +-- stepmania/src/FootMeter.h | 2 +- stepmania/src/GameConstantsAndTypes.h | 3 +- stepmania/src/LifeMeterBar.cpp | 6 +- stepmania/src/MenuElements.cpp | 3 + stepmania/src/MenuElements.h | 2 + stepmania/src/MotionBlurSprite.cpp | 5 +- stepmania/src/MotionBlurSprite.h | 13 +- stepmania/src/MusicWheel.cpp | 2 +- stepmania/src/NoteData.cpp | 5 +- stepmania/src/NoteDataWithScoring.cpp | 4 +- stepmania/src/NoteField.cpp | 11 +- stepmania/src/NoteField.h | 2 + stepmania/src/Notes.cpp | 191 ++++++++++++-------- stepmania/src/Notes.h | 3 + stepmania/src/Player.h | 2 + stepmania/src/PrefsManager.cpp | 14 +- stepmania/src/PrefsManager.h | 1 + stepmania/src/RageUtil.cpp | 3 + stepmania/src/ScoreDisplayRolling.cpp | 37 ++-- stepmania/src/ScoreDisplayRolling.h | 4 +- stepmania/src/ScreenEvaluation.cpp | 69 ++++--- stepmania/src/ScreenGameplay.cpp | 42 +++-- stepmania/src/ScreenSelectGroup.cpp | 2 + stepmania/src/ScreenSelectStyle.cpp | 17 +- stepmania/src/ScreenSelectStyle.h | 7 +- stepmania/src/ScreenTitleMenu.cpp | 5 +- stepmania/src/Song.cpp | 218 +++++++++++++++++++---- stepmania/src/SongManager.cpp | 4 +- stepmania/src/Sprite.cpp | 7 + stepmania/src/Sprite.h | 2 + stepmania/src/TransitionInvisible.cpp | 10 +- stepmania/src/TransitionInvisible.h | 16 +- stepmania/src/smpackage/smpackageDlg.cpp | 34 +--- 37 files changed, 551 insertions(+), 285 deletions(-) diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index 5c00a416c5..6ee116c784 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -77,7 +77,7 @@ float ArrowGetAlpha( const PlayerOptions& po, float fYPos ) fAlpha = (fYPos-100)/200; break; case PlayerOptions::APPEARANCE_SUDDEN: - fAlpha = ((SCREEN_HEIGHT-fYPos)-280)/200; + fAlpha = ((SCREEN_HEIGHT-fYPos)-260)/200; break; case PlayerOptions::APPEARANCE_STEALTH: fAlpha = 0; diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 4ef631681c..9866d0d9cd 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -17,7 +17,8 @@ #include "RageBitmapTexture.h" -const CString VIS_DIR = "Visualizations\\"; +const CString MOVIE_VIS_DIR = "Visualizations\\"; +const CString BG_ANIMS_DIR = "BGAnimations\\"; Background::Background() @@ -34,16 +35,28 @@ Background::Background() m_sprDangerBackground.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_DANGER_BACKGROUND) ); m_sprDangerBackground.StretchTo( CRect((int)SCREEN_LEFT, (int)SCREEN_TOP, (int)SCREEN_RIGHT, (int)SCREEN_BOTTOM) ); - // Load background animations - m_BackgroundAnimations.Add( new BackgroundAnimation(NULL) ); - m_pCurBackgroundAnimation = NULL; } bool Background::LoadFromSong( Song* pSong, bool bDisableVisualizations ) { - // load song background + // + // Load background animations + // + CStringArray asBGAnimNames; + GetDirListing( BG_ANIMS_DIR+"*.*", asBGAnimNames, true ); + SortCStringArray( asBGAnimNames ); + for( int i=0; iHasBackgroundMovie() ) { @@ -67,14 +80,14 @@ bool Background::LoadFromSong( Song* pSong, bool bDisableVisualizations ) { // load a random visualization CStringArray sVisualizationNames; - GetDirListing( VIS_DIR + "*.avi", sVisualizationNames ); - GetDirListing( VIS_DIR + "*.mpg", sVisualizationNames ); - GetDirListing( VIS_DIR + "*.mpeg", sVisualizationNames ); + GetDirListing( MOVIE_VIS_DIR + "*.avi", sVisualizationNames ); + GetDirListing( MOVIE_VIS_DIR + "*.mpg", sVisualizationNames ); + GetDirListing( MOVIE_VIS_DIR + "*.mpeg", sVisualizationNames ); if( sVisualizationNames.GetSize() > 0 ) // there is at least one visualization { int iIndexRandom = rand() % sVisualizationNames.GetSize(); - m_sprVisualizationOverlay.Load( VIS_DIR + sVisualizationNames[iIndexRandom] ); + m_sprVisualizationOverlay.Load( MOVIE_VIS_DIR + sVisualizationNames[iIndexRandom] ); m_sprVisualizationOverlay.StretchTo( CRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT ) ); m_sprVisualizationOverlay.SetZoomY( m_sprVisualizationOverlay.GetZoomY()*-1 ); m_sprVisualizationOverlay.SetBlendModeAdd(); @@ -94,8 +107,11 @@ void Background::Update( float fDeltaTime ) m_pCurBackgroundAnimation = NULL; else { - int iIndexToSwitchTo = int(m_fSongBeat/BEATS_PER_MEASURE/2) % m_BackgroundAnimations.GetSize(); - m_pCurBackgroundAnimation = m_BackgroundAnimations[ iIndexToSwitchTo ]; + if( m_BackgroundAnimations.GetSize() > 0 ) + { + int iIndexToSwitchTo = int(m_fSongBeat/BEATS_PER_MEASURE/4) % m_BackgroundAnimations.GetSize(); + m_pCurBackgroundAnimation = m_BackgroundAnimations[ iIndexToSwitchTo ]; + } } @@ -145,21 +161,20 @@ void Background::DrawPrimitives() { case VIS_MODE_ANIMATION: if( m_pCurBackgroundAnimation ) - m_pCurBackgroundAnimation->DrawPrimitives(); + m_pCurBackgroundAnimation->Draw(); else m_sprSongBackground.Draw(); break; case VIS_MODE_MOVIE: + m_sprSongBackground.Draw(); m_sprVisualizationOverlay.Draw(); - // fall through and draw background + break; case VIS_MODE_NONE: m_sprSongBackground.Draw(); break; } - m_sprSongBackground.Draw(); - m_sprVisualizationOverlay.Draw(); } } diff --git a/stepmania/src/DifficultyIcon.h b/stepmania/src/DifficultyIcon.h index 8ebc52c95f..2cd3ebdaed 100644 --- a/stepmania/src/DifficultyIcon.h +++ b/stepmania/src/DifficultyIcon.h @@ -33,29 +33,21 @@ public: if( pNotes != NULL ) { SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - SetFromDescription( pNotes->m_sDescription ); + switch( pNotes->m_DifficultyClass ) + { + case CLASS_EASY: SetState( 0 ); break; + case CLASS_MEDIUM: SetState( 1 ); break; + case CLASS_HARD: SetState( 2 ); break; + } } else { SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); - SetFromDescription( "" ); + SetState( 0 ); } }; private: - void SetFromDescription( const CString &sDescription ) - { - CString sTemp = sDescription; - sTemp.MakeLower(); - if( sTemp.Find( "basic" ) != -1 ) SetState( 0 ); - else if( sTemp.Find( "trick" ) != -1 ) SetState( 1 ); - else if( sTemp.Find( "another" ) != -1 ) SetState( 1 ); - else if( sTemp.Find( "maniac" ) != -1 ) SetState( 2 ); - else if( sTemp.Find( "ssr" ) != -1 ) SetState( 2 ); - else if( sTemp.Find( "battle" ) != -1 ) SetState( 0 ); - else if( sTemp.Find( "couple" ) != -1 ) SetState( 0 ); - else SetState( 0 ); - }; }; diff --git a/stepmania/src/FootMeter.cpp b/stepmania/src/FootMeter.cpp index 68343665b1..7c45c5c7d1 100644 --- a/stepmania/src/FootMeter.cpp +++ b/stepmania/src/FootMeter.cpp @@ -21,7 +21,7 @@ FootMeter::FootMeter() { Load( THEME->GetPathTo(FONT_METER) ); - SetNumFeet( 0, "" ); + SetFromNotes( NULL ); } void FootMeter::SetFromNotes( Notes* pNotes ) @@ -29,12 +29,13 @@ void FootMeter::SetFromNotes( Notes* pNotes ) if( pNotes != NULL ) { SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - SetNumFeet( pNotes->m_iMeter, pNotes->m_sDescription ); + SetNumFeet( pNotes->m_iMeter ); if( pNotes->m_iMeter >= 10 ) this->SetEffectGlowing(); else this->SetEffectNone(); + SetDiffuseColor( pNotes->GetColor() ); this->StopTweening(); this->SetZoom( 1.1f ); this->BeginTweening( 0.3f, TWEEN_BOUNCE_BEGIN ); @@ -43,12 +44,12 @@ void FootMeter::SetFromNotes( Notes* pNotes ) else { this->SetEffectNone(); - SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); - SetNumFeet( 0, "" ); + SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,0.8f,1) ); + SetNumFeet( 0 ); } } -void FootMeter::SetNumFeet( int iNumFeet, const CString &sDescription ) +void FootMeter::SetNumFeet( int iNumFeet ) { CString sNewText; for( int f=0; f<=8; f++ ) @@ -59,14 +60,4 @@ void FootMeter::SetNumFeet( int iNumFeet, const CString &sDescription ) SetText( sNewText ); - CString sTemp = sDescription; - sTemp.MakeLower(); - if( sTemp.Find( "basic" ) != -1 ) SetDiffuseColor( D3DXCOLOR(1,1,0,1) ); - else if( sTemp.Find( "trick" ) != -1 ) SetDiffuseColor( D3DXCOLOR(1,0,0,1) ); - else if( sTemp.Find( "another" ) != -1 )SetDiffuseColor( D3DXCOLOR(1,0,0,1) ); - else if( sTemp.Find( "maniac" ) != -1 ) SetDiffuseColor( D3DXCOLOR(0,1,0,1) ); - else if( sTemp.Find( "ssr" ) != -1 ) SetDiffuseColor( D3DXCOLOR(0,1,0,1) ); - else if( sTemp.Find( "battle" ) != -1 ) SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - else if( sTemp.Find( "couple" ) != -1 ) SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - else SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,0.8f,1) ); } \ No newline at end of file diff --git a/stepmania/src/FootMeter.h b/stepmania/src/FootMeter.h index 3d9a8c878f..c952578ce0 100644 --- a/stepmania/src/FootMeter.h +++ b/stepmania/src/FootMeter.h @@ -24,5 +24,5 @@ public: void SetFromNotes( Notes* pNotes ); private: - void SetNumFeet( int iNumFeet, const CString &sDescription ); + void SetNumFeet( int iNumFeet ); }; diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index 4d6a6eed6f..ec163bf82a 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -131,7 +131,8 @@ enum DifficultyClass CLASS_EASY, // corresponds to Basic CLASS_MEDIUM, // corresponds to Trick, Another, Standard CLASS_HARD, // corresponds to Maniac, SSR, Heavy - NUM_DIFFICULTY_CLASSES + NUM_DIFFICULTY_CLASSES, + CLASS_INVALID }; inline D3DXCOLOR DifficultyClassToColor( DifficultyClass dc ) diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index e35cb1b0f1..b8db8151f6 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -41,11 +41,11 @@ void LifeMeterBar::ChangeLife( TapNoteScore score ) case TNS_PERFECT: fDeltaLife = +0.015f; break; case TNS_GREAT: fDeltaLife = +0.008f; break; case TNS_GOOD: fDeltaLife = +0.000f; break; - case TNS_BOO: fDeltaLife = -0.050f; break; - case TNS_MISS: fDeltaLife = -0.100f; break; + case TNS_BOO: fDeltaLife = -0.040f; break; + case TNS_MISS: fDeltaLife = -0.080f; break; } - if( bWasHot && !IsHot() ) + if( IsHot() && score < TNS_GREAT ) fDeltaLife = -0.10f; // make it take a while to get back to "doing great" m_fLifePercentage += fDeltaLife; diff --git a/stepmania/src/MenuElements.cpp b/stepmania/src/MenuElements.cpp index 63da1bb5e4..3ef7172290 100644 --- a/stepmania/src/MenuElements.cpp +++ b/stepmania/src/MenuElements.cpp @@ -58,6 +58,8 @@ MenuElements::MenuElements() m_Wipe.SetZ( -2 ); m_Wipe.SetOpened(); this->AddActor( &m_Wipe ); + + this->AddActor( &m_Invisible ); } void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString sHelpText ) @@ -200,6 +202,7 @@ void MenuElements::TweenOffScreenToBlack( ScreenMessage smSendWhenDone, bool bPl { TweenTopLayerOffScreen(); TweenBottomLayerOffScreen(); + m_Invisible.CloseWipingRight( smSendWhenDone ); } else { diff --git a/stepmania/src/MenuElements.h b/stepmania/src/MenuElements.h index eb9913b8f4..2a203a567e 100644 --- a/stepmania/src/MenuElements.h +++ b/stepmania/src/MenuElements.h @@ -20,6 +20,7 @@ #include "MenuTimer.h" #include "TransitionFadeWipe.h" #include "TransitionKeepAlive.h" +#include "TransitionInvisible.h" const float MENU_ELEMENTS_TWEEN_TIME = 0.30f; @@ -70,6 +71,7 @@ protected: TransitionFadeWipe m_Wipe; TransitionKeepAlive m_KeepAlive; + TransitionInvisible m_Invisible; RageSoundSample m_soundSwoosh; RageSoundSample m_soundBack; diff --git a/stepmania/src/MotionBlurSprite.cpp b/stepmania/src/MotionBlurSprite.cpp index 538e960055..4827cc838b 100644 --- a/stepmania/src/MotionBlurSprite.cpp +++ b/stepmania/src/MotionBlurSprite.cpp @@ -1,11 +1,12 @@ #include "stdafx.h" /* ----------------------------------------------------------------------------- - File: MotionBlurSprite.h + Class: MotionBlurSprite - Desc: A graphic that appears to blur and come into focus. + Desc: See header. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ diff --git a/stepmania/src/MotionBlurSprite.h b/stepmania/src/MotionBlurSprite.h index da1c4be5f3..072a255ceb 100644 --- a/stepmania/src/MotionBlurSprite.h +++ b/stepmania/src/MotionBlurSprite.h @@ -1,17 +1,15 @@ +#pragma once /* ----------------------------------------------------------------------------- - File: MotionBlurSprite.h + Class: MotionBlurSprite - Desc: A graphic that appears to blur and come into focus. + Desc: A sprite that leaves a ghost trail. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ -#ifndef _MotionBlurSprite_H_ -#define _MotionBlurSprite_H_ - - #include "Sprite.h" #include "ActorFrame.h" @@ -116,6 +114,3 @@ protected: }; - - -#endif \ No newline at end of file diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 4321149e94..3be029a750 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -659,7 +659,7 @@ void MusicWheel::NotesChanged( PlayerNumber pn ) // update grade graphics and to Notes* m_pNotes = SONGMAN->GetCurrentNotes( pn ); if( m_pNotes ) - m_HighScore[pn].SetScore( m_pNotes->m_iTopScore ); + m_HighScore[pn].SetScore( (float)m_pNotes->m_iTopScore ); for( int i=0; i 40 ) + { + cNoteCharOut = '2'; + iBMSTrack -= 40; + } + else + { + cNoteCharOut = '1'; + } + + switch( iBMSTrack ) + { + case 11: iDanceColOut = DANCE_NOTE_PAD1_LEFT; break; + case 12: iDanceColOut = DANCE_NOTE_PAD1_UPLEFT; break; + case 13: iDanceColOut = DANCE_NOTE_PAD1_DOWN; break; + case 14: iDanceColOut = DANCE_NOTE_PAD1_UP; break; + case 15: iDanceColOut = DANCE_NOTE_PAD1_UPRIGHT; break; + case 16: iDanceColOut = DANCE_NOTE_PAD1_RIGHT; break; + case 21: iDanceColOut = DANCE_NOTE_PAD2_LEFT; break; + case 22: iDanceColOut = DANCE_NOTE_PAD2_UPLEFT; break; + case 23: iDanceColOut = DANCE_NOTE_PAD2_DOWN; break; + case 24: iDanceColOut = DANCE_NOTE_PAD2_UP; break; + case 25: iDanceColOut = DANCE_NOTE_PAD2_UPRIGHT; break; + case 26: iDanceColOut = DANCE_NOTE_PAD2_RIGHT; break; + default: iDanceColOut = -1; break; + } +} + + bool Notes::LoadFromBMSFile( const CString &sPath ) { LOG->WriteLine( "Notes::LoadFromBMSFile( '%s' )", sPath ); this->GetNoteData(); // make sure NoteData is loaded -// BMS encoding: -// 4&8panel: Player1 Player2 -// Left 11 21 -// Down 13 23 -// Up 15 25 -// Right 16 26 -// 6panel: Player1 Player2 -// Left 11 21 -// Left+Up 12 22 -// Down 13 23 -// Up 14 24 -// Up+Right 15 25 -// Right 16 26 -// -// Notice that 15 and 25 have double meanings! What were they thinking??? -// While reading in, use the 6 panel mapping. After reading in, detect if only 4 notes -// are used. If so, shift the Up+Right column back to the Up column -// - CMap mapBMSTrackToDanceNote; - mapBMSTrackToDanceNote[11] = DANCE_NOTE_PAD1_LEFT; - mapBMSTrackToDanceNote[12] = DANCE_NOTE_PAD1_UPLEFT; - mapBMSTrackToDanceNote[13] = DANCE_NOTE_PAD1_DOWN; - mapBMSTrackToDanceNote[14] = DANCE_NOTE_PAD1_UP; - mapBMSTrackToDanceNote[15] = DANCE_NOTE_PAD1_UPRIGHT; - mapBMSTrackToDanceNote[16] = DANCE_NOTE_PAD1_RIGHT; - mapBMSTrackToDanceNote[21] = DANCE_NOTE_PAD2_LEFT; - mapBMSTrackToDanceNote[22] = DANCE_NOTE_PAD2_UPLEFT; - mapBMSTrackToDanceNote[23] = DANCE_NOTE_PAD2_DOWN; - mapBMSTrackToDanceNote[24] = DANCE_NOTE_PAD2_UP; - mapBMSTrackToDanceNote[25] = DANCE_NOTE_PAD2_UPRIGHT; - mapBMSTrackToDanceNote[26] = DANCE_NOTE_PAD2_RIGHT; - bool tempNotes[MAX_NOTE_TRACKS][MAX_TAP_NOTE_ROWS]; + + int tempNotes[MAX_NOTE_TRACKS][MAX_TAP_NOTE_ROWS]; for( int t=0; tm_TapNotes[iNoteDataCol][i] = '1'; + m_pNoteData->m_TapNotes[iNoteDataCol][i] = tempNotes[iTempCol][i]; } } m_pNoteData->m_iNumTracks = mapDanceNoteToNoteDataColumn.GetCount(); + m_pNoteData->Convert2sAnd3sToHoldNotes(); + // search for runs of 32nd notes of all the same note type, and convert them to freezes for( int iCol=0; iColWriteLine( "Unexpected value named '%s'", sValueName ); } - - if ( stricmp(m_sDescription, "BASIC") == 0 ) m_DifficultyClass = CLASS_EASY; - else if( stricmp(m_sDescription, "TRICK") == 0 ) m_DifficultyClass = CLASS_MEDIUM; - else if( stricmp(m_sDescription, "STANDARD") == 0 ) m_DifficultyClass = CLASS_MEDIUM; - else if( stricmp(m_sDescription, "ANOTHER") == 0 ) m_DifficultyClass = CLASS_MEDIUM; - else if( stricmp(m_sDescription, "SSR") == 0 ) m_DifficultyClass = CLASS_HARD; - else if( stricmp(m_sDescription, "MANIAC") == 0 ) m_DifficultyClass = CLASS_HARD; - else if( stricmp(m_sDescription, "HEAVY") == 0 ) m_DifficultyClass = CLASS_HARD; - else if( stricmp(m_sDescription, "SMANIAC") == 0 ) m_DifficultyClass = CLASS_HARD; - else - { - // guess difficulty class from m_iMeter - if( m_iMeter <= 3 ) m_DifficultyClass = CLASS_EASY; - else if( m_iMeter <= 6 ) m_DifficultyClass = CLASS_MEDIUM; - else m_DifficultyClass = CLASS_HARD; - } + m_DifficultyClass = DifficultyClassFromDescriptionAndMeter( m_sDescription, m_iMeter ); return true; } @@ -751,6 +762,40 @@ void Notes::SaveToSMDir( CString sSongDir ) file.Close(); } +DifficultyClass Notes::DifficultyClassFromDescriptionAndMeter( CString sDifficulty, int iMeter ) +{ + sDifficulty.MakeLower(); + + const CString sDescriptionParts[NUM_DIFFICULTY_CLASSES][3] = { + { + "basic", + "light", + "SDFKSJDKFJS", + }, + { + "another", + "trick", + "standard", + }, + { + "ssr", + "maniac", + "heavy", + }, + }; + + for( int i=0; im_bEventMode ) + return false; return m_iCurrentStageIndex == m_iNumArcadeStages-1; } bool PrefsManager::IsExtraStage() { + if( PREFSMAN->m_bEventMode ) + return false; return m_iCurrentStageIndex == m_iNumArcadeStages; } bool PrefsManager::IsExtraStage2() { + if( PREFSMAN->m_bEventMode ) + return false; return m_iCurrentStageIndex == m_iNumArcadeStages+1; } diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index f790b08266..f7dfacac82 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -43,6 +43,7 @@ public: int m_iNumArcadeStages; bool m_bAutoPlay; float m_fJudgeWindow; + CStringArray m_asSongFolders; void ReadPrefsFromDisk(); void SavePrefsToDisk(); diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index ec931ccbbd..151fc9362e 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -76,6 +76,9 @@ CString vssprintf( LPCTSTR fmt, va_list argList) //----------------------------------------------------------------------------- CString join( const CString &Deliminator, const CStringArray& Source) { + if( Source.GetSize() == 0 ) + return ""; + CString csReturn; CString csTmp; diff --git a/stepmania/src/ScoreDisplayRolling.cpp b/stepmania/src/ScoreDisplayRolling.cpp index 7cfced67f0..f742fac0bc 100644 --- a/stepmania/src/ScoreDisplayRolling.cpp +++ b/stepmania/src/ScoreDisplayRolling.cpp @@ -40,13 +40,16 @@ void ScoreDisplayRolling::Init( PlayerNumber pn, PlayerOptions po, int iOriginal m_PlayerOptions = po; m_iTotalNotes = iOriginalNumNotes; m_iNotesMeter = iNotesMeter; + + //for( int i=0; iWriteLine("Called %d times.",iNumTimesCalled); + LOG->WriteLine("Called %d times - param %d.",iNumTimesCalled, iCurCombo); int p; // score multiplier switch( score ) { - case TNS_GREAT: p = 10; break; - case TNS_PERFECT: p = 5; break; + case TNS_PERFECT: p = 10; break; + case TNS_GREAT: p = 5; break; default: p = 0; break; } @@ -140,12 +143,12 @@ void ScoreDisplayRolling::AddToScore( TapNoteScore score, int iCurCombo ) int one_step_score = roundf( p * (B/S) * n ); - // HACK: The total score is off by a factor of 0.5. For now, multiply by two... - one_step_score *= 2; + m_fScore += one_step_score; + ASSERT( m_fScore >= 0 ); + // HACK: The final total is slightly off because of rounding errors + if( fabsf(m_fScore-B*10) < 100.0f ) + m_fScore = (float)B*10; - m_iScore += one_step_score; - ASSERT( m_iScore >= 0 ); - - this->SetScore( m_iScore ); + this->SetScore( m_fScore ); } diff --git a/stepmania/src/ScoreDisplayRolling.h b/stepmania/src/ScoreDisplayRolling.h index 92deb91dea..3a05cdf551 100644 --- a/stepmania/src/ScoreDisplayRolling.h +++ b/stepmania/src/ScoreDisplayRolling.h @@ -26,7 +26,7 @@ public: void Init( PlayerNumber pn, PlayerOptions po, int iOriginalNumNotes, int iNotesMeter ); - void SetScore( int iNewScore ); + void SetScore( float fNewScore ); int GetScore(); void AddToScore( TapNoteScore score, int iCurCombo ); @@ -39,7 +39,7 @@ protected: int m_iTotalNotes; int m_iNotesMeter; - int m_iScore; + float m_fScore; float m_fTrailingScore; float m_fScoreVelocity; diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 92f0dafd94..5f6853a80c 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -49,7 +49,9 @@ const float TRY_EXTRA_STAGE_X = CENTER_X; const float TRY_EXTRA_STAGE_Y = SCREEN_BOTTOM - 60; -const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User+1); +const ScreenMessage SM_GoToSelectMusic = ScreenMessage(SM_User+2); +const ScreenMessage SM_GoToFinalEvaluation = ScreenMessage(SM_User+3); +const ScreenMessage SM_GoToMusicScroll = ScreenMessage(SM_User+4); ScreenEvaluation::ScreenEvaluation( bool bSummary ) @@ -331,8 +333,8 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) m_textJudgeNumbers[4][p].SetText( ssprintf("%4d", GS[p].miss) ); m_textJudgeNumbers[5][p].SetText( ssprintf("%4d", GS[p].ok) ); - m_ScoreDisplay[p].SetScore( GS[p].max_combo * 1000 ); - m_ScoreDisplay[p].SetScore( GS[p].score ); + m_ScoreDisplay[p].SetScore( (float)GS[p].max_combo * 1000 ); + m_ScoreDisplay[p].SetScore( (float)GS[p].score ); switch( m_ResultMode ) { @@ -393,6 +395,9 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) m_bTryExtraStage = true; } } + if( PREFSMAN->m_bEventMode ) + m_bTryExtraStage = false; + for( p=0; pSetNewScreen( new ScreenMusicScroll ); - return; - case RM_ARCADE_STAGE: - if( m_bTryExtraStage ) - SCREENMAN->SetNewScreen( new ScreenSelectMusic ); - else - SCREENMAN->SetNewScreen( new ScreenEvaluation(true) ); - return; - case RM_ONI: - SCREENMAN->SetNewScreen( new ScreenMusicScroll ); - return; + case SM_GoToSelectMusic: + SCREENMAN->SetNewScreen( new ScreenSelectMusic ); + break; + case SM_GoToMusicScroll: + SCREENMAN->SetNewScreen( new ScreenMusicScroll ); + break; + case SM_GoToFinalEvaluation: + SCREENMAN->SetNewScreen( new ScreenEvaluation(true) ); break; - } } } @@ -665,8 +662,38 @@ void ScreenEvaluation::MenuStart( const PlayerNumber p ) { TweenOffScreen(); - m_Menu.TweenOffScreenToMenu( SM_GoToNextState ); - PREFSMAN->m_iCurrentStageIndex++; // increment the stage number before constructing the next screen + switch( m_ResultMode ) + { + case RM_ARCADE_SUMMARY: + m_Menu.TweenOffScreenToBlack( SM_GoToMusicScroll, false ); + return; + case RM_ARCADE_STAGE: + if( m_bTryExtraStage ) + { + PREFSMAN->m_iCurrentStageIndex++; + m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic ); + } + else if( + PREFSMAN->m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages-1 || + PREFSMAN->IsExtraStage() || + PREFSMAN->IsExtraStage2() ) + { + m_Menu.TweenOffScreenToMenu( SM_GoToFinalEvaluation ); + } + else + { + PREFSMAN->m_iCurrentStageIndex++; + m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic ); + } + + return; + case RM_ONI: + m_Menu.TweenOffScreenToBlack( SM_GoToMusicScroll, false ); + return; + default: + ASSERT(0); + } + } diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 443744db4f..d7880121fb 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -37,7 +37,7 @@ const float STAGE_NUMBER_LOCAL_Y = +20; const float SCORE_LOCAL_X[NUM_PLAYERS] = { -214, +214 }; const float SCORE_LOCAL_Y[NUM_PLAYERS] = { -6, -6 }; -const float PLAYER_OPTIONS_LOCAL_X[NUM_PLAYERS] = { -214, +214 }; +const float PLAYER_OPTIONS_LOCAL_X[NUM_PLAYERS] = { -0, +0 }; const float PLAYER_OPTIONS_LOCAL_Y[NUM_PLAYERS] = { -10, +10 }; const float DIFFICULTY_X[NUM_PLAYERS] = { SCREEN_LEFT+60, SCREEN_RIGHT-60 }; @@ -324,7 +324,7 @@ void ScreenGameplay::LoadNextSong() PREFSMAN->m_PlayerOptions[p], &m_LifeMeter[p], &m_ScoreDisplay[p], - pNotes[p]->GetNoteData()->GetNumTapNotes() + pNotes[p]->GetNoteData()->GetNumHoldNotes() + pNotes[p]->GetNoteData()->GetNumTapNotes() ); } @@ -504,6 +504,27 @@ void ScreenGameplay::Update( float fDeltaTime ) iRowLastCrossed = iRowNow; } + // + if( m_bBothHaveFailed ) + { + for( int p=0; pIsPlayerEnabled((PlayerNumber)p) ) + continue; + + float fOverrideAlpha = m_Player[p].GetOverrideAlpha(); + if( fOverrideAlpha == -1 ) + { + m_Player[p].SetOverrideAlpha( 0 ); + } + else + { + float fNewAlpha = min( 1, fOverrideAlpha + fDeltaTime ); + m_Player[p].SetOverrideAlpha( fNewAlpha ); + } + + } + } } @@ -559,21 +580,10 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ - if( MenuI.IsValid() ) + if( MenuI.IsValid() && MenuI.button == MENU_BUTTON_BACK && type == IET_FAST_REPEAT && m_DancingState == STATE_DANCING && !m_bBothHaveFailed ) { - switch( MenuI.button ) - { - case MENU_BUTTON_BACK: - if( m_DancingState == STATE_DANCING - && !m_bBothHaveFailed ) - { - m_bBothHaveFailed = true; - SCREENMAN->SendMessageToTopScreen( SM_BeginFailed, 0 ); - } - else - ; // do not let user go back! - break; - } + m_bBothHaveFailed = true; + SCREENMAN->SendMessageToTopScreen( SM_BeginFailed, 0 ); } const float fMaxBeatDifference = fBPS * PREFSMAN->m_fJudgeWindow * PREFSMAN->m_SongOptions.m_fMusicRate; diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index 9e03e2840a..d9b8f2a533 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -205,6 +205,8 @@ void ScreenSelectGroup::AfterChange() if( m_iSelection == 0 ) arraySongs.Copy( SONGMAN->m_pSongs ); else SONGMAN->GetSongsInGroup( m_arrayGroupNames[m_iSelection], arraySongs ); + SortSongPointerArrayByTitle( arraySongs ); + for( int i=0; iAddActor( &m_sprInfo ); + + // Load dummy Sprites + for( int i=0; iGetPathTo(te) ); + + te = (ThemeElement)(GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_0+m_aPossibleStyles[i]); + m_sprDummyInfo[i].Load( THEME->GetPathTo(te) ); + } + + m_Menu.Load( THEME->GetPathTo(GRAPHIC_SELECT_STYLE_BACKGROUND), THEME->GetPathTo(GRAPHIC_SELECT_STYLE_TOP_EDGE), diff --git a/stepmania/src/ScreenSelectStyle.h b/stepmania/src/ScreenSelectStyle.h index a1f5a5476d..310a093f7f 100644 --- a/stepmania/src/ScreenSelectStyle.h +++ b/stepmania/src/ScreenSelectStyle.h @@ -1,10 +1,11 @@ /* ----------------------------------------------------------------------------- - File: ScreenSelectStyle.h + Class: ScreenSelectStyle Desc: Select the game mode (single, versus, double). Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ @@ -46,6 +47,10 @@ private: Sprite m_sprPreview; Sprite m_sprInfo; + // Sprites that are never drawn. They exist to keep the style textures in memory + Sprite m_sprDummyPreview[NUM_STYLES]; + Sprite m_sprDummyInfo[NUM_STYLES]; + RandomSample m_soundChange; RandomSample m_soundSelect; diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 9dc2d703b2..07af10aad6 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -267,8 +267,9 @@ void ScreenTitleMenu::MenuStart( const PlayerNumber p ) } return; case CHOICE_SELECT_GAME: - m_soundSelect.PlayRandom(); - m_Fade.CloseWipingRight( SM_GoToSelectGame ); + m_soundInvalid.PlayRandom(); + //m_soundSelect.PlayRandom(); + //m_Fade.CloseWipingRight( SM_GoToSelectGame ); return; case CHOICE_MAP_INSTRUMENTS: m_soundSelect.PlayRandom(); diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index b56a42948f..06ac984112 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -308,7 +308,7 @@ bool Song::LoadFromBMSDir( CString sDir ) GetDirListing( sDir + CString("*.bms"), arrayBMSFileNames ); if( arrayBMSFileNames.GetSize() == 0 ) - throw RageException( ssprintf("Couldn't find any BMS files in '%s'", sDir) ); + throw RageException( "Couldn't find any BMS files in '%s'", sDir ); // Load the Song info from the first BMS file. Silly BMS duplicates the song info in every @@ -328,7 +328,7 @@ bool Song::LoadFromBMSDir( CString sDir ) CStdioFile file; if( !file.Open( m_sSongFilePath, CFile::modeRead|CFile::shareDenyNone ) ) { - throw RageException( ssprintf("Failed to open %s.", m_sSongFilePath) ); + throw RageException( "Failed to open %s.", m_sSongFilePath ); return false; } @@ -365,38 +365,36 @@ bool Song::LoadFromBMSDir( CString sDir ) // handle the data - if( -1 != value_name.Find("#title") ) + if( value_name == "#title" ) { - // strip Notes type out of description leaving only song title (looks like 'B4U ') - value_data.Replace( "(ANOTHER)", "" ); - value_data.Replace( "(BASIC)", "" ); - value_data.Replace( "(MANIAC)", "" ); - value_data.Replace( "", "" ); - value_data.Replace( "", "" ); - value_data.Replace( "", "" ); - - GetMainAndSubTitlesFromFullTitle( value_data, m_sMainTitle, m_sSubTitle ); + // strip Notes type out of description leaving only song title - looks like 'B4U ' + int iIndex = value_data.ReverseFind('<'); + if( iIndex == -1 ) + iIndex = value_data.ReverseFind('('); + if( iIndex != -1 ) + { + value_data.Delete( iIndex, 10000 ); + GetMainAndSubTitlesFromFullTitle( value_data, m_sMainTitle, m_sSubTitle ); + } + else + m_sMainTitle = value_data; } - else if( -1 != value_name.Find("#artist") ) + else if( value_name == "#artist" ) { m_sArtist = value_data; } - else if( -1 != value_name.Find("#bpm") ) + else if( value_name == "#bpm" ) { - BPMSegment new_seg; - new_seg.m_fStartBeat = 0; - new_seg.m_fBPM = (float)atof( value_data ); - - // add, then sort - m_BPMSegments.Add( new_seg ); - SortBPMSegmentsArray( m_BPMSegments ); - LOG->WriteLine( "Inserting new BPM change at beat %f, BPM %f", new_seg.m_fStartBeat, new_seg.m_fBPM ); + BPMSegment newSeg( 0, (float)atof(value_data) ); + AddBPMSegment( newSeg ); + + LOG->WriteLine( "Inserting new BPM change at beat %f, BPM %f", newSeg.m_fStartBeat, newSeg.m_fBPM ); } - else if( -1 != value_name.Find("#backbmp") ) + else if( value_name == "#backbmp" ) { m_sBackgroundPath = m_sSongDir + value_data; } - else if( -1 != value_name.Find("#wav") ) + else if( value_name == "#wav" ) { m_sMusicPath = m_sSongDir + value_data; } @@ -405,7 +403,7 @@ bool Song::LoadFromBMSDir( CString sDir ) && IsAnInt( value_name.Mid(4,2) ) ) // this is step or offset data. Looks like "#00705" { int iMeasureNo = atoi( value_name.Mid(1,3) ); - int iTrackNum = atoi( value_name.Mid(4,2) ); + int iBMSTrackNo = atoi( value_name.Mid(4,2) ); CString sNoteData = value_data; CArray arrayNotes; @@ -419,8 +417,8 @@ bool Song::LoadFromBMSDir( CString sDir ) } const int iNumNotesInThisMeasure = arrayNotes.GetSize(); - //LOG->WriteLine( "%s:%s: iMeasureNo = %d, iTrackNum = %d, iNumNotesInThisMeasure = %d", - // valuename, sNoteData, iMeasureNo, iTrackNum, iNumNotesInThisMeasure ); + //LOG->WriteLine( "%s:%s: iMeasureNo = %d, iBMSTrackNo = %d, iNumNotesInThisMeasure = %d", + // valuename, sNoteData, iMeasureNo, iBMSTrackNo, iNumNotesInThisMeasure ); for( int j=0; jWriteLine( "Found offset to be index %d, beat %f", iStepIndex, NoteRowToBeat(iStepIndex) ); break; - case 03: // bpm - BPMSegment new_seg; - new_seg.m_fStartBeat = NoteRowToBeat( (float)iStepIndex ); - new_seg.m_fBPM = (float)arrayNotes[j]; + case 3: // bpm change + { + BPMSegment newSeg( NoteRowToBeat(iStepIndex), (float)arrayNotes[j] ); + AddBPMSegment( newSeg ); + LOG->WriteLine( "Inserting new BPM change at beat %f, BPM %f", newSeg.m_fStartBeat, newSeg.m_fBPM ); + } + break; - m_BPMSegments.Add( new_seg ); // add to back for now (we'll sort later) - SortBPMSegmentsArray( m_BPMSegments ); + // Let me just take a moment to express how frustrated I am with the new, + // poorly-designed changes to the BMS format. + // + // + // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhh!!!!!!!!!!!!!!! + // + // Thank you. + + case 8: // indirect bpm + { + // This is a very inefficient way to parse, but it doesn't matter much + // because this is only parsed on the first run after the song is installed. + CString sTagToLookFor = ssprintf( "#BPM%02x", arrayNotes[j] ); + float fBPM = -1; + + + // open the song file again and and look for this tag's value + CStdioFile file; + if( !file.Open( m_sSongFilePath, CFile::modeRead|CFile::shareDenyNone ) ) + { + throw RageException( "Failed to open %s.", m_sSongFilePath ); + return false; + } + + CString line; + while( file.ReadString(line) ) // foreach line + { + CString value_name; // fill these in + CString value_data; + + // BMS value names can be separated by a space or a colon. + int iIndexOfFirstColon = line.Find( ":" ); + int iIndexOfFirstSpace = line.Find( " " ); + + if( iIndexOfFirstColon == -1 ) + iIndexOfFirstColon = 10000; + if( iIndexOfFirstSpace == -1 ) + iIndexOfFirstSpace = 10000; + + int iIndexOfSeparator = min( iIndexOfFirstSpace, iIndexOfFirstColon ); + + if( iIndexOfSeparator != 10000 ) + { + value_name = line.Mid( 0, iIndexOfSeparator ); + value_data = line; // the rest + value_data.Delete(0,iIndexOfSeparator+1); + } + else // no separator + { + value_name = line; + } + + if( stricmp(value_name, sTagToLookFor) == 0 ) + { + fBPM = (float)atof( value_data ); + break; + } + } + + if( fBPM == -1 ) // we didn't find the line we were looking for + { + LOG->WriteLine( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor, m_sSongFilePath ); + } + else + { + BPMSegment newSeg( NoteRowToBeat(iStepIndex), fBPM ); + AddBPMSegment( newSeg ); + LOG->WriteLine( "Inserting new BPM change at beat %f, BPM %f", newSeg.m_fStartBeat, newSeg.m_fBPM ); + } + } + break; + case 9: // freeze + { + // This is a very inefficient way to parse, but it doesn't + // matter much because this is only parsed on the first run after the song is installed. + CString sTagToLookFor = ssprintf( "#STOP%02x", arrayNotes[j] ); + float fFreezeStartBeat = NoteRowToBeat(iStepIndex); + float fFreezeSecs = -1; + + + // open the song file again and and look for this tag's value + CStdioFile file; + if( !file.Open( m_sSongFilePath, CFile::modeRead|CFile::shareDenyNone ) ) + { + throw RageException( "Failed to open %s.", m_sSongFilePath ); + return false; + } + + CString line; + while( file.ReadString(line) ) // foreach line + { + CString value_name; // fill these in + CString value_data; + + // BMS value names can be separated by a space or a colon. + int iIndexOfFirstColon = line.Find( ":" ); + int iIndexOfFirstSpace = line.Find( " " ); + + if( iIndexOfFirstColon == -1 ) + iIndexOfFirstColon = 10000; + if( iIndexOfFirstSpace == -1 ) + iIndexOfFirstSpace = 10000; + + int iIndexOfSeparator = min( iIndexOfFirstSpace, iIndexOfFirstColon ); + + if( iIndexOfSeparator != 10000 ) + { + value_name = line.Mid( 0, iIndexOfSeparator ); + value_data = line; // the rest + value_data.Delete(0,iIndexOfSeparator+1); + } + else // no separator + { + value_name = line; + } + + if( stricmp(value_name, sTagToLookFor) == 0 ) + { + // find the BPM at the time of this freeze + float fBPM = -1; + for( int i=0; i fFreezeStartBeat ) + { + fBPM = m_BPMSegments[i].m_fBPM; + break; + } + } + // the BPM segment of this beat is the last BPM segment + if( fBPM == -1 ) + fBPM = m_BPMSegments[m_BPMSegments.GetSize()-1].m_fBPM; + + fFreezeSecs = (float)atof(value_data)/(fBPM*0.81f); // I have no idea what units these are in, so I experimented until finding this factor. + break; + } + } + + if( fFreezeSecs == -1 ) // we didn't find the line we were looking for + { + LOG->WriteLine( "WARNING: Couldn't find tag '%s' in '%s'.", sTagToLookFor, m_sSongFilePath ); + } + else + { + FreezeSegment newSeg( fFreezeStartBeat, fFreezeSecs ); + AddFreezeSegment( newSeg ); + LOG->WriteLine( "Inserting new Freeze at beat %f, secs %f", newSeg.m_fStartBeat, newSeg.m_fFreezeSeconds ); + } + } break; } } diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 6351df6bb8..67d5d3ac5a 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -85,7 +85,9 @@ GameplayStatistics SongManager::GetLatestGameplayStatistics( PlayerNumber p ) void SongManager::InitSongArrayFromDisk() { LoadStepManiaSongDir( "Songs" ); - //LoadDWISongDir( "DWI Support" ); + + for( int i=0; im_asSongFolders.GetSize(); i++ ) + LoadStepManiaSongDir( PREFSMAN->m_asSongFolders[i] ); // compute group names CArray arraySongs; diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 17cbec544c..ba073ef07e 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -6,6 +6,7 @@ Desc: A bitmap actor that animates and moves around. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ @@ -376,6 +377,12 @@ void Sprite::SetCustomTextureCoords( float fTexCoords[8] ) // order: bottom left m_CustomTexCoords[i] = fTexCoords[i]; } +void Sprite::GetCustomTextureCoords( float fTexCoordsOut[8] ) // order: bottom left, top left, bottom right, top right +{ + for( int i=0; i<8; i++ ) + fTexCoordsOut[i] = m_CustomTexCoords[i]; +} + void Sprite::SetCustomImageRect( FRECT rectImageCoords ) { diff --git a/stepmania/src/Sprite.h b/stepmania/src/Sprite.h index a7dac59954..b461550b0c 100644 --- a/stepmania/src/Sprite.h +++ b/stepmania/src/Sprite.h @@ -6,6 +6,7 @@ Desc: A bitmap Actor that animates and moves around. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ @@ -50,6 +51,7 @@ public: void SetCustomTextureRect( FRECT new_texcoord_frect ); void SetCustomTextureCoords( float fTexCoords[8] ); + void GetCustomTextureCoords( float fTexCoordsOut[8] ); void SetCustomSourceRect( FRECT rectSourceCoords ); // in source pixel space void SetCustomImageRect( FRECT rectImageCoords ); // in image pixel space void SetCustomImageCoords( float fImageCoords[8] ); diff --git a/stepmania/src/TransitionInvisible.cpp b/stepmania/src/TransitionInvisible.cpp index 9499b9dc05..2b56159db2 100644 --- a/stepmania/src/TransitionInvisible.cpp +++ b/stepmania/src/TransitionInvisible.cpp @@ -1,11 +1,12 @@ #include "stdafx.h" /* ----------------------------------------------------------------------------- - File: TransitionInvisible.cpp + Class: TransitionInvisible - Desc: Fades out or in. + Desc: See header. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ @@ -21,11 +22,6 @@ TransitionInvisible::TransitionInvisible() { } -TransitionInvisible::~TransitionInvisible() -{ - -} - void TransitionInvisible::DrawPrimitives() { } diff --git a/stepmania/src/TransitionInvisible.h b/stepmania/src/TransitionInvisible.h index d422da826b..917d2882b3 100644 --- a/stepmania/src/TransitionInvisible.h +++ b/stepmania/src/TransitionInvisible.h @@ -1,18 +1,16 @@ +#pragma once /* ----------------------------------------------------------------------------- - File: TransitionInvisible.cpp + Class: TransitionInvisible - Desc: Fades out or in. + Desc: Doesn't draw anything. Only used for timing. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ -#ifndef _TransitionInvisible_H_ -#define _TransitionInvisible_H_ - - #include "Transition.h" #include "RageDisplay.h" #include "RageSound.h" @@ -23,14 +21,8 @@ class TransitionInvisible : public Transition { public: TransitionInvisible(); - virtual ~TransitionInvisible(); virtual void DrawPrimitives(); protected: }; - - - - -#endif \ No newline at end of file diff --git a/stepmania/src/smpackage/smpackageDlg.cpp b/stepmania/src/smpackage/smpackageDlg.cpp index 6fb7910378..7cd26b6b41 100644 --- a/stepmania/src/smpackage/smpackageDlg.cpp +++ b/stepmania/src/smpackage/smpackageDlg.cpp @@ -161,32 +161,14 @@ void CSmpackageDlg::OnButtonExport() // Create a new zip file on the desktop CString sZipFileName = sSongName + ".smzip"; - sZipFileName.Replace( " ", "_" ); - sZipFileName.Replace( "!", "_" ); - sZipFileName.Replace( "@", "_" ); - sZipFileName.Replace( "#", "_" ); - sZipFileName.Replace( "$", "_" ); - sZipFileName.Replace( "%", "_" ); - sZipFileName.Replace( "^", "_" ); - sZipFileName.Replace( "&", "_" ); - sZipFileName.Replace( "*", "_" ); - sZipFileName.Replace( "(", "_" ); - sZipFileName.Replace( ")", "_" ); - sZipFileName.Replace( "+", "_" ); - sZipFileName.Replace( "=", "_" ); - sZipFileName.Replace( "[", "_" ); - sZipFileName.Replace( "]", "_" ); - sZipFileName.Replace( "{", "_" ); - sZipFileName.Replace( "}", "_" ); - sZipFileName.Replace( "|", "_" ); - sZipFileName.Replace( ":", "_" ); - sZipFileName.Replace( "\'","_" ); - sZipFileName.Replace( "\"","_" ); - sZipFileName.Replace( "<", "_" ); - sZipFileName.Replace( ">", "_" ); - sZipFileName.Replace( ",", "_" ); - sZipFileName.Replace( "?", "_" ); - sZipFileName.Replace( "/", "_" ); + const char charsToReplace[] = { + ' ', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', + '+', '=', '[', ']', '{', '}', '|', ':', '\"', '\\', + '<', '>', ',', '?', '/' + }; + for( int i=0; i