Broke noteskin colors into " Tap.colors" and " Hold.colors"

This commit is contained in:
Chris Danford
2002-08-03 18:40:09 +00:00
parent f1861ba157
commit 4c3c43abcc
19 changed files with 134 additions and 109 deletions
+1 -30
View File
@@ -41,39 +41,10 @@ float ArrowGetXPos( const PlayerNumber pn, int iColNum, float fYOffset )
float fSongBeat = GAMESTATE->m_fSongBeat;
float fPixelOffsetFromCenter = GAMESTATE->GetCurrentStyleDef()->m_ColumnInfo[PLAYER_1][iColNum].fXOffset;
// BUG OR FEATURE??? THIS IS WHERE THE REAL COLUMN PLACEMENT HAPPENS!!!
// GAMEMANAGER SITS AROUND ON ITS ASS DOING NOTHING
//
// As I know very little about this system, and as this is the only place I can think of that I
// can possibly change my arrow placements, Ez2dancer column setups will be here until
// somebody makes some other system. In the meantime, if it works, i'm using it.
// Chris:
// It's working now, so I'm commenting out your placement code below.
/*
if ( GAMESTATE->m_CurGame == GAME_EZ2 )
{
fPixelOffsetFromCenter = fColOffsetFromCenter * ARROW_SIZE / 1.3f;
if ( GAEMSTATE->m_CurStyle == STYLE_EZ2_REAL || GAEMSTATE->m_CurStyle == STYLE_EZ2_REAL_VERSUS ) // real gets MEGA squashed
{
fPixelOffsetFromCenter = fColOffsetFromCenter * ARROW_SIZE / 1.6f;
}
else if ( GAEMSTATE->m_CurStyle == STYLE_EZ2_DOUBLE && GAEMSTATE->m_sMasterPlayerNumber == PLAYER_1)
{
fPixelOffsetFromCenter = (fColOffsetFromCenter + 2.9f) * ARROW_SIZE / 1.3f;
}
else if ( GAEMSTATE->m_CurStyle == STYLE_EZ2_DOUBLE && GAEMSTATE->m_sMasterPlayerNumber == PLAYER_2)
{
fPixelOffsetFromCenter = (fColOffsetFromCenter - 3.1f) * ARROW_SIZE / 1.3f;
}
}
*/
switch( GAMESTATE->m_PlayerOptions[pn].m_EffectType )
{
case PlayerOptions::EFFECT_DRUNK:
fPixelOffsetFromCenter += cosf( TIMER->GetTimeSinceStart()*2 + iColNum*0.4f + fYOffset/SCREEN_HEIGHT*4) * ARROW_SIZE/3;
fPixelOffsetFromCenter += cosf( TIMER->GetTimeSinceStart() + iColNum*0.2f + fYOffset*6/SCREEN_HEIGHT) * ARROW_SIZE*0.5f;
break;
}
return fPixelOffsetFromCenter;
+5 -5
View File
@@ -67,7 +67,7 @@ Font* FontManager::LoadFont( CString sFontFilePath )
if( m_mapPathToFont.Lookup( sFontFilePath, pFont ) ) // if the texture already exists in the map
{
LOG->Trace( ssprintf("FontManager: The Font '%s' now has %d references.", sFontFilePath, pFont->m_iRefCount) );
// LOG->Trace( ssprintf("FontManager: The Font '%s' now has %d references.", sFontFilePath, pFont->m_iRefCount) );
pFont->m_iRefCount++;
}
else // the texture is not already loaded
@@ -77,7 +77,7 @@ Font* FontManager::LoadFont( CString sFontFilePath )
pFont = (Font*) new Font( sFontFilePath );
LOG->Trace( "FontManager: Loading '%s' from disk.", sFontFilePath);
// LOG->Trace( "FontManager: Loading '%s' from disk.", sFontFilePath);
m_mapPathToFont.SetAt( sFontFilePath, pFont );
}
@@ -106,7 +106,7 @@ void FontManager::UnloadFont( CString sFontFilePath )
if( sFontFilePath == "" )
{
LOG->Trace( "FontManager::UnloadTexture(): tried to Unload a blank" );
// LOG->Trace( "FontManager::UnloadTexture(): tried to Unload a blank" );
return;
}
@@ -117,13 +117,13 @@ void FontManager::UnloadFont( CString sFontFilePath )
pFont->m_iRefCount--;
if( pFont->m_iRefCount == 0 ) // there are no more references to this texture
{
LOG->Trace( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath, pFont->m_iRefCount );
// LOG->Trace( "FontManager: '%s' will be deleted. It has %d references.", sFontFilePath, pFont->m_iRefCount );
SAFE_DELETE( pFont ); // free the texture
m_mapPathToFont.RemoveKey( sFontFilePath ); // and remove the key in the map
}
else
{
LOG->Trace( ssprintf("FontManager: '%s' will not be deleted. It still has %d references.", sFontFilePath, pFont->m_iRefCount) );
// LOG->Trace( ssprintf("FontManager: '%s' will not be deleted. It still has %d references.", sFontFilePath, pFont->m_iRefCount) );
}
}
+43 -7
View File
@@ -60,27 +60,63 @@ CString GameDef::GetPathToGraphic( const CString sSkinName, const CString sButto
return "";
}
void GameDef::GetTweenColors( const CString sSkinName, const CString sButtonName, CArray<D3DXCOLOR,D3DXCOLOR> &arrayTweenColors )
void GameDef::GetTapTweenColors( const CString sSkinName, const CString sButtonName, CArray<D3DXCOLOR,D3DXCOLOR> &aTapColorsOut )
{
const CString sSkinDir = ssprintf("Skins\\%s\\%s\\", m_szName, sSkinName);
const CString sColorsFilePath = sSkinDir + sButtonName + ".colors";
const CString sColorsFilePath = sSkinDir + sButtonName + " Tap.colors";
FILE* file = fopen( sColorsFilePath, "r" );
ASSERT( file != NULL );
if( file == NULL )
FILE* fp = fopen( sColorsFilePath, "r" );
ASSERT( fp != NULL );
if( fp == NULL )
{
ASSERT(0);
aTapColorsOut.Add( D3DXCOLOR(1,1,1,1) );
LOG->Warn( "Couldn't open .colors file '%s'", sColorsFilePath );
return;
}
bool bSuccess;
do
{
D3DXCOLOR color;
int retval = fscanf( file, "%f,%f,%f,%f\n", &color.r, &color.g, &color.b, &color.a );
int retval = fscanf( fp, "%f,%f,%f,%f\n", &color.r, &color.g, &color.b, &color.a );
bSuccess = retval == 4;
if( bSuccess )
arrayTweenColors.Add( color );
aTapColorsOut.Add( color );
} while( bSuccess );
fclose( fp );
return;
}
void GameDef::GetHoldTweenColors( const CString sSkinName, const CString sButtonName, CArray<D3DXCOLOR,D3DXCOLOR> &aHoldColorsOut )
{
const CString sSkinDir = ssprintf("Skins\\%s\\%s\\", m_szName, sSkinName);
const CString sColorsFilePath = sSkinDir + sButtonName + " Hold.colors";
FILE* fp = fopen( sColorsFilePath, "r" );
ASSERT( fp != NULL );
if( fp == NULL )
{
ASSERT(0);
aHoldColorsOut.Add( D3DXCOLOR(1,1,1,1) );
LOG->Warn( "Couldn't open .colors file '%s'", sColorsFilePath );
return;
}
bool bSuccess;
do
{
D3DXCOLOR color;
int retval = fscanf( fp, "%f,%f,%f,%f\n", &color.r, &color.g, &color.b, &color.a );
bSuccess = retval == 4;
if( bSuccess )
aHoldColorsOut.Add( color );
} while( bSuccess );
fclose( fp );
return;
}
+2 -1
View File
@@ -83,6 +83,7 @@ public:
void AssertSkinIsComplete( CString sSkin );
CString GetPathToGraphic( const CString sSkinName, const CString sButtonName, const SkinElement gbg );
void GetTweenColors( const CString sSkinName, const CString sButtonName, CArray<D3DXCOLOR,D3DXCOLOR> &arrayTweenColors );
void GetTapTweenColors( const CString sSkinName, const CString sButtonName, CArray<D3DXCOLOR,D3DXCOLOR> &aTapTweenColorsAddTo );
void GetHoldTweenColors( const CString sSkinName, const CString sButtonName, CArray<D3DXCOLOR,D3DXCOLOR> &aHoldTweenColorsAddTo );
CString ElementToGraphicSuffix( const SkinElement gbg );
};
+15 -12
View File
@@ -802,16 +802,6 @@ void GameManager::SwitchNoteSkin( CString sNewNoteSkin )
m_sCurNoteSkin = sNewNoteSkin;
}
CString GameManager::GetPathTo( Game g, CString sSkinName, CString sButtonName, const SkinElement gbg )
{
return GetGameDefForGame(g)->GetPathToGraphic( sSkinName, sButtonName, gbg );
}
void GameManager::GetTweenColors( Game g, CString sSkinName, CString sButtonName, CArray<D3DXCOLOR,D3DXCOLOR> &aTweenColorsAddTo )
{
GetGameDefForGame(g)->GetTweenColors( sSkinName, sButtonName, aTweenColorsAddTo );
}
CString GameManager::GetPathTo( const int col, const SkinElement gbg ) // looks in GAMESTATE for the current Style
{
StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
@@ -823,7 +813,7 @@ CString GameManager::GetPathTo( const int col, const SkinElement gbg ) // looks
return pGameDef->GetPathToGraphic( m_sCurNoteSkin, sButtonName, gbg );
}
void GameManager::GetTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR> &aTweenColorsAddTo ) // looks in GAMESTATE for the current Style
void GameManager::GetTapTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR> &aTapTweenColorsAddTo ) // looks in GAMESTATE for the current Style
{
ASSERT( m_sCurNoteSkin != "" ); // if this == NULL, SwitchGame() was never called
@@ -833,5 +823,18 @@ void GameManager::GetTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR> &aT
StyleInput SI( PLAYER_1, col );
GameInput GI = pStyleDef->StyleInputToGameInput( SI );
CString sButtonName = pGameDef->m_szButtonNames[GI.button];
pGameDef->GetTweenColors( m_sCurNoteSkin, sButtonName, aTweenColorsAddTo );
pGameDef->GetTapTweenColors( m_sCurNoteSkin, sButtonName, aTapTweenColorsAddTo );
}
void GameManager::GetHoldTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR> &aHoldTweenColorsAddTo ) // looks in GAMESTATE for the current Style
{
ASSERT( m_sCurNoteSkin != "" ); // if this == NULL, SwitchGame() was never called
StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
GameDef* pGameDef = GAMESTATE->GetCurrentGameDef();
StyleInput SI( PLAYER_1, col );
GameInput GI = pStyleDef->StyleInputToGameInput( SI );
CString sButtonName = pGameDef->m_szButtonNames[GI.button];
pGameDef->GetHoldTweenColors( m_sCurNoteSkin, sButtonName, aHoldTweenColorsAddTo );
}
+2 -4
View File
@@ -33,13 +33,11 @@ public:
CString GetCurNoteSkin() { return m_sCurNoteSkin; };
CString GetPathTo( const int col, const SkinElement gbg ); // looks in GAMESTATE for the current Style
void GetTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR> &aTweenColorsAddTo ); // looks in GAMESTATE for the current Style
void GetTapTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR> &aTapTweenColorsAddTo ); // looks in GAMESTATE for the current Style
void GetHoldTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR> &aHoldTweenColorsAddTo ); // looks in GAMESTATE for the current Style
protected:
CString GetPathTo( Game g, CString sSkinName, CString sButtonName, const SkinElement gbg );
void GetTweenColors( Game g, CString sSkinName, CString sButtonName, CArray<D3DXCOLOR,D3DXCOLOR> &aTweenColorsAddTo );
CString m_sCurNoteSkin;
};
+3 -1
View File
@@ -42,10 +42,12 @@ bool MsdFile::ReadFile( CString sNewPath )
NULL // handle to file with attributes to
);
int iBufferSize = GetFileSize( hFile, NULL ) + 1;
int iBufferSize = GetFileSize( hFile, NULL ) + 1000; // +1000 just in case
CloseHandle( hFile );
// allocate a string to hold the file
if( m_szFileString )
delete m_szFileString;
m_szFileString = new char[iBufferSize];
FILE* fp = fopen(sNewPath, "r");
+21 -21
View File
@@ -62,9 +62,6 @@ void NoteField::Load( NoteData* pNoteData, PlayerNumber pn, int iPixelsToDrawBeh
// init arrow rotations and X positions
for( int c=0; c<m_iNumTracks; c++ )
{
CArray<D3DXCOLOR,D3DXCOLOR> arrayTweenColors;
GAMEMAN->GetTweenColors( c, arrayTweenColors );
m_ColorNote[c].Load( c, pn );
}
@@ -87,7 +84,7 @@ void NoteField::Update( float fDeltaTime )
void NoteField::CreateTapNoteInstance( ColorNoteInstance &cni, const int iCol, const float fIndex, const D3DXCOLOR color )
void NoteField::CreateTapNoteInstance( ColorNoteInstance &cni, const int iCol, const float fIndex, const bool bUseHoldNoteBeginColor )
{
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fIndex );
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
@@ -99,17 +96,19 @@ void NoteField::CreateTapNoteInstance( ColorNoteInstance &cni, const int iCol, c
fAlpha = 1-m_fPercentFadeToFail;
D3DXCOLOR colorLeading, colorTrailing; // of the color part. Alpha here be overwritten with fAlpha!
if( color.a == -1 ) // indicated "NULL"
m_ColorNote[iCol].GetEdgeColorsFromIndexAndBeat( roundf(fIndex), colorLeading, colorTrailing );
if( bUseHoldNoteBeginColor )
colorLeading = colorTrailing = m_ColorNote[iCol].GetHoldColorFromPercentIntoHold( 0 );
else
colorLeading = colorTrailing = color;
m_ColorNote[iCol].GetEdgeColorsFromIndexAndBeat( roundf(fIndex), colorLeading, colorTrailing );
float fAddAlpha = m_ColorNote[iCol].GetAddAlphaFromDiffuseAlpha( fAlpha );
int iGrayPartFrameNo = m_ColorNote[iCol].GetGrayPartFrameNoFromIndexAndBeat( roundf(fIndex), GAMESTATE->m_fSongBeat );
int iColorPartFrameNo = m_ColorNote[iCol].GetColorPartFrameNoFromIndexAndBeat( roundf(fIndex), GAMESTATE->m_fSongBeat );
int iGrayPartFrameNo = m_ColorNote[iCol].GetGrayPartFrameNoFromIndexAndBeat( roundf(fIndex), GAMESTATE->m_fSongBeat );
if( iCol == 2 )
printf( "iColorPartFrameNo = %d\n", iColorPartFrameNo );
ColorNoteInstance instance = { fXPos, fYPos, fRotation, fAlpha, colorLeading, colorTrailing, fAddAlpha, iGrayPartFrameNo };
cni = instance;
cni = ColorNoteInstance( fXPos, fYPos, fRotation, fAlpha, colorLeading, colorTrailing, fAddAlpha, iColorPartFrameNo, iGrayPartFrameNo );
}
void NoteField::CreateHoldNoteInstance( ColorNoteInstance &cni, const bool bActive, const float fIndex, const HoldNote &hn, const float fHoldNoteLife )
@@ -126,21 +125,24 @@ void NoteField::CreateHoldNoteInstance( ColorNoteInstance &cni, const bool bActi
fAlpha = 1-m_fPercentFadeToFail;
int iGrayPartFrameNo;
int iColorPartFrameNo;
if( bActive )
iGrayPartFrameNo = m_ColorNote[iCol].GetGrayPartFrameNoFull();
{
iGrayPartFrameNo = m_ColorNote[iCol].GetGrayPartFrameNoFull();
iColorPartFrameNo = m_ColorNote[iCol].GetColorPartFrameNoFull();
}
else
iGrayPartFrameNo = m_ColorNote[iCol].GetGrayPartFrameNoClear();
{
iGrayPartFrameNo = m_ColorNote[iCol].GetGrayPartFrameNoClear();
iColorPartFrameNo = m_ColorNote[iCol].GetColorPartFrameNoClear();
}
const float fPercentIntoHold = (fIndex-hn.m_iStartIndex)/(hn.m_iEndIndex-hn.m_iStartIndex);
D3DXCOLOR colorLeading( fPercentIntoHold, 1, 0, 1 ); // color shifts from green to yellow
colorLeading *= fHoldNoteLife;
colorLeading.a = 1;
D3DXCOLOR colorTrailing = colorLeading;
D3DXCOLOR color = m_ColorNote[iCol].GetHoldColorFromPercentIntoHold( fPercentIntoHold );
float fAddAlpha = m_ColorNote[iCol].GetAddAlphaFromDiffuseAlpha( fAlpha );
ColorNoteInstance instance = { fXPos, fYPos, fRotation, fAlpha, colorLeading, colorTrailing, fAddAlpha, iGrayPartFrameNo };
cni = instance;
cni = ColorNoteInstance( fXPos, fYPos, fRotation, fAlpha, color, color, fAddAlpha, iColorPartFrameNo, iGrayPartFrameNo );
}
void NoteField::DrawMeasureBar( const int iIndex, const int iMeasureNo )
@@ -202,8 +204,6 @@ void NoteField::DrawPrimitives()
//LOG->Trace( "NoteField::DrawPrimitives()" );
float fSongBeat = max( 0, GAMESTATE->m_fSongBeat );
int iBaseFrameNo = (int)(fSongBeat*2.5) % NUM_FRAMES_IN_COLOR_ARROW_SPRITE; // 2.5 is a "fudge number" :-) This should be based on BPM
const float fBeatsToDrawBehind = m_iPixelsToDrawBehind * (1/(float)ARROW_SIZE) * (1/GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_fArrowScrollSpeed);
const float fBeatsToDrawAhead = m_iPixelsToDrawAhead * (1/(float)ARROW_SIZE) * (1/GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_fArrowScrollSpeed);
@@ -359,7 +359,7 @@ void NoteField::DrawPrimitives()
color.r *= fHoldLife;
color.g *= fHoldLife;
color.b *= fHoldLife;
CreateTapNoteInstance( instances[iCount++], c, (float)i, color );
CreateTapNoteInstance( instances[iCount++], c, (float)i, true );
}
else
CreateTapNoteInstance( instances[iCount++], c, (float)i );
+1 -1
View File
@@ -41,7 +41,7 @@ public:
void FadeToFail();
protected:
inline void CreateTapNoteInstance( ColorNoteInstance &cni, const int iCol, const float fIndex, const D3DXCOLOR color = D3DXCOLOR(-1,-1,-1,-1) );
inline void CreateTapNoteInstance( ColorNoteInstance &cni, const int iCol, const float fIndex, const bool bUseHoldNoteBeginColor = false );
inline void CreateHoldNoteInstance( ColorNoteInstance &cni, const bool bActive, const float fIndex, const HoldNote &hn, const float fHoldNoteLife );
inline void DrawMeasureBar( const int iIndex, const int iMeasureNo );
inline void DrawMarkerBar( const int iIndex );
+1 -1
View File
@@ -166,7 +166,7 @@ void Player::Update( float fDeltaTime )
// update the life
if( fStartBeat < fSongBeat && fSongBeat < fEndBeat ) // if the song beat is in the range of this hold
{
const bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI ) || PREFSMAN->m_bAutoPlay;
const bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI ) || PREFSMAN->m_bAutoPlay || GAMESTATE->m_bDemonstration;
// if they got a bad score or haven't stepped on the corresponding tap yet
const bool bSteppedOnTapNote = m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] != TNS_NONE &&
m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] != TNS_MISS;
+1 -1
View File
@@ -66,7 +66,7 @@ CString PlayerOptions::GetString()
switch( m_ColorType )
{
case COLOR_ARCADE: break;
case COLOR_VIVID: break;
case COLOR_NOTE: sReturn += "Note, "; break;
case COLOR_FLAT: sReturn += "Flat, "; break;
case COLOR_PLAIN: sReturn += "Plain, "; break;
+2 -2
View File
@@ -21,7 +21,7 @@ struct PlayerOptions
TurnType m_TurnType;
bool m_bLittle;
bool m_bReverseScroll;
enum ColorType { COLOR_ARCADE=0, COLOR_NOTE, COLOR_FLAT, COLOR_PLAIN, NUM_COLOR_TYPES };
enum ColorType { COLOR_VIVID=0, COLOR_NOTE, COLOR_FLAT, COLOR_PLAIN, NUM_COLOR_TYPES };
ColorType m_ColorType;
bool m_bHoldNotes;
bool m_bDark;
@@ -35,7 +35,7 @@ struct PlayerOptions
m_TurnType = TURN_NONE;
m_bLittle = false;
m_bReverseScroll = false;
m_ColorType = COLOR_ARCADE;
m_ColorType = COLOR_VIVID;
m_bHoldNotes = true;
m_bDark = false;
};
+5 -5
View File
@@ -76,7 +76,7 @@ RageTexture* RageTextureManager::LoadTexture( CString sTexturePath, bool bForceR
if( bForceReload )
pTexture->Reload( m_iMaxTextureSize, m_iTextureColorDepth, iMipMaps, iAlphaBits, bDither, bStretch );
LOG->Trace( "RageTextureManager: '%s' now has %d references.", sTexturePath, pTexture->m_iRefCount );
// LOG->Trace( "RageTextureManager: '%s' now has %d references.", sTexturePath, pTexture->m_iRefCount );
}
else // the texture is not already loaded
{
@@ -89,13 +89,13 @@ RageTexture* RageTextureManager::LoadTexture( CString sTexturePath, bool bForceR
pTexture = (RageTexture*) new RageBitmapTexture( m_pScreen, sTexturePath, m_iMaxTextureSize, m_iTextureColorDepth, iMipMaps, iAlphaBits, bDither, bStretch );
LOG->Trace( "RageTextureManager: Finished loading '%s' - %d references.", sTexturePath, pTexture->m_iRefCount );
LOG->Trace( "RageTextureManager: Finished loading '%s'.", sTexturePath );
m_mapPathToTexture.SetAt( sTexturePath, pTexture );
}
LOG->Trace( "Display: %.2f KB video memory left", DISPLAY->GetDevice()->GetAvailableTextureMem()/1000000.0f );
// LOG->Trace( "Display: %.2f KB video memory left", DISPLAY->GetDevice()->GetAvailableTextureMem()/1000000.0f );
return pTexture;
}
@@ -132,13 +132,13 @@ void RageTextureManager::UnloadTexture( CString sTexturePath )
pTexture->m_iRefCount--;
if( pTexture->m_iRefCount == 0 ) // there are no more references to this texture
{
LOG->Trace( "RageTextureManager: '%s' will be deleted. It has %d references.", sTexturePath, pTexture->m_iRefCount );
// LOG->Trace( "RageTextureManager: '%s' will be deleted. It has %d references.", sTexturePath, pTexture->m_iRefCount );
SAFE_DELETE( pTexture ); // free the texture
m_mapPathToTexture.RemoveKey( sTexturePath ); // and remove the key in the map
}
else
{
LOG->Trace( "RageTextureManager: '%s' will not be deleted. It still has %d references.", sTexturePath, pTexture->m_iRefCount );
// LOG->Trace( "RageTextureManager: '%s' will not be deleted. It still has %d references.", sTexturePath, pTexture->m_iRefCount );
}
}
else // texture not found
+1 -1
View File
@@ -932,7 +932,7 @@ void ScreenEdit::TransitionToEditFromRecord()
// delete old TapNotes in the range
m_NoteFieldEdit.ClearRange( iNoteIndexBegin, iNoteIndexEnd );
m_NoteFieldEdit.CopyRange( (NoteData*)&m_NoteFieldRecord, iNoteIndexBegin, iNoteIndexEnd );
m_NoteFieldEdit.CopyRange( (NoteData*)&m_NoteFieldRecord, iNoteIndexBegin, iNoteIndexEnd, iNoteIndexBegin );
GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_GranularityIndicator.GetSnapMode()) );
}
+2 -1
View File
@@ -769,10 +769,11 @@ void ScreenGameplay::Update( float fDeltaTime )
// fPositionSeconds ahead
if( GAMESTATE->m_SongOptions.m_AssistType == SongOptions::ASSIST_TICK )
{
fPositionSeconds += (SOUND->GetPlayLatency()+0.04f) * m_soundMusic.GetPlaybackRate(); // HACK: Add 0.04 seconds to make them play a tiny bit earlier
fPositionSeconds += (SOUND->GetPlayLatency()+0.01f) * m_soundMusic.GetPlaybackRate(); // HACK: Add 0.02 seconds to account for the fact that the sound file has 0.01 seconds of silence at the beginning
GAMESTATE->m_pCurSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS, bFreeze );
int iRowNow = BeatToNoteRowNotRounded( fSongBeat );
iRowNow = max( 0, iRowNow );
static int iRowLastCrossed = 0;
bool bAnyoneHasANote = false; // set this to true if any player has a note at one of the indicies we crossed
+1 -1
View File
@@ -45,7 +45,7 @@ OptionLineData g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = {
{ "Turn", 5, {"OFF","MIRROR","LEFT","RIGHT","SHUFFLE"} },
{ "Little", 2, {"OFF","ON"} },
{ "Scroll", 2, {"STANDARD","REVERSE"} },
{ "Color", 4, {"ARCADE","NOTE","FLAT","PLAIN"} },
{ "Color", 4, {"VIVID","NOTE","FLAT","PLAIN"} },
{ "Holds", 2, {"OFF","ON"} },
{ "Dark", 2, {"OFF","ON"} },
};
+23 -10
View File
@@ -69,7 +69,7 @@ const ScreenMessage SM_FadeToDemonstration = ScreenMessage(SM_User+13);
const ScreenMessage SM_GoToDemonstration = ScreenMessage(SM_User+14);
const float SECONDS_BEFORE_DEMONSTRATION = 5;
const float SECONDS_BEFORE_DEMONSTRATION = 30;
ScreenTitleMenu::ScreenTitleMenu()
@@ -238,6 +238,9 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
{
case SM_PlayAttract:
m_soundAttract.PlayRandom();
break;
case SM_DoneOpening:
break;
case SM_GoToCaution:
@@ -277,13 +280,17 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE;
if( SONGMAN->m_pSongs.GetSize() == 0 )
goto abort_demonstration;
// choose a Song and Notes
Song* pSongToPlay = NULL;
Notes* pNotesToPlay = NULL;
for( int i=0; i<100; i++ ) // try 100 times
Song* pSongToPlay;
Notes* pNotesToPlay;
int i;
for( i=0; i<600; i++ ) // try 600 times
{
Song* pSong = SONGMAN->m_pSongs[ rand()%SONGMAN->m_pSongs.GetSize() ];
for( int j=0; j<10; j++ ) // try 10 times
for( int j=0; j<3; j++ ) // try 3 times
{
Notes* pNotes = pSong->m_apNotes[ rand()%pSong->m_apNotes.GetSize() ];
if( pNotes->m_NotesType == GAMESTATE->GetCurrentStyleDef()->m_NotesType )
@@ -295,6 +302,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
}
}
}
abort_demonstration:
// Couldn't find Song/Notes to play. Abort demonstration!
GAMESTATE->Reset();
return;
@@ -311,12 +319,17 @@ found_song_and_notes:
{
if( GAMESTATE->IsPlayerEnabled(p) )
{
GAMESTATE->m_PlayerOptions[p].m_fArrowScrollSpeed = (RandomFloat(0,1)>0.7f ? 1.5f : 1.0f) ;
if( RandomFloat(0,1)>0.8f )
GAMESTATE->m_PlayerOptions[p].m_fArrowScrollSpeed = 1.5f;
GAMESTATE->m_PlayerOptions[p].m_EffectType = PlayerOptions::EffectType(rand()%PlayerOptions::NUM_EFFECT_TYPES);
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::AppearanceType(rand()%(PlayerOptions::NUM_APPEARANCE_TYPES-1)); // don't use blink
GAMESTATE->m_PlayerOptions[p].m_bReverseScroll = RandomFloat(0,1) > 0.8f;
GAMESTATE->m_PlayerOptions[p].m_ColorType = PlayerOptions::ColorType(rand()%PlayerOptions::NUM_COLOR_TYPES);
GAMESTATE->m_PlayerOptions[p].m_bDark = RandomFloat(0,1) > 0.8f;
if( RandomFloat(0,1)>0.9f )
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::APPEARANCE_HIDDEN;
if( RandomFloat(0,1)>0.9f )
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::APPEARANCE_SUDDEN;
if( RandomFloat(0,1)>0.8f )
GAMESTATE->m_PlayerOptions[p].m_bReverseScroll = true;
if( RandomFloat(0,1)>0.9f )
GAMESTATE->m_PlayerOptions[p].m_bDark = true;
}
}
GAMESTATE->m_SongOptions.m_LifeType = SongOptions::LifeType(rand()%SongOptions::NUM_LIFE_TYPES);
+2 -2
View File
@@ -22,7 +22,7 @@
#include "RageException.h"
const int FILE_CACHE_VERSION = 53; // increment this to force a cache reload (useful when the SM file format changes)
const int FILE_CACHE_VERSION = 54; // increment this to force a cache reload (useful when the SM file format changes)
int CompareBPMSegments(const void *arg1, const void *arg2)
@@ -256,7 +256,7 @@ void Song::GetMainAndSubTitlesFromFullTitle( const CString sFullTitle, CString &
CString Song::GetCacheFilePath()
{
return ssprintf( "Cache\\%d", GetHashForString(m_sSongDir) );
return ssprintf( "Cache\\%u", (UINT)GetHashForString(m_sSongDir) );
}
CString Song::GetSongFilePath()
+3 -3
View File
@@ -43,10 +43,10 @@ CString SongOptions::GetString()
if( m_fMusicRate != 1 )
{
CString s = ssprintf( "%2.2fxMusic", m_fMusicRate );
CString s = ssprintf( "%2.2f", m_fMusicRate );
if( s[s.GetLength()-1] == '0' )
s.Delete(s.GetLength());
sReturn += s + ", ";
s.Delete(s.GetLength()-1);
sReturn += s + "xMusic, ";
}
if( sReturn.GetLength() > 2 )