From 8da3651c136ecbd8fbcb5968af0eac4a6a879375 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 31 May 2004 22:07:09 +0000 Subject: [PATCH] cleanup, simplify --- stepmania/src/NotesLoader.h | 37 ---------------------------- stepmania/src/NotesLoaderBMS.cpp | 41 ++++++++++++++++++++++++++------ stepmania/src/NotesLoaderBMS.h | 5 ++-- stepmania/src/NotesLoaderDWI.cpp | 21 ++++++++++++++-- stepmania/src/NotesLoaderDWI.h | 2 +- 5 files changed, 57 insertions(+), 49 deletions(-) diff --git a/stepmania/src/NotesLoader.h b/stepmania/src/NotesLoader.h index d167baf6b9..7fc9c2a5f6 100644 --- a/stepmania/src/NotesLoader.h +++ b/stepmania/src/NotesLoader.h @@ -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: diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index 2d278c7fea..a2a0942a29 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -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 40 ) { diff --git a/stepmania/src/NotesLoaderBMS.h b/stepmania/src/NotesLoaderBMS.h index 42206f538f..ee60567cc7 100644 --- a/stepmania/src/NotesLoaderBMS.h +++ b/stepmania/src/NotesLoaderBMS.h @@ -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 ); diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index cb7116a5ab..1ec8e9fea0 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -15,7 +15,24 @@ using namespace std; static std::map 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 ) { @@ -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 ) { - DanceNote note1, note2; + int note1, note2; DWIcharToNote( c, i, note1, note2 ); if( note1 != DANCE_NOTE_NONE ) diff --git a/stepmania/src/NotesLoaderDWI.h b/stepmania/src/NotesLoaderDWI.h index be80afaf2c..4379d32a30 100644 --- a/stepmania/src/NotesLoaderDWI.h +++ b/stepmania/src/NotesLoaderDWI.h @@ -11,7 +11,7 @@ class Steps; 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 ); bool LoadFromDWITokens(