2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2002-04-16 17:31:00 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-08-13 23:26:46 +00:00
|
|
|
Class: GhostArrowRow
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
Desc: A graphic displayed in the GhostArrowRow during Dancing.
|
|
|
|
|
|
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-04-16 17:31:00 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "GhostArrowRow.h"
|
|
|
|
|
#include "RageUtil.h"
|
2002-05-01 19:14:55 +00:00
|
|
|
#include "GameConstantsAndTypes.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-04-16 17:31:00 +00:00
|
|
|
#include "ArrowEffects.h"
|
2003-02-06 07:32:57 +00:00
|
|
|
#include "NoteSkinManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "PrefsManager.h"
|
2003-04-02 21:58:27 +00:00
|
|
|
#include "NoteFieldPositioning.h"
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
GhostArrowRow::GhostArrowRow()
|
|
|
|
|
{
|
|
|
|
|
m_iNumCols = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2002-07-28 20:28:37 +00:00
|
|
|
void GhostArrowRow::Load( PlayerNumber pn )
|
2002-04-16 17:31:00 +00:00
|
|
|
{
|
2002-07-28 20:28:37 +00:00
|
|
|
m_PlayerNumber = pn;
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2002-08-22 22:59:54 +00:00
|
|
|
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2002-04-28 20:42:32 +00:00
|
|
|
m_iNumCols = pStyleDef->m_iColsPerPlayer;
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
// init arrows
|
|
|
|
|
for( int c=0; c<m_iNumCols; c++ )
|
|
|
|
|
{
|
2003-04-17 21:45:37 +00:00
|
|
|
CString Button = g_NoteFieldMode[m_PlayerNumber].GhostButtonNames[c];
|
|
|
|
|
if(Button == "")
|
|
|
|
|
Button = NoteSkinManager::ColToButtonName(c);
|
|
|
|
|
|
2003-08-10 21:27:54 +00:00
|
|
|
m_GhostDim[c].SetName( "GhostArrowDim" );
|
|
|
|
|
m_GhostBright[c].SetName( "GhostArrowBright" );
|
|
|
|
|
m_GhostMine[c].SetName( "GhostArrowMine" );
|
|
|
|
|
m_HoldGhost[c].SetName( "HoldGhostArrow" );
|
|
|
|
|
|
|
|
|
|
m_GhostDim[c].Init( pn );
|
|
|
|
|
m_GhostBright[c].Init( pn );
|
|
|
|
|
m_GhostMine[c].Init( pn );
|
|
|
|
|
//m_HoldGhost[c].Init( pn );
|
|
|
|
|
|
|
|
|
|
m_GhostDim[c].Load( NOTESKIN->GetPathTo(pn, Button, "tap explosion dim") );
|
|
|
|
|
m_GhostBright[c].Load( NOTESKIN->GetPathTo(pn, Button, "tap explosion bright") );
|
|
|
|
|
m_GhostMine[c].Load( NOTESKIN->GetPathTo(pn, Button, "tap explosion mine") );
|
|
|
|
|
m_HoldGhost[c].Load( NOTESKIN->GetPathTo(pn, Button, "hold explosion") );
|
|
|
|
|
|
|
|
|
|
m_GhostDim[c].SetX( pStyleDef->m_ColumnInfo[pn][c].fXOffset );
|
|
|
|
|
m_GhostBright[c].SetX( pStyleDef->m_ColumnInfo[pn][c].fXOffset );
|
|
|
|
|
m_GhostMine[c].SetX( pStyleDef->m_ColumnInfo[pn][c].fXOffset );
|
|
|
|
|
m_HoldGhost[c].SetX( pStyleDef->m_ColumnInfo[pn][c].fXOffset );
|
2002-04-16 17:31:00 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-07-28 20:28:37 +00:00
|
|
|
void GhostArrowRow::Update( float fDeltaTime )
|
2002-04-16 17:31:00 +00:00
|
|
|
{
|
|
|
|
|
for( int c=0; c<m_iNumCols; c++ )
|
|
|
|
|
{
|
2003-08-10 21:27:54 +00:00
|
|
|
m_GhostDim[c].Update( fDeltaTime );
|
|
|
|
|
m_GhostBright[c].Update( fDeltaTime );
|
|
|
|
|
m_GhostMine[c].Update( fDeltaTime );
|
|
|
|
|
m_HoldGhost[c].Update( fDeltaTime );
|
2002-04-16 17:31:00 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
void GhostArrowRow::DrawPrimitives()
|
2002-04-16 17:31:00 +00:00
|
|
|
{
|
|
|
|
|
for( int c=0; c<m_iNumCols; c++ )
|
|
|
|
|
{
|
2003-04-15 02:52:58 +00:00
|
|
|
g_NoteFieldMode[m_PlayerNumber].BeginDrawTrack(c);
|
2003-04-02 21:58:27 +00:00
|
|
|
|
2002-08-29 01:38:21 +00:00
|
|
|
float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
|
2003-08-10 21:27:54 +00:00
|
|
|
m_GhostDim[c].SetX( fX );
|
|
|
|
|
m_GhostBright[c].SetX( fX );
|
|
|
|
|
m_GhostMine[c].SetX( fX );
|
|
|
|
|
m_HoldGhost[c].SetX( fX );
|
|
|
|
|
|
2003-07-12 20:10:48 +00:00
|
|
|
float fZ = ArrowGetZPos( m_PlayerNumber, c, 0 );
|
2003-08-10 21:27:54 +00:00
|
|
|
m_GhostDim[c].SetZ( fZ );
|
|
|
|
|
m_GhostBright[c].SetZ( fZ );
|
|
|
|
|
m_GhostMine[c].SetZ( fZ );
|
|
|
|
|
m_HoldGhost[c].SetZ( fZ );
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2003-08-10 21:27:54 +00:00
|
|
|
m_GhostDim[c].Draw();
|
|
|
|
|
m_GhostBright[c].Draw();
|
|
|
|
|
m_GhostMine[c].Draw();
|
|
|
|
|
m_HoldGhost[c].Draw();
|
2003-04-02 21:58:27 +00:00
|
|
|
|
2003-04-15 02:52:58 +00:00
|
|
|
g_NoteFieldMode[m_PlayerNumber].EndDrawTrack(c);
|
2002-04-16 17:31:00 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GhostArrowRow::TapNote( int iCol, TapNoteScore score, bool bBright )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
|
|
|
|
if( bBright )
|
2003-08-10 21:27:54 +00:00
|
|
|
m_GhostBright[iCol].Step( score );
|
2002-04-16 17:31:00 +00:00
|
|
|
else
|
2003-08-10 21:27:54 +00:00
|
|
|
m_GhostDim[iCol].Step( score );
|
2002-04-16 17:31:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GhostArrowRow::HoldNote( int iCol )
|
|
|
|
|
{
|
|
|
|
|
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
2003-08-10 21:27:54 +00:00
|
|
|
m_HoldGhost[iCol].Step();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GhostArrowRow::TapMine( int iCol, TapNoteScore score )
|
|
|
|
|
{
|
|
|
|
|
m_GhostMine[iCol].Step( score );
|
2002-04-16 17:31:00 +00:00
|
|
|
}
|