From 0e5f97143ee66d8a18be0a9a5ef146f17cd5a35d Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 19 Aug 2002 20:02:30 +0000 Subject: [PATCH] optimizations --- stepmania/README-FIRST.TXT | 4 + stepmania/src/Actor.cpp | 18 +++-- stepmania/src/Actor.h | 6 +- stepmania/src/BitmapText.cpp | 4 +- stepmania/src/HoldJudgement.cpp | 10 ++- stepmania/src/HoldJudgement.h | 12 +-- stepmania/src/LifeMeterBar.cpp | 47 +++++++----- stepmania/src/LifeMeterBar.h | 3 + stepmania/src/MenuElements.cpp | 4 + stepmania/src/MusicWheel.cpp | 94 ++++++++++++++++++------ stepmania/src/MusicWheel.h | 4 +- stepmania/src/NoteField.cpp | 2 +- stepmania/src/RageDisplay.cpp | 7 +- stepmania/src/RageDisplay.h | 8 +- stepmania/src/ScreenEditMenu.cpp | 60 +++++++++++---- stepmania/src/ScreenEditMenu.h | 30 ++++---- stepmania/src/ScreenSelectDifficulty.cpp | 4 +- stepmania/src/ScreenSelectDifficulty.h | 4 +- stepmania/src/Song.cpp | 2 +- 19 files changed, 221 insertions(+), 102 deletions(-) diff --git a/stepmania/README-FIRST.TXT b/stepmania/README-FIRST.TXT index dcec47226f..e3583f3030 100644 --- a/stepmania/README-FIRST.TXT +++ b/stepmania/README-FIRST.TXT @@ -1163,6 +1163,10 @@ CHANGE: Background Movies now start playing at beat 0, and the movie should OPTIMIZATION: New deferred rendering architecture uses more CPU in order to create more efficient operations for the graphics card. BUG FIX: Select Group no longer crashes with > 15 groups. +CHANGE: Last edited song is selected upon entering Edit Menu. +BUG FIX: "Indirect BPM changes" (track 08) work again. This was causing + "0 BPM" segments to be added to songs like MAX300. +BUG FIX: Fixed life meter stream alignment (I hope!) ------------------------CVS after 3.00 beta 5---------------- OPTIMIZATION: Much faster song loading. diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 63a1471492..5609bb8364 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -49,7 +49,15 @@ Actor::Actor() } -void Actor::Draw() // set the world matrix and calculate actor properties, the call DrawPrimitives +void Actor::Draw() +{ + // call the most-derived versions + this->BeginDraw(); + this->DrawPrimitives(); // call the most-derived version of DrawPrimitives(); + this->EndDraw(); +} + +void Actor::BeginDraw() // set the world matrix and calculate actor properties { DISPLAY->PushMatrix(); // we're actually going to do some drawing in this function @@ -141,12 +149,10 @@ void Actor::Draw() // set the world matrix and calculate actor properties, the DISPLAY->RotateY( m_temp_rotation.y ); if( m_temp_rotation.z != 0 ) DISPLAY->RotateZ( m_temp_rotation.z ); +} - - - this->DrawPrimitives(); // call the most-derived version of DrawPrimitives(); - - +void Actor::EndDraw() +{ DISPLAY->PopMatrix(); } diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index b37e095f96..a600d04c21 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -41,8 +41,10 @@ public: virtual void Restore() {}; virtual void Invalidate() {}; - virtual void Draw(); // set up the world matrix, then calls DrawPrimitives() - virtual void DrawPrimitives() = 0; + virtual void Draw(); // calls, BeginDraw, DrawPrimitives, EndDraw + virtual void BeginDraw(); // pushes transform onto world matrix stack + virtual void DrawPrimitives() = 0; // override with Actor specific action + virtual void EndDraw(); // pops transform from world matrix stack virtual void Update( float fDeltaTime ); virtual float GetX() { return m_pos.x; }; diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 7629e5f1ba..b2b8689151 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -254,10 +254,10 @@ void BitmapText::DrawPrimitives() DISPLAY->TranslateLocal( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units DWORD dwColor = D3DXCOLOR(0,0,0,0.5f*m_temp_colorDiffuse[0].a); // semi-transparent black + int i; for( i=0; iAddQuad( &v[i] ); @@ -300,10 +300,10 @@ void BitmapText::DrawPrimitives() if( m_temp_colorGlow.a != 0 ) { DISPLAY->SetColorDiffuse(); + int i; for( i=0; iAddQuad( &v[i] ); } diff --git a/stepmania/src/HoldJudgement.cpp b/stepmania/src/HoldJudgement.cpp index 181898bbd7..4a477782dd 100644 --- a/stepmania/src/HoldJudgement.cpp +++ b/stepmania/src/HoldJudgement.cpp @@ -16,11 +16,15 @@ #include "PrefsManager.h" +// +// Important!!!! Do not use these macros during gameplay. They return very slowly. Cache them in a member. +// #define JUDGEMENT_DISPLAY_TIME THEME->GetMetricF("HoldJudgement","DisplayTime") HoldJudgement::HoldJudgement() { + m_fDisplayTime = JUDGEMENT_DISPLAY_TIME; m_fDisplayCountdown = 0; m_sprJudgement.Load( THEME->GetPathTo("Graphics","gameplay hold judgement") ); m_sprJudgement.StopAnimating(); @@ -57,21 +61,21 @@ void HoldJudgement::SetHoldJudgement( HoldNoteScore hns ) default: ASSERT( false ); } - m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME; + m_fDisplayCountdown = m_fDisplayTime; if( hns == HNS_NG ) { // falling down m_sprJudgement.SetY( -10 ); m_sprJudgement.SetZoom( 1.0f ); - m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME ); + m_sprJudgement.BeginTweening( m_fDisplayTime ); m_sprJudgement.SetTweenY( 10 ); } else // hns == HNS_OK { // zooming out m_sprJudgement.SetZoom( 1.5f ); - m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME/3.0f ); + m_sprJudgement.BeginTweening( m_fDisplayTime/3.0f ); m_sprJudgement.SetTweenZoom( 1.0f ); } } \ No newline at end of file diff --git a/stepmania/src/HoldJudgement.h b/stepmania/src/HoldJudgement.h index 44ed09aaf2..b403256939 100644 --- a/stepmania/src/HoldJudgement.h +++ b/stepmania/src/HoldJudgement.h @@ -1,18 +1,15 @@ +#pragma once /* ----------------------------------------------------------------------------- - File: HoldJudgement.h + Class: HoldJudgement Desc: A graphic displayed in the HoldJudgement during Dancing. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ - -#ifndef _HoldJudgement_H_ -#define _HoldJudgement_H_ - - #include "Sprite.h" #include "ActorFrame.h" #include "Song.h" @@ -30,7 +27,6 @@ public: protected: Sprite m_sprJudgement; + float m_fDisplayTime; float m_fDisplayCountdown; }; - -#endif \ No newline at end of file diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index 258b63e98c..aca1d21966 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -17,9 +17,13 @@ #include "GameState.h" -#define METER_WIDTH THEME->GetMetricF("LifeMeterBar","MeterWidth") -#define METER_HEIGHT THEME->GetMetricF("LifeMeterBar","MeterHeight") +// +// Important!!!! Do not use these macros during gameplay. They return very slowly. Cache them in a member. +// +#define METER_WIDTH THEME->GetMetricI("LifeMeterBar","MeterWidth") +#define METER_HEIGHT THEME->GetMetricI("LifeMeterBar","MeterHeight") #define DANGER_THRESHOLD THEME->GetMetricF("LifeMeterBar","DangerThreshold") + const float FAIL_THRESHOLD = 0; @@ -37,10 +41,13 @@ LifeMeterBar::LifeMeterBar() m_fLifeVelocity = 0; m_fHotAlpha = 0; m_bFailedEarlier = false; + m_iMeterWidth = METER_WIDTH; + m_iMeterHeight = METER_HEIGHT; + m_fDangerThreshold = DANGER_THRESHOLD; m_quadBlackBackground.SetDiffuseColor( D3DXCOLOR(0,0,0,1) ); - m_quadBlackBackground.SetZoomX( METER_WIDTH ); - m_quadBlackBackground.SetZoomY( METER_HEIGHT ); + m_quadBlackBackground.SetZoomX( m_iMeterWidth ); + m_quadBlackBackground.SetZoomY( m_iMeterHeight ); m_frame.AddSubActor( &m_quadBlackBackground ); m_sprStreamNormal.Load( THEME->GetPathTo("Graphics","gameplay lifemeter stream normal") ); @@ -137,7 +144,7 @@ bool LifeMeterBar::IsHot() bool LifeMeterBar::IsInDanger() { - return m_fLifePercentage < DANGER_THRESHOLD; + return m_fLifePercentage < m_fDangerThreshold; } bool LifeMeterBar::IsFailing() @@ -165,13 +172,18 @@ void LifeMeterBar::Update( float fDeltaTime ) m_fLifeVelocity /= 4; // make some drag CLAMP( m_fTrailingLifePercentage, 0, 1 ); + m_fHotAlpha += IsHot() ? +fDeltaTime*2 : -fDeltaTime*2; + CLAMP( m_fHotAlpha, 0, 1 ); +} +void LifeMeterBar::DrawPrimitives() +{ // set custom texture coords - CRect rectSize( - int( -METER_WIDTH/2 ), - int( -METER_HEIGHT/2 ), - int( -METER_WIDTH/2 + METER_WIDTH * m_fTrailingLifePercentage ), - int( -METER_HEIGHT/2 + METER_HEIGHT) ); + static RECT rectSize; + rectSize.left = -m_iMeterWidth/2; + rectSize.top = -m_iMeterHeight/2; + rectSize.right = -m_iMeterWidth/2 + roundf(m_iMeterWidth*m_fTrailingLifePercentage); + rectSize.bottom = +m_iMeterHeight/2; float fPrecentOffset = TIMER->GetTimeSinceStart(); fPrecentOffset -= (int)fPrecentOffset; @@ -182,19 +194,17 @@ void LifeMeterBar::Update( float fDeltaTime ) m_fTrailingLifePercentage - fPrecentOffset, 1 ); - m_sprStreamNormal.StretchTo( rectSize ); + m_sprStreamNormal.StretchTo( &rectSize ); m_sprStreamNormal.SetCustomTextureRect( frectCustomTexCoords ); - m_sprStreamHot.StretchTo( rectSize ); + m_sprStreamHot.StretchTo( &rectSize ); m_sprStreamHot.SetCustomTextureRect( frectCustomTexCoords ); - m_fHotAlpha += IsHot() ? +fDeltaTime*2 : -fDeltaTime*2; - CLAMP( m_fHotAlpha, 0, 1 ); m_sprStreamHot.SetDiffuseColor( D3DXCOLOR(1,1,1,m_fHotAlpha) ); -} -void LifeMeterBar::DrawPrimitives() -{ - float fPercentRed = (m_fTrailingLifePercentageGetTimeSinceStart()*D3DX_PI*4 )/2+0.5f : 0; + + + + float fPercentRed = (m_fTrailingLifePercentageGetTimeSinceStart()*D3DX_PI*4 )/2+0.5f : 0; m_quadBlackBackground.SetDiffuseColor( D3DXCOLOR(fPercentRed*0.8f,0,0,1) ); if( !GAMESTATE->IsPlayerEnabled(m_PlayerNumber) ) @@ -202,6 +212,7 @@ void LifeMeterBar::DrawPrimitives() m_sprStreamNormal.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); m_sprStreamHot.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); } + ActorFrame::DrawPrimitives(); } diff --git a/stepmania/src/LifeMeterBar.h b/stepmania/src/LifeMeterBar.h index 476b52a5f5..b4e3a44ad9 100644 --- a/stepmania/src/LifeMeterBar.h +++ b/stepmania/src/LifeMeterBar.h @@ -47,4 +47,7 @@ private: float m_fLifeVelocity; // how m_fTrailingLifePercentage approaches m_fLifePercentage float m_fHotAlpha; bool m_bFailedEarlier; // set this to true when life dips below 0 + int m_iMeterWidth; + int m_iMeterHeight; + float m_fDangerThreshold; }; diff --git a/stepmania/src/MenuElements.cpp b/stepmania/src/MenuElements.cpp index e0bed0b4ae..f52b8befbd 100644 --- a/stepmania/src/MenuElements.cpp +++ b/stepmania/src/MenuElements.cpp @@ -207,16 +207,20 @@ void MenuElements::DrawPrimitives() void MenuElements::DrawTopLayer() { + BeginDraw(); m_frameTopBar.Draw(); m_frameBottomBar.Draw(); m_textHelp.Draw(); m_KeepAlive.Draw(); m_Wipe.Draw(); + EndDraw(); } void MenuElements::DrawBottomLayer() { + BeginDraw(); m_sprBG.Draw(); + EndDraw(); } void MenuElements::StopTimer() diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 07c56513b4..da46c001ed 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -253,41 +253,92 @@ void WheelItemDisplay::DrawPrimitives() { case TYPE_SECTION: m_sprSectionBar.Draw(); - m_textSectionName.Draw(); break; case TYPE_ROULETTE: m_sprSectionBar.Draw(); - m_textRoulette.Draw(); break; - case TYPE_SONG: - { - m_sprSongBar.Draw(); - m_MusicStatusDisplay.Draw(); - m_TextBanner.Draw(); - for( int p=0; p 0 ) - { - m_sprSongBar.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); - m_sprSongBar.SetGlowColor( D3DXCOLOR(0,0,0,m_fPercentGray) ); - m_sprSongBar.Draw(); - m_sprSongBar.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); - m_sprSongBar.SetGlowColor( D3DXCOLOR(0,0,0,0) ); - } - } + case TYPE_SONG: + m_sprSongBar.Draw(); break; case TYPE_COURSE: m_sprSongBar.Draw(); + break; + default: + ASSERT(0); + } + + switch( m_WheelItemType ) + { + case TYPE_SECTION: + m_textSectionName.Draw(); + break; + case TYPE_ROULETTE: + m_textRoulette.Draw(); + break; + case TYPE_SONG: + m_TextBanner.Draw(); + break; + case TYPE_COURSE: m_textCourse.Draw(); break; default: ASSERT(0); } + + switch( m_WheelItemType ) + { + case TYPE_SECTION: + break; + case TYPE_ROULETTE: + break; + case TYPE_SONG: + m_MusicStatusDisplay.Draw(); + break; + case TYPE_COURSE: + break; + default: + ASSERT(0); + } + + switch( m_WheelItemType ) + { + case TYPE_SECTION: + break; + case TYPE_ROULETTE: + break; + case TYPE_SONG: + int p; + for( p=0; p 0 ) + { + m_sprSongBar.SetGlowColor( D3DXCOLOR(0,0,0,m_fPercentGray) ); + m_sprSongBar.Draw(); + m_sprSongBar.SetGlowColor( D3DXCOLOR(0,0,0,0) ); + } + break; + case TYPE_COURSE: + break; + default: + ASSERT(0); + } + } - - MusicWheel::MusicWheel() { LOG->Trace( "MusicWheel::MusicWheel()" ); @@ -733,7 +784,6 @@ void MusicWheel::DrawPrimitives() display.Draw(); } - ActorFrame::DrawPrimitives(); } diff --git a/stepmania/src/MusicWheel.h b/stepmania/src/MusicWheel.h index 8adbb17408..e4197d1c88 100644 --- a/stepmania/src/MusicWheel.h +++ b/stepmania/src/MusicWheel.h @@ -54,14 +54,14 @@ public: class WheelItemDisplay : public WheelItemData, - public Actor + public ActorFrame { public: WheelItemDisplay(); virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); - + CString GetSectionName() { return m_sSectionName; } void LoadFromWheelItemData( WheelItemData* pWID ); diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index e553242416..24cb424fdd 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -196,7 +196,7 @@ void NoteField::DrawPrimitives() // int iFirstMeasureToDraw = int(fFirstBeatToDraw)/BEATS_PER_MEASURE; int iLastMeasureToDraw = (int(fLastBeatToDraw)/BEATS_PER_MEASURE)+1; - for( i=iFirstMeasureToDraw; i<=fLastBeatToDraw; i++ ) + for( i=iFirstMeasureToDraw; i<=iLastMeasureToDraw; i++ ) DrawMeasureBar( i ); // diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 28a0333ef2..2eb7d4d1d1 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -531,13 +531,18 @@ void RageDisplay::FlushQueue() if( m_iNumVerts == 0 ) return; ASSERT( (m_iNumVerts % 3) == 0 ); - + + m_pd3dDevice->DrawPrimitiveUP( D3DPT_TRIANGLELIST, m_iNumVerts/3, m_vertQueue, sizeof(RAGEVERTEX) ); + m_iNumVerts = 0; + +/* RAGEVERTEX* v; m_pVB->Lock( 0, 0, (BYTE**)&v, 0 ); memcpy( v, m_vertQueue, sizeof(RAGEVERTEX)*m_iNumVerts ); m_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, m_iNumVerts/3 ); m_pVB->Unlock(); m_iNumVerts = 0; +*/ m_iDrawsSinceLastCheck++; } diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index 38f884e3fc..1a7a370511 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -35,6 +35,13 @@ const int MAX_NUM_VERTICIES = MAX_NUM_QUADS*4; // 4 verticies per quad +// +// Chris: +// I did a lot of testing, and drawing indexed primitives is SLOWER than duplicating +// verticies and not indexing. In fact, drawing indexed primitives is about 30% slower. +// + + class RageDisplay { friend class RageTexture; @@ -138,7 +145,6 @@ private: // protected: RAGEVERTEX m_vertQueue[MAX_NUM_VERTICIES]; - D3DCOLOR m_addColors[MAX_NUM_VERTICIES]; int m_iNumVerts; public: diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index d1c8b65330..90c6163abc 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -62,20 +62,10 @@ ScreenEditMenu::ScreenEditMenu() { LOG->Trace( "ScreenEditMenu::ScreenEditMenu()" ); - - // data structures - m_SelectedRow = ROW_GROUP; - - SONGMAN->GetGroupNames( m_sGroups ); - GAMEMAN->GetNotesTypesForGame( GAMESTATE->m_CurGame, m_NotesTypes ); - m_iSelectedGroup = 0; - m_iSelectedSong = 0; - m_iSelectedNotesType = 0; - m_iSelectedNotes = 0; - m_textGroup.LoadFromFont( THEME->GetPathTo("Fonts","header1") ); m_textGroup.SetXY( GROUP_X, GROUP_Y ); m_textGroup.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) ); + m_textGroup.SetText( "blah" ); this->AddSubActor( &m_textGroup ); m_Banner.SetXY( SONG_BANNER_X, SONG_BANNER_Y ); @@ -98,16 +88,54 @@ ScreenEditMenu::ScreenEditMenu() m_textNotesType.LoadFromFont( THEME->GetPathTo("Fonts","header1") ); m_textNotesType.SetXY( GAME_STYLE_X, GAME_STYLE_Y ); m_textNotesType.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) ); + m_textNotesType.SetText( "blah" ); this->AddSubActor( &m_textNotesType ); m_textNotes.LoadFromFont( THEME->GetPathTo("Fonts","header1") ); m_textNotes.SetXY( STEPS_X, STEPS_Y ); m_textNotes.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) ); + m_textNotes.SetText( "blah" ); this->AddSubActor( &m_textNotes ); + + // data structures + m_SelectedRow = ROW_GROUP; AfterRowChange(); - OnGroupChange(); + + SONGMAN->GetGroupNames( m_sGroups ); + GAMEMAN->GetNotesTypesForGame( GAMESTATE->m_CurGame, m_NotesTypes ); + m_iSelectedGroup = 0; + m_iSelectedSong = 0; + m_iSelectedNotesType = 0; + m_iSelectedNotes = 0; + + if( GAMESTATE->m_pCurSong ) + { + int i; + + for( i=0; im_pCurSong->m_sGroupName == m_sGroups[i] ) + m_iSelectedGroup = i; + OnGroupChange(); + + for( i=0; im_pCurSong == m_pSongs[i] ) + m_iSelectedSong = i; + OnSongChange(); + + for( i=0; iGetCurrentStyleDef()->m_NotesType == m_NotesTypes[i] ) + m_iSelectedNotesType = i; + OnNotesTypeChange(); + + for( i=0; im_pCurNotes[PLAYER_1] == m_pNotess[i] ) + m_iSelectedNotes = i; + OnNotesChange(); + } + else + OnGroupChange(); m_textExplanation.LoadFromFont( THEME->GetPathTo("Fonts","normal") ); @@ -248,10 +276,10 @@ void ScreenEditMenu::OnNotesTypeChange() m_iSelectedNotes = 0; - OnStepsChange(); + OnNotesChange(); } -void ScreenEditMenu::OnStepsChange() +void ScreenEditMenu::OnNotesChange() { m_iSelectedNotes = clamp( m_iSelectedNotes, 0, m_pNotess.GetSize()-1 ); @@ -308,7 +336,7 @@ void ScreenEditMenu::MenuLeft( const PlayerNumber p ) if( m_iSelectedNotes == 0 ) // can't go left any further return; m_iSelectedNotes--; - OnStepsChange(); + OnNotesChange(); break; default: ASSERT(false); @@ -341,7 +369,7 @@ void ScreenEditMenu::MenuRight( const PlayerNumber p ) if( m_iSelectedNotes == m_pNotess.GetSize()-1 ) // can't go right any further return; m_iSelectedNotes++; - OnStepsChange(); + OnNotesChange(); break; default: ASSERT(false); diff --git a/stepmania/src/ScreenEditMenu.h b/stepmania/src/ScreenEditMenu.h index f7c8c0d7b5..8638e4b9bf 100644 --- a/stepmania/src/ScreenEditMenu.h +++ b/stepmania/src/ScreenEditMenu.h @@ -39,7 +39,7 @@ private: void OnGroupChange(); void OnSongChange(); void OnNotesTypeChange(); - void OnStepsChange(); + void OnNotesChange(); CString GetSelectedGroup() { return m_sGroups[m_iSelectedGroup]; }; Song* GetSelectedSong() { return m_pSongs[m_iSelectedSong]; }; @@ -60,31 +60,31 @@ private: MenuElements m_Menu; CStringArray m_sGroups; - int m_iSelectedGroup; // index into m_sGroups - BitmapText m_textGroup; + int m_iSelectedGroup; // index into m_sGroups + BitmapText m_textGroup; CArray m_pSongs; - int m_iSelectedSong; // index into m_pSongs - Banner m_Banner; + int m_iSelectedSong; // index into m_pSongs + Banner m_Banner; TextBanner m_TextBanner; - Sprite m_sprArrowLeft; - Sprite m_sprArrowRight; + Sprite m_sprArrowLeft; + Sprite m_sprArrowRight; CArray m_NotesTypes; - int m_iSelectedNotesType; // index into m_NotesTypes - BitmapText m_textNotesType; + int m_iSelectedNotesType; // index into m_NotesTypes + BitmapText m_textNotesType; CArray m_pNotess; - int m_iSelectedNotes; // index into m_pNotess - BitmapText m_textNotes; + int m_iSelectedNotes; // index into m_pNotess + BitmapText m_textNotes; - BitmapText m_textExplanation; + BitmapText m_textExplanation; - TransitionFade m_Fade; + TransitionFade m_Fade; - RandomSample m_soundChangeMusic; - RandomSample m_soundSelect; + RandomSample m_soundChangeMusic; + RandomSample m_soundSelect; }; diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index 75d4ad4b30..c544ac1503 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -409,7 +409,7 @@ void ScreenSelectDifficulty::ChangeTo( const PlayerNumber pn, int iSelectionWas, } } - m_soundChange.PlayRandom(); + m_soundChange.Play(); } void ScreenSelectDifficulty::MenuStart( PlayerNumber pn ) @@ -418,7 +418,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn ) return; m_bChosen[pn] = true; - m_soundSelect.PlayRandom(); + m_soundSelect.Play(); int iSelection = m_iSelection[pn]; switch( iSelection ) diff --git a/stepmania/src/ScreenSelectDifficulty.h b/stepmania/src/ScreenSelectDifficulty.h index afb801cd7c..ee18e4cf48 100644 --- a/stepmania/src/ScreenSelectDifficulty.h +++ b/stepmania/src/ScreenSelectDifficulty.h @@ -58,8 +58,8 @@ private: Sprite m_sprArrowShadow[NUM_PLAYERS]; Sprite m_sprOK[NUM_PLAYERS]; - RandomSample m_soundChange; - RandomSample m_soundSelect; + RageSoundSample m_soundChange; + RageSoundSample m_soundSelect; bool m_bPlayedChallengeSound; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 1e5d88e168..968e519a8e 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -569,7 +569,7 @@ bool Song::LoadFromBMSDir( CString sDir ) value_name = line; } - if( 0==stricmp(value_name, sTagToLookFor) == 0 ) + if( 0==stricmp(value_name, sTagToLookFor) ) { fBPM = (float)atof( value_data ); break;