Update of /cvsroot/stepmania/stepmania/src In directory sc8-pr-cvs1:/tmp/cvs-serv25581/src Modified Files: CroppedSprite.cpp CroppedSprite.h MusicBannerWheel.cpp ScreenEz2SelectMusic.cpp ScreenEz2SelectMusic.h ScreenHowToPlay.cpp ScrollingList.cpp Log Message: Changes to PIU/EZ2 screenselect. Banners loaded in different way, now shows marathon/longver balloons. Scrolls faster after 5/10 seconds of continued scrolling. Index: CroppedSprite.cpp =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/CroppedSprite.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- CroppedSprite.cpp 22 Apr 2003 22:39:51 -0000 1.15 +++ CroppedSprite.cpp 9 May 2003 00:18:37 -0000 1.16 @@ -31,6 +31,12 @@ return true; } +void CroppedSprite::SetWH(float fWidth, float fHeight) +{ + Sprite::SetWidth(fWidth); + Sprite::SetHeight(fWidth); +} + void CroppedSprite::SetCroppedSize( float fWidth, float fHeight ) { m_fCropWidth = fWidth; Index: CroppedSprite.h =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/CroppedSprite.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- CroppedSprite.h 30 Dec 2002 02:43:52 -0000 1.8 +++ CroppedSprite.h 9 May 2003 00:18:37 -0000 1.9 @@ -23,6 +23,7 @@ bool Load( RageTextureID ID ); void SetCroppedSize( float fWidth, float fHeight ); + void SetWH(float fWidth, float fHeight); protected: void CropToSize( float fWidth, float fHeight ); Index: MusicBannerWheel.cpp =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/MusicBannerWheel.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- MusicBannerWheel.cpp 22 Apr 2003 12:13:36 -0000 1.26 +++ MusicBannerWheel.cpp 9 May 2003 00:18:37 -0000 1.27 @@ -19,6 +19,7 @@ #include "RageSoundManager.h" #include "StyleDef.h" #include "song.h" +#include "ActorUtil.h" #define BANNERSPACING 200 #define MAXSONGSINBUFFER 5 @@ -56,7 +57,6 @@ else // Get the Group They Want SONGMAN->GetSongs( arraySongs, GAMESTATE->m_sPreferredGroup, GAMESTATE->GetNumStagesLeft() ); - if( arraySongs.size() > 0) { SongsExist=1; @@ -93,6 +93,7 @@ m_debugtext.SetXY( 0, -120 ); this->AddChild(&m_debugtext); #endif + } /******************************************** @@ -128,7 +129,7 @@ if( pSong == NULL ) sGraphicPath = (THEME->GetPathToG("Common fallback banner")); else if (pSong->HasBanner()) sGraphicPath = (pSong->GetBannerPath()); - else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) sGraphicPath = (pSong->GetBannerPath()); + else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) sGraphicPath = (pSong->GetBackgroundPath()); else sGraphicPath = (THEME->GetPathToG("Common fallback banner")); elementtoreplace = scrlistPos - 2; @@ -155,7 +156,7 @@ if( pSong == NULL ) sGraphicPath = (THEME->GetPathToG("Common fallback banner")); else if (pSong->HasBanner()) sGraphicPath = (pSong->GetBannerPath()); - else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) sGraphicPath = (pSong->GetBannerPath()); + else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) sGraphicPath = (pSong->GetBackgroundPath()); else sGraphicPath = (THEME->GetPathToG("Common fallback banner")); elementtoreplace = scrlistPos + 2; @@ -200,7 +201,7 @@ if( pSong == NULL ) asGraphicPaths.push_back(THEME->GetPathToG("Common fallback banner")); else if (pSong->HasBanner()) asGraphicPaths.push_back(pSong->GetBannerPath()); - else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) asGraphicPaths.push_back(pSong->GetBannerPath()); + else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) asGraphicPaths.push_back(pSong->GetBackgroundPath()); else asGraphicPaths.push_back(THEME->GetPathToG("Common fallback banner")); } } @@ -252,7 +253,7 @@ if( pSong == NULL ) asGraphicPaths.push_back(THEME->GetPathToG("Common fallback banner")); else if (pSong->HasBanner()) asGraphicPaths.push_back(pSong->GetBannerPath()); - else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) asGraphicPaths.push_back(pSong->GetBannerPath()); + else if (PREFSMAN->m_bUseBGIfNoBanner && pSong->HasBackground() ) asGraphicPaths.push_back(pSong->GetBackgroundPath()); else asGraphicPaths.push_back(THEME->GetPathToG("Common fallback banner")); } } Index: ScreenEz2SelectMusic.cpp =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/ScreenEz2SelectMusic.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- ScreenEz2SelectMusic.cpp 4 May 2003 13:58:45 -0000 1.49 +++ ScreenEz2SelectMusic.cpp 9 May 2003 00:18:37 -0000 1.50 @@ -26,7 +26,8 @@ #include "InputMapper.h" #include "CodeDetector.h" #include "Notes.h" - +#include "RageTimer.h" +#include "ActorUtil.h" #define SCROLLING_LIST_X THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListX") #define SCROLLING_LIST_Y THEME->GetMetricF("ScreenEz2SelectMusic","ScrollingListY") @@ -61,6 +62,8 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic() : Screen("ScreenEz2SelectMusic") { + i_SkipAheadOffset = 0; + ScrollStartTime = 0; m_bTransitioning = false; m_fRemainingWaitTime = 0.0f; i_ErrorDetected=0; @@ -167,6 +170,11 @@ m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); this->AddChild( &m_sprOptionsMessage ); + m_sprBalloon.SetName( "Balloon" ); + TEXTUREMAN->CacheTexture( THEME->GetPathToG("ScreenSelectMusic balloon long") ); + TEXTUREMAN->CacheTexture( THEME->GetPathToG("ScreenSelectMusic balloon marathon") ); + this->AddChild( &m_sprBalloon ); + m_soundOptionsChange.Load( THEME->GetPathToS("ScreenEz2SelectMusic options") ); m_bGoToOptions = false; @@ -218,9 +226,28 @@ if( type != IET_FIRST_PRESS ) { m_soundMusicCycle.Play(); + i_SkipAheadOffset = 0; + if(ScrollStartTime == 0) + { + i_SkipAheadOffset = 0; + ScrollStartTime = RageTimer::GetTimeSinceStart(); + } + else + { + if(RageTimer::GetTimeSinceStart() - ScrollStartTime > 5) // been cycling for more than 5 seconds + { + i_SkipAheadOffset = 2; // start skipping ahead in twos + } + else if (RageTimer::GetTimeSinceStart() - ScrollStartTime > 10) // been cycling for more than 10 seconds + { + i_SkipAheadOffset = 3; // start skipping ahead 3 at a time + } + } } else { + i_SkipAheadOffset = 0; + ScrollStartTime = 0; m_soundMusicChange.Play(); } @@ -318,6 +345,8 @@ { m_Menu.m_MenuTimer.Stall(); m_MusicBannerWheel.BannersRight(); + for(int i=i_SkipAheadOffset; i>0; i--) + m_MusicBannerWheel.BannersRight(); MusicChanged(); } @@ -345,6 +374,8 @@ { m_Menu.m_MenuTimer.Stall(); m_MusicBannerWheel.BannersLeft(); + for(int i=i_SkipAheadOffset; i>0; i--) + m_MusicBannerWheel.BannersLeft(); MusicChanged(); } @@ -475,6 +506,24 @@ { Song* pSong = m_MusicBannerWheel.GetSelectedSong(); GAMESTATE->m_pCurSong = pSong; + + if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fMarathonVerSongSeconds ) + { + m_sprBalloon.StopTweening(); + m_sprBalloon.Load( THEME->GetPathToG("ScreenSelectMusic balloon marathon") ); + SET_XY_AND_ON_COMMAND( m_sprBalloon ); + } + else if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fLongVerSongSeconds ) + { + m_sprBalloon.StopTweening(); + m_sprBalloon.Load( THEME->GetPathToG("ScreenSelectMusic balloon long") ); + SET_XY_AND_ON_COMMAND( m_sprBalloon ); + } + else + { + m_sprBalloon.StopTweening(); + OFF_COMMAND( m_sprBalloon ); + } if(PREVIEWMUSICMODE == 1 && iConfirmSelection == 1) { Index: ScreenEz2SelectMusic.h =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/ScreenEz2SelectMusic.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- ScreenEz2SelectMusic.h 4 May 2003 13:58:45 -0000 1.23 +++ ScreenEz2SelectMusic.h 9 May 2003 00:18:37 -0000 1.24 @@ -62,6 +62,7 @@ Sprite m_ShuffleIcon[NUM_PLAYERS]; Sprite m_HiddenIcon[NUM_PLAYERS]; Sprite m_VanishIcon[NUM_PLAYERS]; + Sprite m_sprBalloon; BitmapText m_PumpDifficultyRating; RageSound m_soundOptionsChange; @@ -78,7 +79,10 @@ bool m_bGoToOptions; bool m_bMadeChoice; bool m_bTransitioning; - + + int i_SkipAheadOffset; + float ScrollStartTime; + int i_ErrorDetected; #ifdef DEBUG @@ -86,6 +90,7 @@ #endif int iConfirmSelection; + RageSound m_soundSelect; }; Index: ScreenHowToPlay.cpp =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/ScreenHowToPlay.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ScreenHowToPlay.cpp 21 Apr 2003 02:40:40 -0000 1.26 +++ ScreenHowToPlay.cpp 9 May 2003 00:18:37 -0000 1.27 @@ -18,17 +18,33 @@ #include "SongManager.h" #include "NoteFieldPositioning.h" +#define BPMSPEED THEME->GetMetricI("ScreenHowToPlay","ScrollBPM") ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay") { - GAMESTATE->m_CurStyle = STYLE_DANCE_SINGLE; + int iNumOfTracks = 0; + switch(GAMESTATE->m_CurGame) // which style should we use to demonstrate? + { + case GAME_DANCE: GAMESTATE->m_CurStyle = STYLE_DANCE_SINGLE; iNumOfTracks = 4; break; + case GAME_PUMP: GAMESTATE->m_CurStyle = STYLE_PUMP_SINGLE; iNumOfTracks = 5; break; + case GAME_EZ2: GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE; iNumOfTracks = 5; break; + case GAME_PARA: GAMESTATE->m_CurStyle = STYLE_PARA_SINGLE; iNumOfTracks = 5; break; + case GAME_DS3DDX: GAMESTATE->m_CurStyle = STYLE_DS3DDX_SINGLE; iNumOfTracks = 8; break; + case GAME_BM: GAMESTATE->m_CurStyle = STYLE_BM_SINGLE; iNumOfTracks = 6; break; + default: ASSERT(0); break; // we should cover all gametypes.... + } + + if(iNumOfTracks < 1) + { + ASSERT(0); // crazy to have less than 1 track.... + } m_LifeMeter.Load( PLAYER_1 ); m_LifeMeter.SetXY( 480, 40 ); this->AddChild( &m_LifeMeter ); NoteData* pND = new NoteData; - pND->SetNumTracks( 4 ); + pND->SetNumTracks( iNumOfTracks ); 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 ); @@ -47,7 +63,7 @@ pND->SetTapNote( 2, ROWS_PER_BEAT*46, TAP_TAP ); m_pSong = new Song; - m_pSong->AddBPMSegment( BPMSegment(0,60) ); + m_pSong->AddBPMSegment( BPMSegment(0,BPMSPEED) ); m_pSong->AddStopSegment( StopSegment(12,2) ); m_pSong->AddStopSegment( StopSegment(16,2) ); m_pSong->AddStopSegment( StopSegment(20,2) ); Index: ScrollingList.cpp =================================================================== RCS file: /cvsroot/stepmania/stepmania/src/ScrollingList.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ScrollingList.cpp 2 May 2003 15:12:09 -0000 1.18 +++ ScrollingList.cpp 9 May 2003 00:18:37 -0000 1.19 @@ -97,6 +97,7 @@ m_iBouncingState = 1; if(m_iSpriteType == SPRITE_TYPE_SPRITE) { + m_RippleSprite.UnloadTexture(); m_RippleSprite.Load( m_apSprites[m_iSelection]->GetTexturePath() ); m_RippleSprite.SetXY( m_apSprites[m_iSelection]->GetX(), m_apSprites[m_iSelection]->GetY() ); m_RippleSprite.SetZoom( 1.1f ); @@ -104,8 +105,21 @@ } else { - m_RippleCSprite.SetCroppedSize( 100, 100 ); + m_RippleCSprite.UnloadTexture(); m_RippleCSprite.Load( m_apCSprites[m_iSelection]->GetTexturePath() ); + + if(m_RippleCSprite.GetUnzoomedWidth() == m_RippleCSprite.GetUnzoomedHeight()) // rotated graphics need cropping + { + m_RippleCSprite.SetCroppedSize( 100, 100 ); + } + else // flat, unrotated graphics need widths changing + { + m_RippleCSprite.SetCroppedSize( -1, -1 ); // default image size. + m_RippleCSprite.SetWidth(EZ2_BANNER_WIDTH); + m_RippleCSprite.SetHeight(EZ2_BANNER_HEIGHT); + // m_RippleCSprite.SetWH(EZ2_BANNER_WIDTH+10, EZ2_BANNER_HEIGHT+10); + } + m_RippleCSprite.SetXY( m_apCSprites[m_iSelection]->GetX(), m_apCSprites[m_iSelection]->GetY() ); m_RippleCSprite.SetZoom( 2.0f ); m_RippleCSprite.SetDiffuse( RageColor(1,1,1,0.5f)); @@ -142,22 +156,11 @@ for( unsigned i=0; i<asGraphicPaths.size(); i++ ) { CroppedSprite* pNewCSprite = new CroppedSprite; - if(m_iBannerPrefs == BANNERPREFS_DDRFLAT) - { - pNewCSprite->SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT ); - } - else if(m_iBannerPrefs == BANNERPREFS_DDRROT) - { - pNewCSprite->SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT ); - pNewCSprite->SetRotationZ( DDRROT_ROTATION ); - } - else if(m_iBannerPrefs == BANNERPREFS_EZ2) - { - pNewCSprite->SetCroppedSize( EZ2_BANNER_WIDTH*2, EZ2_BANNER_HEIGHT*2 ); - } - pNewCSprite->Load( asGraphicPaths[i] ); + m_apCSprites.push_back( pNewCSprite ); + for(int i=m_apCSprites.size()-1; i>=0; i--) + Replace(asGraphicPaths[i],i); } } } @@ -394,9 +397,17 @@ else { CroppedSprite* pNewCSprite = new CroppedSprite; + pNewCSprite->Load( sGraphicPath ); if(m_iBannerPrefs == BANNERPREFS_DDRFLAT) { - pNewCSprite->SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT ); + if(pNewCSprite->GetUnzoomedWidth() == pNewCSprite->GetUnzoomedHeight()) // rotated graphics need cropping + { + pNewCSprite->SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT ); + } + else // flat, unrotated graphics need widths changing + { + pNewCSprite->SetWH(BANNER_WIDTH, BANNER_HEIGHT ); + } } else if(m_iBannerPrefs == BANNERPREFS_DDRROT) { @@ -405,13 +416,17 @@ } else if(m_iBannerPrefs == BANNERPREFS_EZ2) { - pNewCSprite->SetCroppedSize( EZ2_BANNER_WIDTH*2, EZ2_BANNER_HEIGHT*2 ); + if(pNewCSprite->GetUnzoomedWidth() == pNewCSprite->GetUnzoomedHeight()) // rotated graphics need cropping + { + pNewCSprite->SetCroppedSize( EZ2_BANNER_WIDTH*2, EZ2_BANNER_HEIGHT*2 ); + } + else // flat, unrotated graphics need widths changing + { + pNewCSprite->SetWH(EZ2_BANNER_WIDTH*2, EZ2_BANNER_HEIGHT*2); + } } - - pNewCSprite->Load( sGraphicPath ); - - m_apCSprites[ElementNumber] = pNewCSprite; + m_apCSprites[ElementNumber] = pNewCSprite; } } @@ -425,10 +440,12 @@ if(m_iSpriteType == SPRITE_TYPE_SPRITE) { ASSERT( !m_apSprites.empty() ); + m_RippleSprite.SetXY( m_apSprites[m_iSelection]->GetX(), m_apSprites[m_iSelection]->GetY() ); // keep the ripple sprites with the current selection } else { ASSERT( !m_apCSprites.empty() ); + m_RippleCSprite.SetXY( m_apCSprites[m_iSelection]->GetX(), m_apCSprites[m_iSelection]->GetY() ); // keep the ripple sprites with the current selection } for( int i=(m_iNumVisible)/2; i>= 0; i-- ) // draw outside to inside |