From b79affe965fc253c18cd7567cf19a3ae9e93962a Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 4 Jul 2002 21:05:18 +0000 Subject: [PATCH] 3.0 b1? --- stepmania/src/AnnouncerManager.cpp | 1 - stepmania/src/Course.cpp | 12 ++---- stepmania/src/Course.h | 13 ++----- stepmania/src/CourseContentsFrame.cpp | 21 +++++++++-- stepmania/src/MusicWheel.cpp | 9 ++--- stepmania/src/NoteData.cpp | 2 +- stepmania/src/Notes.cpp | 43 +++++++++++----------- stepmania/src/Notes.h | 3 +- stepmania/src/Player.cpp | 14 +++---- stepmania/src/Player.h | 4 +- stepmania/src/ScreenEdit.cpp | 4 +- stepmania/src/ScreenEvaluation.cpp | 17 ++------- stepmania/src/ScreenGameplay.cpp | 32 +++++++++++----- stepmania/src/ScreenGameplay.h | 3 +- stepmania/src/ScreenSelectCourse.cpp | 2 + stepmania/src/ScreenTitleMenu.cpp | 24 ++++++++---- stepmania/src/SongManager.cpp | 53 +++++++++------------------ stepmania/src/StepMania.cpp | 7 ++-- stepmania/src/ThemeManager.cpp | 25 ++++--------- stepmania/src/ThemeManager.h | 12 +++--- 20 files changed, 144 insertions(+), 157 deletions(-) diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index e3e871a287..0882829f2f 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -17,7 +17,6 @@ AnnouncerManager* ANNOUNCER = NULL; // global object accessable from anywhere in the program -const CString DEFAULT_ANNOUNCER_NAME = "default"; const CString EZ2_ANNOUNCER_NAME = "ez2"; const CString ANNOUNER_BASE_DIR = "Announcers\\"; diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index ce40a103af..444e6d9ad8 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -19,7 +19,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray &apSongs ) { CStdioFile file; if( !file.Open( sPath, CFile::modeRead|CFile::shareDenyNone ) ) - throw RageException( "Error opening SM file '%s'.", sPath ); + throw RageException( "Error opening CRS file '%s'.", sPath ); // read the whole file into a sFileText @@ -89,15 +89,9 @@ void Course::LoadFromCRSFile( CString sPath, CArray &apSongs ) if( pSong == NULL ) // we didn't find the Song continue; // skip this song - Notes* pNotes = NULL; - for( i=0; im_arrayNotes.GetSize(); i++ ) - if( 0 == stricmp(pSong->m_arrayNotes[i]->m_sDescription, sNotesDescription) ) - pNotes = pSong->m_arrayNotes[i]; + DifficultyClass dc = Notes::DifficultyClassFromDescriptionAndMeter( sNotesDescription, 6 ); - if( pNotes == NULL ) // we didn't find the Notes - continue; // skip this song - - AddStage( pSong, pNotes ); + AddStage( pSong, dc ); } else diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 54975daa45..55649020c5 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -21,33 +21,28 @@ class Course public: Course() { - m_NotesType = NOTES_TYPE_INVALID; m_iStages = 0; m_bRepeat = false; for( int i=0; i &apSongs ); - void AddStage( Song* pSong, Notes* pNotes ) + void AddStage( Song* pSong, DifficultyClass dc ) { ASSERT( m_iStages <= MAX_COURSE_STAGES ); m_apSongs[m_iStages] = pSong; - m_apNotes[m_iStages] = pNotes; + m_aDifficultyClasses[m_iStages] = dc; m_iStages++; } diff --git a/stepmania/src/CourseContentsFrame.cpp b/stepmania/src/CourseContentsFrame.cpp index d909d64df4..bcaa77d56d 100644 --- a/stepmania/src/CourseContentsFrame.cpp +++ b/stepmania/src/CourseContentsFrame.cpp @@ -58,14 +58,29 @@ void CourseContentsFrame::SetFromCourse( Course* pCourse ) m_Meters[i].SetFromNotes( NULL ); } - for( i=0; im_iStages-1; i++ ) + for( i=0; im_iStages, MAX_COURSE_CONTENTS); i++ ) { m_textContents[i].SetText( pCourse->m_apSongs[i]->GetFullTitle() ); - m_textContents[i].SetDiffuseColor( DifficultyClassToColor(pCourse->m_apNotes[i]->m_DifficultyClass) ); + m_textContents[i].SetDiffuseColor( DifficultyClassToColor(pCourse->m_aDifficultyClasses[i]) ); + + m_Meters[i].SetFromNotes( NULL ); + + Song* pSong = pCourse->m_apSongs[i]; + for( int j=0; jm_arrayNotes.GetSize(); j++ ) + { + Notes* pNotes = pSong->m_arrayNotes[j]; + if( pSong->m_arrayNotes[j]->m_DifficultyClass == pCourse->m_aDifficultyClasses[i] ) + { + m_Meters[i].SetFromNotes( pNotes ); + break; + } + } - m_Meters[i].SetFromNotes( pCourse->m_apNotes[i] ); } if( pCourse->m_iStages >= MAX_COURSE_CONTENTS ) + { m_textContents[MAX_COURSE_CONTENTS-1].SetText( ssprintf("%d more...", pCourse->m_iStages-(MAX_COURSE_CONTENTS-1)) ); + m_Meters[MAX_COURSE_CONTENTS-1].SetFromNotes( NULL ); + } } diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index fb6aab8227..33a6212351 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -532,12 +532,9 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr for( int c=0; cm_aCourses.GetSize(); c++ ) // foreach course { Course* pCourse = &SONGMAN->m_aCourses[c]; - if( GAMEMAN->GetCurrentStyleDef()->m_NotesType == pCourse->m_NotesType ) - { - arrayWheelItemDatas.Add( WheelItemData() ); - WheelItemData &WID = arrayWheelItemDatas[arrayWheelItemDatas.GetSize()-1]; - WID.Load( TYPE_COURSE, NULL, "", pCourse, D3DXCOLOR(1,1,1,1) ); - } + arrayWheelItemDatas.Add( WheelItemData() ); + WheelItemData &WID = arrayWheelItemDatas[arrayWheelItemDatas.GetSize()-1]; + WID.Load( TYPE_COURSE, NULL, "", pCourse, D3DXCOLOR(1,1,1,1) ); } } break; diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index a11ad88a21..195570ca92 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -758,7 +758,7 @@ float NoteData::GetChaosRadarValue( float fSongSeconds ) iNumChaosNotes++; } - float fReturn = iNumChaosNotes / fSongSeconds * 0.5; + float fReturn = iNumChaosNotes / fSongSeconds * 0.5f; return min( fReturn, 1.0f ); } diff --git a/stepmania/src/Notes.cpp b/stepmania/src/Notes.cpp index bd13d7562a..7c38ecc2d6 100644 --- a/stepmania/src/Notes.cpp +++ b/stepmania/src/Notes.cpp @@ -268,7 +268,7 @@ bool Notes::LoadFromBMSFile( const CString &sPath ) case NOTES_TYPE_DANCE_DOUBLE: case NOTES_TYPE_DANCE_COUPLE: iTransformNewToOld[0] = DANCE_NOTE_PAD1_LEFT; - iTransformNewToOld[1] = DANCE_NOTE_PAD1_UP; + iTransformNewToOld[1] = DANCE_NOTE_PAD1_DOWN; iTransformNewToOld[2] = DANCE_NOTE_PAD1_UP; iTransformNewToOld[3] = DANCE_NOTE_PAD1_RIGHT; iTransformNewToOld[4] = DANCE_NOTE_PAD2_LEFT; @@ -337,9 +337,10 @@ void DWIcharToNote( char c, InstrumentNumber i, DanceNote ¬e1Out, DanceNote & case INSTRUMENT_1: break; case INSTRUMENT_2: - note1Out <<= 6; + if( note1Out != DANCE_NOTE_NONE ) + note1Out += 6; if( note2Out != DANCE_NOTE_NONE ) - note2Out <<= 6; + note2Out += 6; break; default: ASSERT( false ); @@ -367,6 +368,7 @@ bool Notes::LoadFromDWITokens( else throw RageException( "Unrecognized DWI mode '%s'", sMode ); + CMap mapDanceNoteToNoteDataColumn; if( m_NotesType == NOTES_TYPE_DANCE_SINGLE ) { @@ -459,26 +461,25 @@ bool Notes::LoadFromDWITokens( case '!': // hold start { - // rewind and get the last step we inserted - double fLastStepBeat = fCurrentBeat - fCurrentIncrementer; - int iIndex = BeatToNoteRow( (float)fLastStepBeat ); + // rewind and get the last step we inserted + double fLastStepBeat = fCurrentBeat - fCurrentIncrementer; + int iIndex = BeatToNoteRow( (float)fLastStepBeat ); - char holdChar = sStepData[i++]; - - DanceNote note1, note2; - DWIcharToNote( holdChar, (InstrumentNumber)pad, note1, note2 ); - - if( note1 != DANCE_NOTE_NONE ) - { - int iCol1 = mapDanceNoteToNoteDataColumn[note1]; - tempNoteData.m_TapNotes[iCol1][iIndex] = '2'; - } - if( note2 != DANCE_NOTE_NONE ) - { - int iCol2 = mapDanceNoteToNoteDataColumn[note2]; - tempNoteData.m_TapNotes[iCol2][iIndex] = '2'; - } + char holdChar = sStepData[i++]; + + DanceNote note1, note2; + DWIcharToNote( holdChar, (InstrumentNumber)pad, note1, note2 ); + if( note1 != DANCE_NOTE_NONE ) + { + int iCol1 = mapDanceNoteToNoteDataColumn[note1]; + tempNoteData.m_TapNotes[iCol1][iIndex] = '2'; + } + if( note2 != DANCE_NOTE_NONE ) + { + int iCol2 = mapDanceNoteToNoteDataColumn[note2]; + tempNoteData.m_TapNotes[iCol2][iIndex] = '2'; + } } break; default: // this is a note character diff --git a/stepmania/src/Notes.h b/stepmania/src/Notes.h index 1163ff64e6..8ee8b2c9b2 100644 --- a/stepmania/src/Notes.h +++ b/stepmania/src/Notes.h @@ -75,9 +75,10 @@ public: int m_iMaxCombo; int m_iNumTimesPlayed; + static DifficultyClass DifficultyClassFromDescriptionAndMeter( CString sDescription, int iMeter ); + protected: void TidyUpData(); - static DifficultyClass DifficultyClassFromDescriptionAndMeter( CString sDescription, int iMeter ); }; diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 025b8d8a8b..180de53a0f 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -55,7 +55,7 @@ Player::Player() } -void Player::Load( PlayerNumber player_no, StyleDef* pStyleDef, NoteData* pNoteData, const PlayerOptions& po, LifeMeterBar* pLM, ScoreDisplayRolling* pScore, int iOriginalNumNotes ) +void Player::Load( PlayerNumber player_no, StyleDef* pStyleDef, NoteData* pNoteData, const PlayerOptions& po, LifeMeterBar* pLM, ScoreDisplayRolling* pScore, int iOriginalNumNotes, int iNotesMeter ) { //LOG->WriteLine( "Player::Load()", ); this->CopyAll( pNoteData ); @@ -69,7 +69,7 @@ void Player::Load( PlayerNumber player_no, StyleDef* pStyleDef, NoteData* pNoteD m_pLifeMeter = pLM; m_pScore = pScore; if( m_pScore ) - m_pScore->Init( player_no, m_PlayerOptions, iOriginalNumNotes, SONGMAN->GetCurrentNotes(player_no)->m_iMeter ); + m_pScore->Init( player_no, m_PlayerOptions, iOriginalNumNotes, iNotesMeter ); if( !po.m_bHoldNotes ) this->RemoveHoldNotes(); @@ -438,12 +438,12 @@ void Player::CrossedRow( int iNoteRow, float fSongBeat, float fMaxBeatDiff ) -GameplayStatistics Player::GetGameplayStatistics() +GameplayStatistics Player::GetGameplayStatistics( Song* pS, Notes* pN ) { GameplayStatistics GSreturn; - GSreturn.pSong = SONGMAN->GetCurrentSong(); - Notes* pNotes = SONGMAN->GetCurrentNotes(m_PlayerNumber); + GSreturn.pSong = pS; + Notes* pNotes = pN; GSreturn.dc = pNotes->m_DifficultyClass; GSreturn.meter = pNotes->m_iMeter; GSreturn.iPossibleDancePoints = ((NoteData*)this)->GetPossibleDancePoints(); @@ -487,8 +487,8 @@ GameplayStatistics Player::GetGameplayStatistics() for( int r=0; rGetRadarValue( (RadarCategory)r, SONGMAN->GetCurrentSong()->m_fMusicLengthSeconds ); - GSreturn.fRadarActual[r] = this->GetActualRadarValue( (RadarCategory)r, SONGMAN->GetCurrentSong()->m_fMusicLengthSeconds ); + GSreturn.fRadarPossible[r] = this->GetRadarValue( (RadarCategory)r, pS->m_fMusicLengthSeconds ); + GSreturn.fRadarActual[r] = this->GetActualRadarValue( (RadarCategory)r, pS->m_fMusicLengthSeconds ); GSreturn.fRadarPossible[r] = clamp( GSreturn.fRadarPossible[r], 0, 1 ); GSreturn.fRadarActual[r] = clamp( GSreturn.fRadarActual[r], 0, 1 ); diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 76ba4d1781..9772c86241 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -44,12 +44,12 @@ public: void Update( float fDeltaTime, float fSongBeat, float fMaxBeatDifference ); void DrawPrimitives(); - void Load( PlayerNumber player_no, StyleDef *pStyleDef, NoteData* pNoteData, const PlayerOptions& po, LifeMeterBar* pLM, ScoreDisplayRolling* pScore, int iOriginalNumNotes ); + void Load( PlayerNumber player_no, StyleDef *pStyleDef, NoteData* pNoteData, const PlayerOptions& po, LifeMeterBar* pLM, ScoreDisplayRolling* pScore, int iOriginalNumNotes, int iNotesMeter ); void CrossedRow( int iNoteRow, float fSongBeat, float fMaxBeatDiff ); void HandlePlayerStep( float fSongBeat, int col, float fMaxBeatDiff ); int UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ); - GameplayStatistics GetGameplayStatistics(); + GameplayStatistics GetGameplayStatistics( Song* pS, Notes* pN ); void SetOverrideAdd( float fAdd ) { m_NoteField.m_fOverrideAdd = fAdd; }; float GetOverrideAdd() { return m_NoteField.m_fOverrideAdd; }; diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 498212abf6..52b196fd5d 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -138,7 +138,7 @@ ScreenEdit::ScreenEdit() m_Clipboard.m_iNumTracks = m_NoteFieldEdit.m_iNumTracks; - m_Player.Load( PLAYER_1, GAMEMAN->GetCurrentStyleDef(), ¬eData, PlayerOptions(), NULL, NULL, 1 ); + m_Player.Load( PLAYER_1, GAMEMAN->GetCurrentStyleDef(), ¬eData, PlayerOptions(), NULL, NULL, 1, 1 ); m_Player.SetXY( PLAYER_X, PLAYER_Y ); m_Fade.SetClosed(); @@ -552,7 +552,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ m_Mode = MODE_PLAY; - m_Player.Load( PLAYER_1, GAMEMAN->GetCurrentStyleDef(), (NoteData*)&m_NoteFieldEdit, PlayerOptions(), NULL, NULL, 1 ); + m_Player.Load( PLAYER_1, GAMEMAN->GetCurrentStyleDef(), (NoteData*)&m_NoteFieldEdit, PlayerOptions(), NULL, NULL, 1, 1 ); m_rectRecordBack.BeginTweening( 0.5f ); m_rectRecordBack.SetTweenDiffuseColor( D3DXCOLOR(0,0,0,0.5f) ); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 413d62e268..f12fb19262 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -282,18 +282,6 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) m_ScoreDisplay[p].SetScore( (float)GS[p].max_combo * 1000 ); m_ScoreDisplay[p].SetScore( (float)GS[p].score ); - switch( m_ResultMode ) - { - case RM_ARCADE_STAGE: - case RM_ARCADE_SUMMARY: - m_Grades[p].SpinAndSettleOn( grade[p] ); - break; - case RM_ONI: - m_textOniPercent[p].SetText( "100.0%" ); - break; - } - - m_BonusInfoFrame[p].SetBonusInfo( (PlayerNumber)p, GS[p].fRadarPossible, GS[p].fRadarActual, GS[p].max_combo ); @@ -363,8 +351,10 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) m_textOniPercent[p].Load( THEME->GetPathTo(FONT_HEADER1) ); m_textOniPercent[p].SetXY( GRADE_X[p], GRADE_Y ); m_textOniPercent[p].SetShadowLength( 2 ); - m_textOniPercent[p].SetZoom( 3 ); + m_textOniPercent[p].SetZoomX( 1.5f ); + m_textOniPercent[p].SetZoomY( 3 ); m_textOniPercent[p].SetEffectGlowing( 1.0f ); + m_textOniPercent[p].SetText( "100.0%" ); this->AddActor( &m_textOniPercent[p] ); break; case RM_ARCADE_STAGE: @@ -373,6 +363,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) m_Grades[p].SetZ( -2 ); m_Grades[p].SetZoom( 1.0f ); m_Grades[p].SetEffectGlowing( 1.0f ); + m_Grades[p].SpinAndSettleOn( grade[p] ); this->AddActor( &m_Grades[p] ); break; } diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index e058a16f8f..8dc0fd9fbf 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -88,9 +88,20 @@ ScreenGameplay::ScreenGameplay() ASSERT( pCourse != NULL ); for( int i=0; im_iStages; i++ ) { - m_apSongQueue.Add( pCourse->m_apSongs[i] ); - for( int p=0; pm_apNotes[i] ); + Song* pSong = pCourse->m_apSongs[i]; + DifficultyClass dc = pCourse->m_aDifficultyClasses[i]; + + for( int j=0; jm_arrayNotes.GetSize(); j++ ) + { + Notes* pNotes = pSong->m_arrayNotes[j]; + if( pSong->m_arrayNotes[j]->m_DifficultyClass == dc ) + { + m_apSongQueue.Add( pSong ); + for( int p=0; pIsPlayerEnabled((PlayerNumber)p) ) continue; // skip - SONGMAN->m_aGameplayStatistics[p].Add( m_Player[p].GetGameplayStatistics() ); + SONGMAN->m_aGameplayStatistics[p].Add( m_Player[p].GetGameplayStatistics( m_pCurSong, m_pCurNotes[p]) ); } m_pCurSong = NULL; + for( int p=0; pIsPlayerEnabled(PlayerNumber(p)) ) continue; - m_DifficultyBanner[p].SetFromNotes( PlayerNumber(p), pNotes[p] ); + m_DifficultyBanner[p].SetFromNotes( PlayerNumber(p), m_pCurNotes[p] ); NoteData originalNoteData; - pNotes[p]->GetNoteData( &originalNoteData ); + m_pCurNotes[p]->GetNoteData( &originalNoteData ); NoteData newNoteData; pStyleDef->GetTransformedNoteDataForStyle( (PlayerNumber)p, &originalNoteData, &newNoteData ); @@ -325,7 +337,8 @@ void ScreenGameplay::LoadNextSong() PREFSMAN->m_PlayerOptions[p], &m_LifeMeter[p], &m_ScoreDisplay[p], - originalNoteData.GetNumTapNotes() + originalNoteData.GetNumTapNotes(), + m_pCurNotes[p]->m_iMeter ); } @@ -668,7 +681,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) break; case SM_GoToResults: SaveSummary(); - m_pCurSong->SaveToSMFile(); // save offset changes SCREENMAN->SetNewScreen( new ScreenEvaluation(false) ); break; diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index 02fbac15bc..6332ca7433 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -53,7 +53,8 @@ private: DancingState m_DancingState; - Song* m_pCurSong; // nearest songs are on back of queue + Song* m_pCurSong; + Notes* m_pCurNotes[NUM_PLAYERS]; CArray m_apSongQueue; // nearest songs are on back of queue CArray m_apNotesQueue[NUM_PLAYERS]; // nearest notes are on back of queue bool m_bBothHaveFailed; diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index 72d345621b..33cbdcf829 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -221,6 +221,8 @@ void ScreenSelectCourse::MenuStart( const PlayerNumber p ) m_Menu.TweenOffScreenToBlack( SM_None, false ); + SONGMAN->m_pCurCourse = m_MusicWheel.GetSelectedCourse(); + this->SendScreenMessage( SM_GoToNextState, 2.5f ); break; diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 110c0b105b..4211e24a77 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -65,6 +65,13 @@ ScreenTitleMenu::ScreenTitleMenu() { LOG->WriteLine( "ScreenTitleMenu::ScreenTitleMenu()" ); + + // reset game info +// GAMEMAN->m_sMasterPlayerNumber = PLAYER_INVALID; +// GAMEMAN->m_CurGame = GAME_INVALID; +// GAMEMAN->m_CurGame = GAME_INVALID; + + int i; m_sprBG.Load( THEME->GetPathTo(GRAPHIC_TITLE_MENU_BACKGROUND) ); @@ -123,12 +130,6 @@ ScreenTitleMenu::ScreenTitleMenu() m_Fade.OpenWipingRight( SM_DoneOpening ); this->AddActor( &m_Fade ); - /* ENSURE that the correct announcer is in place for GAME_DANCE (the default game) */ - if (GAME_DANCE == GAMEMAN->m_CurGame) - { - ANNOUNCER->SwitchAnnouncer( "default" ); - } - SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_TITLE_MENU_GAME_NAME) ); m_soundChange.Load( THEME->GetPathTo(SOUND_TITLE_MENU_CHANGE) ); @@ -281,8 +282,15 @@ void ScreenTitleMenu::MenuStart( const PlayerNumber p ) m_Fade.CloseWipingRight( SM_GoToGameOptions ); return; case CHOICE_EDIT: - m_soundSelect.PlayRandom(); - m_Fade.CloseWipingRight( SM_GoToEdit ); + if( SONGMAN->m_pSongs.GetSize() == 0 ) + { + m_soundInvalid.PlayRandom(); + } + else + { + m_soundSelect.PlayRandom(); + m_Fade.CloseWipingRight( SM_GoToEdit ); + } return; /* case CHOICE_HELP: m_soundSelect.PlayRandom(); diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 2a461ddc6a..acd20c53ae 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -432,45 +432,26 @@ void SongManager::InitCoursesFromDisk() CArray apSongs; this->GetSongsInGroup( sGroupName, apSongs ); - for( NotesType nt=NotesType(0); nt apNotes; - pSong->GetNotesThatMatch( course.m_NotesType, apNotes ); - - // search for first Notes matching this DifficultyClass - for( int n=0; nm_DifficultyClass == dc ) - { - course.AddStage( pSong, pNotes ); - break; - } - } - } - - if( course.m_iStages > 0 ) - m_aCourses.Add( course ); + case CLASS_EASY: course.m_sName += "Easy"; break; + case CLASS_MEDIUM: course.m_sName += "Medium"; break; + case CLASS_HARD: course.m_sName += "Hard"; break; } + + for( int s=0; s 0 ) + m_aCourses.Add( course ); } } } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index e8614819d3..19adda80ba 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -144,7 +144,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow ) g_hMutex = CreateMutex( NULL, TRUE, g_sAppName ); if( GetLastError() == ERROR_ALREADY_EXISTS ) { - CloseHandle( g_hMutex ); + MessageBox( NULL, "StepMania is already running.", "FatalError", MB_OK ); + exit( 1 ); } @@ -687,9 +688,9 @@ void Update() INPUTMAPPER->DeviceToGame( DeviceI, GameI ); - MenuI = INPUTMAPPER->DeviceToMenu( DeviceI ); + INPUTMAPPER->GameToMenu( GameI, MenuI ); if( !MenuI.IsValid() ) // try again - INPUTMAPPER->GameToMenu( GameI, MenuI ); + MenuI = INPUTMAPPER->DeviceToMenu( DeviceI ); if( MenuI.IsValid() && type == IET_FIRST_PRESS ) INPUTQUEUE->HandleInput( MenuI.player, MenuI.button ); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index ae8770c05d..2b26ec78c4 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -186,17 +186,17 @@ CString ThemeManager::GetPathTo( ThemeElement te ) case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_2: sAssetPrefix = "Graphics\\select style info game 0 style 2"; break; case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_3: sAssetPrefix = "Graphics\\select style info game 0 style 3"; break; case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_4: sAssetPrefix = "Graphics\\select style info game 0 style 4"; break; - case GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_0: sAssetPrefix = "Graphics\\select style info game 1 style 0"; break; - case GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_1: sAssetPrefix = "Graphics\\select style info game 1 style 1"; break; - case GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_2: sAssetPrefix = "Graphics\\select style info game 1 style 2"; break; +// case GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_0: sAssetPrefix = "Graphics\\select style info game 1 style 0"; break; +// case GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_1: sAssetPrefix = "Graphics\\select style info game 1 style 1"; break; +// case GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_2: sAssetPrefix = "Graphics\\select style info game 1 style 2"; break; case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0: sAssetPrefix = "Graphics\\select style preview game 0 style 0"; break; case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_1: sAssetPrefix = "Graphics\\select style preview game 0 style 1"; break; case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_2: sAssetPrefix = "Graphics\\select style preview game 0 style 2"; break; case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_3: sAssetPrefix = "Graphics\\select style preview game 0 style 3"; break; case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_4: sAssetPrefix = "Graphics\\select style preview game 0 style 4"; break; - case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_0: sAssetPrefix = "Graphics\\select style preview game 1 style 0"; break; - case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_1: sAssetPrefix = "Graphics\\select style preview game 1 style 1"; break; - case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_2: sAssetPrefix = "Graphics\\select style preview game 1 style 2"; break; +// case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_0: sAssetPrefix = "Graphics\\select style preview game 1 style 0"; break; +// case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_1: sAssetPrefix = "Graphics\\select style preview game 1 style 1"; break; +// case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_2: sAssetPrefix = "Graphics\\select style preview game 1 style 2"; break; case GRAPHIC_SONG_OPTIONS_BACKGROUND: sAssetPrefix = "Graphics\\song options background"; break; case GRAPHIC_SONG_OPTIONS_TOP_EDGE: sAssetPrefix = "Graphics\\song options top edge"; break; case GRAPHIC_STAGE_UNDERSCORE: sAssetPrefix = "Graphics\\stage underscore"; break; @@ -262,11 +262,7 @@ CString ThemeManager::GetPathTo( ThemeElement te ) GetDirListing( sCurrentThemeDir + sAssetPrefix + "*.png", asPossibleElementFilePaths, false, true ); GetDirListing( sCurrentThemeDir + sAssetPrefix + "*.jpg", asPossibleElementFilePaths, false, true ); GetDirListing( sCurrentThemeDir + sAssetPrefix + "*.bmp", asPossibleElementFilePaths, false, true ); - - GetDirListing( sDefaultThemeDir + sAssetPrefix + "*.sprite", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetPrefix + "*.png", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetPrefix + "*.jpg", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetPrefix + "*.bmp", asPossibleElementFilePaths, false, true ); + GetDirListing( sCurrentThemeDir + sAssetPrefix + "*.gif", asPossibleElementFilePaths, false, true ); } else if( -1 != sAssetPrefix.Find("Sounds\\") ) { @@ -274,17 +270,10 @@ CString ThemeManager::GetPathTo( ThemeElement te ) GetDirListing( sCurrentThemeDir + sAssetPrefix + ".mp3", asPossibleElementFilePaths, false, true ); GetDirListing( sCurrentThemeDir + sAssetPrefix + ".ogg", asPossibleElementFilePaths, false, true ); GetDirListing( sCurrentThemeDir + sAssetPrefix + ".wav", asPossibleElementFilePaths, false, true ); - - GetDirListing( sDefaultThemeDir + sAssetPrefix + ".set", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetPrefix + ".mp3", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetPrefix + ".ogg", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetPrefix + ".wav", asPossibleElementFilePaths, false, true ); } else if( -1 != sAssetPrefix.Find("Fonts\\") ) { GetDirListing( sCurrentThemeDir + sAssetPrefix + ".font", asPossibleElementFilePaths, false, true ); - - GetDirListing( sDefaultThemeDir + sAssetPrefix + ".font", asPossibleElementFilePaths, false, true ); } else { diff --git a/stepmania/src/ThemeManager.h b/stepmania/src/ThemeManager.h index 94cfe76c2b..cd9eaf3ca2 100644 --- a/stepmania/src/ThemeManager.h +++ b/stepmania/src/ThemeManager.h @@ -119,17 +119,17 @@ enum ThemeElement { GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_2, GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_3, GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_4, - GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_0, - GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_1, - GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_2, +// GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_0, +// GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_1, +// GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_2, GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0, GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_1, GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_2, GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_3, GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_4, - GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_0, - GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_1, - GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_2, +// GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_0, +// GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_1, +// GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_2, GRAPHIC_SONG_OPTIONS_BACKGROUND, GRAPHIC_SONG_OPTIONS_TOP_EDGE, GRAPHIC_STAGE_UNDERSCORE,