From 64499909d5bdeea0ab06cdd8325a271278617fc2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 3 Nov 2002 05:02:48 +0000 Subject: [PATCH] remove more magic constants --- stepmania/src/NotesWriterDWI.cpp | 25 +++++++++++++++---------- stepmania/src/NotesWriterDWI.h | 4 +++- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/stepmania/src/NotesWriterDWI.cpp b/stepmania/src/NotesWriterDWI.cpp index bb67e61ba0..5662fb5b2e 100644 --- a/stepmania/src/NotesWriterDWI.cpp +++ b/stepmania/src/NotesWriterDWI.cpp @@ -51,16 +51,21 @@ char NotesWriterDWI::NotesToDWIChar( bool bCol1, bool bCol2, bool bCol3, bool bC return NotesToDWIChar( bCol1, 0, bCol2, bCol3, 0, bCol4 ); } -CString NotesWriterDWI::NotesToDWIString( char cNoteCol1, char cNoteCol2, char cNoteCol3, char cNoteCol4, char cNoteCol5, char cNoteCol6 ) +CString NotesWriterDWI::NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4, TapNote cNoteCol5, TapNote cNoteCol6 ) { char cShow = NotesToDWIChar( - cNoteCol1!='0'&&cNoteCol1!='2', - cNoteCol2!='0'&&cNoteCol2!='2', - cNoteCol3!='0'&&cNoteCol3!='2', - cNoteCol4!='0'&&cNoteCol4!='2', - cNoteCol5!='0'&&cNoteCol5!='2', - cNoteCol6!='0'&&cNoteCol6!='2' ); - char cHold = NotesToDWIChar( cNoteCol1=='2', cNoteCol2=='2', cNoteCol3=='2', cNoteCol4=='2', cNoteCol5=='2', cNoteCol6=='2' ); + cNoteCol1 != TAP_EMPTY && cNoteCol1!=TAP_HOLD_HEAD, + cNoteCol2 != TAP_EMPTY && cNoteCol2!=TAP_HOLD_HEAD, + cNoteCol3 != TAP_EMPTY && cNoteCol3!=TAP_HOLD_HEAD, + cNoteCol4 != TAP_EMPTY && cNoteCol4!=TAP_HOLD_HEAD, + cNoteCol5 != TAP_EMPTY && cNoteCol5!=TAP_HOLD_HEAD, + cNoteCol6 != TAP_EMPTY && cNoteCol6!=TAP_HOLD_HEAD ); + char cHold = NotesToDWIChar( cNoteCol1==TAP_HOLD_HEAD, + cNoteCol2==TAP_HOLD_HEAD, + cNoteCol3==TAP_HOLD_HEAD, + cNoteCol4==TAP_HOLD_HEAD, + cNoteCol5==TAP_HOLD_HEAD, + cNoteCol6==TAP_HOLD_HEAD ); if( cHold != '0' ) return ssprintf( "%c!%c", cShow, cHold ); @@ -68,9 +73,9 @@ CString NotesWriterDWI::NotesToDWIString( char cNoteCol1, char cNoteCol2, char c return ssprintf( "%c", cShow ); } -CString NotesWriterDWI::NotesToDWIString( char cNoteCol1, char cNoteCol2, char cNoteCol3, char cNoteCol4 ) +CString NotesWriterDWI::NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4 ) { - return NotesToDWIString( cNoteCol1, '0', cNoteCol2, cNoteCol3, '0', cNoteCol4 ); + return NotesToDWIString( cNoteCol1, TAP_EMPTY, cNoteCol2, cNoteCol3, TAP_EMPTY, cNoteCol4 ); } void NotesWriterDWI::WriteDWINotesField( FILE* fp, const Notes &out, int start ) diff --git a/stepmania/src/NotesWriterDWI.h b/stepmania/src/NotesWriterDWI.h index aab930e807..50ab5ebc5e 100644 --- a/stepmania/src/NotesWriterDWI.h +++ b/stepmania/src/NotesWriterDWI.h @@ -3,11 +3,13 @@ #include "Song.h" #include "Notes.h" +#include "NoteTypes.h" class NotesWriterDWI { char NotesToDWIChar( bool bCol1, bool bCol2, bool bCol3, bool bCol4, bool bCol5, bool bCol6 ); char NotesToDWIChar( bool bCol1, bool bCol2, bool bCol3, bool bCol4 ); - CString NotesToDWIString( char cNoteCol1, char cNoteCol2, char cNoteCol3, char cNoteCol4, char cNoteCol5, char cNoteCol6 ); + CString NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4, TapNote cNoteCol5, TapNote cNoteCol6 ); + CString NotesToDWIString( TapNote cNoteCol1, TapNote cNoteCol2, TapNote cNoteCol3, TapNote cNoteCol4 ); CString NotesToDWIString( char cNoteCol1, char cNoteCol2, char cNoteCol3, char cNoteCol4 ); void WriteDWINotesField( FILE* fp, const Notes &out, int start ); bool WriteDWINotesTag( FILE* fp, const Notes &out );