diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index ae9894b83f..81523b0632 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -2197,7 +2197,7 @@ NextScreen=ScreenHowToPlay [ScreenHowToPlay] NextScreen=ScreenDemonstration SongBPM=100 -SecondsToShow=60 +SecondsToShow=25 [ScreenDemonstration] SecondsToShow=30 diff --git a/stepmania/Utils/forfiles.exe b/stepmania/Utils/forfiles.exe index 7fa0a22c98..a42b83e610 100755 Binary files a/stepmania/Utils/forfiles.exe and b/stepmania/Utils/forfiles.exe differ diff --git a/stepmania/Utils/handle.exe b/stepmania/Utils/handle.exe index 0a47a61f3c..fa2d67a999 100755 Binary files a/stepmania/Utils/handle.exe and b/stepmania/Utils/handle.exe differ diff --git a/stepmania/Utils/unlockconvert.exe b/stepmania/Utils/unlockconvert.exe index 64c0a2b40d..fbd22b4da3 100755 Binary files a/stepmania/Utils/unlockconvert.exe and b/stepmania/Utils/unlockconvert.exe differ diff --git a/stepmania/Utils/upx.exe b/stepmania/Utils/upx.exe index b0b309ac7c..c5e215379f 100644 Binary files a/stepmania/Utils/upx.exe and b/stepmania/Utils/upx.exe differ diff --git a/stepmania/src/Character.cpp b/stepmania/src/Character.cpp index 1e6d73da14..c91ed79009 100644 --- a/stepmania/src/Character.cpp +++ b/stepmania/src/Character.cpp @@ -52,10 +52,11 @@ CString GetRandomFileInDir( CString sDir ) } -CString Character::GetModelPath() { return m_sCharDir + "model.txt"; } -CString Character::GetRestAnimationPath() { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Rest" SLASH)); } -CString Character::GetWarmUpAnimationPath() { return DerefRedir(GetRandomFileInDir(m_sCharDir + "WarmUp" SLASH)); } -CString Character::GetDanceAnimationPath() { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Dance" SLASH)); } +CString Character::GetModelPath() { return m_sCharDir + "model.txt"; } +CString Character::GetRestAnimationPath() { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Rest" SLASH)); } +CString Character::GetWarmUpAnimationPath() { return DerefRedir(GetRandomFileInDir(m_sCharDir + "WarmUp" SLASH)); } +CString Character::GetDanceAnimationPath() { return DerefRedir(GetRandomFileInDir(m_sCharDir + "Dance" SLASH)); } +CString Character::GetHowToPlayAnimationPath() { return DerefRedir(GetRandomFileInDir(m_sCharDir + "HowToPlay" SLASH)); } CString Character::GetTakingABreakPath() { CStringArray as; diff --git a/stepmania/src/Character.h b/stepmania/src/Character.h index 070e8f0ed6..11859451e7 100644 --- a/stepmania/src/Character.h +++ b/stepmania/src/Character.h @@ -29,6 +29,7 @@ public: CString GetRestAnimationPath(); CString GetWarmUpAnimationPath(); CString GetDanceAnimationPath(); + CString GetHowToPlayAnimationPath(); CString m_sCharDir; CString m_sName; diff --git a/stepmania/src/DancingCharacters.cpp b/stepmania/src/DancingCharacters.cpp index 5e1bebc389..642da8ecfe 100644 --- a/stepmania/src/DancingCharacters.cpp +++ b/stepmania/src/DancingCharacters.cpp @@ -59,6 +59,7 @@ DancingCharacters::DancingCharacters() m_Character[p].LoadMilkshapeAsciiBones( "rest", pChar->GetRestAnimationPath() ); m_Character[p].LoadMilkshapeAsciiBones( "warmup", pChar->GetWarmUpAnimationPath() ); m_Character[p].LoadMilkshapeAsciiBones( "dance", pChar->GetDanceAnimationPath() ); + m_Character[p].LoadMilkshapeAsciiBones( "howtoplay", pChar->GetHowToPlayAnimationPath() ); m_Character[p].PlayAnimation( "rest" ); this->AddChild( &m_Character[p] ); } diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index 854470d81c..c0b2d2e3bc 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -738,6 +738,13 @@ void Model::PlayAnimation( CString sAniName ) m_fCurrFrame = 0; } +float Model::GetCurFrame() { return m_fCurrFrame; }; + +void Model::SetFrame( float fNewFrame ) +{ + m_fCurrFrame = fNewFrame; +} + void Model::AdvanceFrame (float dt) { diff --git a/stepmania/src/Model.h b/stepmania/src/Model.h index df907ef5bf..7daef5af8a 100644 --- a/stepmania/src/Model.h +++ b/stepmania/src/Model.h @@ -57,6 +57,8 @@ public: void AdvanceFrame (float dt); virtual void SetState( int iNewState ); + float GetCurFrame(); + void SetFrame( float fNewFrame ); virtual int GetNumStates(); diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index 0d1b128342..b0c5542b01 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -1,4 +1,5 @@ #include "global.h" +#include "stdlib.h" /* ----------------------------------------------------------------------------- Class: ScreenHowToPlay @@ -43,9 +44,35 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay") m_LifeMeter.Load( PLAYER_1 ); m_LifeMeter.SetXY( 480, 40 ); this->AddChild( &m_LifeMeter ); + + + + + + + + // Display character + int iRnd; + iRnd = rand() % (GAMESTATE->m_pCharacters.size()-1); + if( iRnd != 0 ) + { + m_mCharacter.LoadMilkshapeAscii( GAMESTATE->m_pCharacters[iRnd]->GetModelPath() ); + m_mCharacter.LoadMilkshapeAsciiBones("howtoplay", GAMESTATE->m_pCharacters[iRnd]->GetHowToPlayAnimationPath() ); + m_mCharacter.SetZoom(20); + m_mCharacter.Command("X,150;Y,300;Zoom,15;RotationY,180;sleep,4.7;linear,1.0;RotationY,360;Zoom,20;X,100;Y,425"); + this->AddChild(&m_mCharacter); + } + // + + + + + + NoteData* pND = new NoteData; pND->SetNumTracks( iNumOfTracks ); + /* Old notes.. Until our HowToPlay animation changes, Steps changed. pND->SetTapNote( 0, ROWS_PER_BEAT*12, TAP_TAP ); pND->SetTapNote( 1, ROWS_PER_BEAT*16, TAP_TAP ); pND->SetTapNote( 2, ROWS_PER_BEAT*20, TAP_TAP ); @@ -62,25 +89,39 @@ ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay") pND->SetTapNote( 3, (int)(ROWS_PER_BEAT*45.5f), TAP_TAP ); pND->SetTapNote( 0, ROWS_PER_BEAT*46, TAP_TAP ); pND->SetTapNote( 2, ROWS_PER_BEAT*46, TAP_TAP ); + */ + + pND->SetTapNote( 1, ROWS_PER_BEAT*16, TAP_TAP ); + pND->SetTapNote( 2, ROWS_PER_BEAT*18, TAP_TAP ); + pND->SetTapNote( 0, ROWS_PER_BEAT*20, TAP_TAP ); + pND->SetTapNote( 0, ROWS_PER_BEAT*22, TAP_TAP ); + pND->SetTapNote( 3, ROWS_PER_BEAT*22, TAP_TAP ); m_pSong = new Song; float fSongBPM = SONG_BPM; // need this on a separate line, otherwise VC6 release build screws up and returns 0 m_pSong->AddBPMSegment( BPMSegment(0.0,fSongBPM) ); - m_pSong->AddStopSegment( StopSegment(15,2) ); + /* Same as above + m_pSong->AddStopSegment( StopSegment(12,2) ); m_pSong->AddStopSegment( StopSegment(16,2) ); m_pSong->AddStopSegment( StopSegment(20,2) ); m_pSong->AddStopSegment( StopSegment(24,2) ); m_pSong->AddStopSegment( StopSegment(28,2) ); + */ + m_pSong->AddStopSegment( StopSegment(16,2) ); + m_pSong->AddStopSegment( StopSegment(18,2) ); + m_pSong->AddStopSegment( StopSegment(20,2) ); + m_pSong->AddStopSegment( StopSegment(22,2) ); GAMESTATE->m_pCurSong = m_pSong; GAMESTATE->m_bPastHereWeGo = true; GAMESTATE->m_PlayerController[PLAYER_1] = PC_AUTOPLAY; m_Player.Load( PLAYER_1, pND, &m_LifeMeter, NULL, NULL, NULL, NULL, NULL ); + + /* We need a nice way to fill up the LifeMeter half-way. -- Miryo */ m_Player.SetX( 480 ); m_Player.DontShowJudgement(); this->AddChild( &m_Player ); - delete pND; m_fFakeSecondsIntoSong = 0; @@ -99,6 +140,56 @@ void ScreenHowToPlay::Update( float fDelta ) { GAMESTATE->UpdateSongPosition( m_fFakeSecondsIntoSong ); m_fFakeSecondsIntoSong += fDelta; + LOG->ShowConsole(); + + if( GAMESTATE->m_bFreeze ) + { + switch(int(GAMESTATE->m_fSongBeat)) + { + case 16: m_mCharacter.SetFrame(30); break; + case 18: m_mCharacter.SetFrame(85); break; + case 20: m_mCharacter.SetFrame(150); break; + case 22: m_mCharacter.SetFrame(270); break; + }; + } + else + { + // HowToPlay animations.. This will be retimed soon to be a reasonable speed. This was just a quick'n'dirty way of showing this screen correctly. + // Until we get a better HowToPlay animation done, it has to be this way.. + if( (GAMESTATE->m_fSongBeat >= 15.0f && GAMESTATE->m_fSongBeat <= 15.2f) ) + { + m_mCharacter.SetFrame(1); + }; + if( (GAMESTATE->m_fSongBeat >= 17.0f && GAMESTATE->m_fSongBeat <= 17.2f) ) + { + m_mCharacter.SetFrame(55); + }; + if( (GAMESTATE->m_fSongBeat >= 19.0f && GAMESTATE->m_fSongBeat <= 19.2f) ) + { + m_mCharacter.SetFrame(120); + }; + if( (GAMESTATE->m_fSongBeat >= 21.0f && GAMESTATE->m_fSongBeat <= 21.2f) ) + { + m_mCharacter.SetFrame(240); + }; + // ----------------------------------------------------------------------- */ + + + if( (GAMESTATE->m_fSongBeat >= 0.0f && GAMESTATE->m_fSongBeat <= 15.0f) || + (GAMESTATE->m_fSongBeat >= 16.8f && GAMESTATE->m_fSongBeat <= 17.0f) || + (GAMESTATE->m_fSongBeat >= 18.8f && GAMESTATE->m_fSongBeat <= 19.0f) || + (GAMESTATE->m_fSongBeat >= 20.8f && GAMESTATE->m_fSongBeat <= 21.0f) || + (GAMESTATE->m_fSongBeat >= 22.8f) ) + { + if( (m_mCharacter.GetCurFrame() >=243) || (m_mCharacter.GetCurFrame() <=184) ) + m_mCharacter.SetFrame(184); + //Loop for HowToPlay static movement is 184~243 + }; + + m_mCharacter.Update( (0+(fDelta*1.08)) ); + //m_mCharacter.Draw(); + }; + } ScreenAttract::Update( fDelta ); @@ -110,7 +201,7 @@ void ScreenHowToPlay::HandleScreenMessage( const ScreenMessage SM ) { case SM_BeginFadingOut: /* We can't do this in ScreenHowToPlay::~ScreenHowToPlay, since that happens - * after the ctor of the next screen; we don't want to mess with its state. */ + * after the actor of the next screen; we don't want to mess with its state. */ GAMESTATE->m_pCurSong = NULL; break; } diff --git a/stepmania/src/ScreenHowToPlay.h b/stepmania/src/ScreenHowToPlay.h index 89ab502ed0..8863c91a30 100644 --- a/stepmania/src/ScreenHowToPlay.h +++ b/stepmania/src/ScreenHowToPlay.h @@ -9,9 +9,11 @@ ----------------------------------------------------------------------------- */ + #include "ScreenAttract.h" #include "Player.h" #include "LifeMeterBar.h" +#include "Character.h" class ScreenHowToPlay : public ScreenAttract @@ -26,9 +28,15 @@ public: protected: LifeMeterBar m_LifeMeter; Player m_Player; + Model m_mCharacter; Song* m_pSong; float m_fFakeSecondsIntoSong; + float m_fSecondsUntilNextKeyFrame; + + /*#define NUM_KEY_FRAMES 10 + float m_fKeyFrames[NUM_KEY_FRAMES]; + float m_fCurKeyFrame;*/ }; diff --git a/stepmania/src/disasm/mapconv.exe b/stepmania/src/disasm/mapconv.exe index 629bc1ddc4..c8b120534a 100644 Binary files a/stepmania/src/disasm/mapconv.exe and b/stepmania/src/disasm/mapconv.exe differ diff --git a/stepmania/src/disasm/verinc.exe b/stepmania/src/disasm/verinc.exe index 1a5eda7e42..47b4c2a256 100644 Binary files a/stepmania/src/disasm/verinc.exe and b/stepmania/src/disasm/verinc.exe differ