From adc19d0a158a2780e2b27ac642c708a8665d8506 Mon Sep 17 00:00:00 2001 From: Kevin Slaughter Date: Thu, 31 Jul 2003 11:31:24 +0000 Subject: [PATCH] Updated ScreenHowToPlay code to include dancer. I know it's a bit rough and too-fast paced right now, but that will all be fixed tonight when I get home and re-commit. --- stepmania/Themes/default/metrics.ini | 2 +- stepmania/Utils/forfiles.exe | Bin 49152 -> 49152 bytes stepmania/Utils/handle.exe | Bin 69632 -> 69632 bytes stepmania/Utils/unlockconvert.exe | Bin 107520 -> 107520 bytes stepmania/Utils/upx.exe | Bin 94208 -> 94208 bytes stepmania/src/Character.cpp | 9 +-- stepmania/src/Character.h | 1 + stepmania/src/DancingCharacters.cpp | 1 + stepmania/src/Model.cpp | 7 ++ stepmania/src/Model.h | 2 + stepmania/src/ScreenHowToPlay.cpp | 97 ++++++++++++++++++++++++++- stepmania/src/ScreenHowToPlay.h | 8 +++ stepmania/src/disasm/mapconv.exe | Bin 61440 -> 61440 bytes stepmania/src/disasm/verinc.exe | Bin 49152 -> 49152 bytes 14 files changed, 119 insertions(+), 8 deletions(-) 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 7fa0a22c9816bbbb108cdf38420867b9230a62a7..a42b83e610e5baa99598847631ad08fef7b0435c 100755 GIT binary patch delta 83 zcmZo@U~Xt&o^X$mW#WA=t_KVZ3<3-cYU>#%8#BIPJTO^-Nkc;~Co_#5D8UHC3>QEI e5FB7&*e#;*KSBFCn5)3R@L+Qw(*)i{0viC7c@*0K delta 42 xcmZo@U~Xt&o^X$mdE$L9t_utd3<5yRz%bdE@eQNHWCbRT&4!zH@GcVA000fP466VD diff --git a/stepmania/Utils/handle.exe b/stepmania/Utils/handle.exe index 0a47a61f3cdbd273e324f0b3a2baeaa60df8d65e..fa2d67a9995359e8432bba4d15b7a89addc08524 100755 GIT binary patch delta 82 zcmZozz|ydQWx_i~)`{=ExE3%nFbFU(BtB-G?9BLv@xWvQrT`7S{G3d71_lP890S7y fFbPz}$j~FA@jv|cHIOKS0t3T?&5cYEyiEcCric`f delta 41 vcmZozz|ydQWx_i~mWl7ZxF#?%FbFV!z+`8}H;fLG4VVHp7jA0cZ4v+g3$P4N diff --git a/stepmania/Utils/unlockconvert.exe b/stepmania/Utils/unlockconvert.exe index 64c0a2b40db8664c1fe953278c34edde04f52c20..fbd22b4da3c6fe2045078b4125c991a7adc4429f 100755 GIT binary patch delta 84 zcmZoT!PansZNfE1mWkKBxD+@U7z7v?940bt)@BrC)X*y}%4cU_U|7s^$OybZQkG delta 49 zcmZp8z}oPDbpsnCBlBc-MlY@f%nS?y3?Q&Mno*Q-^Fk&o#>op94V!N>Z@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 629bc1ddc4b3a1b2b98742848f68dc27268e83db..c8b120534afaf799fd37804572f852ca4b5ab759 100644 GIT binary patch delta 83 zcmZp8z})bFdBQzLmWlVhxEzET7z7v?9_(kFY|QwE@xWvSCJha}{G3d71_lO3AZ9QC fssMox3=Dly8vjE>uYz;Q#;t diff --git a/stepmania/src/disasm/verinc.exe b/stepmania/src/disasm/verinc.exe index 1a5eda7e426318d36ec7c1783d9aa1fd2dc7a7f0..47b4c2a256c1c3a4b3bb6230ba80f40266528ef6 100644 GIT binary patch delta 82 zcmZo@U~Xt&o^X$mW#WA=&JPR>3<3-cU1uj7F}`IyFj;{~Lqo41H;Wx8&IrT|4?qME c9AIFmi_-YNIQ2T1s{oYQ9LO|*cagvb0KS734FCWD delta 41 wcmZo@U~Xt&o^X$mdE$L9&Ib$(3<5yRFxiOlEu+I^1tyKn2dC}eT_msp01R^tE&u=k