handle Y values in GrayArrowRow and GhostArrowRow
This commit is contained in:
@@ -26,9 +26,10 @@ GhostArrowRow::GhostArrowRow()
|
|||||||
m_iNumCols = 0;
|
m_iNumCols = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GhostArrowRow::Load( PlayerNumber pn )
|
void GhostArrowRow::Load( PlayerNumber pn, float fYReverseOffset )
|
||||||
{
|
{
|
||||||
m_PlayerNumber = pn;
|
m_PlayerNumber = pn;
|
||||||
|
m_fYReverseOffsetPixels = fYReverseOffset;
|
||||||
|
|
||||||
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
||||||
|
|
||||||
@@ -55,11 +56,6 @@ void GhostArrowRow::Load( PlayerNumber pn )
|
|||||||
m_GhostBright[c].Load( NOTESKIN->GetPathTo(pn, Button, "tap explosion bright") );
|
m_GhostBright[c].Load( NOTESKIN->GetPathTo(pn, Button, "tap explosion bright") );
|
||||||
m_GhostMine[c].Load( NOTESKIN->GetPathTo(pn, Button, "tap explosion mine") );
|
m_GhostMine[c].Load( NOTESKIN->GetPathTo(pn, Button, "tap explosion mine") );
|
||||||
m_HoldGhost[c].Load( NOTESKIN->GetPathTo(pn, Button, "hold explosion") );
|
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 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,6 +68,25 @@ void GhostArrowRow::Update( float fDeltaTime )
|
|||||||
m_GhostBright[c].Update( fDeltaTime );
|
m_GhostBright[c].Update( fDeltaTime );
|
||||||
m_GhostMine[c].Update( fDeltaTime );
|
m_GhostMine[c].Update( fDeltaTime );
|
||||||
m_HoldGhost[c].Update( fDeltaTime );
|
m_HoldGhost[c].Update( fDeltaTime );
|
||||||
|
|
||||||
|
const float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
|
||||||
|
const float fY = ArrowGetYPos( m_PlayerNumber, c, 0, m_fYReverseOffsetPixels );
|
||||||
|
const float fZ = ArrowGetZPos( m_PlayerNumber, c, 0 );
|
||||||
|
|
||||||
|
m_GhostDim[c].SetX( fX );
|
||||||
|
m_GhostBright[c].SetX( fX );
|
||||||
|
m_GhostMine[c].SetX( fX );
|
||||||
|
m_HoldGhost[c].SetX( fX );
|
||||||
|
|
||||||
|
m_GhostDim[c].SetY( fY );
|
||||||
|
m_GhostBright[c].SetY( fY );
|
||||||
|
m_GhostMine[c].SetY( fY );
|
||||||
|
m_HoldGhost[c].SetY( fY );
|
||||||
|
|
||||||
|
m_GhostDim[c].SetZ( fZ );
|
||||||
|
m_GhostBright[c].SetZ( fZ );
|
||||||
|
m_GhostMine[c].SetZ( fZ );
|
||||||
|
m_HoldGhost[c].SetZ( fZ );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,18 +96,6 @@ void GhostArrowRow::DrawPrimitives()
|
|||||||
{
|
{
|
||||||
g_NoteFieldMode[m_PlayerNumber].BeginDrawTrack(c);
|
g_NoteFieldMode[m_PlayerNumber].BeginDrawTrack(c);
|
||||||
|
|
||||||
float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
|
|
||||||
m_GhostDim[c].SetX( fX );
|
|
||||||
m_GhostBright[c].SetX( fX );
|
|
||||||
m_GhostMine[c].SetX( fX );
|
|
||||||
m_HoldGhost[c].SetX( fX );
|
|
||||||
|
|
||||||
float fZ = ArrowGetZPos( m_PlayerNumber, c, 0 );
|
|
||||||
m_GhostDim[c].SetZ( fZ );
|
|
||||||
m_GhostBright[c].SetZ( fZ );
|
|
||||||
m_GhostMine[c].SetZ( fZ );
|
|
||||||
m_HoldGhost[c].SetZ( fZ );
|
|
||||||
|
|
||||||
m_GhostDim[c].Draw();
|
m_GhostDim[c].Draw();
|
||||||
m_GhostBright[c].Draw();
|
m_GhostBright[c].Draw();
|
||||||
m_GhostMine[c].Draw();
|
m_GhostMine[c].Draw();
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public:
|
|||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
void Load( PlayerNumber pn );
|
void Load( PlayerNumber pn, float fYReverseOffset );
|
||||||
|
|
||||||
void TapNote( int iCol, TapNoteScore score, bool bBright );
|
void TapNote( int iCol, TapNoteScore score, bool bBright );
|
||||||
void TapMine( int iCol, TapNoteScore score );
|
void TapMine( int iCol, TapNoteScore score );
|
||||||
@@ -34,6 +34,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_iNumCols;
|
int m_iNumCols;
|
||||||
|
float m_fYReverseOffsetPixels;
|
||||||
PlayerNumber m_PlayerNumber;
|
PlayerNumber m_PlayerNumber;
|
||||||
|
|
||||||
GhostArrow m_GhostDim[MAX_NOTE_TRACKS];
|
GhostArrow m_GhostDim[MAX_NOTE_TRACKS];
|
||||||
|
|||||||
@@ -25,9 +25,10 @@ GrayArrowRow::GrayArrowRow()
|
|||||||
m_iNumCols = 0;
|
m_iNumCols = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrayArrowRow::Load( PlayerNumber pn )
|
void GrayArrowRow::Load( PlayerNumber pn, float fYReverseOffset )
|
||||||
{
|
{
|
||||||
m_PlayerNumber = pn;
|
m_PlayerNumber = pn;
|
||||||
|
m_fYReverseOffsetPixels = fYReverseOffset;
|
||||||
|
|
||||||
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
||||||
|
|
||||||
@@ -43,6 +44,14 @@ void GrayArrowRow::Update( float fDeltaTime )
|
|||||||
{
|
{
|
||||||
m_GrayArrow[c].Update( fDeltaTime );
|
m_GrayArrow[c].Update( fDeltaTime );
|
||||||
m_GrayArrow[c].SetDiffuse( RageColor(1,1,1,1 - GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fDark) );
|
m_GrayArrow[c].SetDiffuse( RageColor(1,1,1,1 - GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fDark) );
|
||||||
|
|
||||||
|
// set arrow XYZ
|
||||||
|
const float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
|
||||||
|
const float fY = ArrowGetYPos( m_PlayerNumber, c, 0, m_fYReverseOffsetPixels );
|
||||||
|
const float fZ = ArrowGetZPos( m_PlayerNumber, c, 0 );
|
||||||
|
m_GrayArrow[c].SetX( fX );
|
||||||
|
m_GrayArrow[c].SetY( fY );
|
||||||
|
m_GrayArrow[c].SetZ( fZ );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,17 +60,9 @@ void GrayArrowRow::DrawPrimitives()
|
|||||||
for( int c=0; c<m_iNumCols; c++ )
|
for( int c=0; c<m_iNumCols; c++ )
|
||||||
{
|
{
|
||||||
g_NoteFieldMode[m_PlayerNumber].BeginDrawTrack(c);
|
g_NoteFieldMode[m_PlayerNumber].BeginDrawTrack(c);
|
||||||
|
|
||||||
// set arrow X
|
|
||||||
float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
|
|
||||||
m_GrayArrow[c].SetX( fX );
|
|
||||||
float fZ = ArrowGetZPos( m_PlayerNumber, c, 0 );
|
|
||||||
m_GrayArrow[c].SetZ( fZ );
|
|
||||||
m_GrayArrow[c].Draw();
|
m_GrayArrow[c].Draw();
|
||||||
|
|
||||||
g_NoteFieldMode[m_PlayerNumber].EndDrawTrack(c);
|
g_NoteFieldMode[m_PlayerNumber].EndDrawTrack(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrayArrowRow::Step( int iCol )
|
void GrayArrowRow::Step( int iCol )
|
||||||
@@ -69,3 +70,10 @@ void GrayArrowRow::Step( int iCol )
|
|||||||
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
||||||
m_GrayArrow[iCol].Step();
|
m_GrayArrow[iCol].Step();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GrayArrowRow::UpdateBars( int iCol )
|
||||||
|
{
|
||||||
|
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
||||||
|
m_GrayArrow[iCol].UpdateBars();
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,16 +22,18 @@ class GrayArrowRow : public ActorFrame
|
|||||||
public:
|
public:
|
||||||
GrayArrowRow();
|
GrayArrowRow();
|
||||||
|
|
||||||
void Load( PlayerNumber pn );
|
void Load( PlayerNumber pn, float fYReverseOffset );
|
||||||
|
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
void Step( int iCol );
|
void Step( int iCol );
|
||||||
|
void UpdateBars( int iCol );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_iNumCols;
|
int m_iNumCols;
|
||||||
PlayerNumber m_PlayerNumber;
|
PlayerNumber m_PlayerNumber;
|
||||||
|
float m_fYReverseOffsetPixels;
|
||||||
|
|
||||||
GrayArrow m_GrayArrow[MAX_NOTE_TRACKS];
|
GrayArrow m_GrayArrow[MAX_NOTE_TRACKS];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -278,8 +278,8 @@ ScreenEdit::ScreenEdit( CString sName ) : Screen( sName )
|
|||||||
m_SnapDisplay.Load( PLAYER_1 );
|
m_SnapDisplay.Load( PLAYER_1 );
|
||||||
m_SnapDisplay.SetZoom( 0.5f );
|
m_SnapDisplay.SetZoom( 0.5f );
|
||||||
|
|
||||||
m_GrayArrowRowEdit.SetXY( EDIT_X, PLAYER_Y_STANDARD );
|
m_GrayArrowRowEdit.SetXY( EDIT_X, PLAYER_Y );
|
||||||
m_GrayArrowRowEdit.Load( PLAYER_1 );
|
m_GrayArrowRowEdit.Load( PLAYER_1, PLAYER_HEIGHT*2 );
|
||||||
m_GrayArrowRowEdit.SetZoom( 0.5f );
|
m_GrayArrowRowEdit.SetZoom( 0.5f );
|
||||||
|
|
||||||
m_NoteFieldEdit.SetXY( EDIT_X, PLAYER_Y );
|
m_NoteFieldEdit.SetXY( EDIT_X, PLAYER_Y );
|
||||||
@@ -290,7 +290,7 @@ ScreenEdit::ScreenEdit( CString sName ) : Screen( sName )
|
|||||||
m_rectRecordBack.SetDiffuse( RageColor(0,0,0,0) );
|
m_rectRecordBack.SetDiffuse( RageColor(0,0,0,0) );
|
||||||
|
|
||||||
m_GrayArrowRowRecord.SetXY( EDIT_X, PLAYER_Y_STANDARD );
|
m_GrayArrowRowRecord.SetXY( EDIT_X, PLAYER_Y_STANDARD );
|
||||||
m_GrayArrowRowRecord.Load( PLAYER_1 );
|
m_GrayArrowRowRecord.Load( PLAYER_1, PLAYER_HEIGHT*2 );
|
||||||
m_GrayArrowRowRecord.SetZoom( 1.0f );
|
m_GrayArrowRowRecord.SetZoom( 1.0f );
|
||||||
|
|
||||||
m_NoteFieldRecord.SetXY( EDIT_X, PLAYER_Y );
|
m_NoteFieldRecord.SetXY( EDIT_X, PLAYER_Y );
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "AnnouncerManager.h"
|
#include "AnnouncerManager.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
|
#include "NoteFieldPositioning.h"
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -187,7 +188,10 @@ ScreenNameEntry::ScreenNameEntry( CString sClassName ) : Screen( sClassName )
|
|||||||
|
|
||||||
ASSERT( GAMESTATE->IsHumanPlayer(p) ); // they better be enabled if they made a high score!
|
ASSERT( GAMESTATE->IsHumanPlayer(p) ); // they better be enabled if they made a high score!
|
||||||
|
|
||||||
m_GrayArrowRow[p].Load( (PlayerNumber)p );
|
/* Ensure that this is up-to-date. */
|
||||||
|
GAMESTATE->m_pPosition->Load( (PlayerNumber)p );
|
||||||
|
|
||||||
|
m_GrayArrowRow[p].Load( (PlayerNumber)p, 0 );
|
||||||
m_GrayArrowRow[p].SetX( (float)GAMESTATE->GetCurrentStyleDef()->m_iCenterX[p] );
|
m_GrayArrowRow[p].SetX( (float)GAMESTATE->GetCurrentStyleDef()->m_iCenterX[p] );
|
||||||
m_GrayArrowRow[p].SetY( SCREEN_TOP + 100 );
|
m_GrayArrowRow[p].SetY( SCREEN_TOP + 100 );
|
||||||
this->AddChild( &m_GrayArrowRow[p] );
|
this->AddChild( &m_GrayArrowRow[p] );
|
||||||
|
|||||||
Reference in New Issue
Block a user