fixed some ScreenGameplay transition glitches

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