2002-03-19 07:09:49 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-08-13 23:26:46 +00:00
|
|
|
Class: StyleDef
|
2002-03-19 07:09:49 +00:00
|
|
|
|
|
|
|
|
Desc: A data structure that holds the definition of a GameMode.
|
|
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-08-13 23:26:46 +00:00
|
|
|
Chris Danford
|
2002-03-19 07:09:49 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "StyleDef.h"
|
2002-05-01 19:14:55 +00:00
|
|
|
#include "RageLog.h"
|
2002-04-01 02:04:43 +00:00
|
|
|
#include "RageUtil.h"
|
2002-04-28 20:42:32 +00:00
|
|
|
#include "GameDef.h"
|
|
|
|
|
#include "IniFile.h"
|
2002-03-19 07:09:49 +00:00
|
|
|
|
|
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
void StyleDef::GetTransformedNoteDataForStyle( PlayerNumber p, NoteData* pOriginal, NoteData* pNoteDataOut )
|
2002-05-01 19:14:55 +00:00
|
|
|
{
|
2002-05-27 08:23:27 +00:00
|
|
|
int iNewToOriginalTrack[MAX_COLS_PER_PLAYER];
|
2002-05-01 19:14:55 +00:00
|
|
|
for( int col=0; col<m_iColsPerPlayer; col++ )
|
|
|
|
|
{
|
|
|
|
|
ColumnInfo colInfo = m_ColumnInfo[p][col];
|
2002-05-27 08:23:27 +00:00
|
|
|
int originalTrack = colInfo.track;
|
2002-05-01 19:14:55 +00:00
|
|
|
|
|
|
|
|
iNewToOriginalTrack[col] = originalTrack;
|
|
|
|
|
}
|
|
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
pNoteDataOut->LoadTransformed( pOriginal, m_iColsPerPlayer, iNewToOriginalTrack );
|
2002-07-31 19:40:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GameInput StyleDef::StyleInputToGameInput( const StyleInput StyleI )
|
|
|
|
|
{
|
|
|
|
|
GameController c = m_ColumnInfo[StyleI.player][StyleI.col].controller;
|
|
|
|
|
GameButton b = m_ColumnInfo[StyleI.player][StyleI.col].button;
|
|
|
|
|
return GameInput( c, b );
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StyleInput StyleDef::GameInputToStyleInput( const GameInput &GameI )
|
|
|
|
|
{
|
|
|
|
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
|
|
|
{
|
|
|
|
|
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
|
|
|
|
|
{
|
|
|
|
|
if( m_ColumnInfo[p][t].controller == GameI.controller &&
|
|
|
|
|
m_ColumnInfo[p][t].button == GameI.button )
|
|
|
|
|
{
|
|
|
|
|
return StyleInput( (PlayerNumber)p, t );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return StyleInput(); // Didn't find a match. Return invalid.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|