cleanup, simplify
This commit is contained in:
@@ -6,43 +6,6 @@
|
|||||||
|
|
||||||
class Song;
|
class Song;
|
||||||
|
|
||||||
typedef int DanceNote;
|
|
||||||
// MD 10/26/03 - this structure is only correct for DDR - use the lower enum instead
|
|
||||||
enum {
|
|
||||||
DANCE_NOTE_NONE = 0,
|
|
||||||
DANCE_NOTE_PAD1_LEFT,
|
|
||||||
DANCE_NOTE_PAD1_UPLEFT,
|
|
||||||
DANCE_NOTE_PAD1_DOWN,
|
|
||||||
DANCE_NOTE_PAD1_UP,
|
|
||||||
DANCE_NOTE_PAD1_UPRIGHT,
|
|
||||||
DANCE_NOTE_PAD1_RIGHT,
|
|
||||||
DANCE_NOTE_PAD2_LEFT,
|
|
||||||
DANCE_NOTE_PAD2_UPLEFT,
|
|
||||||
DANCE_NOTE_PAD2_DOWN,
|
|
||||||
DANCE_NOTE_PAD2_UP,
|
|
||||||
DANCE_NOTE_PAD2_UPRIGHT,
|
|
||||||
DANCE_NOTE_PAD2_RIGHT
|
|
||||||
};
|
|
||||||
enum {
|
|
||||||
BMS_NULL_COLUMN = 0,
|
|
||||||
BMS_P1_KEY1,
|
|
||||||
BMS_P1_KEY2,
|
|
||||||
BMS_P1_KEY3,
|
|
||||||
BMS_P1_KEY4,
|
|
||||||
BMS_P1_KEY5,
|
|
||||||
BMS_P1_TURN,
|
|
||||||
BMS_P1_KEY6,
|
|
||||||
BMS_P1_KEY7,
|
|
||||||
BMS_P2_KEY1,
|
|
||||||
BMS_P2_KEY2,
|
|
||||||
BMS_P2_KEY3,
|
|
||||||
BMS_P2_KEY4,
|
|
||||||
BMS_P2_KEY5,
|
|
||||||
BMS_P2_TURN,
|
|
||||||
BMS_P2_KEY6,
|
|
||||||
BMS_P2_KEY7,
|
|
||||||
};
|
|
||||||
|
|
||||||
class NotesLoader
|
class NotesLoader
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -49,16 +49,44 @@
|
|||||||
18/19 marks bm-single7, 28/29 marks bm-double7
|
18/19 marks bm-single7, 28/29 marks bm-double7
|
||||||
bm-double uses 21-26. */
|
bm-double uses 21-26. */
|
||||||
|
|
||||||
int iTracks[MAX_NOTE_TRACKS];
|
static int iTracks[MAX_NOTE_TRACKS];
|
||||||
|
|
||||||
void BMSLoader::ResetTracksMagic( void ) {
|
enum
|
||||||
for (int ix = 0; ix<MAX_NOTE_TRACKS; ix++) iTracks[ix] = 0;
|
{
|
||||||
|
BMS_NULL_COLUMN = 0,
|
||||||
|
BMS_P1_KEY1,
|
||||||
|
BMS_P1_KEY2,
|
||||||
|
BMS_P1_KEY3,
|
||||||
|
BMS_P1_KEY4,
|
||||||
|
BMS_P1_KEY5,
|
||||||
|
BMS_P1_TURN,
|
||||||
|
BMS_P1_KEY6,
|
||||||
|
BMS_P1_KEY7,
|
||||||
|
BMS_P2_KEY1,
|
||||||
|
BMS_P2_KEY2,
|
||||||
|
BMS_P2_KEY3,
|
||||||
|
BMS_P2_KEY4,
|
||||||
|
BMS_P2_KEY5,
|
||||||
|
BMS_P2_TURN,
|
||||||
|
BMS_P2_KEY6,
|
||||||
|
BMS_P2_KEY7,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void BMSLoader::ResetTracksMagic()
|
||||||
|
{
|
||||||
|
for( int i = 0; i<MAX_NOTE_TRACKS; i++ )
|
||||||
|
iTracks[i] = 0;
|
||||||
}
|
}
|
||||||
void BMSLoader::PushTrackNumForMagic( int iTrackNum ) {
|
|
||||||
|
void BMSLoader::PushTrackNumForMagic( int iTrackNum )
|
||||||
|
{
|
||||||
int ix = (iTrackNum < 20) ? (iTrackNum - 11) : (iTrackNum - 12);
|
int ix = (iTrackNum < 20) ? (iTrackNum - 11) : (iTrackNum - 12);
|
||||||
iTracks[ix]++;
|
iTracks[ix]++;
|
||||||
}
|
}
|
||||||
StepsType BMSLoader::CheckTracksMagic( void ) {
|
|
||||||
|
StepsType BMSLoader::CheckTracksMagic()
|
||||||
|
{
|
||||||
int iTrackCount = 0;
|
int iTrackCount = 0;
|
||||||
for (int ix = 0; ix<MAX_NOTE_TRACKS; ix++) {
|
for (int ix = 0; ix<MAX_NOTE_TRACKS; ix++) {
|
||||||
if(iTracks[ix] != 0) iTrackCount++;
|
if(iTracks[ix] != 0) iTrackCount++;
|
||||||
@@ -100,8 +128,7 @@ StepsType BMSLoader::CheckTracksMagic( void ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BMSLoader::mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut,
|
void BMSLoader::mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOut )
|
||||||
char &cNoteCharOut )
|
|
||||||
{
|
{
|
||||||
if( iBMSTrack > 40 )
|
if( iBMSTrack > 40 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define NOTES_LOADER_BMS_H
|
#define NOTES_LOADER_BMS_H
|
||||||
|
|
||||||
#include "NotesLoader.h"
|
#include "NotesLoader.h"
|
||||||
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
class Song;
|
class Song;
|
||||||
class Steps;
|
class Steps;
|
||||||
@@ -11,8 +12,8 @@ class BMSLoader: public NotesLoader
|
|||||||
bool LoadFromBMSFile( const CString &sPath, Steps &out1 );
|
bool LoadFromBMSFile( const CString &sPath, Steps &out1 );
|
||||||
void mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOut );
|
void mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOut );
|
||||||
void PushTrackNumForMagic( int iTrackNum );
|
void PushTrackNumForMagic( int iTrackNum );
|
||||||
StepsType CheckTracksMagic( void );
|
StepsType CheckTracksMagic();
|
||||||
void ResetTracksMagic( void );
|
void ResetTracksMagic();
|
||||||
|
|
||||||
void SlideDuplicateDifficulties( Song &p );
|
void SlideDuplicateDifficulties( Song &p );
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,24 @@ using namespace std;
|
|||||||
|
|
||||||
static std::map<int,int> g_mapDanceNoteToNoteDataColumn;
|
static std::map<int,int> g_mapDanceNoteToNoteDataColumn;
|
||||||
|
|
||||||
void DWILoader::DWIcharToNote( char c, GameController i, DanceNote ¬e1Out, DanceNote ¬e2Out )
|
enum
|
||||||
|
{
|
||||||
|
DANCE_NOTE_NONE = 0,
|
||||||
|
DANCE_NOTE_PAD1_LEFT,
|
||||||
|
DANCE_NOTE_PAD1_UPLEFT,
|
||||||
|
DANCE_NOTE_PAD1_DOWN,
|
||||||
|
DANCE_NOTE_PAD1_UP,
|
||||||
|
DANCE_NOTE_PAD1_UPRIGHT,
|
||||||
|
DANCE_NOTE_PAD1_RIGHT,
|
||||||
|
DANCE_NOTE_PAD2_LEFT,
|
||||||
|
DANCE_NOTE_PAD2_UPLEFT,
|
||||||
|
DANCE_NOTE_PAD2_DOWN,
|
||||||
|
DANCE_NOTE_PAD2_UP,
|
||||||
|
DANCE_NOTE_PAD2_UPRIGHT,
|
||||||
|
DANCE_NOTE_PAD2_RIGHT
|
||||||
|
};
|
||||||
|
|
||||||
|
void DWILoader::DWIcharToNote( char c, GameController i, int ¬e1Out, int ¬e2Out )
|
||||||
{
|
{
|
||||||
switch( c )
|
switch( c )
|
||||||
{
|
{
|
||||||
@@ -64,7 +81,7 @@ void DWILoader::DWIcharToNote( char c, GameController i, DanceNote ¬e1Out, Da
|
|||||||
|
|
||||||
void DWILoader::DWIcharToNoteCol( char c, GameController i, int &col1Out, int &col2Out )
|
void DWILoader::DWIcharToNoteCol( char c, GameController i, int &col1Out, int &col2Out )
|
||||||
{
|
{
|
||||||
DanceNote note1, note2;
|
int note1, note2;
|
||||||
DWIcharToNote( c, i, note1, note2 );
|
DWIcharToNote( c, i, note1, note2 );
|
||||||
|
|
||||||
if( note1 != DANCE_NOTE_NONE )
|
if( note1 != DANCE_NOTE_NONE )
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class Steps;
|
|||||||
|
|
||||||
class DWILoader: public NotesLoader
|
class DWILoader: public NotesLoader
|
||||||
{
|
{
|
||||||
void DWIcharToNote( char c, GameController i, DanceNote ¬e1Out, DanceNote ¬e2Out );
|
void DWIcharToNote( char c, GameController i, int ¬e1Out, int ¬e2Out );
|
||||||
void DWIcharToNoteCol( char c, GameController i, int &col1Out, int &col2Out );
|
void DWIcharToNoteCol( char c, GameController i, int &col1Out, int &col2Out );
|
||||||
|
|
||||||
bool LoadFromDWITokens(
|
bool LoadFromDWITokens(
|
||||||
|
|||||||
Reference in New Issue
Block a user