diff --git a/stepmania/src/Notes.cpp b/stepmania/src/Notes.cpp index 7cf17524c5..d9ea4afcac 100644 --- a/stepmania/src/Notes.cpp +++ b/stepmania/src/Notes.cpp @@ -66,7 +66,7 @@ void Notes::WriteSMNotesTag( FILE* fp ) CStringArray asRadarValues; for( int r=0; rIsButtonDown( GameI ) || PREFSMAN->m_bAutoPlay || GAMESTATE->m_bDemonstration; + bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI ); + if( !GAMESTATE->m_bEditing && (PREFSMAN->m_bAutoPlay || GAMESTATE->m_bDemonstration) ) + bIsHoldingButton = true; m_NoteField.m_bIsHoldingHoldNote[i] = bIsHoldingButton && bSteppedOnTapNote; // set host flag so NoteField can do intelligent drawing diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index bb1651bc75..7b04d204a7 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -125,32 +125,19 @@ void RageBitmapTexture::Create( // Figure out which texture format to use /////////////////////// D3DFORMAT fmtTexture; - switch( dwTextureColorDepth ) + if( dwTextureColorDepth == 32 ) + fmtTexture = D3DFMT_A8R8G8B8; + else if( ddii.Format == D3DFMT_P8 ) + fmtTexture = D3DFMT_A1R5G5B5; + else // dwTextureColorDepth == 16 { - case 16: switch( iAlphaBits ) { - case 0: fmtTexture = D3DFMT_R5G6B5; break; - case 1: fmtTexture = D3DFMT_A1R5G5B5; break; - case 4: - // Ignore dwTextureColorDepth, and infer based on image format - switch( ddii.Format ) - { - case D3DFMT_P8: fmtTexture = D3DFMT_A1R5G5B5; break; - default: fmtTexture = D3DFMT_A4R4G4B4; break; - } - break; - default: - ASSERT(0); // invalid iAlphaBits value - fmtTexture = D3DFMT_A4R4G4B4; break; + case 0: fmtTexture = D3DFMT_R5G6B5; break; + case 1: fmtTexture = D3DFMT_A1R5G5B5; break; + case 4: fmtTexture = D3DFMT_A4R4G4B4; break; + default: ASSERT(0); fmtTexture = D3DFMT_A4R4G4B4; break; } - - break; - case 32: - fmtTexture = D3DFMT_A8R8G8B8; - break; - default: - throw RageException( "Invalid color depth: %d bits", dwTextureColorDepth ); } @@ -166,12 +153,12 @@ void RageBitmapTexture::Create( if( FAILED( hr = D3DXCreateTextureFromFileEx( m_pd3dDevice, // device m_sFilePath, // soure file - bStretch ? dwMaxSize : D3DX_DEFAULT, // width - bStretch ? dwMaxSize : D3DX_DEFAULT, // height + D3DX_DEFAULT, // width + D3DX_DEFAULT, // height iMipMaps, // mip map levels 0, // usage (is a render target?) fmtTexture, // our preferred texture format - D3DPOOL_MANAGED, // which memory pool + D3DPOOL_DEFAULT, // which memory pool (bStretch ? D3DX_FILTER_LINEAR : D3DX_FILTER_NONE) | (bDither ? D3DX_FILTER_DITHER : 0), // filter D3DX_FILTER_BOX | (bDither ? D3DX_FILTER_DITHER : 0), // mip filter D3DCOLOR_ARGB(255,255,0,255), // pink color key diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 417d0d7114..7e71a05b4e 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -697,14 +697,14 @@ void Song::SaveToSMFile( CString sPath, bool bSavingCache ) fprintf( fp, "#CDTITLE:%s;\n", m_sCDTitleFile ); fprintf( fp, "#MUSIC:%s;\n", m_sMusicFile ); fprintf( fp, "#MUSICBYTES:%u;\n", m_iMusicBytes ); - fprintf( fp, "#MUSICLENGTH:%.2f;\n", m_fMusicLengthSeconds ); + fprintf( fp, "#MUSICLENGTH:%.3f;\n", m_fMusicLengthSeconds ); if(bSavingCache) { - fprintf( fp, "#FIRSTBEAT:%.2f;\n", m_fFirstBeat ); - fprintf( fp, "#LASTBEAT:%.2f;\n", m_fLastBeat ); + fprintf( fp, "#FIRSTBEAT:%.3f;\n", m_fFirstBeat ); + fprintf( fp, "#LASTBEAT:%.3f;\n", m_fLastBeat ); } - fprintf( fp, "#OFFSET:%.2f;\n", m_fBeat0OffsetInSeconds ); - fprintf( fp, "#SAMPLESTART:%.2f;\n", m_fMusicSampleStartSeconds ); - fprintf( fp, "#SAMPLELENGTH:%.2f;\n", m_fMusicSampleLengthSeconds ); + fprintf( fp, "#OFFSET:%.3f;\n", m_fBeat0OffsetInSeconds ); + fprintf( fp, "#SAMPLESTART:%.3f;\n", m_fMusicSampleStartSeconds ); + fprintf( fp, "#SAMPLELENGTH:%.3f;\n", m_fMusicSampleLengthSeconds ); fprintf( fp, "#SELECTABLE:" ); switch(m_SelectionDisplay) { default: ASSERT(0); /* fallthrough */ @@ -722,7 +722,7 @@ void Song::SaveToSMFile( CString sPath, bool bSavingCache ) { BPMSegment &bs = m_BPMSegments[i]; - fprintf( fp, "%.2f=%.2f", bs.m_fStartBeat, bs.m_fBPM ); + fprintf( fp, "%.3f=%.3f", bs.m_fStartBeat, bs.m_fBPM ); if( i != m_BPMSegments.GetSize()-1 ) fprintf( fp, "," ); } @@ -733,7 +733,7 @@ void Song::SaveToSMFile( CString sPath, bool bSavingCache ) { StopSegment &fs = m_StopSegments[i]; - fprintf( fp, "%.2f=%.2f", fs.m_fStartBeat, fs.m_fStopSeconds ); + fprintf( fp, "%.3f=%.3f", fs.m_fStartBeat, fs.m_fStopSeconds ); if( i != m_StopSegments.GetSize()-1 ) fprintf( fp, "," ); } @@ -744,7 +744,7 @@ void Song::SaveToSMFile( CString sPath, bool bSavingCache ) { BackgroundChange &seg = m_BackgroundChanges[i]; - fprintf( fp, "%.2f=%s", seg.m_fStartBeat, seg.m_sBGName ); + fprintf( fp, "%.3f=%s", seg.m_fStartBeat, seg.m_sBGName ); if( i != m_BackgroundChanges.GetSize()-1 ) fprintf( fp, "," ); }