2002-04-16 17:31:00 +00:00
|
|
|
#pragma once
|
2002-02-24 01:43:11 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-04-16 17:31:00 +00:00
|
|
|
Class: StyleDef
|
2002-02-24 01:43:11 +00:00
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
Desc: A data structure that holds the definition for one of a Game's styles.
|
|
|
|
|
Styles define a set of columns for each player, and information about those
|
|
|
|
|
columns, like what Instruments are used play those columns and what track
|
|
|
|
|
to use to populate the column's notes.
|
2002-04-28 20:42:32 +00:00
|
|
|
A "track" is the term used to descibe a particular vertical sting of note
|
|
|
|
|
in NoteData.
|
|
|
|
|
A "column" is the term used to describe the vertical string of notes that
|
|
|
|
|
a player sees on the screen while they're playing. Column notes are
|
|
|
|
|
picked from a track, but columns and tracks don't have a 1-to-1
|
|
|
|
|
correspondance. For example, dance-versus has 8 columns but only 4 tracks
|
|
|
|
|
because two players place from the same set of 4 tracks.
|
2002-02-24 01:43:11 +00:00
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
Copyright (c) 2001-2002 by the persons listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
2002-02-24 01:43:11 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
#include "NoteMetadata.h"
|
|
|
|
|
#include "NoteData.h"
|
|
|
|
|
#include "StyleInput.h"
|
|
|
|
|
#include "GameInput.h"
|
2002-02-24 01:43:11 +00:00
|
|
|
|
|
|
|
|
|
2002-04-28 20:42:32 +00:00
|
|
|
const int MAX_COLS_PER_PLAYER = MAX_NOTE_TRACKS;
|
2002-02-24 01:43:11 +00:00
|
|
|
|
2002-03-19 07:09:49 +00:00
|
|
|
|
2002-04-28 20:42:32 +00:00
|
|
|
class GameDef;
|
|
|
|
|
|
|
|
|
|
class StyleDef
|
2002-02-24 01:43:11 +00:00
|
|
|
{
|
2002-04-01 02:04:43 +00:00
|
|
|
public:
|
2002-04-28 20:42:32 +00:00
|
|
|
StyleDef( GameDef* pGameDef, CString sStyleFilePath );
|
2002-04-01 02:04:43 +00:00
|
|
|
|
2002-04-28 20:42:32 +00:00
|
|
|
struct ColumnInfo
|
|
|
|
|
{
|
|
|
|
|
TrackNumber track; // take note data from this track
|
|
|
|
|
InstrumentNumber number; // use this instrument to hit a note on this track
|
|
|
|
|
InstrumentButton button; // use this button to hit a note on this track
|
|
|
|
|
int iX; // x position of the column
|
|
|
|
|
};
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2002-04-28 20:42:32 +00:00
|
|
|
CString m_sName; // name of the style. e.g. "single", "double"
|
|
|
|
|
CString m_sDescription;
|
|
|
|
|
CString m_sReadsTag; // name of the style that we can read. For example, the style named "versus" reads the NoteData with the tag "dance-single"
|
|
|
|
|
int m_iNumPlayers; // either 1 or 2
|
|
|
|
|
int m_iColsPerPlayer; // number of total tracks this style expects (e.g. 4 for versus, but 8 for double)
|
|
|
|
|
ColumnInfo m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; // maps each players' column to a track in the NoteData
|
|
|
|
|
int m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
inline GameInput StyleInputToGameInput( const StyleInput StyleI )
|
2002-02-24 01:43:11 +00:00
|
|
|
{
|
2002-04-28 20:42:32 +00:00
|
|
|
InstrumentNumber n = m_ColumnInfo[StyleI.player][StyleI.col].number;
|
|
|
|
|
InstrumentButton b = m_ColumnInfo[StyleI.player][StyleI.col].button;
|
2002-04-16 17:31:00 +00:00
|
|
|
return GameInput( n, b );
|
2002-02-24 01:43:11 +00:00
|
|
|
};
|
|
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
inline StyleInput GameInputToStyleInput( const GameInput GameI )
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
|
|
|
|
|
{
|
2002-04-28 20:42:32 +00:00
|
|
|
if( m_ColumnInfo[p][t].number == GameI.number &&
|
|
|
|
|
m_ColumnInfo[p][t].button == GameI.button )
|
2002-04-16 17:31:00 +00:00
|
|
|
{
|
|
|
|
|
return StyleInput( (PlayerNumber)p, t );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return StyleInput(); // didn't find a StyleInput
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void GetTransformedNoteDataForStyle( PlayerNumber p, NoteData* pOriginal, NoteData &newNoteData )
|
|
|
|
|
{
|
2002-04-28 20:42:32 +00:00
|
|
|
TrackNumber iNewToOriginalTrack[MAX_COLS_PER_PLAYER];
|
|
|
|
|
for( int col=0; col<m_iColsPerPlayer; col++ )
|
2002-04-16 17:31:00 +00:00
|
|
|
{
|
2002-04-28 20:42:32 +00:00
|
|
|
ColumnInfo colInfo = m_ColumnInfo[p][col];
|
|
|
|
|
TrackNumber originalTrack = colInfo.track;
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
iNewToOriginalTrack[col] = originalTrack;
|
|
|
|
|
}
|
|
|
|
|
|
2002-04-28 20:42:32 +00:00
|
|
|
newNoteData.LoadTransformed( pOriginal, m_iColsPerPlayer, iNewToOriginalTrack );
|
2002-04-16 17:31:00 +00:00
|
|
|
}
|
2002-04-01 02:04:43 +00:00
|
|
|
|
2002-02-24 01:43:11 +00:00
|
|
|
};
|
|
|
|
|
|