eliminate TransitionOniFade

This commit is contained in:
Chris Danford
2003-04-13 00:44:50 +00:00
parent 1ac4953877
commit 7f40e36919
19 changed files with 145 additions and 315 deletions
+2
View File
@@ -348,7 +348,9 @@ InitCommand=horizalign,left;vertalign,top;shadowlength,2;zoom,0.5;
[ScreenInstructions]
NextScreenArcade=ScreenSelectMusic
NextScreenNonstop=ScreenSelectCourse
NextScreenOni=ScreenSelectCourse
NextScreenEndless=ScreenSelectCourse
NextScreenBattle=ScreenSelectMusic
NextScreenRave=ScreenSelectCharacter
HelpText=Press START to continue
+21 -13
View File
@@ -453,25 +453,33 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer )
IniFile ini(sPathToIni);
ini.ReadFile();
CString sPath;
ini.GetValue( sLayer, "File", sPath );
CString sFile;
ini.GetValue( sLayer, "File", sFile );
bool bUseSongBG = false;
ini.GetValueB( sLayer, "UseSongBG", bUseSongBG );
if( bUseSongBG ) {
/* Don't throw for missing song backgrounds. */
CString sPath = sAniDir+sFile;
if( sFile.CompareNoCase("songbackground")==0 )
{
Song *pSong = GAMESTATE->m_pCurSong;
if(pSong && pSong->HasBackground())
if( pSong && pSong->HasBackground() )
sPath = pSong->GetBackgroundPath();
else
sPath = THEME->GetPathToG("Common fallback background");
} else {
if( sPath == "" )
RageException::Throw( "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.GetString(), sLayer.GetString() );
}
else if( sFile.CompareNoCase("songbanner")==0 )
{
Song *pSong = GAMESTATE->m_pCurSong;
if( pSong && pSong->HasBanner() )
sPath = pSong->GetBannerPath();
else
sPath = THEME->GetPathToG("Common fallback banner");
}
else if( sFile == "" )
{
RageException::Throw( "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.GetString(), sLayer.GetString() );
if( !DoesFileExist(sAniDir+sPath) )
RageException::Throw( "In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.GetString(), sPath.GetString() );
sPath = sAniDir+sPath;
if( !DoesFileExist(sPath) )
RageException::Throw( "In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.GetString(), sFile.GetString() );
}
ini.GetValueI( sLayer, "Type", (int&)m_Type );
+27 -27
View File
@@ -35,22 +35,21 @@ const float FADE_SECONDS = 1.0f;
const CString STATIC_BACKGROUND = "static background";
const int MAX_RANDOM_BACKGROUNDS = 5;
const int MAX_RANDOM_BACKGROUNDS = 4;
const CString RANDOM_BACKGROUND[MAX_RANDOM_BACKGROUNDS] =
{
"__random1",
"__random2",
"__random3",
"__random4",
"__random5"
};
Background::Background()
{
m_iCurBGChange = 0;
m_bInDanger = false;
m_pCurrentBGA = NULL;
m_pFadingBGA = NULL;
m_fSecsLeftInFade = 0;
@@ -83,7 +82,8 @@ void Background::Unload()
m_BGAnimations.clear();
m_aBGChanges.clear();
m_iCurBGChange = 0;
m_pCurrentBGA = NULL;
m_pFadingBGA = NULL;
}
void Background::LoadFromAniDir( CString sAniDir )
@@ -345,36 +345,42 @@ void Background::Update( float fDeltaTime )
if( GAMESTATE->m_fMusicSeconds == GameState::MUSIC_SECONDS_INVALID )
return; /* hasn't been updated yet */
if( m_aBGChanges.size() == 0 )
return;
/* If we're in a freeze, hold all animations (don't animate by calling Update). */
if( GAMESTATE->m_bFreeze )
return;
// Find the BGSegment we're in
unsigned i;
for( i=0; i<m_aBGChanges.size()-1; i++ )
int i;
int size = (int)(m_aBGChanges.size()) - 1;
for( i=0; i<size; i++ )
if( GAMESTATE->m_fSongBeat < m_aBGChanges[i+1].m_fStartBeat )
break;
ASSERT( i >= 0 && i<m_aBGChanges.size() );
if( int(i) > m_iCurBGChange )
BGAnimation* pOld = m_pCurrentBGA;
CString sNewBGName = m_aBGChanges[i].m_sBGName;
BGAnimation* pNew = m_BGAnimations[sNewBGName];
if( pOld != pNew )
{
LOG->Trace( "new bga %d, %d, %f, %f", m_iCurBGChange, i, m_aBGChanges[i].m_fStartBeat, GAMESTATE->m_fSongBeat );
BGAnimation* pOld = GetCurrentBGA();
m_iCurBGChange = i;
BGAnimation* pNew = GetCurrentBGA();
// LOG->Trace( "new bga %d, %d, %f, %f", m_iCurBGChange, i, m_aBGChanges[i].m_fStartBeat, GAMESTATE->m_fSongBeat );
if( pOld != pNew )
{
m_pFadingBGA = pOld;
m_pCurrentBGA = pNew;
if( pOld )
pOld->LosingFocus();
if( pNew )
pNew->GainingFocus();
m_pFadingBGA = pOld;
bool bBGAnimsMode = PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_ANIMATIONS;
m_fSecsLeftInFade = bBGAnimsMode ? 0 : FADE_SECONDS;
}
bool bBGAnimsMode = PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_ANIMATIONS;
m_fSecsLeftInFade = bBGAnimsMode ? 0 : FADE_SECONDS;
}
GetCurrentBGA()->Update( fDeltaTime );
if( m_pCurrentBGA )
m_pCurrentBGA->Update( fDeltaTime );
if( m_pFadingBGA )
{
m_pFadingBGA->Update( fDeltaTime );
@@ -399,7 +405,8 @@ void Background::DrawPrimitives()
}
else
{
GetCurrentBGA()->Draw();
if( m_pCurrentBGA )
m_pCurrentBGA->Draw();
if( m_pFadingBGA )
m_pFadingBGA->Draw();
}
@@ -427,10 +434,3 @@ void Background::FadeOut()
m_quadBGBrightness.SetDiffuse( RageColor(0,0,0,1-0.5f) );
}
BGAnimation* Background::GetCurrentBGA()
{
CString sBGName = m_aBGChanges[m_iCurBGChange].m_sBGName;
ASSERT( m_BGAnimations[ sBGName ] );
return m_BGAnimations[ sBGName ];
}
+1 -4
View File
@@ -22,7 +22,6 @@
class Background : public ActorFrame
{
public:
Background();
~Background();
@@ -46,14 +45,12 @@ protected:
BGAnimation m_BGADanger;
BGAnimation* CreateSongBGA(const Song *pSong, CString sBGName) const;
BGAnimation* CreateRandomBGA() const;
map<CString,BGAnimation*> m_BGAnimations;
vector<BackgroundChange> m_aBGChanges;
int m_iCurBGChange; // starts at 0 and increases to m_aBGSegments.size()-1
BGAnimation* GetCurrentBGA();
BGAnimation* m_pCurrentBGA;
BGAnimation* m_pFadingBGA;
float m_fSecsLeftInFade;
+6 -2
View File
@@ -345,6 +345,8 @@ void Player::Step( int col )
//LOG->Trace( "iIndexStartLookingAt = %d, iNumElementsToExamine = %d", iIndexStartLookingAt, iNumElementsToExamine );
bool bGrayArrowStep = true;
if( iIndexOverlappingNote != -1 )
{
// compute the score for this hit
@@ -384,8 +386,7 @@ void Player::Step( int col )
if( score==TNS_MARVELOUS && !PREFSMAN->m_bMarvelousTiming )
score = TNS_PERFECT;
if( score < TNS_GOOD )
m_GrayArrowRow.Step( col );
bGrayArrowStep = score < TNS_GOOD;
LOG->Trace("Note offset: %f (fSecondsFromPerfect = %f), Score: %i", fNoteOffset, fSecondsFromPerfect, score);
@@ -401,6 +402,9 @@ void Player::Step( int col )
if( IsRowCompletelyJudged(iIndexOverlappingNote) )
OnRowCompletelyJudged( iIndexOverlappingNote );
}
if( bGrayArrowStep )
m_GrayArrowRow.Step( col );
}
void Player::HandleAutosync(float fNoteOffset)
+1 -1
View File
@@ -154,7 +154,7 @@ SDL_Surface *RageBitmapTexture::CreateImg(int &pixfmt)
/* XXX: Wait, we don't want to throw for all images; in particular, we
* want to tolerate corrupt/unknown background images. */
if(img == NULL)
RageException::Throw( "Couldn't load %s: %s", GetFilePath().GetString(), SDL_GetError() );
RageException::Throw( "RageBitmapTexture: Couldn't load %s: %s", GetFilePath().GetString(), SDL_GetError() );
if(m_ActualID.bHotPinkColorKey)
{
+2 -2
View File
@@ -23,13 +23,13 @@ RandomSample::RandomSample()
m_iIndexLastPlayed = -1;
}
RandomSample::~RandomSample()
{
for( unsigned i=0; i<m_pSamples.size(); i++ )
SAFE_DELETE( m_pSamples[i] );
delete m_pSamples[i];
}
bool RandomSample::Load( CString sFilePath, int iMaxToLoad )
{
CString sDir, sFName, sExt;
+1 -1
View File
@@ -17,7 +17,7 @@ class RandomSample
{
public:
RandomSample();
~RandomSample();
virtual ~RandomSample();
bool Load( CString sFilePath, int iMaxToLoad = 1000 /*load all*/ );
void PlayRandom();
+1
View File
@@ -17,6 +17,7 @@
#include "SongManager.h"
#include "StepMania.h"
#include "ScreenAttract.h" // for AttractInput()
#include "ScreenManager.h"
#define SECONDS_TO_SHOW THEME->GetMetricF("ScreenDemonstration","SecondsToShow")
+52 -61
View File
@@ -90,7 +90,7 @@ const ScreenMessage SM_PlayGo = ScreenMessage(SM_User+1);
// received while STATE_DANCING
const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+10);
const ScreenMessage SM_BeginLoadingNextSong = ScreenMessage(SM_User+11);
const ScreenMessage SM_LoadNextSong = ScreenMessage(SM_User+11);
// received while STATE_OUTRO
const ScreenMessage SM_SaveChangedBeforeGoingBack = ScreenMessage(SM_User+20);
@@ -185,6 +185,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay")
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
m_bZeroDeltaOnNextUpdate = false;
@@ -245,8 +246,9 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay")
this->AddChild(&m_TimingAssist);
m_OniFade.SetOpened();
this->AddChild( &m_OniFade );
this->AddChild( &m_NextSongIn );
this->AddChild( &m_NextSongOut );
const bool bExtra = GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2();
@@ -622,12 +624,6 @@ void ScreenGameplay::LoadNextSong()
m_TimingAssist.Reset();
}
/* Set up song-specific graphics. */
m_Background.LoadFromSong( GAMESTATE->m_pCurSong );
m_Background.SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) );
m_Background.BeginTweening( 2 );
m_Background.SetDiffuse( RageColor(1,1,1,1) );
m_textSongTitle.SetText( GAMESTATE->m_pCurSong->m_sMainTitle );
/* XXX: set it to the current BPM, not the range */
@@ -650,17 +646,35 @@ void ScreenGameplay::LoadNextSong()
m_DifficultyIcon[p].SetXY( DIFFICULTY_X(p), DIFFICULTY_Y(p,bExtra,bReverse[p]) );
}
/* Load the Oni transitions */
m_NextSongIn.Load( THEME->GetPathToB("ScreenGameplay next song in") );
// Instead, load this right before it's used
// m_NextSongOut.Load( THEME->GetPathToB("ScreenGameplay next song out") );
/* XXX: We want to put the lyrics out of the way, but it's likely that one
* player is in reverse and the other isn't. What to do? */
m_LyricDisplay.SetXY( LYRICS_X, LYRICS_Y(bExtra,bReverse[GAMESTATE->m_MasterPlayerNumber]) );
m_soundMusic.Load( GAMESTATE->m_pCurSong->GetMusicPath() );
// Load lyrics
// XXX: don't load this here
LyricsLoader LL;
if( GAMESTATE->m_pCurSong->HasLyrics() )
LL.LoadFromLRCFile(GAMESTATE->m_pCurSong->GetLyricsPath(), *GAMESTATE->m_pCurSong);
m_soundMusic.Load( GAMESTATE->m_pCurSong->GetMusicPath() );
/* Set up song-specific graphics. */
m_Background.LoadFromSong( GAMESTATE->m_pCurSong );
m_Background.SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) );
m_Background.BeginTweening( 2 );
m_Background.SetDiffuse( RageColor(1,1,1,1) );
/* m_soundMusic and m_Background take a very long time to load,
* so cap fDelta at 0 so m_NextSongIn will show up on screen.
* -Chris */
m_bZeroDeltaOnNextUpdate = true;
}
float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic)
@@ -813,7 +827,16 @@ void ScreenGameplay::Update( float fDeltaTime )
if(m_soundMusic.IsPlaying())
GAMESTATE->UpdateSongPosition(m_soundMusic.GetPositionSeconds());
Screen::Update( fDeltaTime );
if( m_bZeroDeltaOnNextUpdate )
int sdkjfskdf = 0;
if( m_bZeroDeltaOnNextUpdate )
{
Screen::Update( 0 );
m_bZeroDeltaOnNextUpdate = false;
}
else
Screen::Update( fDeltaTime );
if( GAMESTATE->m_pCurSong == NULL )
return;
@@ -838,7 +861,7 @@ void ScreenGameplay::Update( float fDeltaTime )
// Check for end of song
//
float fSecondsToStop = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fLastBeat ) + 1;
if( GAMESTATE->m_fMusicSeconds > fSecondsToStop && !m_OniFade.IsClosing() )
if( GAMESTATE->m_fMusicSeconds > fSecondsToStop && !m_NextSongOut.IsTransitioning() )
{
GAMESTATE->m_fSongBeat = 0;
this->PostScreenMessage( SM_NotesEnded, 0 );
@@ -1277,7 +1300,19 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
for( p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) && !GAMESTATE->m_CurStageStats.bFailed[p] )
m_pLifeMeter[p]->OnSongEnded(); // give a little life back between stages
m_OniFade.CloseWipingRight( SM_BeginLoadingNextSong );
// HACK: Temporarily set the song pointer to the next song so that
// this m_NextSongOut will show the next song banner
Song* pCurSong = GAMESTATE->m_pCurSong;
int iPlaySongIndex = GAMESTATE->GetCourseSongIndex()+1;
iPlaySongIndex %= m_apSongsQueue.size();
GAMESTATE->m_pCurSong = m_apSongsQueue[iPlaySongIndex];
m_NextSongOut.Load( THEME->GetPathToB("ScreenGameplay next song out") );
GAMESTATE->m_pCurSong = pCurSong;
m_NextSongOut.StartTransitioning( SM_LoadNextSong );
}
else // IsLastSong
{
@@ -1296,26 +1331,24 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
{
m_Extra.StartTransitioning( SM_GoToStateAfterCleared );
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay extra") );
// this->PostScreenMessage( SM_ShowTryExtraStage, 1 );
}
else
{
m_Cleared.StartTransitioning( SM_GoToStateAfterCleared );
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay cleared") );
// this->PostScreenMessage( SM_ShowCleared, 1 );
}
}
}
}
break;
case SM_BeginLoadingNextSong:
case SM_LoadNextSong:
LoadNextSong();
GAMESTATE->m_bPastHereWeGo = true;
/* We're fading in, so don't hit any notes for a few seconds; they'll be
* obscured by the fade. */
StartPlayingSong( 3, 0 );
m_OniFade.OpenWipingRight( SM_None );
StartPlayingSong( m_NextSongIn.GetLengthSeconds()+2, 0 );
m_NextSongIn.StartTransitioning( SM_None );
break;
case SM_PlayToasty:
@@ -1402,48 +1435,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
}
break;
/* // received while STATE_OUTRO
case SM_ShowCleared:
m_sprCleared.BeginTweening(1.0f);
m_sprCleared.SetDiffuse( RageColor(1,1,1,1) );
m_sprCleared.BeginTweening(1.5f); // sleep
m_sprCleared.BeginTweening(0.7f);
m_sprCleared.SetDiffuse( RageColor(1,1,1,0) );
SCREENMAN->PostMessageToTopScreen( SM_GoToStateAfterCleared, 4 );
break;
*/
/* case SM_ShowTryExtraStage:
{
m_soundTryExtraStage.PlayRandom();
// make the background invisible so we don't waste mem bandwidth drawing it
m_Background.BeginTweening( 1 );
m_Background.SetDiffuse( RageColor(1,1,1,0) );
RageColor colorStage = GAMESTATE->GetStageColor();
colorStage.a *= 0.7f;
m_sprTryExtraStage.SetZoom( 4 );
m_sprTryExtraStage.BeginBlurredTweening( 0.8f, TWEEN_DECELERATE );
m_sprTryExtraStage.SetZoom( 0.4f ); // zoom out
m_sprTryExtraStage.SetDiffuse( colorStage ); // and fade in
m_sprTryExtraStage.BeginTweening( 0.2f );
m_sprTryExtraStage.SetZoom( 0.8f ); // bounce
m_sprTryExtraStage.SetDiffuse( colorStage ); // and fade in
m_sprTryExtraStage.BeginTweening( 0.2f );
m_sprTryExtraStage.SetZoom( 1.0f ); // come to rest
m_sprTryExtraStage.SetDiffuse( colorStage ); // and fade in
colorStage.a = 0;
m_sprTryExtraStage.BeginTweening( 2 ); // sleep
m_sprTryExtraStage.BeginTweening( 1 ); // fade out
m_sprTryExtraStage.SetDiffuse( colorStage );
SCREENMAN->PostMessageToTopScreen( SM_GoToStateAfterCleared, 5 );
}
break;
*/
case SM_SaveChangedBeforeGoingBack:
if( m_bChangedOffsetOrBPM )
{
+3 -2
View File
@@ -14,7 +14,6 @@
#include "Screen.h"
#include "Sprite.h"
#include "TransitionBGAnimation.h"
#include "TransitionOniFade.h"
#include "BitmapText.h"
#include "Player.h"
#include "RandomSample.h"
@@ -98,7 +97,8 @@ protected:
Background m_Background;
TransitionOniFade m_OniFade; // shows between songs in a course
TransitionBGAnimation m_NextSongIn; // shows between songs in a course
TransitionBGAnimation m_NextSongOut; // shows between songs in a course
Sprite m_sprLifeFrame;
LifeMeter* m_pLifeMeter[NUM_PLAYERS];
@@ -168,6 +168,7 @@ protected:
RandomSample m_announcer1000Combo;
RandomSample m_announcerComboStopped;
bool m_bZeroDeltaOnNextUpdate;
bool m_bDemonstration;
int m_iRowLastCrossed;
+13 -25
View File
@@ -22,12 +22,18 @@
#include "PrefsManager.h"
#define HELP_TEXT THEME->GetMetric("ScreenInstructions","HelpText")
#define TIMER_SECONDS THEME->GetMetricI("ScreenInstructions","TimerSeconds")
#define NEXT_SCREEN_ARCADE THEME->GetMetric("ScreenInstructions","NextScreenArcade")
#define NEXT_SCREEN_ONI THEME->GetMetric("ScreenInstructions","NextScreenOni")
#define NEXT_SCREEN_BATTLE THEME->GetMetric("ScreenInstructions","NextScreenBattle")
#define NEXT_SCREEN_RAVE THEME->GetMetric("ScreenInstructions","NextScreenRave")
#define HELP_TEXT THEME->GetMetric("ScreenInstructions","HelpText")
#define TIMER_SECONDS THEME->GetMetricI("ScreenInstructions","TimerSeconds")
CString Capitalize( CString s )
{
if( s.GetLength()==0 )
return "";
CString s1 = s.Left(1);
s1.MakeUpper();
CString s2 = s.Right( s.GetLength()-1 );
return s1+s2;
}
#define NEXT_SCREEN( pm ) THEME->GetMetric("ScreenInstructions","NextScreen"+Capitalize(PlayModeToString(pm)) )
ScreenInstructions::ScreenInstructions() : Screen("ScreenInstructions")
@@ -118,25 +124,7 @@ void ScreenInstructions::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
break;
case SM_GoToNextScreen:
switch( GAMESTATE->m_PlayMode )
{
case PLAY_MODE_ARCADE:
SCREENMAN->SetNewScreen( NEXT_SCREEN_ARCADE );
break;
case PLAY_MODE_NONSTOP:
case PLAY_MODE_ONI:
case PLAY_MODE_ENDLESS:
SCREENMAN->SetNewScreen( NEXT_SCREEN_ONI );
break;
case PLAY_MODE_BATTLE:
SCREENMAN->SetNewScreen( NEXT_SCREEN_BATTLE );
break;
case PLAY_MODE_RAVE:
SCREENMAN->SetNewScreen( NEXT_SCREEN_RAVE );
break;
default:
ASSERT(0);
}
SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) );
break;
}
}
+1
View File
@@ -17,6 +17,7 @@
#include "SongManager.h"
#include "StepMania.h"
#include "SDL_utils.h"
#include "ScreenManager.h"
+1 -1
View File
@@ -223,7 +223,7 @@ ScreenNameEntry::ScreenNameEntry() : Screen("ScreenNameEntry")
bAnyStillEntering |= m_bStillEnteringName[p];
if( !bAnyStillEntering )
{
this->PostScreenMessage( SM_GoToNextScreen, 0 );
HandleScreenMessage( SM_GoToNextScreen );
return;
}
}
+2 -10
View File
@@ -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
@@ -950,14 +950,6 @@ SOURCE=.\TransitionBGAnimation.cpp
SOURCE=.\TransitionBGAnimation.h
# End Source File
# Begin Source File
SOURCE=.\TransitionOniFade.cpp
# End Source File
# Begin Source File
SOURCE=.\TransitionOniFade.h
# End Source File
# End Group
# Begin Group "Actors"
-6
View File
@@ -1023,12 +1023,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File
RelativePath="TransitionBGAnimation.h">
</File>
<File
RelativePath="TransitionOniFade.cpp">
</File>
<File
RelativePath="TransitionOniFade.h">
</File>
</Filter>
<Filter
Name="Actors used in Menus"
+10 -3
View File
@@ -18,7 +18,7 @@
TransitionBGAnimation::TransitionBGAnimation()
{
m_State = waiting,
m_State = waiting;
m_fSecsIntoTransition = 0.0f;
}
@@ -29,6 +29,9 @@ void TransitionBGAnimation::Load( CString sBGAniDir )
m_BGAnimation.LoadFromAniDir( sBGAniDir );
m_State = waiting;
m_fSecsIntoTransition = 0.0f;
// load sound from file specified by ini, or use the first sound in the directory
IniFile ini;
ini.SetPath( sBGAniDir+"BGAnimation.ini" );
@@ -62,8 +65,12 @@ void TransitionBGAnimation::Update( float fDeltaTime )
void TransitionBGAnimation::DrawPrimitives()
{
// if( m_State == transitioning )
m_BGAnimation.Draw();
// Unless we're transitioning, don't draw because we'll waste resources drawing things
// that aren't visible. -Chris
if( m_State != transitioning )
return;
m_BGAnimation.Draw();
}
void TransitionBGAnimation::StartTransitioning( ScreenMessage send_when_done )
-110
View File
@@ -1,110 +0,0 @@
#include "global.h"
/*
-----------------------------------------------------------------------------
Class: TransitionOniFade
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "RageUtil.h"
#include "TransitionOniFade.h"
#include "GameConstantsAndTypes.h"
#include "PrefsManager.h"
#include "GameState.h"
#include "ThemeManager.h"
#define BANNER_WIDTH THEME->GetMetricF("TransitionOniFade","BannerWidth")
#define BANNER_HEIGHT THEME->GetMetricF("TransitionOniFade","BannerHeight")
TransitionOniFade::TransitionOniFade()
{
SetDiffuse( RageColor(1,1,1,1) ); // white
m_quadBackground.StretchTo( RectI(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) );
m_quadStrip.StretchTo( RectI(SCREEN_LEFT, int(CENTER_Y-30), SCREEN_RIGHT, int(CENTER_Y+30)) );
m_textSongInfo.LoadFromFont( THEME->GetPathToF("Common normal") );
m_textSongInfo.EnableShadow( false );
m_textSongInfo.SetZoom( 0.5f );
m_textSongInfo.SetXY( CENTER_X, CENTER_Y );
m_Banner.SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
m_Banner.SetXY( CENTER_X, CENTER_Y );
}
TransitionOniFade::~TransitionOniFade()
{
}
void TransitionOniFade::DrawPrimitives()
{
if( m_TransitionState == opened )
return;
if( m_TransitionState == closed )
{
UpdateSongText();
}
m_quadBackground.SetDiffuse( RageColor(1,1,1,SCALE(GetPercentageClosed(),0,1,-1,1)) );
m_quadBackground.Draw();
if( m_TransitionState == closed || m_TransitionState == opening_right )
{
m_quadStrip.SetDiffuse( RageColor(0,0,0,SCALE(GetPercentageClosed(),0,1,0,2)) );
// m_quadStrip.Draw();
m_textSongInfo.SetDiffuse( RageColor(1,1,1,SCALE(GetPercentageClosed(),0,1,0,2)) );
// m_textSongInfo.Draw();
m_Banner.SetDiffuse( RageColor(1,1,1,SCALE(GetPercentageClosed(),0,1,0,2)) );
m_Banner.Draw();
}
}
void TransitionOniFade::OpenWipingRight( ScreenMessage send_when_done )
{
SetTransitionTime( 2.5f );
Transition::OpenWipingRight( send_when_done );
UpdateSongText();
}
void TransitionOniFade::OpenWipingLeft( ScreenMessage send_when_done )
{
SetTransitionTime( 2.5f );
Transition::OpenWipingLeft( send_when_done );
UpdateSongText();
}
void TransitionOniFade::CloseWipingRight(ScreenMessage send_when_done )
{
SetTransitionTime( 1 );
Transition::CloseWipingRight( send_when_done );
UpdateSongText();
}
void TransitionOniFade::CloseWipingLeft( ScreenMessage send_when_done )
{
SetTransitionTime( 1 );
Transition::CloseWipingLeft( send_when_done );
UpdateSongText();
}
void TransitionOniFade::UpdateSongText()
{
Song* pSong = GAMESTATE->m_pCurSong;
ASSERT( pSong );
m_textSongInfo.SetText( pSong->GetFullDisplayTitle() + "\n" + pSong->GetDisplayArtist(),
pSong->GetFullTranslitTitle() + "\n" + pSong->GetTranslitArtist() );
m_Banner.LoadFromSong( pSong );
}
-46
View File
@@ -1,46 +0,0 @@
#ifndef TRANSITIONONIFADE_H
#define TRANSITIONONIFADE_H
/*
-----------------------------------------------------------------------------
Class: TransitionOniFade
Desc: Fade to white and shows song title and artist info.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Transition.h"
#include "Quad.h"
#include "Banner.h"
#include "BitmapText.h"
class TransitionOniFade : public Transition
{
public:
TransitionOniFade();
~TransitionOniFade();
virtual void DrawPrimitives();
virtual void OpenWipingRight( ScreenMessage send_when_done = SM_None );
virtual void OpenWipingLeft( ScreenMessage send_when_done = SM_None );
virtual void CloseWipingRight(ScreenMessage send_when_done = SM_None );
virtual void CloseWipingLeft( ScreenMessage send_when_done = SM_None );
protected:
void UpdateSongText();
Quad m_quadBackground;
Quad m_quadStrip; // background for song text
BitmapText m_textSongInfo;
Banner m_Banner;
};
#endif