CanAutoGenStepsType. For some reason lights cannot be autogenned. I've moved that from Song to GameManager. Whenever this restriction is lifted (I don't know why the restriction exists), it should be changed to ST_FLAGS_NONE.

This commit is contained in:
Steve Checkoway
2006-07-24 05:01:48 +00:00
parent 5da3ac8f36
commit 52d48a1eac
3 changed files with 47 additions and 33 deletions
+44 -30
View File
@@ -65,39 +65,47 @@ const int TECHNO_VERSUS_COL_SPACING = 33;
const int POPN5_COL_SPACING = 32; const int POPN5_COL_SPACING = 32;
const int POPN9_COL_SPACING = 32; const int POPN9_COL_SPACING = 32;
static struct { enum
{
ST_FLAGS_NONE = 0,
ST_FLAGS_DONT_AUTOGEN = 1 << 0
};
static struct
{
char *name; char *name;
int NumTracks; int NumTracks;
uint32_t flags;
} const StepsTypes[NUM_STEPS_TYPES] = { } const StepsTypes[NUM_STEPS_TYPES] = {
{ "dance-single", 4 }, { "dance-single", 4, ST_FLAGS_NONE },
{ "dance-double", 8 }, { "dance-double", 8, ST_FLAGS_NONE },
{ "dance-couple", 8 }, { "dance-couple", 8, ST_FLAGS_NONE },
{ "dance-solo", 6 }, { "dance-solo", 6, ST_FLAGS_NONE },
{ "dance-routine", 8 }, { "dance-routine", 8, ST_FLAGS_DONT_AUTOGEN },
{ "pump-single", 5 }, { "pump-single", 5, ST_FLAGS_NONE },
{ "pump-halfdouble",6 }, { "pump-halfdouble", 6, ST_FLAGS_NONE },
{ "pump-double", 10 }, { "pump-double", 10, ST_FLAGS_NONE },
{ "pump-couple", 10 }, { "pump-couple", 10, ST_FLAGS_NONE },
{ "ez2-single", 5 }, // Single: TL,LHH,D,RHH,TR { "ez2-single", 5, ST_FLAGS_NONE }, // Single: TL,LHH,D,RHH,TR
{ "ez2-double", 10 }, // Double: Single x2 { "ez2-double", 10, ST_FLAGS_NONE }, // Double: Single x2
{ "ez2-real", 7 }, // Real: TL,LHH,LHL,D,RHL,RHH,TR { "ez2-real", 7, ST_FLAGS_NONE }, // Real: TL,LHH,LHL,D,RHL,RHH,TR
{ "para-single", 5 }, { "para-single", 5, ST_FLAGS_NONE },
{ "para-versus", 10 }, { "para-versus", 10, ST_FLAGS_NONE },
{ "ds3ddx-single", 8 }, { "ds3ddx-single", 8, ST_FLAGS_NONE },
{ "bm-single5", 6 }, // called "bm" for backward compat { "bm-single5", 6, ST_FLAGS_NONE }, // called "bm" for backward compat
{ "bm-double5", 12 }, // called "bm" for backward compat { "bm-double5", 12, ST_FLAGS_NONE }, // called "bm" for backward compat
{ "bm-single7", 8 }, // called "bm" for backward compat { "bm-single7", 8, ST_FLAGS_NONE }, // called "bm" for backward compat
{ "bm-double7", 16 }, // called "bm" for backward compat { "bm-double7", 16, ST_FLAGS_NONE }, // called "bm" for backward compat
{ "maniax-single", 4 }, { "maniax-single", 4, ST_FLAGS_NONE },
{ "maniax-double", 8 }, { "maniax-double", 8, ST_FLAGS_NONE },
{ "techno-single4", 4 }, { "techno-single4", 4, ST_FLAGS_NONE },
{ "techno-single5", 5 }, { "techno-single5", 5, ST_FLAGS_NONE },
{ "techno-single8", 8 }, { "techno-single8", 8, ST_FLAGS_NONE },
{ "techno-double4", 8 }, { "techno-double4", 8, ST_FLAGS_NONE },
{ "techno-double5", 10 }, { "techno-double5", 10, ST_FLAGS_NONE },
{ "pnm-five", 5 }, // called "pnm" for backward compat { "pnm-five", 5, ST_FLAGS_NONE }, // called "pnm" for backward compat
{ "pnm-nine", 9 }, // called "pnm" for backward compat { "pnm-nine", 9, ST_FLAGS_NONE }, // called "pnm" for backward compat
{ "lights-cabinet", NUM_CABINET_LIGHTS }, { "lights-cabinet", NUM_CABINET_LIGHTS, ST_FLAGS_DONT_AUTOGEN }, // XXX disable lights autogen for now
}; };
// //
@@ -2766,6 +2774,12 @@ int GameManager::StepsTypeToNumTracks( StepsType st )
return StepsTypes[st].NumTracks; return StepsTypes[st].NumTracks;
} }
bool GameManager::CanAutoGenStepsType( StepsType st )
{
ASSERT_M( st < NUM_STEPS_TYPES, ssprintf("%d", st) );
return !(StepsTypes[st].flags & ST_FLAGS_DONT_AUTOGEN);
}
StepsType GameManager::StringToStepsType( RString sStepsType ) StepsType GameManager::StringToStepsType( RString sStepsType )
{ {
sStepsType.MakeLower(); sStepsType.MakeLower();
+1
View File
@@ -30,6 +30,7 @@ public:
const Game* GetGameFromIndex( int index ) const; const Game* GetGameFromIndex( int index ) const;
static int StepsTypeToNumTracks( StepsType st ); static int StepsTypeToNumTracks( StepsType st );
static bool CanAutoGenStepsType( StepsType st );
static StepsType StringToStepsType( RString sStepsType ); static StepsType StringToStepsType( RString sStepsType );
static RString StepsTypeToString( StepsType st ); static RString StepsTypeToString( StepsType st );
static RString StepsTypeToLocalizedString( StepsType st ); static RString StepsTypeToLocalizedString( StepsType st );
+2 -3
View File
@@ -800,8 +800,7 @@ void Song::AddAutoGenNotes()
/* If m_bAutogenSteps is disabled, only autogen lights. */ /* If m_bAutogenSteps is disabled, only autogen lights. */
if( !PREFSMAN->m_bAutogenSteps && stMissing != STEPS_TYPE_LIGHTS_CABINET ) if( !PREFSMAN->m_bAutogenSteps && stMissing != STEPS_TYPE_LIGHTS_CABINET )
continue; continue;
/* XXX: disable lights autogen for now */ if( !GameManager::CanAutoGenStepsType(stMissing) )
if( stMissing == STEPS_TYPE_LIGHTS_CABINET )
continue; continue;
// missing Steps of this type // missing Steps of this type
@@ -841,7 +840,7 @@ void Song::AutoGen( StepsType ntTo, StepsType ntFrom )
if( pOriginalNotes->m_StepsType == ntFrom ) if( pOriginalNotes->m_StepsType == ntFrom )
{ {
Steps* pNewNotes = new Steps; Steps* pNewNotes = new Steps;
pNewNotes->AutogenFrom(pOriginalNotes, ntTo); pNewNotes->AutogenFrom( pOriginalNotes, ntTo );
this->AddSteps( pNewNotes ); this->AddSteps( pNewNotes );
} }
} }