Files
itgmania212121/stepmania/src/GhostArrowRow.cpp
T

90 lines
2.2 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
2002-04-16 17:31:00 +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.
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"
#include "NoteSkinManager.h"
2002-07-23 01:41:40 +00:00
#include "GameState.h"
#include "PrefsManager.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-02-17 12:19:42 +00:00
m_GhostArrowRow[c].Load( NOTESKIN->GetPathTo(pn, c, "tap explosion dim") );
m_GhostArrowRowBright[c].Load( NOTESKIN->GetPathTo(pn, c, "tap explosion bright") );
m_HoldGhostArrowRow[c].Load( NOTESKIN->GetPathTo(pn, c, "hold explosion") );
2002-05-27 08:23:27 +00:00
m_GhostArrowRow[c].SetX( pStyleDef->m_ColumnInfo[pn][c].fXOffset );
m_GhostArrowRowBright[c].SetX( pStyleDef->m_ColumnInfo[pn][c].fXOffset );
m_HoldGhostArrowRow[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++ )
{
m_GhostArrowRow[c].Update( fDeltaTime );
m_GhostArrowRowBright[c].Update( fDeltaTime );
m_HoldGhostArrowRow[c].Update( fDeltaTime );
}
}
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++ )
{
float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
2002-04-16 17:31:00 +00:00
m_GhostArrowRow[c].SetX( fX );
m_GhostArrowRowBright[c].SetX( fX );
m_HoldGhostArrowRow[c].SetX( fX );
m_GhostArrowRow[c].Draw();
m_GhostArrowRowBright[c].Draw();
m_HoldGhostArrowRow[c].Draw();
}
}
void GhostArrowRow::TapNote( int iCol, TapNoteScore score, bool bBright )
{
ASSERT( iCol >= 0 && iCol < m_iNumCols );
if( bBright )
m_GhostArrowRowBright[iCol].Step( score );
else
m_GhostArrowRow[iCol].Step( score );
}
void GhostArrowRow::HoldNote( int iCol )
{
ASSERT( iCol >= 0 && iCol < m_iNumCols );
m_HoldGhostArrowRow[iCol].Step();
}