Added clamp in RageColor->RageVColor conversion to fix some artifacts
Fixed "autogen doesn't generate patterns for all difficulties for some songs" Fixed incorrect "show" value in "show!hold" being written in DWIs Fixed "song ends early after adding an edit then playing"
This commit is contained in:
@@ -2,6 +2,18 @@
|
|||||||
Fix
|
Fix
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
|
I'd also like to see "custom steps" implemented-- if you hit right twice on the arcade, you get to the custom (memcard) steps. I would like to see it so that any difficulty that isn't one of the standards gets put in this category (perhaps another way would be to put levels labeled "custom" there)
|
||||||
|
|
||||||
|
Only being able to see one difficulty at a time doesnt' work so well for a simulator as it does for the arcade, because things are so varied-- you have to end up doing a lot of searching to find what level you want to play. Some indication of how many feet the other options are would be nice.
|
||||||
|
|
||||||
|
1) The main menu should only be acessable by keyboard presses. Too many times people got in strange menus, quit the game, etc, without intending to.
|
||||||
|
|
||||||
|
2) pressing both starts at the same time should not reset the game. The most common way to start doubles or versus is for someone to go up to the machine and press both starts at the same time. Same for selecting difficulty. This caused a LOT of confusion.
|
||||||
|
|
||||||
|
a WIBNI (Wouldn't it be nice if...) is to add a "training" mode. basically, it would take a song, turn it into only having steps on 1 and 3. Similar to DDR USA. It was a real bear finidng songs for the newbies. (This is what prompted me to start lint-- there are many songs with only maniac steps out there!)
|
||||||
|
|
||||||
|
play intro.mp3 if available.
|
||||||
|
|
||||||
rename Notes to Pattern
|
rename Notes to Pattern
|
||||||
|
|
||||||
You'll notice that if you add up the Perfects and Greats, they are far less than the max combo. Where did they go? Apparently Jumps count for 2 steps during normal game play, but ONLY for max combo.
|
You'll notice that if you add up the Perfects and Greats, they are far less than the max combo. Where did they go? Apparently Jumps count for 2 steps during normal game play, but ONLY for max combo.
|
||||||
|
|||||||
@@ -248,8 +248,13 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
|||||||
const float fXBottomRight = fXBottom + fFrameWidth/2;
|
const float fXBottomRight = fXBottom + fFrameWidth/2;
|
||||||
const float fTopDistFromTailTop = fYTop - fYTailTop;
|
const float fTopDistFromTailTop = fYTop - fYTailTop;
|
||||||
const float fBottomDistFromTailTop = fYBottom - fYTailTop;
|
const float fBottomDistFromTailTop = fYBottom - fYTailTop;
|
||||||
const float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fFrameHeight, 0.5f, 1.0f );
|
float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fFrameHeight, 0.5f, 1.0f );
|
||||||
const float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fFrameHeight, 0.5f, 1.0f );
|
float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fFrameHeight, 0.5f, 1.0f );
|
||||||
|
if( fTexCoordTop > 1 && fTexCoordBottom > 1 )
|
||||||
|
{
|
||||||
|
fTexCoordTop -= (int)fTexCoordTop;
|
||||||
|
fTexCoordBottom -= (int)fTexCoordTop;
|
||||||
|
}
|
||||||
ASSERT( fBottomDistFromTailTop-0.001 <= fFrameHeight );
|
ASSERT( fBottomDistFromTailTop-0.001 <= fFrameHeight );
|
||||||
const float fTexCoordLeft = bActive ? 0.25f : 0.00f;
|
const float fTexCoordLeft = bActive ? 0.25f : 0.00f;
|
||||||
const float fTexCoordRight = bActive ? 0.50f : 0.25f;
|
const float fTexCoordRight = bActive ? 0.50f : 0.25f;
|
||||||
@@ -294,8 +299,13 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
|||||||
const float fXBottomRight = fXBottom + fFrameWidth/2;
|
const float fXBottomRight = fXBottom + fFrameWidth/2;
|
||||||
const float fTopDistFromTailTop = fYTailTop - fYTop;
|
const float fTopDistFromTailTop = fYTailTop - fYTop;
|
||||||
const float fBottomDistFromTailTop = fYTailTop - fYBottom;
|
const float fBottomDistFromTailTop = fYTailTop - fYBottom;
|
||||||
const float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fBodyHeight, 1, 0 );
|
float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fBodyHeight, 1, 0 );
|
||||||
const float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fBodyHeight, 1, 0 );
|
float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fBodyHeight, 1, 0 );
|
||||||
|
if( fTexCoordTop > 1 && fTexCoordBottom > 1 )
|
||||||
|
{
|
||||||
|
fTexCoordTop -= (int)fTexCoordTop;
|
||||||
|
fTexCoordBottom -= (int)fTexCoordTop;
|
||||||
|
}
|
||||||
const float fTexCoordLeft = bActive ? 0.75f : 0.50f;
|
const float fTexCoordLeft = bActive ? 0.75f : 0.50f;
|
||||||
const float fTexCoordRight = bActive ? 1.00f : 0.75f;
|
const float fTexCoordRight = bActive ? 1.00f : 0.75f;
|
||||||
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop, fPercentFadeToFail );
|
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop, fPercentFadeToFail );
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ Notes::Notes()
|
|||||||
* it'd trip obscure asserts all over the place, so I'll wait
|
* it'd trip obscure asserts all over the place, so I'll wait
|
||||||
* until after b6 to do this. -glenn */
|
* until after b6 to do this. -glenn */
|
||||||
m_NotesType = NOTES_TYPE_DANCE_SINGLE;
|
m_NotesType = NOTES_TYPE_DANCE_SINGLE;
|
||||||
|
m_bAutoGen = false;
|
||||||
m_Difficulty = CLASS_INVALID;
|
m_Difficulty = CLASS_INVALID;
|
||||||
m_iMeter = 0;
|
m_iMeter = 0;
|
||||||
ZeroMemory(m_fRadarValues, sizeof(m_fRadarValues));
|
ZeroMemory(m_fRadarValues, sizeof(m_fRadarValues));
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
NotesType m_NotesType;
|
NotesType m_NotesType;
|
||||||
CString m_sDescription; // This text is displayed next to thte number of feet when a song is selected
|
CString m_sDescription; // This text is displayed next to thte number of feet when a song is selected
|
||||||
|
bool m_bAutoGen; // Was created by autogen?
|
||||||
Difficulty m_Difficulty; // difficulty classification
|
Difficulty m_Difficulty; // difficulty classification
|
||||||
int m_iMeter; // difficulty rating from 1-10
|
int m_iMeter; // difficulty rating from 1-10
|
||||||
float m_fRadarValues[NUM_RADAR_VALUES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
|
float m_fRadarValues[NUM_RADAR_VALUES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
|
||||||
|
|||||||
@@ -54,19 +54,20 @@ char NotesWriterDWI::NotesToDWIChar( bool bCol1, bool bCol2, bool bCol3, bool bC
|
|||||||
CString NotesWriterDWI::NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4, TapNote cNoteCol5, TapNote cNoteCol6 )
|
CString NotesWriterDWI::NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4, TapNote cNoteCol5, TapNote cNoteCol6 )
|
||||||
{
|
{
|
||||||
char cShow = NotesToDWIChar(
|
char cShow = NotesToDWIChar(
|
||||||
cNoteCol1 != TAP_EMPTY && cNoteCol1!=TAP_HOLD_HEAD,
|
cNoteCol1!=TAP_EMPTY,
|
||||||
cNoteCol2 != TAP_EMPTY && cNoteCol2!=TAP_HOLD_HEAD,
|
cNoteCol2!=TAP_EMPTY,
|
||||||
cNoteCol3 != TAP_EMPTY && cNoteCol3!=TAP_HOLD_HEAD,
|
cNoteCol3!=TAP_EMPTY,
|
||||||
cNoteCol4 != TAP_EMPTY && cNoteCol4!=TAP_HOLD_HEAD,
|
cNoteCol4!=TAP_EMPTY,
|
||||||
cNoteCol5 != TAP_EMPTY && cNoteCol5!=TAP_HOLD_HEAD,
|
cNoteCol5!=TAP_EMPTY,
|
||||||
cNoteCol6 != TAP_EMPTY && cNoteCol6!=TAP_HOLD_HEAD );
|
cNoteCol6!=TAP_EMPTY );
|
||||||
char cHold = NotesToDWIChar( cNoteCol1==TAP_HOLD_HEAD,
|
char cHold = NotesToDWIChar(
|
||||||
cNoteCol2==TAP_HOLD_HEAD,
|
cNoteCol1==TAP_HOLD_HEAD,
|
||||||
cNoteCol3==TAP_HOLD_HEAD,
|
cNoteCol2==TAP_HOLD_HEAD,
|
||||||
cNoteCol4==TAP_HOLD_HEAD,
|
cNoteCol3==TAP_HOLD_HEAD,
|
||||||
cNoteCol5==TAP_HOLD_HEAD,
|
cNoteCol4==TAP_HOLD_HEAD,
|
||||||
cNoteCol6==TAP_HOLD_HEAD );
|
cNoteCol5==TAP_HOLD_HEAD,
|
||||||
|
cNoteCol6==TAP_HOLD_HEAD );
|
||||||
|
|
||||||
if( cHold != '0' )
|
if( cHold != '0' )
|
||||||
return ssprintf( "%c!%c", cShow, cHold );
|
return ssprintf( "%c!%c", cShow, cHold );
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -273,6 +273,14 @@ void RageDisplay::DrawQuads( const RageVertex v[], int iNumVerts )
|
|||||||
ASSERT( (iNumVerts%4) == 0 );
|
ASSERT( (iNumVerts%4) == 0 );
|
||||||
g_vertMode = GL_QUADS;
|
g_vertMode = GL_QUADS;
|
||||||
AddVerts( v, iNumVerts );
|
AddVerts( v, iNumVerts );
|
||||||
|
|
||||||
|
glInterleavedArrays( GL_T2F_C4UB_V3F, sizeof(RageVertex), g_vertQueue );
|
||||||
|
glDrawArrays( g_vertMode, 0, g_iNumVerts );
|
||||||
|
|
||||||
|
g_iVertsRenderedSinceLastCheck += g_iNumVerts;
|
||||||
|
g_iNumVerts = 0;
|
||||||
|
|
||||||
|
g_iDrawsSinceLastCheck++;
|
||||||
}
|
}
|
||||||
void RageDisplay::DrawFan( const RageVertex v[], int iNumVerts )
|
void RageDisplay::DrawFan( const RageVertex v[], int iNumVerts )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -143,13 +143,13 @@ public:
|
|||||||
RageColor& operator *= ( float f ) { r*=f; g*=f; b*=f; a*=f; }
|
RageColor& operator *= ( float f ) { r*=f; g*=f; b*=f; a*=f; }
|
||||||
RageColor& operator /= ( float f ) { r/=f; g/=f; b/=f; a/=f; }
|
RageColor& operator /= ( float f ) { r/=f; g/=f; b/=f; a/=f; }
|
||||||
|
|
||||||
// binarg operators
|
// binary operators
|
||||||
RageColor operator + ( const RageColor& other ) const { return RageColor( r+other.r, g+other.g, b+other.b, a+other.a ); }
|
RageColor operator + ( const RageColor& other ) const { return RageColor( r+other.r, g+other.g, b+other.b, a+other.a ); }
|
||||||
RageColor operator - ( const RageColor& other ) const { return RageColor( r-other.r, g-other.g, b-other.b, a-other.a ); }
|
RageColor operator - ( const RageColor& other ) const { return RageColor( r-other.r, g-other.g, b-other.b, a-other.a ); }
|
||||||
RageColor operator * ( float f ) const { return RageColor( r*f, g*f, b*f, a*f ); }
|
RageColor operator * ( float f ) const { return RageColor( r*f, g*f, b*f, a*f ); }
|
||||||
RageColor operator / ( float f ) const { return RageColor( r/f, g/f, b/f, a/f ); }
|
RageColor operator / ( float f ) const { return RageColor( r/f, g/f, b/f, a/f ); }
|
||||||
|
|
||||||
friend RageVector4 operator * ( float f, const RageVector4& other ) { return other*f; }
|
friend RageVector4 operator * ( float f, const RageVector4& other ) { return other*f; } // What is this for? Did I add this? -Chris
|
||||||
|
|
||||||
/* unneeded; this is a POD type */
|
/* unneeded; this is a POD type */
|
||||||
// bool operator == ( const RageColor& other ) const { return r==other.r && g==other.g && b==other.b && a==other.a; }
|
// bool operator == ( const RageColor& other ) const { return r==other.r && g==other.g && b==other.b && a==other.a; }
|
||||||
@@ -159,12 +159,14 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Convert floating-point 0..1 value to integer 0..255 value. */
|
/* Convert floating-point 0..1 value to integer 0..255 value. */
|
||||||
inline unsigned char FTOC(float a) { return (unsigned char)(a * 255.f); }
|
inline unsigned char FTOC(float a) { if(a<0) a=0; if(a>1) a=1; return (unsigned char)(a*255.f); } // need clamping to handle values <0.0 and > 1.0
|
||||||
|
|
||||||
/* Color type used only in vertex lists. OpenGL expects colors in
|
/* Color type used only in vertex lists. OpenGL expects colors in
|
||||||
* r, g, b, a order, independent of endianness, so storing them this
|
* r, g, b, a order, independent of endianness, so storing them this
|
||||||
* way avoids endianness problems. Don't try to manipulate this; only
|
* way avoids endianness problems. Don't try to manipulate this; only
|
||||||
* manip RageColors. */
|
* manip RageColors. */
|
||||||
|
/* Perhaps the math in RageColor could be moved to RaveVColor. We don't need the
|
||||||
|
* precision of a float for our calculations anyway. -Chris */
|
||||||
class RageVColor
|
class RageVColor
|
||||||
{
|
{
|
||||||
unsigned char r, g, b, a;
|
unsigned char r, g, b, a;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void RandomSample::PlayRandom()
|
|||||||
// play one of the samples
|
// play one of the samples
|
||||||
if( m_pSamples.empty() )
|
if( m_pSamples.empty() )
|
||||||
{
|
{
|
||||||
LOG->Trace( "WARNING: Tried to play a RandomSample that has 0 sounds loaded." );
|
// LOG->Trace( "WARNING: Tried to play a RandomSample that has 0 sounds loaded." );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -752,14 +752,12 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
|||||||
// copy edit into current Notes
|
// copy edit into current Notes
|
||||||
Notes* pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
|
Notes* pNotes = GAMESTATE->m_pCurNotes[PLAYER_1];
|
||||||
ASSERT( pNotes );
|
ASSERT( pNotes );
|
||||||
|
pNotes->m_bAutoGen = false; // set not autogen so these Notes will be saved to disk.
|
||||||
// strip out the autogen marker if any. The autogen marker would have caused these Notes not to be saved to disk.
|
|
||||||
pNotes->m_sDescription.Replace( " (autogen)", "" );
|
|
||||||
|
|
||||||
pNotes->SetNoteData( &m_NoteFieldEdit );
|
pNotes->SetNoteData( &m_NoteFieldEdit );
|
||||||
GAMESTATE->m_pCurSong->Save();
|
GAMESTATE->m_pCurSong->Save();
|
||||||
SCREENMAN->SystemMessage( "Saved as SM and DWI." );
|
|
||||||
|
|
||||||
|
SCREENMAN->SystemMessage( "Saved as SM and DWI." );
|
||||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","edit save") );
|
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","edit save") );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
+62
-61
@@ -33,9 +33,9 @@
|
|||||||
#include "NotesLoaderKSF.h"
|
#include "NotesLoaderKSF.h"
|
||||||
#include "NotesWriterDWI.h"
|
#include "NotesWriterDWI.h"
|
||||||
|
|
||||||
|
#include "SDL.h"
|
||||||
|
#include "SDL_image.h"
|
||||||
|
|
||||||
// XXX needed for D3DXGetImageInfo. Remove this ASAP!
|
|
||||||
#include "D3DX8.h"
|
|
||||||
|
|
||||||
const int FILE_CACHE_VERSION = 102; // increment this when Song or Notes changes to invalidate cache
|
const int FILE_CACHE_VERSION = 102; // increment this when Song or Notes changes to invalidate cache
|
||||||
|
|
||||||
@@ -482,20 +482,24 @@ void Song::TidyUpData()
|
|||||||
if( HasCDTitle() && stricmp(m_sCDTitleFile, arrayImages[i])==0 )
|
if( HasCDTitle() && stricmp(m_sCDTitleFile, arrayImages[i])==0 )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
D3DXIMAGE_INFO ddii;
|
SDL_Surface *img = IMG_Load( m_sSongDir + arrayImages[i] );
|
||||||
if( !FAILED( D3DXGetImageInfoFromFile( m_sSongDir + arrayImages[i], &ddii ) ) )
|
if( img )
|
||||||
{
|
{
|
||||||
if( !HasBackground() && ddii.Width >= 320 && ddii.Height >= 240 )
|
int width = img->w;
|
||||||
|
int height = img->h;
|
||||||
|
SDL_FreeSurface( img );
|
||||||
|
|
||||||
|
if( !HasBackground() && width >= 320 && height >= 240 )
|
||||||
{
|
{
|
||||||
m_sBackgroundFile = arrayImages[i];
|
m_sBackgroundFile = arrayImages[i];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( !HasBanner() && 100 < ddii.Width && ddii.Width < 320 && 50 < ddii.Height && ddii.Height < 240 )
|
if( !HasBanner() && 100<width && width<320 && 50<height && height<240 )
|
||||||
{
|
{
|
||||||
m_sBannerFile = arrayImages[i];
|
m_sBannerFile = arrayImages[i];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( !HasCDTitle() && ddii.Width <= 100 && ddii.Height <= 50 )
|
if( !HasCDTitle() && width<=100 && height<=50 )
|
||||||
{
|
{
|
||||||
m_sCDTitleFile = arrayImages[i];
|
m_sCDTitleFile = arrayImages[i];
|
||||||
continue;
|
continue;
|
||||||
@@ -528,10 +532,31 @@ void Song::TidyUpData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReCalulateRadarValuesAndLastBeat();
|
||||||
|
|
||||||
|
// challenge notes are encoded as smaniac. If there is only one Notes for
|
||||||
|
// a NotesType and it's "smaniac", then convert it to "Challenge"
|
||||||
|
for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) )
|
||||||
|
{
|
||||||
|
CArray<Notes*,Notes*> apNotes;
|
||||||
|
GetNotesThatMatch( nt, apNotes );
|
||||||
|
if( apNotes.size() == 1 )
|
||||||
|
{
|
||||||
|
if( 0 == apNotes[0]->m_sDescription.CompareNoCase("smaniac") )
|
||||||
|
{
|
||||||
|
apNotes[0]->m_sDescription = "Challenge";
|
||||||
|
apNotes[0]->m_Difficulty = DIFFICULTY_HARD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Song::ReCalulateRadarValuesAndLastBeat()
|
||||||
|
{
|
||||||
//
|
//
|
||||||
// calculate radar values and first/last beat
|
// calculate radar values and first/last beat
|
||||||
//
|
//
|
||||||
for( i=0; i<m_apNotes.size(); i++ )
|
for( unsigned int i=0; i<m_apNotes.size(); i++ )
|
||||||
{
|
{
|
||||||
Notes* pNotes = m_apNotes[i];
|
Notes* pNotes = m_apNotes[i];
|
||||||
NoteData tempNoteData;
|
NoteData tempNoteData;
|
||||||
@@ -552,19 +577,6 @@ void Song::TidyUpData()
|
|||||||
m_fLastBeat = max( m_fLastBeat, fLastBeat );
|
m_fLastBeat = max( m_fLastBeat, fLastBeat );
|
||||||
}
|
}
|
||||||
|
|
||||||
// challenge notes are encoded as smaniac. If there is only one Notes for
|
|
||||||
// a NotesType and it's "smaniac", then convert it to "Challenge"
|
|
||||||
for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) )
|
|
||||||
{
|
|
||||||
CArray<Notes*,Notes*> apNotes;
|
|
||||||
GetNotesThatMatch( nt, apNotes );
|
|
||||||
if( apNotes.size() == 1 )
|
|
||||||
if( 0 == apNotes[0]->m_sDescription.CompareNoCase("smaniac") )
|
|
||||||
{
|
|
||||||
apNotes[0]->m_sDescription = "Challenge";
|
|
||||||
apNotes[0]->m_Difficulty = DIFFICULTY_HARD;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Song::GetNotesThatMatch( NotesType nt, CArray<Notes*, Notes*>& arrayAddTo ) const
|
void Song::GetNotesThatMatch( NotesType nt, CArray<Notes*, Notes*>& arrayAddTo ) const
|
||||||
@@ -634,6 +646,8 @@ void Song::Save()
|
|||||||
MoveFile( sOldPath, sNewPath );
|
MoveFile( sOldPath, sNewPath );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReCalulateRadarValuesAndLastBeat();
|
||||||
|
|
||||||
SaveToSMFile( GetSongFilePath(), false );
|
SaveToSMFile( GetSongFilePath(), false );
|
||||||
SaveToDWIFile();
|
SaveToDWIFile();
|
||||||
}
|
}
|
||||||
@@ -720,7 +734,7 @@ void Song::SaveToSMFile( CString sPath, bool bSavingCache )
|
|||||||
for( i=0; i<m_apNotes.size(); i++ )
|
for( i=0; i<m_apNotes.size(); i++ )
|
||||||
{
|
{
|
||||||
Notes* pNotes = m_apNotes[i];
|
Notes* pNotes = m_apNotes[i];
|
||||||
if( bSavingCache || pNotes->m_sDescription.Find("(autogen)") == -1 ) // If notes aren't autogen
|
if( bSavingCache || !pNotes->m_bAutoGen ) // If notes aren't autogen
|
||||||
m_apNotes[i]->WriteSMNotesTag( fp );
|
m_apNotes[i]->WriteSMNotesTag( fp );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -741,21 +755,6 @@ void Song::SaveToDWIFile()
|
|||||||
|
|
||||||
void Song::AddAutoGenNotes()
|
void Song::AddAutoGenNotes()
|
||||||
{
|
{
|
||||||
|
|
||||||
// This hack is no longer needed. I've sped up autogen.
|
|
||||||
|
|
||||||
// // This is way too slow. Only autogen dance->pump and pump->dance
|
|
||||||
// CArray<NotesType,NotesType> aMissingNotesTypes;
|
|
||||||
// if( !SongHasNotesType(NOTES_TYPE_DANCE_SINGLE) ) aMissingNotesTypes.push_back( NOTES_TYPE_DANCE_SINGLE );
|
|
||||||
// if( !SongHasNotesType(NOTES_TYPE_DANCE_DOUBLE) ) aMissingNotesTypes.push_back( NOTES_TYPE_DANCE_DOUBLE );
|
|
||||||
// if( !SongHasNotesType(NOTES_TYPE_DANCE_SOLO) ) aMissingNotesTypes.push_back( NOTES_TYPE_DANCE_SOLO );
|
|
||||||
// if( !SongHasNotesType(NOTES_TYPE_PUMP_SINGLE) ) aMissingNotesTypes.push_back( NOTES_TYPE_PUMP_SINGLE );
|
|
||||||
// if( !SongHasNotesType(NOTES_TYPE_PUMP_DOUBLE) ) aMissingNotesTypes.push_back( NOTES_TYPE_PUMP_DOUBLE );
|
|
||||||
//
|
|
||||||
// for( unsigned i=0; i<aMissingNotesTypes.size(); i++ )
|
|
||||||
// {
|
|
||||||
// NotesType ntMissing = aMissingNotesTypes[i];
|
|
||||||
|
|
||||||
for( NotesType ntMissing=(NotesType)0; ntMissing<NUM_NOTES_TYPES; ntMissing=(NotesType)(ntMissing+1) )
|
for( NotesType ntMissing=(NotesType)0; ntMissing<NUM_NOTES_TYPES; ntMissing=(NotesType)(ntMissing+1) )
|
||||||
{
|
{
|
||||||
next_notes_type:
|
next_notes_type:
|
||||||
@@ -769,21 +768,18 @@ next_notes_type:
|
|||||||
|
|
||||||
unsigned j;
|
unsigned j;
|
||||||
|
|
||||||
// look for an exact match that was created by autogen
|
// look for previously autogen'd data with the same number of tracks
|
||||||
for( j=0; j<m_apNotes.size(); j++ )
|
for( j=0; j<m_apNotes.size(); j++ )
|
||||||
{
|
{
|
||||||
Notes* pOriginalNotes = m_apNotes[j];
|
Notes* pOriginalNotes = m_apNotes[j];
|
||||||
if( iNumTracksOfMissing != GAMEMAN->NotesTypeToNumTracks(pOriginalNotes->m_NotesType) )
|
NotesType ntOriginal = pOriginalNotes->m_NotesType;
|
||||||
continue; // no match, skip
|
int iNumOriginalNotesTracks = GAMEMAN->NotesTypeToNumTracks(ntOriginal);
|
||||||
|
|
||||||
Notes* pNewNotes = new Notes;
|
if( pOriginalNotes->m_bAutoGen && iNumTracksOfMissing == iNumOriginalNotesTracks )
|
||||||
pNewNotes->m_Difficulty = pOriginalNotes->m_Difficulty;
|
{
|
||||||
pNewNotes->m_iMeter = pOriginalNotes->m_iMeter;
|
AutoGen( ntMissing, ntOriginal );
|
||||||
pNewNotes->m_sDescription = pOriginalNotes->m_sDescription + " (autogen)";
|
goto next_notes_type; // done searching
|
||||||
pNewNotes->m_NotesType = ntMissing;
|
}
|
||||||
pNewNotes->m_sSMNoteData = pOriginalNotes->m_sSMNoteData;
|
|
||||||
this->m_apNotes.push_back( pNewNotes );
|
|
||||||
goto next_notes_type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -797,35 +793,40 @@ next_notes_type:
|
|||||||
int iTrackDifference = abs(iNumTracks-iNumTracksOfMissing);
|
int iTrackDifference = abs(iNumTracks-iNumTracksOfMissing);
|
||||||
CArray<Notes*,Notes*> apNotes;
|
CArray<Notes*,Notes*> apNotes;
|
||||||
this->GetNotesThatMatch( nt, apNotes );
|
this->GetNotesThatMatch( nt, apNotes );
|
||||||
if( iTrackDifference < iBestTrackDifference && !apNotes.empty() && apNotes[0]->m_sDescription.Find("autogen")==-1 )
|
if( iTrackDifference < iBestTrackDifference && !apNotes.empty() && !apNotes[0]->m_bAutoGen )
|
||||||
{
|
{
|
||||||
ntBestMatch = nt;
|
ntBestMatch = nt;
|
||||||
iBestTrackDifference = iTrackDifference;
|
iBestTrackDifference = iTrackDifference;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ntBestMatch == -1 )
|
if( ntBestMatch != -1 )
|
||||||
continue;
|
AutoGen( ntMissing, ntBestMatch );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for( j=0; j<m_apNotes.size(); j++ )
|
void Song::AutoGen( NotesType ntTo, NotesType ntFrom )
|
||||||
|
{
|
||||||
|
int iNumTracksOfTo = GAMEMAN->NotesTypeToNumTracks(ntTo);
|
||||||
|
|
||||||
|
for( unsigned int j=0; j<m_apNotes.size(); j++ )
|
||||||
|
{
|
||||||
|
Notes* pOriginalNotes = m_apNotes[j];
|
||||||
|
if( pOriginalNotes->m_NotesType == ntFrom )
|
||||||
{
|
{
|
||||||
Notes* pOriginalNotes = m_apNotes[j];
|
|
||||||
if( pOriginalNotes->m_NotesType != ntBestMatch )
|
|
||||||
continue; // skip
|
|
||||||
|
|
||||||
Notes* pNewNotes = new Notes;
|
Notes* pNewNotes = new Notes;
|
||||||
pNewNotes->m_Difficulty = pOriginalNotes->m_Difficulty;
|
pNewNotes->m_Difficulty = pOriginalNotes->m_Difficulty;
|
||||||
pNewNotes->m_iMeter = pOriginalNotes->m_iMeter;
|
pNewNotes->m_iMeter = pOriginalNotes->m_iMeter;
|
||||||
pNewNotes->m_sDescription = pOriginalNotes->m_sDescription + " (autogen)";
|
pNewNotes->m_sDescription = pOriginalNotes->m_sDescription;
|
||||||
pNewNotes->m_NotesType = ntMissing;
|
pNewNotes->m_bAutoGen = true;
|
||||||
|
pNewNotes->m_NotesType = ntTo;
|
||||||
|
|
||||||
NoteData originalNoteData;
|
NoteData originalNoteData;
|
||||||
NoteData newNoteData;
|
NoteData newNoteData;
|
||||||
pOriginalNotes->GetNoteData( &originalNoteData );
|
pOriginalNotes->GetNoteData( &originalNoteData );
|
||||||
newNoteData.LoadTransformedSlidingWindow( &originalNoteData, iNumTracksOfMissing );
|
newNoteData.LoadTransformedSlidingWindow( &originalNoteData, iNumTracksOfTo );
|
||||||
pNewNotes->SetNoteData( &newNoteData );
|
pNewNotes->SetNoteData( &newNoteData );
|
||||||
this->m_apNotes.push_back( pNewNotes );
|
this->m_apNotes.push_back( pNewNotes );
|
||||||
goto next_notes_type;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,6 +282,13 @@ void SongSelector::OnNotesChange()
|
|||||||
if( GetSelectedNotes() == NULL )
|
if( GetSelectedNotes() == NULL )
|
||||||
m_textNotes.SetText( "(NEW)" );
|
m_textNotes.SetText( "(NEW)" );
|
||||||
else
|
else
|
||||||
m_textNotes.SetText( GetSelectedNotes()->m_sDescription!="" ? GetSelectedNotes()->m_sDescription : "[no name]" );
|
{
|
||||||
|
CString sDescription = GetSelectedNotes()->m_sDescription;
|
||||||
|
if( sDescription == "" )
|
||||||
|
sDescription = "[no name]";
|
||||||
|
if( GetSelectedNotes()->m_bAutoGen )
|
||||||
|
sDescription += " (autogen)";
|
||||||
|
m_textNotes.SetText( sDescription );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,12 @@ TransitionFade::~TransitionFade()
|
|||||||
|
|
||||||
void TransitionFade::DrawPrimitives()
|
void TransitionFade::DrawPrimitives()
|
||||||
{
|
{
|
||||||
const float fPercentageOpaque = 1 - GetPercentageOpen();
|
float fPercentageOpaque = 1 - GetPercentageOpen();
|
||||||
if( fPercentageOpaque == 0 )
|
if( fPercentageOpaque == 0 )
|
||||||
return; // draw nothing
|
return; // draw nothing
|
||||||
|
|
||||||
|
CLAMP( fPercentageOpaque, 0, 1 );
|
||||||
|
|
||||||
RageColor colorTemp = GetDiffuse();
|
RageColor colorTemp = GetDiffuse();
|
||||||
colorTemp.a = fPercentageOpaque;
|
colorTemp.a = fPercentageOpaque;
|
||||||
m_rect.SetDiffuse( colorTemp );
|
m_rect.SetDiffuse( colorTemp );
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public:
|
|||||||
bool LoadFromSongDir( CString sDir );
|
bool LoadFromSongDir( CString sDir );
|
||||||
|
|
||||||
void TidyUpData(); // call after loading to clean up invalid data
|
void TidyUpData(); // call after loading to clean up invalid data
|
||||||
|
void ReCalulateRadarValuesAndLastBeat(); // called by TidyUpData, and after saving
|
||||||
|
|
||||||
void SaveToSMFile( CString sPath, bool bSavingCache );
|
void SaveToSMFile( CString sPath, bool bSavingCache );
|
||||||
void Save(); // saves SM and DWI
|
void Save(); // saves SM and DWI
|
||||||
@@ -72,6 +73,7 @@ public:
|
|||||||
CString GetCacheFilePath() const;
|
CString GetCacheFilePath() const;
|
||||||
|
|
||||||
void AddAutoGenNotes();
|
void AddAutoGenNotes();
|
||||||
|
void AutoGen( NotesType ntTo, NotesType ntFrom ); // create Notes of type ntTo from Notes of type ntFrom
|
||||||
|
|
||||||
/* Directory this song data came from: */
|
/* Directory this song data came from: */
|
||||||
CString m_sSongDir;
|
CString m_sSongDir;
|
||||||
|
|||||||
Reference in New Issue
Block a user