optimizations

This commit is contained in:
Chris Danford
2002-08-19 20:02:30 +00:00
parent fc68b90acc
commit 0e5f97143e
19 changed files with 221 additions and 102 deletions
+4
View File
@@ -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 OPTIMIZATION: New deferred rendering architecture uses more CPU in order to
create more efficient operations for the graphics card. create more efficient operations for the graphics card.
BUG FIX: Select Group no longer crashes with > 15 groups. 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---------------- ------------------------CVS after 3.00 beta 5----------------
OPTIMIZATION: Much faster song loading. OPTIMIZATION: Much faster song loading.
+12 -6
View File
@@ -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 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 ); DISPLAY->RotateY( m_temp_rotation.y );
if( m_temp_rotation.z != 0 ) if( m_temp_rotation.z != 0 )
DISPLAY->RotateZ( m_temp_rotation.z ); DISPLAY->RotateZ( m_temp_rotation.z );
}
void Actor::EndDraw()
{
this->DrawPrimitives(); // call the most-derived version of DrawPrimitives();
DISPLAY->PopMatrix(); DISPLAY->PopMatrix();
} }
+4 -2
View File
@@ -41,8 +41,10 @@ public:
virtual void Restore() {}; virtual void Restore() {};
virtual void Invalidate() {}; virtual void Invalidate() {};
virtual void Draw(); // set up the world matrix, then calls DrawPrimitives() virtual void Draw(); // calls, BeginDraw, DrawPrimitives, EndDraw
virtual void DrawPrimitives() = 0; 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 void Update( float fDeltaTime );
virtual float GetX() { return m_pos.x; }; virtual float GetX() { return m_pos.x; };
+2 -2
View File
@@ -254,10 +254,10 @@ void BitmapText::DrawPrimitives()
DISPLAY->TranslateLocal( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units 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 DWORD dwColor = D3DXCOLOR(0,0,0,0.5f*m_temp_colorDiffuse[0].a); // semi-transparent black
int i; int i;
for( i=0; i<iNumV; i++ ) for( i=0; i<iNumV; i++ )
v[i].color = dwColor; v[i].color = dwColor;
for( i=0; i<iNumV; i+=4 ) for( i=0; i<iNumV; i+=4 )
DISPLAY->AddQuad( &v[i] ); DISPLAY->AddQuad( &v[i] );
@@ -300,10 +300,10 @@ void BitmapText::DrawPrimitives()
if( m_temp_colorGlow.a != 0 ) if( m_temp_colorGlow.a != 0 )
{ {
DISPLAY->SetColorDiffuse(); DISPLAY->SetColorDiffuse();
int i; int i;
for( i=0; i<iNumV; i++ ) for( i=0; i<iNumV; i++ )
v[i].color = m_temp_colorGlow; v[i].color = m_temp_colorGlow;
for( i=0; i<iNumV; i+=4 ) for( i=0; i<iNumV; i+=4 )
DISPLAY->AddQuad( &v[i] ); DISPLAY->AddQuad( &v[i] );
} }
+7 -3
View File
@@ -16,11 +16,15 @@
#include "PrefsManager.h" #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") #define JUDGEMENT_DISPLAY_TIME THEME->GetMetricF("HoldJudgement","DisplayTime")
HoldJudgement::HoldJudgement() HoldJudgement::HoldJudgement()
{ {
m_fDisplayTime = JUDGEMENT_DISPLAY_TIME;
m_fDisplayCountdown = 0; m_fDisplayCountdown = 0;
m_sprJudgement.Load( THEME->GetPathTo("Graphics","gameplay hold judgement") ); m_sprJudgement.Load( THEME->GetPathTo("Graphics","gameplay hold judgement") );
m_sprJudgement.StopAnimating(); m_sprJudgement.StopAnimating();
@@ -57,21 +61,21 @@ void HoldJudgement::SetHoldJudgement( HoldNoteScore hns )
default: ASSERT( false ); default: ASSERT( false );
} }
m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME; m_fDisplayCountdown = m_fDisplayTime;
if( hns == HNS_NG ) if( hns == HNS_NG )
{ {
// falling down // falling down
m_sprJudgement.SetY( -10 ); m_sprJudgement.SetY( -10 );
m_sprJudgement.SetZoom( 1.0f ); m_sprJudgement.SetZoom( 1.0f );
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME ); m_sprJudgement.BeginTweening( m_fDisplayTime );
m_sprJudgement.SetTweenY( 10 ); m_sprJudgement.SetTweenY( 10 );
} }
else // hns == HNS_OK else // hns == HNS_OK
{ {
// zooming out // zooming out
m_sprJudgement.SetZoom( 1.5f ); 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 ); m_sprJudgement.SetTweenZoom( 1.0f );
} }
} }
+4 -8
View File
@@ -1,18 +1,15 @@
#pragma once
/* /*
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
File: HoldJudgement.h Class: HoldJudgement
Desc: A graphic displayed in the HoldJudgement during Dancing. Desc: A graphic displayed in the HoldJudgement during Dancing.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. 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 "Sprite.h"
#include "ActorFrame.h" #include "ActorFrame.h"
#include "Song.h" #include "Song.h"
@@ -30,7 +27,6 @@ public:
protected: protected:
Sprite m_sprJudgement; Sprite m_sprJudgement;
float m_fDisplayTime;
float m_fDisplayCountdown; float m_fDisplayCountdown;
}; };
#endif
+29 -18
View File
@@ -17,9 +17,13 @@
#include "GameState.h" #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") #define DANGER_THRESHOLD THEME->GetMetricF("LifeMeterBar","DangerThreshold")
const float FAIL_THRESHOLD = 0; const float FAIL_THRESHOLD = 0;
@@ -37,10 +41,13 @@ LifeMeterBar::LifeMeterBar()
m_fLifeVelocity = 0; m_fLifeVelocity = 0;
m_fHotAlpha = 0; m_fHotAlpha = 0;
m_bFailedEarlier = false; 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.SetDiffuseColor( D3DXCOLOR(0,0,0,1) );
m_quadBlackBackground.SetZoomX( METER_WIDTH ); m_quadBlackBackground.SetZoomX( m_iMeterWidth );
m_quadBlackBackground.SetZoomY( METER_HEIGHT ); m_quadBlackBackground.SetZoomY( m_iMeterHeight );
m_frame.AddSubActor( &m_quadBlackBackground ); m_frame.AddSubActor( &m_quadBlackBackground );
m_sprStreamNormal.Load( THEME->GetPathTo("Graphics","gameplay lifemeter stream normal") ); m_sprStreamNormal.Load( THEME->GetPathTo("Graphics","gameplay lifemeter stream normal") );
@@ -137,7 +144,7 @@ bool LifeMeterBar::IsHot()
bool LifeMeterBar::IsInDanger() bool LifeMeterBar::IsInDanger()
{ {
return m_fLifePercentage < DANGER_THRESHOLD; return m_fLifePercentage < m_fDangerThreshold;
} }
bool LifeMeterBar::IsFailing() bool LifeMeterBar::IsFailing()
@@ -165,13 +172,18 @@ void LifeMeterBar::Update( float fDeltaTime )
m_fLifeVelocity /= 4; // make some drag m_fLifeVelocity /= 4; // make some drag
CLAMP( m_fTrailingLifePercentage, 0, 1 ); CLAMP( m_fTrailingLifePercentage, 0, 1 );
m_fHotAlpha += IsHot() ? +fDeltaTime*2 : -fDeltaTime*2;
CLAMP( m_fHotAlpha, 0, 1 );
}
void LifeMeterBar::DrawPrimitives()
{
// set custom texture coords // set custom texture coords
CRect rectSize( static RECT rectSize;
int( -METER_WIDTH/2 ), rectSize.left = -m_iMeterWidth/2;
int( -METER_HEIGHT/2 ), rectSize.top = -m_iMeterHeight/2;
int( -METER_WIDTH/2 + METER_WIDTH * m_fTrailingLifePercentage ), rectSize.right = -m_iMeterWidth/2 + roundf(m_iMeterWidth*m_fTrailingLifePercentage);
int( -METER_HEIGHT/2 + METER_HEIGHT) ); rectSize.bottom = +m_iMeterHeight/2;
float fPrecentOffset = TIMER->GetTimeSinceStart(); float fPrecentOffset = TIMER->GetTimeSinceStart();
fPrecentOffset -= (int)fPrecentOffset; fPrecentOffset -= (int)fPrecentOffset;
@@ -182,19 +194,17 @@ void LifeMeterBar::Update( float fDeltaTime )
m_fTrailingLifePercentage - fPrecentOffset, m_fTrailingLifePercentage - fPrecentOffset,
1 ); 1 );
m_sprStreamNormal.StretchTo( rectSize ); m_sprStreamNormal.StretchTo( &rectSize );
m_sprStreamNormal.SetCustomTextureRect( frectCustomTexCoords ); m_sprStreamNormal.SetCustomTextureRect( frectCustomTexCoords );
m_sprStreamHot.StretchTo( rectSize ); m_sprStreamHot.StretchTo( &rectSize );
m_sprStreamHot.SetCustomTextureRect( frectCustomTexCoords ); 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) ); m_sprStreamHot.SetDiffuseColor( D3DXCOLOR(1,1,1,m_fHotAlpha) );
}
void LifeMeterBar::DrawPrimitives()
{
float fPercentRed = (m_fTrailingLifePercentage<DANGER_THRESHOLD) ? sinf( TIMER->GetTimeSinceStart()*D3DX_PI*4 )/2+0.5f : 0;
float fPercentRed = (m_fTrailingLifePercentage<m_fDangerThreshold) ? sinf( TIMER->GetTimeSinceStart()*D3DX_PI*4 )/2+0.5f : 0;
m_quadBlackBackground.SetDiffuseColor( D3DXCOLOR(fPercentRed*0.8f,0,0,1) ); m_quadBlackBackground.SetDiffuseColor( D3DXCOLOR(fPercentRed*0.8f,0,0,1) );
if( !GAMESTATE->IsPlayerEnabled(m_PlayerNumber) ) if( !GAMESTATE->IsPlayerEnabled(m_PlayerNumber) )
@@ -202,6 +212,7 @@ void LifeMeterBar::DrawPrimitives()
m_sprStreamNormal.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); m_sprStreamNormal.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
m_sprStreamHot.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); m_sprStreamHot.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
} }
ActorFrame::DrawPrimitives(); ActorFrame::DrawPrimitives();
} }
+3
View File
@@ -47,4 +47,7 @@ private:
float m_fLifeVelocity; // how m_fTrailingLifePercentage approaches m_fLifePercentage float m_fLifeVelocity; // how m_fTrailingLifePercentage approaches m_fLifePercentage
float m_fHotAlpha; float m_fHotAlpha;
bool m_bFailedEarlier; // set this to true when life dips below 0 bool m_bFailedEarlier; // set this to true when life dips below 0
int m_iMeterWidth;
int m_iMeterHeight;
float m_fDangerThreshold;
}; };
+4
View File
@@ -207,16 +207,20 @@ void MenuElements::DrawPrimitives()
void MenuElements::DrawTopLayer() void MenuElements::DrawTopLayer()
{ {
BeginDraw();
m_frameTopBar.Draw(); m_frameTopBar.Draw();
m_frameBottomBar.Draw(); m_frameBottomBar.Draw();
m_textHelp.Draw(); m_textHelp.Draw();
m_KeepAlive.Draw(); m_KeepAlive.Draw();
m_Wipe.Draw(); m_Wipe.Draw();
EndDraw();
} }
void MenuElements::DrawBottomLayer() void MenuElements::DrawBottomLayer()
{ {
BeginDraw();
m_sprBG.Draw(); m_sprBG.Draw();
EndDraw();
} }
void MenuElements::StopTimer() void MenuElements::StopTimer()
+70 -20
View File
@@ -253,41 +253,92 @@ void WheelItemDisplay::DrawPrimitives()
{ {
case TYPE_SECTION: case TYPE_SECTION:
m_sprSectionBar.Draw(); m_sprSectionBar.Draw();
m_textSectionName.Draw();
break; break;
case TYPE_ROULETTE: case TYPE_ROULETTE:
m_sprSectionBar.Draw(); m_sprSectionBar.Draw();
m_textRoulette.Draw();
break; break;
case TYPE_SONG: case TYPE_SONG:
{
m_sprSongBar.Draw(); m_sprSongBar.Draw();
m_MusicStatusDisplay.Draw();
m_TextBanner.Draw();
for( int p=0; p<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Draw();
if( m_fPercentGray > 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) );
}
}
break; break;
case TYPE_COURSE: case TYPE_COURSE:
m_sprSongBar.Draw(); 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(); m_textCourse.Draw();
break; break;
default: default:
ASSERT(0); 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<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Draw();
break;
case TYPE_COURSE:
break;
default:
ASSERT(0);
}
switch( m_WheelItemType )
{
case TYPE_SECTION:
break;
case TYPE_ROULETTE:
break;
case TYPE_SONG:
if( m_fPercentGray > 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() MusicWheel::MusicWheel()
{ {
LOG->Trace( "MusicWheel::MusicWheel()" ); LOG->Trace( "MusicWheel::MusicWheel()" );
@@ -733,7 +784,6 @@ void MusicWheel::DrawPrimitives()
display.Draw(); display.Draw();
} }
ActorFrame::DrawPrimitives(); ActorFrame::DrawPrimitives();
} }
+1 -1
View File
@@ -54,7 +54,7 @@ public:
class WheelItemDisplay : public WheelItemData, class WheelItemDisplay : public WheelItemData,
public Actor public ActorFrame
{ {
public: public:
WheelItemDisplay(); WheelItemDisplay();
+1 -1
View File
@@ -196,7 +196,7 @@ void NoteField::DrawPrimitives()
// //
int iFirstMeasureToDraw = int(fFirstBeatToDraw)/BEATS_PER_MEASURE; int iFirstMeasureToDraw = int(fFirstBeatToDraw)/BEATS_PER_MEASURE;
int iLastMeasureToDraw = (int(fLastBeatToDraw)/BEATS_PER_MEASURE)+1; int iLastMeasureToDraw = (int(fLastBeatToDraw)/BEATS_PER_MEASURE)+1;
for( i=iFirstMeasureToDraw; i<=fLastBeatToDraw; i++ ) for( i=iFirstMeasureToDraw; i<=iLastMeasureToDraw; i++ )
DrawMeasureBar( i ); DrawMeasureBar( i );
// //
+5
View File
@@ -532,12 +532,17 @@ void RageDisplay::FlushQueue()
return; return;
ASSERT( (m_iNumVerts % 3) == 0 ); ASSERT( (m_iNumVerts % 3) == 0 );
m_pd3dDevice->DrawPrimitiveUP( D3DPT_TRIANGLELIST, m_iNumVerts/3, m_vertQueue, sizeof(RAGEVERTEX) );
m_iNumVerts = 0;
/*
RAGEVERTEX* v; RAGEVERTEX* v;
m_pVB->Lock( 0, 0, (BYTE**)&v, 0 ); m_pVB->Lock( 0, 0, (BYTE**)&v, 0 );
memcpy( v, m_vertQueue, sizeof(RAGEVERTEX)*m_iNumVerts ); memcpy( v, m_vertQueue, sizeof(RAGEVERTEX)*m_iNumVerts );
m_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, m_iNumVerts/3 ); m_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, m_iNumVerts/3 );
m_pVB->Unlock(); m_pVB->Unlock();
m_iNumVerts = 0; m_iNumVerts = 0;
*/
m_iDrawsSinceLastCheck++; m_iDrawsSinceLastCheck++;
} }
+7 -1
View File
@@ -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 class RageDisplay
{ {
friend class RageTexture; friend class RageTexture;
@@ -138,7 +145,6 @@ private:
// //
protected: protected:
RAGEVERTEX m_vertQueue[MAX_NUM_VERTICIES]; RAGEVERTEX m_vertQueue[MAX_NUM_VERTICIES];
D3DCOLOR m_addColors[MAX_NUM_VERTICIES];
int m_iNumVerts; int m_iNumVerts;
public: public:
+43 -15
View File
@@ -62,20 +62,10 @@ ScreenEditMenu::ScreenEditMenu()
{ {
LOG->Trace( "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.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
m_textGroup.SetXY( GROUP_X, GROUP_Y ); m_textGroup.SetXY( GROUP_X, GROUP_Y );
m_textGroup.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) ); m_textGroup.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) );
m_textGroup.SetText( "blah" );
this->AddSubActor( &m_textGroup ); this->AddSubActor( &m_textGroup );
m_Banner.SetXY( SONG_BANNER_X, SONG_BANNER_Y ); m_Banner.SetXY( SONG_BANNER_X, SONG_BANNER_Y );
@@ -98,15 +88,53 @@ ScreenEditMenu::ScreenEditMenu()
m_textNotesType.LoadFromFont( THEME->GetPathTo("Fonts","header1") ); m_textNotesType.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
m_textNotesType.SetXY( GAME_STYLE_X, GAME_STYLE_Y ); m_textNotesType.SetXY( GAME_STYLE_X, GAME_STYLE_Y );
m_textNotesType.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) ); m_textNotesType.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) );
m_textNotesType.SetText( "blah" );
this->AddSubActor( &m_textNotesType ); this->AddSubActor( &m_textNotesType );
m_textNotes.LoadFromFont( THEME->GetPathTo("Fonts","header1") ); m_textNotes.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
m_textNotes.SetXY( STEPS_X, STEPS_Y ); m_textNotes.SetXY( STEPS_X, STEPS_Y );
m_textNotes.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) ); m_textNotes.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) );
m_textNotes.SetText( "blah" );
this->AddSubActor( &m_textNotes ); this->AddSubActor( &m_textNotes );
// data structures
m_SelectedRow = ROW_GROUP;
AfterRowChange(); AfterRowChange();
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; i<m_sGroups.GetSize(); i++ )
if( GAMESTATE->m_pCurSong->m_sGroupName == m_sGroups[i] )
m_iSelectedGroup = i;
OnGroupChange();
for( i=0; i<m_pSongs.GetSize(); i++ )
if( GAMESTATE->m_pCurSong == m_pSongs[i] )
m_iSelectedSong = i;
OnSongChange();
for( i=0; i<m_NotesTypes.GetSize(); i++ )
if( GAMESTATE->GetCurrentStyleDef()->m_NotesType == m_NotesTypes[i] )
m_iSelectedNotesType = i;
OnNotesTypeChange();
for( i=0; i<m_pNotess.GetSize(); i++ )
if( GAMESTATE->m_pCurNotes[PLAYER_1] == m_pNotess[i] )
m_iSelectedNotes = i;
OnNotesChange();
}
else
OnGroupChange(); OnGroupChange();
@@ -248,10 +276,10 @@ void ScreenEditMenu::OnNotesTypeChange()
m_iSelectedNotes = 0; m_iSelectedNotes = 0;
OnStepsChange(); OnNotesChange();
} }
void ScreenEditMenu::OnStepsChange() void ScreenEditMenu::OnNotesChange()
{ {
m_iSelectedNotes = clamp( m_iSelectedNotes, 0, m_pNotess.GetSize()-1 ); 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 if( m_iSelectedNotes == 0 ) // can't go left any further
return; return;
m_iSelectedNotes--; m_iSelectedNotes--;
OnStepsChange(); OnNotesChange();
break; break;
default: default:
ASSERT(false); 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 if( m_iSelectedNotes == m_pNotess.GetSize()-1 ) // can't go right any further
return; return;
m_iSelectedNotes++; m_iSelectedNotes++;
OnStepsChange(); OnNotesChange();
break; break;
default: default:
ASSERT(false); ASSERT(false);
+1 -1
View File
@@ -39,7 +39,7 @@ private:
void OnGroupChange(); void OnGroupChange();
void OnSongChange(); void OnSongChange();
void OnNotesTypeChange(); void OnNotesTypeChange();
void OnStepsChange(); void OnNotesChange();
CString GetSelectedGroup() { return m_sGroups[m_iSelectedGroup]; }; CString GetSelectedGroup() { return m_sGroups[m_iSelectedGroup]; };
Song* GetSelectedSong() { return m_pSongs[m_iSelectedSong]; }; Song* GetSelectedSong() { return m_pSongs[m_iSelectedSong]; };
+2 -2
View File
@@ -409,7 +409,7 @@ void ScreenSelectDifficulty::ChangeTo( const PlayerNumber pn, int iSelectionWas,
} }
} }
m_soundChange.PlayRandom(); m_soundChange.Play();
} }
void ScreenSelectDifficulty::MenuStart( PlayerNumber pn ) void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
@@ -418,7 +418,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
return; return;
m_bChosen[pn] = true; m_bChosen[pn] = true;
m_soundSelect.PlayRandom(); m_soundSelect.Play();
int iSelection = m_iSelection[pn]; int iSelection = m_iSelection[pn];
switch( iSelection ) switch( iSelection )
+2 -2
View File
@@ -58,8 +58,8 @@ private:
Sprite m_sprArrowShadow[NUM_PLAYERS]; Sprite m_sprArrowShadow[NUM_PLAYERS];
Sprite m_sprOK[NUM_PLAYERS]; Sprite m_sprOK[NUM_PLAYERS];
RandomSample m_soundChange; RageSoundSample m_soundChange;
RandomSample m_soundSelect; RageSoundSample m_soundSelect;
bool m_bPlayedChallengeSound; bool m_bPlayedChallengeSound;
+1 -1
View File
@@ -569,7 +569,7 @@ bool Song::LoadFromBMSDir( CString sDir )
value_name = line; value_name = line;
} }
if( 0==stricmp(value_name, sTagToLookFor) == 0 ) if( 0==stricmp(value_name, sTagToLookFor) )
{ {
fBPM = (float)atof( value_data ); fBPM = (float)atof( value_data );
break; break;