cleanup, simplify

This commit is contained in:
Glenn Maynard
2004-05-31 22:07:09 +00:00
parent f50d78d94a
commit 8da3651c13
5 changed files with 57 additions and 49 deletions
-37
View File
@@ -6,43 +6,6 @@
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
{
protected:
+34 -7
View File
@@ -49,16 +49,44 @@
18/19 marks bm-single7, 28/29 marks bm-double7
bm-double uses 21-26. */
int iTracks[MAX_NOTE_TRACKS];
static int iTracks[MAX_NOTE_TRACKS];
void BMSLoader::ResetTracksMagic( void ) {
for (int ix = 0; ix<MAX_NOTE_TRACKS; ix++) iTracks[ix] = 0;
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,
};
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);
iTracks[ix]++;
}
StepsType BMSLoader::CheckTracksMagic( void ) {
StepsType BMSLoader::CheckTracksMagic()
{
int iTrackCount = 0;
for (int ix = 0; ix<MAX_NOTE_TRACKS; ix++) {
if(iTracks[ix] != 0) iTrackCount++;
@@ -100,8 +128,7 @@ StepsType BMSLoader::CheckTracksMagic( void ) {
}
}
void BMSLoader::mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut,
char &cNoteCharOut )
void BMSLoader::mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOut )
{
if( iBMSTrack > 40 )
{
+3 -2
View File
@@ -2,6 +2,7 @@
#define NOTES_LOADER_BMS_H
#include "NotesLoader.h"
#include "GameConstantsAndTypes.h"
class Song;
class Steps;
@@ -11,8 +12,8 @@ class BMSLoader: public NotesLoader
bool LoadFromBMSFile( const CString &sPath, Steps &out1 );
void mapBMSTrackToDanceNote( int iBMSTrack, int &iDanceColOut, char &cNoteCharOut );
void PushTrackNumForMagic( int iTrackNum );
StepsType CheckTracksMagic( void );
void ResetTracksMagic( void );
StepsType CheckTracksMagic();
void ResetTracksMagic();
void SlideDuplicateDifficulties( Song &p );
+19 -2
View File
@@ -15,7 +15,24 @@ using namespace std;
static std::map<int,int> g_mapDanceNoteToNoteDataColumn;
void DWILoader::DWIcharToNote( char c, GameController i, DanceNote &note1Out, DanceNote &note2Out )
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 &note1Out, int &note2Out )
{
switch( c )
{
@@ -64,7 +81,7 @@ void DWILoader::DWIcharToNote( char c, GameController i, DanceNote &note1Out, Da
void DWILoader::DWIcharToNoteCol( char c, GameController i, int &col1Out, int &col2Out )
{
DanceNote note1, note2;
int note1, note2;
DWIcharToNote( c, i, note1, note2 );
if( note1 != DANCE_NOTE_NONE )
+1 -1
View File
@@ -11,7 +11,7 @@ class Steps;
class DWILoader: public NotesLoader
{
void DWIcharToNote( char c, GameController i, DanceNote &note1Out, DanceNote &note2Out );
void DWIcharToNote( char c, GameController i, int &note1Out, int &note2Out );
void DWIcharToNoteCol( char c, GameController i, int &col1Out, int &col2Out );
bool LoadFromDWITokens(