Added fade between movies and touched up some graphics

This commit is contained in:
Chris Danford
2002-10-10 04:11:30 +00:00
parent 8770a98106
commit 5e9a6a4df6
18 changed files with 141 additions and 70 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
Fix Fix
///////////////////////// /////////////////////////
default difficulty goofed crowd cheer on AA or greater
- ez2dancer missing graphic - ez2dancer missing graphic
+2 -2
View File
@@ -419,8 +419,8 @@ TryExtraStageY=428
HelpText=Press START to continue HelpText=Press START to continue
TimerSeconds=40 TimerSeconds=40
SpinGrades=1 SpinGrades=1
GradesGlowColor1=1,1,1,0.2 GradesGlowColor1=1,1,1,0.0
GradesGlowColor2=1,1,1,0.8 GradesGlowColor2=1,1,1,0.3
[ScreenMusicScroll] [ScreenMusicScroll]
ScrollDelay=0.2 ScrollDelay=0.2
+18 -2
View File
@@ -20,6 +20,7 @@
BGAnimation::BGAnimation() BGAnimation::BGAnimation()
{ {
m_fFadeSeconds = 0;
} }
BGAnimation::~BGAnimation() BGAnimation::~BGAnimation()
@@ -41,6 +42,8 @@ void BGAnimation::LoadFromStaticGraphic( CString sPath )
BGAnimationLayer* pLayer = new BGAnimationLayer; BGAnimationLayer* pLayer = new BGAnimationLayer;
pLayer->LoadFromStaticGraphic( sPath ); pLayer->LoadFromStaticGraphic( sPath );
m_Layers.Add( pLayer ); m_Layers.Add( pLayer );
m_fFadeSeconds = 0.5f;
} }
void BGAnimation::LoadFromAniDir( CString sAniDir, CString sSongBGPath ) void BGAnimation::LoadFromAniDir( CString sAniDir, CString sSongBGPath )
@@ -72,15 +75,19 @@ void BGAnimation::LoadFromAniDir( CString sAniDir, CString sSongBGPath )
pLayer->LoadFromAniLayerFile( asImagePaths[i], sSongBGPath ); pLayer->LoadFromAniLayerFile( asImagePaths[i], sSongBGPath );
m_Layers.Add( pLayer ); m_Layers.Add( pLayer );
} }
m_fFadeSeconds = 0;
} }
void BGAnimation::LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewind, bool bFadeSongBG, CString sSongBGPath ) void BGAnimation::LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewind )
{ {
Unload(); Unload();
BGAnimationLayer* pLayer = new BGAnimationLayer; BGAnimationLayer* pLayer = new BGAnimationLayer;
pLayer->LoadFromMovie( sMoviePath, bLoop, bRewind, bFadeSongBG, sSongBGPath ); pLayer->LoadFromMovie( sMoviePath, bLoop, bRewind );
m_Layers.Add( pLayer ); m_Layers.Add( pLayer );
m_fFadeSeconds = 0.5f;
} }
void BGAnimation::LoadFromVisualization( CString sVisPath, CString sSongBGPath ) void BGAnimation::LoadFromVisualization( CString sVisPath, CString sSongBGPath )
@@ -95,6 +102,8 @@ void BGAnimation::LoadFromVisualization( CString sVisPath, CString sSongBGPath )
pLayer = new BGAnimationLayer; pLayer = new BGAnimationLayer;
pLayer->LoadFromVisualization( sVisPath ); pLayer->LoadFromVisualization( sVisPath );
m_Layers.Add( pLayer ); m_Layers.Add( pLayer );
m_fFadeSeconds = 0.5f;
} }
@@ -114,6 +123,8 @@ void BGAnimation::GainingFocus()
{ {
for( int i=0; i<m_Layers.GetSize(); i++ ) for( int i=0; i<m_Layers.GetSize(); i++ )
m_Layers[i]->GainingFocus(); m_Layers[i]->GainingFocus();
SetDiffuse( D3DXCOLOR(1,1,1,1) );
} }
void BGAnimation::LosingFocus() void BGAnimation::LosingFocus()
@@ -122,3 +133,8 @@ void BGAnimation::LosingFocus()
m_Layers[i]->LosingFocus(); m_Layers[i]->LosingFocus();
} }
void BGAnimation::SetDiffuse( const D3DXCOLOR &c )
{
for( int i=0; i<m_Layers.GetSize(); i++ )
m_Layers[i]->SetDiffuse(c);
}
+5 -1
View File
@@ -28,16 +28,20 @@ public:
void LoadFromStaticGraphic( CString sPath ); void LoadFromStaticGraphic( CString sPath );
void LoadFromAniDir( CString sAniDir, CString sSongBGPath="" ); void LoadFromAniDir( CString sAniDir, CString sSongBGPath="" );
void LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewind, bool bFadeSongBG = false, CString sSongBGPath = "" ); void LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewind );
void LoadFromVisualization( CString sMoviePath, CString sSongBGPath ); void LoadFromVisualization( CString sMoviePath, CString sSongBGPath );
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
virtual void DrawPrimitives(); virtual void DrawPrimitives();
virtual void SetDiffuse( const D3DXCOLOR &c );
void GainingFocus(); void GainingFocus();
void LosingFocus(); void LosingFocus();
protected: protected:
CArray<BGAnimationLayer*,BGAnimationLayer*> m_Layers; CArray<BGAnimationLayer*,BGAnimationLayer*> m_Layers;
float m_fFadeSeconds;
}; };
+2 -10
View File
@@ -61,9 +61,9 @@ void BGAnimationLayer::LoadFromStaticGraphic( CString sPath )
m_Sprites[0].StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) ); m_Sprites[0].StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
} }
void BGAnimationLayer::LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewind, bool bFadeSongBG, CString sSongBGPath ) void BGAnimationLayer::LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewind )
{ {
m_iNumSprites = bFadeSongBG ? 2 : 1; m_iNumSprites = 1;
m_Sprites[0].Load( sMoviePath ); m_Sprites[0].Load( sMoviePath );
m_Sprites[0].StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) ); m_Sprites[0].StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
m_Sprites[0].GetTexture()->Play(); m_Sprites[0].GetTexture()->Play();
@@ -72,14 +72,6 @@ void BGAnimationLayer::LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewi
m_bRewindMovie = bRewind; m_bRewindMovie = bRewind;
if( !bLoop ) if( !bLoop )
m_Sprites[0].GetTexture()->SetLooping(false); m_Sprites[0].GetTexture()->SetLooping(false);
if( bFadeSongBG )
{
m_Sprites[1].Load( sSongBGPath );
m_Sprites[1].StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
m_Sprites[1].BeginTweening( 0.7f ); // this tween won't actually happen until GainFocus is called and this Layer starts getting Update()s.
m_Sprites[1].SetTweenDiffuse( D3DXCOLOR(1,1,1,0) );
}
} }
void BGAnimationLayer::LoadFromVisualization( CString sMoviePath ) void BGAnimationLayer::LoadFromVisualization( CString sMoviePath )
+3 -1
View File
@@ -26,12 +26,14 @@ public:
void LoadFromStaticGraphic( CString sPath ); void LoadFromStaticGraphic( CString sPath );
void LoadFromAniLayerFile( CString sPath, CString sSongBGPath ); void LoadFromAniLayerFile( CString sPath, CString sSongBGPath );
void LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewind, bool bFadeSongBG, CString sSongBGPath ); void LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewind );
void LoadFromVisualization( CString sMoviePath ); void LoadFromVisualization( CString sMoviePath );
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
virtual void Draw(); virtual void Draw();
virtual void SetDiffuse( D3DXCOLOR c ) { for(int i=0; i<m_iNumSprites; i++) m_Sprites[i].SetDiffuse(c); }
void GainingFocus(); void GainingFocus();
void LosingFocus(); void LosingFocus();
+54 -26
View File
@@ -25,6 +25,8 @@ const CString BG_ANIMS_DIR = "BGAnimations\\";
const CString VISUALIZATIONS_DIR = "Visualizations\\"; const CString VISUALIZATIONS_DIR = "Visualizations\\";
const CString RANDOMMOVIES_DIR = "RandomMovies\\"; const CString RANDOMMOVIES_DIR = "RandomMovies\\";
const float FADE_SECONDS = 1.0f;
// TODO: Move these into theme metrics // TODO: Move these into theme metrics
#define LEFT_EDGE THEME->GetMetricI("Background","LeftEdge") #define LEFT_EDGE THEME->GetMetricI("Background","LeftEdge")
#define TOP_EDGE THEME->GetMetricI("Background","TopEdge") #define TOP_EDGE THEME->GetMetricI("Background","TopEdge")
@@ -61,7 +63,8 @@ Background::Background()
m_iCurBGSegment = 0; m_iCurBGSegment = 0;
m_bInDanger = false; m_bInDanger = false;
m_BackgroundMode = MODE_STATIC_BG; m_pFadingBGA = NULL;
m_fSecsLeftInFade = 0;
m_BGADanger.LoadFromAniDir( THEME->GetPathTo("BGAnimations","gameplay danger") ); m_BGADanger.LoadFromAniDir( THEME->GetPathTo("BGAnimations","gameplay danger") );
@@ -134,7 +137,7 @@ void Background::LoadFromSong( Song* pSong )
if( pSong->HasBGChanges() ) if( pSong->HasBGChanges() )
{ {
// start off showing the static song background // start off showing the static song background
m_aBGSegments.Add( BGSegment(-10000,0) ); m_aBGSegments.Add( BGSegment(-10000,0,false) );
// Load the animations used by the song's pre-defined animation plan. // Load the animations used by the song's pre-defined animation plan.
@@ -142,6 +145,7 @@ void Background::LoadFromSong( Song* pSong )
for( int i=0; i<pSong->m_BackgroundChanges.GetSize(); i++ ) for( int i=0; i<pSong->m_BackgroundChanges.GetSize(); i++ )
{ {
const BackgroundChange& aniseg = pSong->m_BackgroundChanges[i]; const BackgroundChange& aniseg = pSong->m_BackgroundChanges[i];
bool bFade = i==0;
// Using aniseg.m_sBGName, search for the corresponding animation. // Using aniseg.m_sBGName, search for the corresponding animation.
// Look in this order: movies in song dir, BGAnims in song dir // Look in this order: movies in song dir, BGAnims in song dir
@@ -155,10 +159,10 @@ void Background::LoadFromSong( Song* pSong )
if( asFiles.GetSize() > 0 ) if( asFiles.GetSize() > 0 )
{ {
pTempBGA = new BGAnimation; pTempBGA = new BGAnimation;
pTempBGA->LoadFromMovie( asFiles[0], true, true, i==0/*first BGChange*/, sSongBackgroundPath ); pTempBGA->LoadFromMovie( asFiles[0], true, true );
m_BGAnimations.Add( pTempBGA ); m_BGAnimations.Add( pTempBGA );
m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.GetSize()-1) ); // add to the plan m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.GetSize()-1, bFade) ); // add to the plan
continue; // stop looking for this background continue; // stop looking for this background
} }
@@ -170,7 +174,7 @@ void Background::LoadFromSong( Song* pSong )
pTempBGA->LoadFromAniDir( asFiles[0], sSongBackgroundPath ); pTempBGA->LoadFromAniDir( asFiles[0], sSongBackgroundPath );
m_BGAnimations.Add( pTempBGA ); m_BGAnimations.Add( pTempBGA );
m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.GetSize()-1) ); // add to the plan m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.GetSize()-1, bFade) ); // add to the plan
continue; // stop looking for this background continue; // stop looking for this background
} }
@@ -181,10 +185,10 @@ void Background::LoadFromSong( Song* pSong )
if( asFiles.GetSize() > 0 ) if( asFiles.GetSize() > 0 )
{ {
pTempBGA = new BGAnimation; pTempBGA = new BGAnimation;
pTempBGA->LoadFromMovie( asFiles[0], true, false, i==0/*first BGChange*/, sSongBackgroundPath ); pTempBGA->LoadFromMovie( asFiles[0], true, false );
m_BGAnimations.Add( pTempBGA ); m_BGAnimations.Add( pTempBGA );
m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.GetSize()-1) ); // add to the plan m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.GetSize()-1, bFade) ); // add to the plan
continue; // stop looking for this background continue; // stop looking for this background
} }
@@ -196,7 +200,7 @@ void Background::LoadFromSong( Song* pSong )
pTempBGA->LoadFromAniDir( asFiles[0], sSongBackgroundPath ); pTempBGA->LoadFromAniDir( asFiles[0], sSongBackgroundPath );
m_BGAnimations.Add( pTempBGA ); m_BGAnimations.Add( pTempBGA );
m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.GetSize()-1) ); // add to the plan m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.GetSize()-1, bFade) ); // add to the plan
continue; // stop looking for this background continue; // stop looking for this background
} }
@@ -204,29 +208,33 @@ void Background::LoadFromSong( Song* pSong )
} }
// end showing the static song background // end showing the static song background
m_aBGSegments.Add( BGSegment(pSong->m_fLastBeat,0) ); m_aBGSegments.Add( BGSegment(pSong->m_fLastBeat,0,false) );
SortBGSegmentArray( m_aBGSegments ); // Need to sort in case there is a background change after the last beat (not likely) SortBGSegmentArray( m_aBGSegments ); // Need to sort in case there is a background change after the last beat (not likely)
} }
else // pSong doesn't have an animation plan else // pSong doesn't have an animation plan
{ {
enum BackgroundMode { MODE_STATIC_BG, MODE_ANIMATIONS, MODE_MOVIE_VIS, MODE_RANDOMMOVIES } backgroundMode;
// //
// figure out what BackgroundMode to use // figure out what BackgroundMode to use
// //
if( PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_OFF ) if( PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_OFF )
m_BackgroundMode = MODE_STATIC_BG; backgroundMode = MODE_STATIC_BG;
else if( PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_MOVIEVIS ) else if( PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_MOVIEVIS )
m_BackgroundMode = MODE_MOVIE_VIS; backgroundMode = MODE_MOVIE_VIS;
else if( PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_RANDOMMOVIES ) else if( PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_RANDOMMOVIES )
m_BackgroundMode = MODE_RANDOMMOVIES; backgroundMode = MODE_RANDOMMOVIES;
else else
m_BackgroundMode = MODE_ANIMATIONS; backgroundMode = MODE_ANIMATIONS;
bool bFade = backgroundMode==MODE_RANDOMMOVIES;
// //
// Load animations that will play while notes are active // Load animations that will play while notes are active
// //
switch( m_BackgroundMode ) switch( backgroundMode )
{ {
case MODE_STATIC_BG: case MODE_STATIC_BG:
break; break;
@@ -280,7 +288,7 @@ void Background::LoadFromSong( Song* pSong )
{ {
int index = rand() % arrayPossibleMovies.GetSize(); int index = rand() % arrayPossibleMovies.GetSize();
pTempBGA = new BGAnimation; pTempBGA = new BGAnimation;
pTempBGA->LoadFromMovie( arrayPossibleMovies[index], true, false, i==0, sSongBackgroundPath ); pTempBGA->LoadFromMovie( arrayPossibleMovies[index], true, false );
m_BGAnimations.Add( pTempBGA ); m_BGAnimations.Add( pTempBGA );
arrayPossibleMovies.RemoveAt( index ); arrayPossibleMovies.RemoveAt( index );
} }
@@ -296,14 +304,16 @@ void Background::LoadFromSong( Song* pSong )
// //
// Generate an animation plan // Generate an animation plan
// //
if( m_BackgroundMode == MODE_MOVIE_VIS ) if( backgroundMode == MODE_MOVIE_VIS )
{ {
m_aBGSegments.Add( BGSegment(-10000,1) ); m_aBGSegments.Add( BGSegment(-10000,1,false) );
return; return;
} }
else
{
// start off showing the static song background // start off showing the static song background
m_aBGSegments.Add( BGSegment(-10000,0) ); m_aBGSegments.Add( BGSegment(-10000,0,false) );
}
/* If we have only 2, only generate a single animation segment for for the /* If we have only 2, only generate a single animation segment for for the
* whole song. Otherwise, if it's a movie., it'll loop every four bars; we * whole song. Otherwise, if it's a movie., it'll loop every four bars; we
@@ -312,7 +322,7 @@ void Background::LoadFromSong( Song* pSong )
const float fLastBeat = pSong->m_fLastBeat; const float fLastBeat = pSong->m_fLastBeat;
if( m_BGAnimations.GetSize() == 2) { if( m_BGAnimations.GetSize() == 2) {
m_aBGSegments.Add( BGSegment(fFirstBeat,1) ); m_aBGSegments.Add( BGSegment(fFirstBeat,1,bFade) );
} else { } else {
// change BG every 4 bars // change BG every 4 bars
for( float f=fFirstBeat; f<fLastBeat; f+=16 ) for( float f=fFirstBeat; f<fLastBeat; f+=16 )
@@ -324,7 +334,7 @@ void Background::LoadFromSong( Song* pSong )
index = 1; // force the first random background to play first index = 1; // force the first random background to play first
else else
index = 1 + rand()%(m_BGAnimations.GetSize()-1); index = 1 + rand()%(m_BGAnimations.GetSize()-1);
m_aBGSegments.Add( BGSegment(f,index) ); m_aBGSegments.Add( BGSegment(f,index,bFade || f==fFirstBeat) );
} }
// change BG every BPM change // change BG every BPM change
@@ -340,12 +350,12 @@ void Background::LoadFromSong( Song* pSong )
index = 0; index = 0;
else else
index = 1 + int(bpmseg.m_fBPM)%(m_BGAnimations.GetSize()-1); index = 1 + int(bpmseg.m_fBPM)%(m_BGAnimations.GetSize()-1);
m_aBGSegments.Add( BGSegment(bpmseg.m_fStartBeat,index) ); m_aBGSegments.Add( BGSegment(bpmseg.m_fStartBeat,index,bFade) );
} }
} }
// end showing the static song background // end showing the static song background
m_aBGSegments.Add( BGSegment(pSong->m_fLastBeat,0) ); m_aBGSegments.Add( BGSegment(pSong->m_fLastBeat,0,bFade) );
// sort segments // sort segments
SortBGSegmentArray( m_aBGSegments ); SortBGSegmentArray( m_aBGSegments );
@@ -386,14 +396,30 @@ void Background::Update( float fDeltaTime )
if( i > m_iCurBGSegment ) if( i > m_iCurBGSegment )
{ {
// printf( "%d, %d, %f, %f\n", m_iCurBGSegment, i, m_aBGSegments[i].m_fStartBeat, GAMESTATE->m_fSongBeat ); // printf( "%d, %d, %f, %f\n", m_iCurBGSegment, i, m_aBGSegments[i].m_fStartBeat, GAMESTATE->m_fSongBeat );
GetCurBGA()->LosingFocus(); BGAnimation* pOld = GetCurBGA();
m_iCurBGSegment = i; m_iCurBGSegment = i;
GetCurBGA()->GainingFocus(); BGAnimation* pNew = GetCurBGA();
if( pOld != pNew )
{
pOld->LosingFocus();
pNew->GainingFocus();
m_pFadingBGA = pOld;
m_fSecsLeftInFade = m_aBGSegments[m_iCurBGSegment].m_bFade ? FADE_SECONDS : 0;
}
} }
GetCurBGA()->Update( fDeltaTime ); GetCurBGA()->Update( fDeltaTime );
if( m_pFadingBGA )
{
m_pFadingBGA->Update( fDeltaTime );
m_fSecsLeftInFade -= fDeltaTime;
float fPercentOpaque = m_fSecsLeftInFade / FADE_SECONDS;
m_pFadingBGA->SetDiffuse( D3DXCOLOR(1,1,1,fPercentOpaque) );
if( fPercentOpaque <= 0 )
m_pFadingBGA = NULL;
}
} }
m_quadBGBrightness.Update( fDeltaTime ); m_quadBGBrightness.Update( fDeltaTime );
@@ -410,6 +436,8 @@ void Background::DrawPrimitives()
else else
{ {
GetCurBGA()->Draw(); GetCurBGA()->Draw();
if( m_pFadingBGA )
m_pFadingBGA->Draw();
} }
m_quadBGBrightness.Draw(); m_quadBGBrightness.Draw();
+5 -5
View File
@@ -22,9 +22,10 @@
struct BGSegment // like a BGChange, but holds index of a background instead of name struct BGSegment // like a BGChange, but holds index of a background instead of name
{ {
BGSegment() {}; BGSegment() {};
BGSegment( float b, int i ) { m_fStartBeat = b; m_iBGIndex = i; }; BGSegment( float b, int i, bool f ) { m_fStartBeat = b; m_iBGIndex = i; m_bFade = f; };
float m_fStartBeat; float m_fStartBeat;
int m_iBGIndex; int m_iBGIndex;
bool m_bFade;
}; };
@@ -53,9 +54,6 @@ public:
protected: protected:
bool DangerVisible(); bool DangerVisible();
enum BackgroundMode { MODE_STATIC_BG, MODE_ANIMATIONS, MODE_MOVIE_VIS, MODE_RANDOMMOVIES };
BackgroundMode m_BackgroundMode;
BGAnimation m_BGADanger; BGAnimation m_BGADanger;
// used in all BackgroundModes except OFF // used in all BackgroundModes except OFF
@@ -63,7 +61,9 @@ protected:
CArray<BGSegment,BGSegment&> m_aBGSegments; CArray<BGSegment,BGSegment&> m_aBGSegments;
int m_iCurBGSegment; // this increases as we move into new segments int m_iCurBGSegment; // this increases as we move into new segments
BGAnimation* GetCurBGA() { int index = m_aBGSegments[m_iCurBGSegment].m_iBGIndex; return m_BGAnimations[index]; }; BGAnimation* GetCurBGA() { int index = m_aBGSegments[m_iCurBGSegment].m_iBGIndex; return m_BGAnimations[index]; };
BGAnimation* m_pCurrentBGA;
BGAnimation* m_pFadingBGA;
float m_fSecsLeftInFade;
Quad m_quadBGBrightness; Quad m_quadBGBrightness;
Quad m_quadBorder[4]; // l, t, r, b - cover up the edge of animations that might hang outside of the background rectangle Quad m_quadBorder[4]; // l, t, r, b - cover up the edge of animations that might hang outside of the background rectangle
+14 -1
View File
@@ -541,7 +541,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
arrayWheelItemDatas.Add( WheelItemData(TYPE_ROULETTE, NULL, "", NULL, D3DXCOLOR(1,0,0,1)) ); arrayWheelItemDatas.Add( WheelItemData(TYPE_ROULETTE, NULL, "", NULL, D3DXCOLOR(1,0,0,1)) );
} }
// HACK: Add extra stage item since it's not necessarily in the same group // HACK: Add extra stage item if it isn't already present on the music wheel
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
{ {
Song* pSong; Song* pSong;
@@ -549,6 +549,19 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
PlayerOptions po; PlayerOptions po;
SongOptions so; SongOptions so;
SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->m_pCurSong->m_sGroupName, GAMESTATE->GetCurrentStyleDef(), pSong, pNotes, po, so ); SONGMAN->GetExtraStageInfo( GAMESTATE->IsExtraStage2(), GAMESTATE->m_pCurSong->m_sGroupName, GAMESTATE->GetCurrentStyleDef(), pSong, pNotes, po, so );
bool bFoundExtraSong = false;
for( int i=0; i<arrayWheelItemDatas.GetSize(); i++ )
{
if( arrayWheelItemDatas[i].m_pSong == pSong )
{
bFoundExtraSong = true;
break;
}
}
if( !bFoundExtraSong )
arrayWheelItemDatas.Add( WheelItemData(TYPE_SONG, pSong, "", NULL, GAMESTATE->GetStageColor()) ); arrayWheelItemDatas.Add( WheelItemData(TYPE_SONG, pSong, "", NULL, GAMESTATE->GetStageColor()) );
} }
+1 -1
View File
@@ -45,7 +45,7 @@ PrefsManager::PrefsManager()
m_bEventMode = false; m_bEventMode = false;
m_iNumArcadeStages = 3; m_iNumArcadeStages = 3;
m_bAutoPlay = false; m_bAutoPlay = false;
m_fJudgeWindowSeconds = 0.20f; m_fJudgeWindowSeconds = 0.17f;
m_fJudgeWindowPerfectPercent = 0.25f; m_fJudgeWindowPerfectPercent = 0.25f;
m_fJudgeWindowGreatPercent = 0.50f; m_fJudgeWindowGreatPercent = 0.50f;
m_fJudgeWindowGoodPercent = 0.75f; m_fJudgeWindowGoodPercent = 0.75f;
+14 -1
View File
@@ -188,7 +188,10 @@ HRESULT CTextureRenderer::SetRenderTarget( RageMovieTexture* pTexture )
HRESULT CTextureRenderer::DoRenderSample( IMediaSample * pSample ) HRESULT CTextureRenderer::DoRenderSample( IMediaSample * pSample )
{ {
if( m_pTexture == NULL ) if( m_pTexture == NULL )
throw RageException( "DoRenderSample called while m_pTexture was NULL!" ); {
LOG->Warn( "DoRenderSample called while m_pTexture was NULL!" );
return S_OK;
}
BYTE *pBmpBuffer; // Bitmap buffer BYTE *pBmpBuffer; // Bitmap buffer
@@ -307,6 +310,7 @@ RageMovieTexture::RageMovieTexture(
} }
m_bLoop = true; m_bLoop = true;
m_bPlaying = false;
} }
RageMovieTexture::~RageMovieTexture() RageMovieTexture::~RageMovieTexture()
@@ -490,6 +494,8 @@ HRESULT RageMovieTexture::PlayMovie()
if( FAILED( hr = pMC->Run() ) ) if( FAILED( hr = pMC->Run() ) )
throw RageException( hr, "Could not run the DirectShow graph." ); throw RageException( hr, "Could not run the DirectShow graph." );
m_bPlaying = true;
return S_OK; return S_OK;
} }
@@ -552,6 +558,8 @@ void RageMovieTexture::Stop()
HRESULT hr; HRESULT hr;
if( FAILED( hr = pMC->Stop() ) ) if( FAILED( hr = pMC->Stop() ) )
throw RageException( hr, "Could not stop the DirectShow graph." ); throw RageException( hr, "Could not stop the DirectShow graph." );
m_bPlaying = false;
} }
void RageMovieTexture::SetPosition( float fSeconds ) void RageMovieTexture::SetPosition( float fSeconds )
@@ -561,3 +569,8 @@ void RageMovieTexture::SetPosition( float fSeconds )
pMP->put_CurrentPosition(0); pMP->put_CurrentPosition(0);
} }
bool RageMovieTexture::IsPlaying() const
{
return m_bPlaying;
}
+2
View File
@@ -53,6 +53,7 @@ public:
virtual void Stop(); virtual void Stop();
virtual void SetPosition( float fSeconds ); virtual void SetPosition( float fSeconds );
virtual bool IsAMovie() const { return true; }; virtual bool IsAMovie() const { return true; };
virtual bool IsPlaying() const;
void SetLooping(bool looping=true) { m_bLoop = looping; } void SetLooping(bool looping=true) { m_bLoop = looping; }
LPDIRECT3DTEXTURE8 GetBackBuffer() { return m_pd3dTexture[!m_iIndexFrontBuffer]; } LPDIRECT3DTEXTURE8 GetBackBuffer() { return m_pd3dTexture[!m_iIndexFrontBuffer]; }
@@ -76,4 +77,5 @@ protected:
CComPtr<IGraphBuilder> m_pGB; // GraphBuilder CComPtr<IGraphBuilder> m_pGB; // GraphBuilder
CTextureRenderer *m_pCTR; // DShow Texture renderer CTextureRenderer *m_pCTR; // DShow Texture renderer
bool m_bLoop; bool m_bLoop;
bool m_bPlaying;
}; };
+1
View File
@@ -64,6 +64,7 @@ public:
virtual void Pause() {} virtual void Pause() {}
virtual void SetPosition( float fSeconds ) {} virtual void SetPosition( float fSeconds ) {}
virtual bool IsAMovie() const { return false; } virtual bool IsAMovie() const { return false; }
virtual bool IsPlaying() const { return false; }
void SetLooping(bool looping=true) { } void SetLooping(bool looping=true) { }
int GetSourceWidth() const {return m_iSourceWidth;} int GetSourceWidth() const {return m_iSourceWidth;}
+1 -1
View File
@@ -435,7 +435,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
m_Grades[p].SetXY( GRADE_X(p), GRADE_Y ); m_Grades[p].SetXY( GRADE_X(p), GRADE_Y );
m_Grades[p].SetZ( -2 ); m_Grades[p].SetZ( -2 );
m_Grades[p].SetZoom( 1.0f ); m_Grades[p].SetZoom( 1.0f );
m_Grades[p].SetEffectGlowing( 8.0f, GRADES_GLOW_COLOR_1, GRADES_GLOW_COLOR_2 ); m_Grades[p].SetEffectGlowing( 5.0f, GRADES_GLOW_COLOR_1, GRADES_GLOW_COLOR_2 );
if( SPIN_GRADES ) if( SPIN_GRADES )
m_Grades[p].SpinAndSettleOn( grade[p] ); m_Grades[p].SpinAndSettleOn( grade[p] );
else else
+13 -13
View File
@@ -88,11 +88,11 @@ void ScreenMachineOptions::ImportOptions()
* impossible, and perhaps it *is* justice that even the CPU fails * impossible, and perhaps it *is* justice that even the CPU fails
* it. :) * it. :)
*/ */
if( PREFSMAN->m_fJudgeWindowSeconds == 0.29f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 0; if( PREFSMAN->m_fJudgeWindowSeconds == 0.27f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 0;
else if( PREFSMAN->m_fJudgeWindowSeconds == 0.26f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 1; else if( PREFSMAN->m_fJudgeWindowSeconds == 0.24f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 1;
else if( PREFSMAN->m_fJudgeWindowSeconds == 0.23f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 2; else if( PREFSMAN->m_fJudgeWindowSeconds == 0.21f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 2;
else if( PREFSMAN->m_fJudgeWindowSeconds == 0.20f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 3; else if( PREFSMAN->m_fJudgeWindowSeconds == 0.18f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 3;
else if( PREFSMAN->m_fJudgeWindowSeconds == 0.17f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 4; else if( PREFSMAN->m_fJudgeWindowSeconds == 0.15f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 4;
else if( PREFSMAN->m_fJudgeWindowSeconds == 0.12f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 5; else if( PREFSMAN->m_fJudgeWindowSeconds == 0.12f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 5;
else if( PREFSMAN->m_fJudgeWindowSeconds == 0.09f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 6; else if( PREFSMAN->m_fJudgeWindowSeconds == 0.09f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 6;
else if( PREFSMAN->m_fJudgeWindowSeconds == 0.06f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 7; else if( PREFSMAN->m_fJudgeWindowSeconds == 0.06f ) m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] = 7;
@@ -120,14 +120,14 @@ void ScreenMachineOptions::ExportOptions()
switch( m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] ) switch( m_iSelectedOption[0][MO_JUDGE_DIFFICULTY] )
{ {
case 0: PREFSMAN->m_fJudgeWindowSeconds = 0.29f; break; case 0: PREFSMAN->m_fJudgeWindowSeconds = 0.27f; break;
case 1: PREFSMAN->m_fJudgeWindowSeconds = 0.26f; break; case 1: PREFSMAN->m_fJudgeWindowSeconds = 0.24f; break;
case 2: PREFSMAN->m_fJudgeWindowSeconds = 0.23f; break; case 2: PREFSMAN->m_fJudgeWindowSeconds = 0.21f; break;
case 3: PREFSMAN->m_fJudgeWindowSeconds = 0.20f; break; case 3: PREFSMAN->m_fJudgeWindowSeconds = 0.18f; break;
case 4: PREFSMAN->m_fJudgeWindowSeconds = 0.17f; break; case 4: PREFSMAN->m_fJudgeWindowSeconds = 0.15f; break;
case 5: PREFSMAN->m_fJudgeWindowSeconds = 0.12f; break; case 5: PREFSMAN->m_fJudgeWindowSeconds = 0.10f; break;
case 6: PREFSMAN->m_fJudgeWindowSeconds = 0.09f; break; case 6: PREFSMAN->m_fJudgeWindowSeconds = 0.07f; break;
case 7: PREFSMAN->m_fJudgeWindowSeconds = 0.06f; break; case 7: PREFSMAN->m_fJudgeWindowSeconds = 0.04f; break;
default: ASSERT(0); default: ASSERT(0);
} }
+1 -1
View File
@@ -74,6 +74,7 @@ const CString CREDIT_LINES[] =
"Bruno Figueiredo", "Bruno Figueiredo",
"Dro Kulix (Peter S. May)", "Dro Kulix (Peter S. May)",
"nmspaz (Jared Roberts)", "nmspaz (Jared Roberts)",
"binarys (Brendan Walker)",
"Mantis (Ben Nordstrom)", "Mantis (Ben Nordstrom)",
"Parasyte (Chris Gomez)", "Parasyte (Chris Gomez)",
"dirkthedaring (Michael Patterson)", "dirkthedaring (Michael Patterson)",
@@ -103,7 +104,6 @@ const CString CREDIT_LINES[] =
"Lagged", "Lagged",
"The Melting Pot", "The Melting Pot",
"DDRJamz Global BBS", "DDRJamz Global BBS",
"Brendan Walker",
"Eric 'WaffleKing' Webster", "Eric 'WaffleKing' Webster",
"Mark 'Foobly' Verrey", "Mark 'Foobly' Verrey",
"Mandarin Blue", "Mandarin Blue",
+1 -1
View File
@@ -272,7 +272,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
if( RandomFloat(0,1)>0.8f ) if( RandomFloat(0,1)>0.8f )
GAMESTATE->m_PlayerOptions[p].m_bDark = true; GAMESTATE->m_PlayerOptions[p].m_bDark = true;
} }
GAMESTATE->m_SongOptions.m_LifeType = (randomf(0,1)>0.7f) ? SongOptions::LIFE_BATTERY : SongOptions::LIFE_BAR; GAMESTATE->m_SongOptions.m_LifeType = (randomf(0,1)>0.8f) ? SongOptions::LIFE_BATTERY : SongOptions::LIFE_BAR;
GAMESTATE->m_SongOptions.m_FailType = SongOptions::FAIL_OFF; GAMESTATE->m_SongOptions.m_FailType = SongOptions::FAIL_OFF;
GAMESTATE->m_bDemonstration = true; GAMESTATE->m_bDemonstration = true;
+1 -1
View File
@@ -197,7 +197,7 @@ void Sprite::DrawPrimitives()
if( m_pTexture == NULL ) if( m_pTexture == NULL )
return; return;
if( m_pTexture->IsAMovie() ) if( m_pTexture->IsAMovie() && m_pTexture->IsPlaying() )
::Sleep( PREFSMAN->m_iMovieDecodeMS ); // let the movie decode a frame ::Sleep( PREFSMAN->m_iMovieDecodeMS ); // let the movie decode a frame