diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 6d65759c6e..403fe424f4 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -444,8 +444,8 @@ SurviveTimeX=320 SurviveTimeY=340 DebugX=320 DebugY=240 -StatusIconsX=320 -StatusIconsY=400 +AutoPlayX=320 +AutoPlayY=400 SecondsBetweenComments=10 DemonstrationSeconds=30 TickEarlySeconds=0.05 diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 1c6f979490..411517973f 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -42,6 +42,7 @@ Actor::Actor() m_bShadow = false; m_fShadowLength = 4; + m_bTextureWrapping = false; m_bIsAnimating = true; m_bBlendAdd = false; } @@ -619,9 +620,9 @@ void Actor::Command( CString sCommandString ) else if( sName=="effectcolor2" ) SetEffectColor2( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) ); else if( sName=="effectperiod" ) SetEffectPeriod( fParam(0) ); else if( sName=="effectmagnitude" ) SetEffectMagnitude( RageVector3(fParam(0),fParam(1),fParam(2)) ); - else if( sName=="startanimating" ) this->StartAnimating(); - else if( sName=="stopanimating" ) this->StopAnimating(); - else if( sName=="additiveblend" ) EnableAdditiveBlend( iParam(0)!=0 ); + else if( sName=="animate" ) EnableAnimation( bParam(0) ); + else if( sName=="texturewrapping" ) EnableTextureWrapping( bParam(0) ); + else if( sName=="additiveblend" ) EnableAdditiveBlend( bParam(0) ); else { CString sError = ssprintf( "Unrecognized command name '%s' in command string '%s'.", sName.GetString(), sCommandString.GetString() ); diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index cc5eaa8eb5..23e9529f7f 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -273,6 +273,8 @@ public: virtual void StartAnimating() { this->EnableAnimation(true); }; virtual void StopAnimating() { this->EnableAnimation(false); }; + virtual void EnableTextureWrapping( bool b ) { m_bTextureWrapping = b; } + // // fade command // @@ -345,6 +347,7 @@ protected: // bool m_bShadow; float m_fShadowLength; + bool m_bTextureWrapping; bool m_bIsAnimating; bool m_bBlendAdd; diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index 0dde9160ae..14c83c5bec 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -326,15 +326,15 @@ void BGAnimationLayer::LoadFromAniLayerFile( CString sPath ) m_fTilesStartY = m_Sprites[0].GetUnzoomedHeight() / 2; m_fTilesSpacingX = m_Sprites[0].GetUnzoomedWidth(); m_fTilesSpacingY = m_Sprites[0].GetUnzoomedHeight(); - // HACK: fix cracks in tiles - m_fTilesSpacingX -= 1; - m_fTilesSpacingY -= 1; + m_fTilesSpacingX -= 1; // HACK: Fix textures with transparence have gaps + m_fTilesSpacingY -= 1; // HACK: Fix textures with transparence have gaps for( int x=0; xAddChild( &m_sprTryExtraStage ); - SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","ScreenEvaluation extra stage") ); + if( GAMESTATE->IsExtraStage() ) + SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","ScreenEvaluation extra2") ); + else + SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","ScreenEvaluation extra1") ); } else if( bOneHasNewRecord && ANNOUNCER->HasSoundsFor("evaluation new record") ) { diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index f96bca84d3..98af19113e 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -70,8 +70,8 @@ #define ACTIVE_ITEMS_Y( p, e, r ) THEME->GetMetricF("ScreenGameplay",ssprintf("ActiveItemsP%d%s%sY",p+1,e?"Extra":"",r?"Reverse":"")) #define DEBUG_X THEME->GetMetricF("ScreenGameplay","DebugX") #define DEBUG_Y THEME->GetMetricF("ScreenGameplay","DebugY") -#define STATUS_ICONS_X THEME->GetMetricF("ScreenGameplay","StatusIconsX") -#define STATUS_ICONS_Y THEME->GetMetricF("ScreenGameplay","StatusIconsY") +#define AUTOPLAY_X THEME->GetMetricF("ScreenGameplay","AutoPlayX") +#define AUTOPLAY_Y THEME->GetMetricF("ScreenGameplay","AutoPlayY") #define SURVIVE_TIME_X THEME->GetMetricF("ScreenGameplay","SurviveTimeX") #define SURVIVE_TIME_Y THEME->GetMetricF("ScreenGameplay","SurviveTimeY") CachedThemeMetric SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBetweenComments"); @@ -104,6 +104,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) { LOG->Trace( "ScreenGameplay::ScreenGameplay()" ); + m_bDemonstration = bDemonstration; SECONDS_BETWEEN_COMMENTS.Refresh(); G_TICK_EARLY_SECONDS.Refresh(); @@ -396,9 +397,10 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) //this->AddChild( &m_textLyrics ); -- THIS IS NOT DONE YET!! (Miryokuteki) - m_textOptions.LoadFromFont( THEME->GetPathTo("Fonts","header2") ); - this->AddChild( &m_textOptions ); - UpdateOptionsText(); + m_textAutoPlay.LoadFromFont( THEME->GetPathTo("Fonts","header2") ); + m_textAutoPlay.SetXY( AUTOPLAY_X, AUTOPLAY_Y ); + this->AddChild( &m_textAutoPlay ); + UpdateAutoPlayText(); m_BPMDisplay.SetXY( BPM_X, BPM_Y ); @@ -471,60 +473,37 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) m_soundFail.Load( THEME->GetPathTo("Sounds","ScreenGameplay failed") ); m_soundTryExtraStage.Load( THEME->GetPathTo("Sounds","ScreenGameplay extra") ); m_soundOniDie.Load( THEME->GetPathTo("Sounds","ScreenGameplay oni die") ); - m_announcerReady.Load( ANNOUNCER->GetPathTo("ScreenGameplay ready") ); + m_announcerReady.Load( ANNOUNCER->GetPathTo("gameplay ready") ); if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) - m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("ScreenGameplay here we go extra") ); + m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go extra") ); else if( GAMESTATE->IsFinalStage() ) - m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("ScreenGameplay here we go final") ); + m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go final") ); else - m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("ScreenGameplay here we go normal") ); - m_announcerDanger.Load( ANNOUNCER->GetPathTo("ScreenGameplay comment danger") ); - m_announcerGood.Load( ANNOUNCER->GetPathTo("ScreenGameplay comment good") ); - m_announcerHot.Load( ANNOUNCER->GetPathTo("ScreenGameplay comment hot") ); - m_announcerOni.Load( ANNOUNCER->GetPathTo("ScreenGameplay comment oni") ); + m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo("gameplay here we go normal") ); + m_announcerDanger.Load( ANNOUNCER->GetPathTo("gameplay comment danger") ); + m_announcerGood.Load( ANNOUNCER->GetPathTo("gameplay comment good") ); + m_announcerHot.Load( ANNOUNCER->GetPathTo("gameplay comment hot") ); + m_announcerOni.Load( ANNOUNCER->GetPathTo("gameplay comment oni") ); - m_announcer100Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 100 combo") ); - m_announcer200Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 200 combo") ); - m_announcer300Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 300 combo") ); - m_announcer400Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 400 combo") ); - m_announcer500Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 500 combo") ); - m_announcer600Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 600 combo") ); - m_announcer700Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 700 combo") ); - m_announcer800Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 800 combo") ); - m_announcer900Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 900 combo") ); - m_announcer1000Combo.Load( ANNOUNCER->GetPathTo("ScreenGameplay 1000 combo") ); - m_announcerComboStopped.Load( ANNOUNCER->GetPathTo("ScreenGameplay combo stopped") ); + m_announcer100Combo.Load( ANNOUNCER->GetPathTo("gameplay 100 combo") ); + m_announcer200Combo.Load( ANNOUNCER->GetPathTo("gameplay 200 combo") ); + m_announcer300Combo.Load( ANNOUNCER->GetPathTo("gameplay 300 combo") ); + m_announcer400Combo.Load( ANNOUNCER->GetPathTo("gameplay 400 combo") ); + m_announcer500Combo.Load( ANNOUNCER->GetPathTo("gameplay 500 combo") ); + m_announcer600Combo.Load( ANNOUNCER->GetPathTo("gameplay 600 combo") ); + m_announcer700Combo.Load( ANNOUNCER->GetPathTo("gameplay 700 combo") ); + m_announcer800Combo.Load( ANNOUNCER->GetPathTo("gameplay 800 combo") ); + m_announcer900Combo.Load( ANNOUNCER->GetPathTo("gameplay 900 combo") ); + m_announcer1000Combo.Load( ANNOUNCER->GetPathTo("gameplay 1000 combo") ); + m_announcerComboStopped.Load( ANNOUNCER->GetPathTo("gameplay combo stopped") ); m_soundAssistTick.Load( THEME->GetPathTo("Sounds","ScreenGameplay assist tick") ); } - // - // Get the transitions rolling - // - if( bDemonstration ) - { - StartPlayingSong( 0, 0 ); // *kick* (no transitions) - } - else - { - float fMinTimeToMusic = m_In.GetLengthSeconds(); // start of m_Ready - float fMinTimeToNotes = fMinTimeToMusic + m_Ready.GetLengthSeconds() + m_Go.GetLengthSeconds()+2; // end of Go - - /* - * Tell the music to start, but don't actually make any noise for - * at least 2.5 (or 1.5) seconds. (This is so we scroll on screen smoothly.) - * - * This is only a minimum: the music might be started later, to meet - * the minimum-time-to-notes value. If you're writing song data, - * and you want to make sure we get ideal timing here, make sure there's - * a bit of space at the beginning of the music with no steps. - */ - - /*float delay =*/ StartPlayingSong( fMinTimeToNotes, fMinTimeToMusic ); - - m_In.StartTransitioning( SM_PlayReady ); - } - m_iRowLastCrossed = -1; + + // Get the transitions rolling on the first update. + // We can't do this in the constructor because ScreenGameplay is constructed + // in the middle of ScreenStage. } ScreenGameplay::~ScreenGameplay() @@ -762,6 +741,38 @@ bool ScreenGameplay::IsTimeToPlayTicks() const void ScreenGameplay::Update( float fDeltaTime ) { + if( m_bFirstUpdate ) + { + // + // Get the transitions rolling + // + if( m_bDemonstration ) + { + StartPlayingSong( 0, 0 ); // *kick* (no transitions) + } + else + { + float fMinTimeToMusic = m_In.GetLengthSeconds(); // start of m_Ready + float fMinTimeToNotes = fMinTimeToMusic + m_Ready.GetLengthSeconds() + m_Go.GetLengthSeconds()+2; // end of Go + + /* + * Tell the music to start, but don't actually make any noise for + * at least 2.5 (or 1.5) seconds. (This is so we scroll on screen smoothly.) + * + * This is only a minimum: the music might be started later, to meet + * the minimum-time-to-notes value. If you're writing song data, + * and you want to make sure we get ideal timing here, make sure there's + * a bit of space at the beginning of the music with no steps. + */ + + /*float delay =*/ StartPlayingSong( fMinTimeToNotes, fMinTimeToMusic ); + + m_In.StartTransitioning( SM_PlayReady ); + } + } + + + /* Very important: Update GAMESTATE's song beat information * -before- calling update on all the classes that depend on it. * If you don't do this first, the classes are all acting on old @@ -996,7 +1007,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ case SDLK_F6: m_bChangedOffsetOrBPM = true; GAMESTATE->m_SongOptions.m_bAutoSync = !GAMESTATE->m_SongOptions.m_bAutoSync; // toggle - UpdateOptionsText(); + UpdateAutoPlayText(); break; case SDLK_F7: if( GAMESTATE->m_SongOptions.m_AssistType == SongOptions::ASSIST_NONE ) @@ -1013,7 +1024,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ break; case SDLK_F8: PREFSMAN->m_bAutoPlay = !PREFSMAN->m_bAutoPlay; - UpdateOptionsText(); + UpdateAutoPlayText(); break; case SDLK_F9: case SDLK_F10: @@ -1098,7 +1109,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ } } -void ScreenGameplay::UpdateOptionsText() +void ScreenGameplay::UpdateAutoPlayText() { CString sText; @@ -1109,6 +1120,8 @@ void ScreenGameplay::UpdateOptionsText() if( sText.length() > 0 ) sText.resize( sText.length()-5 ); + + m_textAutoPlay.SetText( sText ); } void SaveChanges() @@ -1505,13 +1518,13 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) m_textSurviveTime.SetTweenDiffuse( RageColor(1,1,1,0) ); } - SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("ScreenGameplay failed") ); + SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay failed") ); // SCREENMAN->SendMessageToTopScreen( SM_GoToScreenAfterFail, 5.0f ); break; /* case SM_PlayFailComment: - SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("ScreenGameplay failed") ); + SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay failed") ); break; */ case SM_GoToScreenAfterFail: diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index 3206a82d91..375006f32f 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -112,8 +112,8 @@ protected: BitmapText m_textDebug; BitmapText m_textLyrics; - BitmapText m_textOptions; // for AutoPlay, AutoAdjust - void UpdateOptionsText(); + BitmapText m_textAutoPlay; // for AutoPlay, AutoAdjust + void UpdateAutoPlayText(); BitmapText m_MaxCombo; @@ -163,7 +163,7 @@ protected: RandomSample m_announcer1000Combo; RandomSample m_announcerComboStopped; - + bool m_bDemonstration; int m_iRowLastCrossed; RageSound m_soundAssistTick; diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 41cd88291a..bc7a22036a 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -205,6 +205,11 @@ void ScreenManager::LoadPreppedScreen() { ASSERT( m_ScreenBuffered != NULL); SetNewScreen( m_ScreenBuffered ); + + // Need to update the new screen once, or else it will be + // drawn before ever being Update()d. + Update( 0 ); + m_ScreenBuffered = NULL; } diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index c198c49f9e..322a7fd783 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -243,9 +243,9 @@ void Sprite::DrawPrimitives() v[2].t = RageVector2( pTexCoordRect->right, pTexCoordRect->bottom ); // bottom right v[3].t = RageVector2( pTexCoordRect->right, pTexCoordRect->top ); // top right - // if the texture has more than one frame, we're going to get border mess from the - // neighboring frame, so don't bother turning wrapping off. - if( m_pTexture->GetNumFrames() == 1 ) + if( m_bTextureWrapping ) + DISPLAY->EnableTextureWrapping(); + else DISPLAY->DisableTextureWrapping(); } } diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 17da0a9bd3..31fe243a93 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -60,7 +60,7 @@ IntDir=.\../Release6 TargetDir=\stepmania\stepmania TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -95,7 +95,7 @@ IntDir=.\../Debug6 TargetDir=\stepmania\stepmania TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -1677,14 +1677,6 @@ SOURCE=.\ScreenMachineOptions.h # End Source File # Begin Source File -SOURCE=.\ScreenManager.cpp -# End Source File -# Begin Source File - -SOURCE=.\ScreenManager.h -# End Source File -# Begin Source File - SOURCE=.\ScreenMapControllers.cpp # End Source File # Begin Source File @@ -2009,6 +2001,14 @@ SOURCE=.\PrefsManager.h # End Source File # Begin Source File +SOURCE=.\ScreenManager.cpp +# End Source File +# Begin Source File + +SOURCE=.\ScreenManager.h +# End Source File +# Begin Source File + SOURCE=.\SongManager.cpp # End Source File # Begin Source File diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index fa2d036140..69cdde31e2 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -303,12 +303,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ - - - - @@ -1609,6 +1603,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ + + + +