remove some more old experimental stuff
This commit is contained in:
@@ -40,36 +40,8 @@ void NoteFieldMode::EndDrawTrack(int tn)
|
|||||||
DISPLAY->CameraPopMatrix();
|
DISPLAY->CameraPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
|
||||||
static bool GetValue(const XNode *pNode, int pn, const CString &valuename, T &value )
|
|
||||||
{
|
|
||||||
if(pn != -1 && pNode->GetAttrValue( ssprintf("P%i%s", pn+1, valuename.c_str()), value))
|
|
||||||
return true;
|
|
||||||
return pNode->GetAttrValue( valuename, value );
|
|
||||||
}
|
|
||||||
|
|
||||||
void NoteFieldMode::Load(const XNode *pNode, int pn)
|
|
||||||
{
|
|
||||||
m_Id = pNode->m_sName;
|
|
||||||
|
|
||||||
/* Required: */
|
|
||||||
ASSERT( pNode->GetAttrValue("Name", m_Name ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
NoteFieldPositioning::NoteFieldPositioning(CString fn)
|
NoteFieldPositioning::NoteFieldPositioning(CString fn)
|
||||||
{
|
{
|
||||||
m_Filename = fn;
|
|
||||||
IniFile ini;
|
|
||||||
if( !ini.ReadFile(fn) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
FOREACH_CONST_Child( &ini, i )
|
|
||||||
{
|
|
||||||
NoteFieldMode m;
|
|
||||||
m.Load( i );
|
|
||||||
|
|
||||||
Modes.push_back(m);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NoteFieldMode::MatchesCurrentGame() const
|
bool NoteFieldMode::MatchesCurrentGame() const
|
||||||
@@ -91,65 +63,9 @@ void NoteFieldPositioning::Load(PlayerNumber pn)
|
|||||||
const float fPixelXOffsetFromCenter = s->m_ColumnInfo[pn][tn].fXOffset;
|
const float fPixelXOffsetFromCenter = s->m_ColumnInfo[pn][tn].fXOffset;
|
||||||
mode.m_fPositionTrackX[tn] = fPixelXOffsetFromCenter;
|
mode.m_fPositionTrackX[tn] = fPixelXOffsetFromCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Is there a custom mode with the current name that fits the current game? */
|
|
||||||
const int ModeNum = GetID(GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.m_sPositioning);
|
|
||||||
if(ModeNum == -1)
|
|
||||||
return; /* No, only use the style table settings. */
|
|
||||||
|
|
||||||
/* We have a custom mode. Reload the mode on top of the default style
|
|
||||||
* table settings. */
|
|
||||||
IniFile ini;
|
|
||||||
if( !ini.ReadFile(m_Filename) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
XNode* pNode = ini.GetChild( Modes[ModeNum].m_Id );
|
|
||||||
ASSERT( pNode );
|
|
||||||
mode.Load( pNode, pn );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Get the unique ID of the given name, for the current game/style. If it
|
|
||||||
* doesn't exist, return "". */
|
|
||||||
int NoteFieldPositioning::GetID(const CString &name) const
|
|
||||||
{
|
|
||||||
for(unsigned i = 0; i < Modes.size(); ++i)
|
|
||||||
{
|
|
||||||
if(Modes[i].m_Name.CompareNoCase(name))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(!Modes[i].MatchesCurrentGame())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Get all arrow modifier names for the current game. */
|
|
||||||
void NoteFieldPositioning::GetNamesForCurrentGame(vector<CString> &IDs)
|
|
||||||
{ // XXX dupes
|
|
||||||
/* Iterate over all keys. */
|
|
||||||
for(unsigned i = 0; i < Modes.size(); ++i)
|
|
||||||
{
|
|
||||||
if(!Modes[i].MatchesCurrentGame())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
IDs.push_back(Modes[i].m_Name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NoteFieldPositioning::IsValidModeForAnyStyle(CString mode) const
|
|
||||||
{
|
|
||||||
for(unsigned i = 0; i < Modes.size(); ++i)
|
|
||||||
if(Modes[i].m_Name.CompareNoCase(mode)==0)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -12,17 +12,10 @@ struct NoteFieldMode
|
|||||||
{
|
{
|
||||||
NoteFieldMode();
|
NoteFieldMode();
|
||||||
bool MatchesCurrentGame() const;
|
bool MatchesCurrentGame() const;
|
||||||
void Load(const XNode* pNode, int pn = -1);
|
|
||||||
|
|
||||||
void BeginDrawTrack(int tn);
|
void BeginDrawTrack(int tn);
|
||||||
void EndDrawTrack(int tn);
|
void EndDrawTrack(int tn);
|
||||||
|
|
||||||
/* Visual name. */
|
|
||||||
CString m_Name;
|
|
||||||
|
|
||||||
/* Unique ID from the INI. */
|
|
||||||
CString m_Id;
|
|
||||||
|
|
||||||
float m_fPositionTrackX[MAX_NOTE_TRACKS];
|
float m_fPositionTrackX[MAX_NOTE_TRACKS];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -32,14 +25,8 @@ public:
|
|||||||
NoteFieldPositioning(CString fn);
|
NoteFieldPositioning(CString fn);
|
||||||
void Load(PlayerNumber pn);
|
void Load(PlayerNumber pn);
|
||||||
|
|
||||||
void GetNamesForCurrentGame(vector<CString> &IDs);
|
|
||||||
bool IsValidModeForCurrentStyle(CString mode) const;
|
|
||||||
bool IsValidModeForAnyStyle(CString mode) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CString m_Filename;
|
|
||||||
vector<NoteFieldMode> Modes;
|
vector<NoteFieldMode> Modes;
|
||||||
int GetID(const CString &name) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern NoteFieldMode g_NoteFieldMode[NUM_PLAYERS];
|
extern NoteFieldMode g_NoteFieldMode[NUM_PLAYERS];
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ void PlayerOptions::Init()
|
|||||||
ZERO( m_bTransforms );
|
ZERO( m_bTransforms );
|
||||||
m_bProTiming = false;
|
m_bProTiming = false;
|
||||||
m_ScoreDisplay = SCORING_ADD;
|
m_ScoreDisplay = SCORING_ADD;
|
||||||
m_sPositioning = ""; // "null"
|
|
||||||
m_sNoteSkin = "default";
|
m_sNoteSkin = "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,8 +169,6 @@ CString PlayerOptions::GetString() const
|
|||||||
else if( m_fSkew==0 && m_fPerspectiveTilt==+1 )
|
else if( m_fSkew==0 && m_fPerspectiveTilt==+1 )
|
||||||
sReturn += "Distant, ";
|
sReturn += "Distant, ";
|
||||||
|
|
||||||
if( !m_sPositioning.empty() )
|
|
||||||
sReturn += m_sPositioning + ", ";
|
|
||||||
if( !m_sNoteSkin.empty() && m_sNoteSkin.CompareNoCase("default")!=0 )
|
if( !m_sNoteSkin.empty() && m_sNoteSkin.CompareNoCase("default")!=0 )
|
||||||
sReturn += m_sNoteSkin + ", ";
|
sReturn += m_sNoteSkin + ", ";
|
||||||
|
|
||||||
@@ -304,12 +301,6 @@ void PlayerOptions::FromString( CString sOptions )
|
|||||||
else if( sBit == "space" ) { m_fSkew = level; m_fPerspectiveTilt = +level; m_SpeedfSkew = m_SpeedfPerspectiveTilt = speed; }
|
else if( sBit == "space" ) { m_fSkew = level; m_fPerspectiveTilt = +level; m_SpeedfSkew = m_SpeedfPerspectiveTilt = speed; }
|
||||||
else if( sBit == "hallway" ) { m_fSkew = 0; m_fPerspectiveTilt = -level; m_SpeedfSkew = m_SpeedfPerspectiveTilt = speed; }
|
else if( sBit == "hallway" ) { m_fSkew = 0; m_fPerspectiveTilt = -level; m_SpeedfSkew = m_SpeedfPerspectiveTilt = speed; }
|
||||||
else if( sBit == "distant" ) { m_fSkew = 0; m_fPerspectiveTilt = +level; m_SpeedfSkew = m_SpeedfPerspectiveTilt = speed; }
|
else if( sBit == "distant" ) { m_fSkew = 0; m_fPerspectiveTilt = +level; m_SpeedfSkew = m_SpeedfPerspectiveTilt = speed; }
|
||||||
else if( GAMESTATE->m_pPosition && GAMESTATE->m_pPosition->IsValidModeForAnyStyle(sBit) )
|
|
||||||
// The only time we'll be in this function and NOTESKIN isn't created is
|
|
||||||
// when calculating RadarValues for courses with transform mods.
|
|
||||||
m_sPositioning = sBit;
|
|
||||||
else if( sBit == "nopositioning" )
|
|
||||||
m_sPositioning = "";
|
|
||||||
else if( NOTESKIN && NOTESKIN->DoesNoteSkinExist(sBit) )
|
else if( NOTESKIN && NOTESKIN->DoesNoteSkinExist(sBit) )
|
||||||
m_sNoteSkin = sBit;
|
m_sNoteSkin = sBit;
|
||||||
else if( sBit == "noteskin" && !on ) /* "no noteskin" */
|
else if( sBit == "noteskin" && !on ) /* "no noteskin" */
|
||||||
@@ -530,7 +521,6 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
|
|||||||
COMPARE(m_bProTiming);
|
COMPARE(m_bProTiming);
|
||||||
COMPARE(m_fPerspectiveTilt);
|
COMPARE(m_fPerspectiveTilt);
|
||||||
COMPARE(m_fSkew);
|
COMPARE(m_fSkew);
|
||||||
COMPARE(m_sPositioning);
|
|
||||||
COMPARE(m_sNoteSkin);
|
COMPARE(m_sNoteSkin);
|
||||||
for( int i = 0; i < PlayerOptions::NUM_ACCELS; ++i )
|
for( int i = 0; i < PlayerOptions::NUM_ACCELS; ++i )
|
||||||
COMPARE(m_fAccels[i]);
|
COMPARE(m_fAccels[i]);
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ struct PlayerOptions
|
|||||||
bool m_bProTiming;
|
bool m_bProTiming;
|
||||||
ScoreDisplay m_ScoreDisplay;
|
ScoreDisplay m_ScoreDisplay;
|
||||||
|
|
||||||
CString m_sPositioning; /* The current positioning mode, or empty to use the normal positions. */
|
|
||||||
CString m_sNoteSkin;
|
CString m_sNoteSkin;
|
||||||
|
|
||||||
void NextAccel();
|
void NextAccel();
|
||||||
|
|||||||
Reference in New Issue
Block a user