diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index b87c8c31de..3a9c039132 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -102,14 +102,6 @@ BGAnimation *Background::GetBGA(const Song *pSong, const BackgroundChange &anise // movies in RandomMovies dir, BGAnims in BGAnimsDir. CStringArray asFiles; - // Look for BG movies in the song dir - GetDirListing( pSong->GetSongDir()+aniseg.m_sBGName, asFiles, false, true ); - if( !asFiles.empty() ) - { - pTempBGA = new BGAnimation; - pTempBGA->LoadFromMovie( asFiles[0], true, true ); - return pTempBGA; - } // Look for BGAnims in the song dir GetDirListing( pSong->GetSongDir()+aniseg.m_sBGName, asFiles, true, true ); if( !asFiles.empty() ) @@ -118,7 +110,14 @@ BGAnimation *Background::GetBGA(const Song *pSong, const BackgroundChange &anise pTempBGA->LoadFromAniDir( asFiles[0], bgpath ); return pTempBGA; } - + // Look for BG movies in the song dir + GetDirListing( pSong->GetSongDir()+aniseg.m_sBGName, asFiles, false, true ); + if( !asFiles.empty() ) + { + pTempBGA = new BGAnimation; + pTempBGA->LoadFromMovie( asFiles[0], true, true ); + return pTempBGA; + } // Look for movies in the RandomMovies dir GetDirListing( RANDOMMOVIES_DIR+aniseg.m_sBGName, asFiles, false, true ); if( !asFiles.empty() ) diff --git a/stepmania/src/Game.h b/stepmania/src/Game.h index a5e57b7509..983544b24b 100644 --- a/stepmania/src/Game.h +++ b/stepmania/src/Game.h @@ -17,6 +17,7 @@ enum Game GAME_PUMP, // Pump It Up GAME_EZ2, // Ez2dancer GAME_PARA, // ParaPAraParadise + GAME_DS3DDX, // Dance Station 3DDX. NUM_GAMES, // leave this at the end GAME_INVALID, }; diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index 82dd7f8b75..52c39e0486 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -75,6 +75,7 @@ enum NotesType NOTES_TYPE_EZ2_DOUBLE, NOTES_TYPE_EZ2_REAL, NOTES_TYPE_PARA_SINGLE, + NOTES_TYPE_DS3DDX_SINGLE, NUM_NOTES_TYPES, // leave this at the end NOTES_TYPE_INVALID, }; diff --git a/stepmania/src/GameInput.h b/stepmania/src/GameInput.h index 39f3a9c022..fd0fcea414 100644 --- a/stepmania/src/GameInput.h +++ b/stepmania/src/GameInput.h @@ -84,9 +84,27 @@ enum // ParaButtons PARA_BUTTON_MENURIGHT, PARA_BUTTON_MENUUP, PARA_BUTTON_MENUDOWN, - PARA_EZ2_BUTTONS, // leave this at the end + NUM_PARA_BUTTONS, // leave this at the end }; +enum // 3DDX Buttons +{ + DS3DDX_BUTTON_HANDLEFT, + DS3DDX_BUTTON_FOOTDOWNLEFT, + DS3DDX_BUTTON_FOOTUPLEFT, + DS3DDX_BUTTON_HANDUP, + DS3DDX_BUTTON_HANDDOWN, + DS3DDX_BUTTON_FOOTUPRIGHT, + DS3DDX_BUTTON_FOOTDOWNRIGHT, + DS3DDX_BUTTON_HANDRIGHT, + DS3DDX_BUTTON_START, + DS3DDX_BUTTON_BACK, + DS3DDX_BUTTON_MENULEFT, + DS3DDX_BUTTON_MENURIGHT, + DS3DDX_BUTTON_MENUUP, + DS3DDX_BUTTON_MENUDOWN, + NUM_DS3DDX_BUTTONS, // leave this at the end. +}; const GameButton MAX_GAME_BUTTONS = 14; const GameButton GAME_BUTTON_INVALID = MAX_GAME_BUTTONS+1; diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index b80e3643aa..76f4420751 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -33,6 +33,7 @@ const int PUMP_COL_SPACING = 50; const int EZ2_COL_SPACING = 46; const int EZ2_REAL_COL_SPACING = 40; const int PARA_COL_SPACING = 54; +const int DS3DDX_COL_SPACING = 54; struct { char *name; @@ -48,7 +49,8 @@ struct { { "ez2-single", 5 }, // Single: TL,LHH,D,RHH,TR { "ez2-double", 10 }, // Double: Single x2 { "ez2-real", 7 }, // Real: TL,LHH,LHL,D,RHL,RHH,TR - { "para-single", 5 } + { "para-single", 5 }, + { "ds3ddx-single", 8 } }; // @@ -372,6 +374,94 @@ GameDef g_GameDefs[NUM_GAMES] = }, } }, + { // GAME_DS3DDX + "ds3ddx", // m_szName + "Dance Station 3DDX", // m_szDescription + 2, // m_iNumControllers + NUM_DS3DDX_BUTTONS, // m_iButtonsPerController + { // m_szButtonNames + "HandLeft", + "FootDownLeft", + "FootUpLeft", + "HandUp", + "HandDown", + "FootUpRight", + "FootDownRight", + "HandRight", + "Start", + "Back", + "MenuLeft", + "MenuRight", + "MenuUp", + "MenuDown", + }, + { // m_szSecondaryFunction + "(MenuLeft)", + "", + "", + "(MenuUp)", + "(MenuDown)", + "", + "", + "(MenuRight)", + "", + "", + "(dedicated)", + "(dedicated)", + "(dedicated)", + "(dedicated)", + }, + { // m_DedicatedMenuButton + DS3DDX_BUTTON_MENULEFT, // MENU_BUTTON_LEFT + DS3DDX_BUTTON_MENURIGHT, // MENU_BUTTON_RIGHT + DS3DDX_BUTTON_MENUUP, // MENU_BUTTON_UP + DS3DDX_BUTTON_MENUDOWN, // MENU_BUTTON_DOWN + DS3DDX_BUTTON_START, // MENU_BUTTON_START + DS3DDX_BUTTON_BACK, // MENU_BUTTON_BACK + }, + { // m_SecondaryMenuButton + DS3DDX_BUTTON_HANDLEFT, // MENU_BUTTON_LEFT + DS3DDX_BUTTON_HANDRIGHT, // MENU_BUTTON_RIGHT + DS3DDX_BUTTON_HANDUP, // MENU_BUTTON_UP + DS3DDX_BUTTON_HANDDOWN, // MENU_BUTTON_DOWN + DS3DDX_BUTTON_START, // MENU_BUTTON_START + DS3DDX_BUTTON_BACK, // MENU_BUTTON_BACK + }, + { // m_iDefaultKeyboardKey + { // PLAYER_1 + SDLK_a, // DS3DDX_BUTTON_HANDLEFT, + SDLK_z, // DS3DDX_BUTTON_FOOTDOWNLEFT, + SDLK_q, // DS3DDX_BUTTON_FOOTUPLEFT, + SDLK_w, // DS3DDX_BUTTON_HANDUP, + SDLK_x, // DS3DDX_BUTTON_HANDDOWN, + SDLK_e, // DS3DDX_BUTTON_FOOTUPRIGHT, + SDLK_c, // DS3DDX_BUTTON_FOOTDOWNRIGHT, + SDLK_d, // DS3DDX_BUTTON_HANDRIGHT, + SDLK_RETURN, // DS3DDX_BUTTON_START, + SDLK_ESCAPE, // DS3DDX_BUTTON_BACK + SDLK_LEFT, //no default key // DS3DDX_BUTTON_MENULEFT + SDLK_RIGHT, //no default key // DS3DDX_BUTTON_MENURIGHT + SDLK_UP, // DS3DDX_BUTTON_MENUUP + SDLK_DOWN, // DS3DDX_BUTTON_MENUDOWN + }, + { // PLAYER_2 + -1, // DS3DDX_BUTTON_HANDLEFT, + -1, // DS3DDX_BUTTON_FOOTDOWNLEFT, + -1, // DS3DDX_BUTTON_FOOTUPLEFT, + -1, // DS3DDX_BUTTON_HANDUP, + -1, // DS3DDX_BUTTON_HANDDOWN, + -1, // DS3DDX_BUTTON_FOOTUPRIGHT, + -1, // DS3DDX_BUTTON_FOOTDOWNRIGHT, + -1, // DS3DDX_BUTTON_HANDRIGHT, + -1, // DS3DDX_BUTTON_START, + -1, // DS3DDX_BUTTON_BACK + -1, //no default key // DS3DDX_BUTTON_MENULEFT + -1, //no default key // DS3DDX_BUTTON_MENURIGHT + -1, // DS3DDX_BUTTON_MENUUP + -1, // DS3DDX_BUTTON_MENUDOWN + }, + } + }, }; StyleDef g_StyleDefs[NUM_STYLES] = @@ -937,6 +1027,41 @@ StyleDef g_StyleDefs[NUM_STYLES] = { // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER]; 2,0,4,1,3 }, + }, + { // DS3DDX_SINGLE + GAME_DS3DDX, // m_Game + true, // m_bUsedForGameplay + true, // m_bUsedForEdit + "single", // m_szName + NOTES_TYPE_PARA_SINGLE, // m_NotesType + StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType + { 320, 320 }, // m_iCenterX + 8, // m_iColsPerPlayer + { // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; + { // PLAYER_1 + { TRACK_1, GAME_CONTROLLER_1, DS3DDX_BUTTON_HANDLEFT, -DS3DDX_COL_SPACING*3 }, + { TRACK_2, GAME_CONTROLLER_1, DS3DDX_BUTTON_FOOTDOWNLEFT, -DS3DDX_COL_SPACING*2 }, + { TRACK_3, GAME_CONTROLLER_1, DS3DDX_BUTTON_FOOTUPLEFT, -DS3DDX_COL_SPACING*1 }, + { TRACK_4, GAME_CONTROLLER_1, DS3DDX_BUTTON_HANDUP, -DS3DDX_COL_SPACING*0 }, + { TRACK_5, GAME_CONTROLLER_1, DS3DDX_BUTTON_HANDDOWN, +DS3DDX_COL_SPACING*0 }, + { TRACK_6, GAME_CONTROLLER_1, DS3DDX_BUTTON_FOOTUPRIGHT, +DS3DDX_COL_SPACING*1 }, + { TRACK_7, GAME_CONTROLLER_1, DS3DDX_BUTTON_FOOTDOWNRIGHT, +DS3DDX_COL_SPACING*2 }, + { TRACK_8, GAME_CONTROLLER_1, DS3DDX_BUTTON_HANDRIGHT, +DS3DDX_COL_SPACING*3 }, + }, + { // PLAYER_2 + { TRACK_1, GAME_CONTROLLER_2, DS3DDX_BUTTON_HANDLEFT, -DS3DDX_COL_SPACING*3 }, + { TRACK_2, GAME_CONTROLLER_2, DS3DDX_BUTTON_FOOTDOWNLEFT, -DS3DDX_COL_SPACING*2 }, + { TRACK_3, GAME_CONTROLLER_2, DS3DDX_BUTTON_FOOTUPLEFT, -DS3DDX_COL_SPACING*1 }, + { TRACK_4, GAME_CONTROLLER_2, DS3DDX_BUTTON_HANDUP, -DS3DDX_COL_SPACING*0 }, + { TRACK_5, GAME_CONTROLLER_2, DS3DDX_BUTTON_HANDDOWN, +DS3DDX_COL_SPACING*0 }, + { TRACK_6, GAME_CONTROLLER_2, DS3DDX_BUTTON_FOOTUPRIGHT, +DS3DDX_COL_SPACING*1 }, + { TRACK_7, GAME_CONTROLLER_2, DS3DDX_BUTTON_FOOTDOWNRIGHT, +DS3DDX_COL_SPACING*2 }, + { TRACK_8, GAME_CONTROLLER_2, DS3DDX_BUTTON_HANDRIGHT, +DS3DDX_COL_SPACING*3 }, + }, + }, + { // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER]; + 0,1,2,3,4,5,6,7 + }, } }; @@ -1151,6 +1276,30 @@ ModeChoice g_ModeChoices[] = "expert", 1 }, + { + GAME_DS3DDX, + PLAY_MODE_ARCADE, + STYLE_DS3DDX_SINGLE, + DIFFICULTY_EASY, + "pretty", + 1 + }, + { + GAME_DS3DDX, + PLAY_MODE_ARCADE, + STYLE_DS3DDX_SINGLE, + DIFFICULTY_MEDIUM, + "power", + 1 + }, + { + GAME_DS3DDX, + PLAY_MODE_ARCADE, + STYLE_DS3DDX_SINGLE, + DIFFICULTY_HARD, + "power2", + 1 + }, }; const int NUM_MODE_CHOICES = sizeof(g_ModeChoices) / sizeof(g_ModeChoices[0]); diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index f9e64d48ed..827642dddc 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -423,7 +423,13 @@ void NoteData::LoadTransformed( NoteData* pOriginal, int iNewNumTracks, const in for( int t=0; tm_iNumTracks ); + + // ******************* WHY DO THIS? IT BREAKS SOME AUTOGEN LOADING (NAMELY DDR->DS3DDX) - Andy. + + // ASSERT( iOriginalTrack < pOriginal->m_iNumTracks ); + + + if( iOriginalTrack == -1 ) continue; m_TapNotes[t] = pOriginal->m_TapNotes[iOriginalTrack]; diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index d94ba9234a..d68d5d17f5 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -145,6 +145,14 @@ void ScreenEz2SelectMusic::MenuLeft( PlayerNumber pn, const InputEventType type void ScreenEz2SelectMusic::MenuStart( PlayerNumber pn ) { + if( !m_MusicBannerWheel.GetSelectedSong()->HasMusic() ) + { + /* TODO: gray these out. + * + * XXX: also, make sure they're not selected by roulette */ + SCREENMAN->Prompt( SM_None, "ERROR:\n \nThis song does not have a music file\n and cannot be played." ); + return; + } MUSIC->Stop(); SCREENMAN->SetNewScreen( "ScreenStage" ); } diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 515e68d0a4..1265bbfe66 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -247,6 +247,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM ) case GAME_PUMP: GAMESTATE->m_CurStyle = STYLE_PUMP_VERSUS; break; case GAME_EZ2: GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE_VERSUS; break; case GAME_PARA: GAMESTATE->m_CurStyle = STYLE_PARA_SINGLE; break; + case GAME_DS3DDX: GAMESTATE->m_CurStyle = STYLE_DS3DDX_SINGLE; break; default: ASSERT(0); } diff --git a/stepmania/src/Style.h b/stepmania/src/Style.h index a531b98c4b..3920c67744 100644 --- a/stepmania/src/Style.h +++ b/stepmania/src/Style.h @@ -30,6 +30,7 @@ enum Style STYLE_EZ2_REAL_VERSUS, STYLE_EZ2_DOUBLE, STYLE_PARA_SINGLE, + STYLE_DS3DDX_SINGLE, NUM_STYLES, // leave this at the end STYLE_NONE, }; @@ -38,6 +39,7 @@ const int NUM_DANCE_STYLES = 6; const int NUM_PUMP_STYLES = 5; const int NUM_EZ2_STYLES = 5; const int NUM_PARA_STYLES = 1; +const int NUM_DS3DDX_STYLES = 1; // Ugh. This is needed for the style icon. // TODO: Find a more elegant way to handle this @@ -50,6 +52,7 @@ inline int GetStyleIndexRelativeToGame( int iGameIndex, Style style ) case 1: iStyleIndex -= NUM_DANCE_STYLES; break; // pump case 2: iStyleIndex -= NUM_DANCE_STYLES+NUM_PUMP_STYLES; break; // ez2 case 3: iStyleIndex -= NUM_DANCE_STYLES+NUM_PUMP_STYLES+NUM_EZ2_STYLES; break; // para + case 4: iStyleIndex -= NUM_DANCE_STYLES+NUM_PUMP_STYLES+NUM_EZ2_STYLES+NUM_PARA_STYLES; break; // ds3ddx default: ASSERT(0); // invalid game index } return iStyleIndex; diff --git a/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp b/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp index 199e41b70e..b8f5b581b1 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_WaveOut.cpp @@ -15,7 +15,7 @@ const int channels = 2; const int samplesize = channels*2; /* 16-bit */ const int samplerate = 44100; -const int buffersize_frames = 1024*4; /* in frames */ +const int buffersize_frames = 1024*8; /* in frames */ const int buffersize = buffersize_frames * samplesize; /* in bytes */ const int num_chunks = 8; @@ -188,7 +188,7 @@ RageSound_WaveOut::RageSound_WaveOut() fmt.nBlockAlign = fmt.nChannels * fmt.wBitsPerSample / 8; fmt.nAvgBytesPerSec = fmt.nSamplesPerSec * fmt.nBlockAlign; - MMRESULT ret = waveOutOpen(&wo, WAVE_MAPPER, &fmt, + MMRESULT ret = waveOutOpen(&wo, WAVE_MAPPER, &fmt, (DWORD_PTR) sound_event, NULL, CALLBACK_EVENT); if(ret != MMSYSERR_NOERROR) @@ -204,7 +204,7 @@ RageSound_WaveOut::RageSound_WaveOut() RageException::ThrowNonfatal(wo_ssprintf(ret, "waveOutPrepareHeader failed")); buffers[b].dwFlags |= WHDR_DONE; } - + MixerThreadPtr = SDL_CreateThread(MixerThread_start, this); }