Add "tipsy" effect (is there a better name for this?)

This commit is contained in:
Chris Danford
2003-08-16 23:34:47 +00:00
parent 7395839f3e
commit 7429c86ebe
17 changed files with 343 additions and 79 deletions
+13 -4
View File
@@ -24,7 +24,7 @@
float g_fExpandSeconds = 0;
float ArrowGetYOffset( PlayerNumber pn, float fNoteBeat )
float ArrowGetYOffset( PlayerNumber pn, int iCol, float fNoteBeat )
{
float fYOffset;
if( !GAMESTATE->m_PlayerOptions[pn].m_bTimeSpacing )
@@ -48,6 +48,7 @@ float ArrowGetYOffset( PlayerNumber pn, float fNoteBeat )
return fYOffset;
const float* fAccels = GAMESTATE->m_CurrentPlayerOptions[pn].m_fAccels;
const float* fEffects = GAMESTATE->m_CurrentPlayerOptions[pn].m_fEffects;
float fYAdjust = 0; // fill this in depending on PlayerOptions
@@ -172,15 +173,23 @@ float ArrowGetRotation( PlayerNumber pn, float fNoteBeat )
return 0;
}
float ArrowGetYPosWithoutReverse( PlayerNumber pn, float fYOffset )
float ArrowGetYPosWithoutReverse( PlayerNumber pn, int iCol, float fYOffset )
{
float fYPos = fYOffset * GAMESTATE->m_CurrentPlayerOptions[pn].m_fScrollSpeed;
return fYPos;
}
float ArrowGetYPos( PlayerNumber pn, float fYOffset )
float ArrowGetYPos( PlayerNumber pn, int iCol, float fYOffset, float fYReverseOffsetPixels )
{
return ArrowGetYPosWithoutReverse(pn,fYOffset) * SCALE( GAMESTATE->m_CurrentPlayerOptions[pn].m_fReverseScroll, 0.f, 1.f, 1.f, -1.f );
float f = ArrowGetYPosWithoutReverse(pn,iCol,fYOffset);
f *= SCALE( GAMESTATE->m_CurrentPlayerOptions[pn].m_fReverseScroll, 0.f, 1.f, 1.f, -1.f );
f += SCALE( GAMESTATE->m_CurrentPlayerOptions[pn].m_fReverseScroll, 0.f, 1.f, 0.f, fYReverseOffsetPixels );
const float* fEffects = GAMESTATE->m_CurrentPlayerOptions[pn].m_fEffects;
if( fEffects[PlayerOptions::EFFECT_TIPSY] > 0 )
f += fEffects[PlayerOptions::EFFECT_TIPSY] * ( cosf( RageTimer::GetTimeSinceStart()*1.2f + iCol*2.f) * ARROW_SIZE*0.4f );
return f;
}
+3 -3
View File
@@ -23,7 +23,7 @@ const float ARROW_SPACING = ARROW_SIZE;// + 2;
// fYOffset is a vertical position in pixels relative to the center.
// (positive if has not yet been stepped on, negative if has already passed).
// The ArrowEffect is applied in this stage.
float ArrowGetYOffset( PlayerNumber pn, float fNoteBeat );
float ArrowGetYOffset( PlayerNumber pn, int iCol, float fNoteBeat );
// fRotation is Z rotation of an arrow. This will depend on the column of
@@ -35,8 +35,8 @@ float ArrowGetRotation( PlayerNumber pn, float fNoteBeat );
// fYPos is the position of the note in pixels relative to the center.
// (positive if has not yet been stepped on, negative if has already passed).
// This value is fYOffset with bReverseScroll and fScrollSpeed factored in.
float ArrowGetYPosWithoutReverse( PlayerNumber pn, float fYOffset );
float ArrowGetYPos( PlayerNumber pn, float fYOffset );
float ArrowGetYPosWithoutReverse( PlayerNumber pn, int iCol, float fYOffset );
float ArrowGetYPos( PlayerNumber pn, int iCol, float fYOffset, float fYReverseOffsetPixels );
// fXPos is a horizontal position in pixels relative to the center of the field.
+9 -9
View File
@@ -756,17 +756,17 @@ void NoteDisplay::DrawHoldHead( const HoldNote& hn, bool bActive, float fYHead,
}
}
void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float fLife, const float fPercentFadeToFail, bool bDrawGlowOnly )
void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float fLife, const float fPercentFadeToFail, bool bDrawGlowOnly, float fReverseOffsetPixels )
{
// bDrawGlowOnly is a little hacky. We need to draw the diffuse part and the glow part one pass at a time to minimize state changes
const bool bReverse = GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fReverseScroll > 0.5;
const int iCol = hn.iTrack;
const float fStartYOffset = ArrowGetYOffset( m_PlayerNumber, hn.fStartBeat );
const float fStartYPos = ArrowGetYPos( m_PlayerNumber, fStartYOffset );
const float fEndYOffset = ArrowGetYOffset( m_PlayerNumber, hn.fEndBeat );
const float fEndYPos = ArrowGetYPos( m_PlayerNumber, fEndYOffset );
const float fStartYOffset = ArrowGetYOffset( m_PlayerNumber, iCol, hn.fStartBeat );
const float fStartYPos = ArrowGetYPos( m_PlayerNumber, iCol, fStartYOffset, fReverseOffsetPixels );
const float fEndYOffset = ArrowGetYOffset( m_PlayerNumber, iCol, hn.fEndBeat );
const float fEndYPos = ArrowGetYPos( m_PlayerNumber, iCol, fEndYOffset, fReverseOffsetPixels );
const float fYHead = bReverse ? fEndYPos : fStartYPos; // the center of the head
const float fYTail = bReverse ? fStartYPos : fEndYPos; // the center the tail
@@ -802,13 +802,13 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
// now, draw the glow pass
if( !bDrawGlowOnly )
DrawHold( hn, bActive, fLife, fPercentFadeToFail, true );
DrawHold( hn, bActive, fLife, fPercentFadeToFail, true, fReverseOffsetPixels );
}
void NoteDisplay::DrawTap( int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition, bool bIsMine, float fPercentFadeToFail, float fLife )
void NoteDisplay::DrawTap( int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition, bool bIsMine, float fPercentFadeToFail, float fLife, float fReverseOffsetPixels )
{
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, iCol, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, iCol, fYOffset, fReverseOffsetPixels );
const float fRotation = ArrowGetRotation( m_PlayerNumber, fBeat );
const float fXPos = ArrowGetXPos( m_PlayerNumber, iCol, fYPos );
const float fZPos = ArrowGetZPos( m_PlayerNumber, iCol, fYPos );
+2 -2
View File
@@ -29,8 +29,8 @@ public:
void Load( int iColNum, PlayerNumber pn );
void DrawTap( int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition, bool bIsMine, float fPercentFadeToFail, float fLife = 1 );
void DrawHold( const HoldNote& hn, bool bActive, float fLife, float fPercentFadeToFail, bool bDrawGlowOnly = false );
void DrawTap( int iCol, float fBeat, bool bOnSameRowAsHoldStart, bool bIsAddition, bool bIsMine, float fPercentFadeToFail, float fLife, float fReverseOffsetPixels );
void DrawHold( const HoldNote& hn, bool bActive, float fLife, float fPercentFadeToFail, bool bDrawGlowOnly, float fReverseOffsetPixels );
protected:
void SetActiveFrame( float fNoteBeat, Actor &actorToSet, float fAnimationLengthInBeats, bool bVivid, bool bNoteColor );
+30 -26
View File
@@ -26,13 +26,14 @@
#include "ThemeManager.h"
#include "NoteFieldPositioning.h"
#include "NoteSkinManager.h"
#include "song.h"
const float HOLD_NOTE_BITS_PER_BEAT = 6;
const float HOLD_NOTE_BITS_PER_ROW = HOLD_NOTE_BITS_PER_BEAT / ROWS_PER_BEAT;
const float ROWS_BETWEEN_HOLD_BITS = 1 / HOLD_NOTE_BITS_PER_ROW;
NoteField::NoteField()
{
{
m_textMeasureNumber.LoadFromFont( THEME->GetPathToF("Common normal") );
m_textMeasureNumber.SetZoom( 1.0f );
@@ -48,11 +49,12 @@ NoteField::NoteField()
}
void NoteField::Load( NoteData* pNoteData, PlayerNumber pn, int iFirstPixelToDraw, int iLastPixelToDraw )
void NoteField::Load( NoteData* pNoteData, PlayerNumber pn, int iFirstPixelToDraw, int iLastPixelToDraw, int iYReverseOffsetPixels )
{
m_PlayerNumber = pn;
m_iFirstPixelToDraw = iFirstPixelToDraw;
m_iLastPixelToDraw = iLastPixelToDraw;
m_iStartDrawingPixel = iFirstPixelToDraw;
m_iEndDrawingPixel = iLastPixelToDraw;
m_iYReverseOffsetPixels = iYReverseOffsetPixels;
m_fPercentFadeToFail = -1;
@@ -79,6 +81,8 @@ void NoteField::ReloadNoteSkin()
void NoteField::Update( float fDeltaTime )
{
ActorFrame::Update( fDeltaTime );
m_rectMarkerBar.Update( fDeltaTime );
if( m_fPercentFadeToFail >= 0 )
@@ -102,8 +106,8 @@ void NoteField::DrawBeatBar( const float fBeat )
NoteType nt = BeatToNoteType( fBeat );
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, 0, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, 0, fYOffset, m_iYReverseOffsetPixels );
float fAlpha;
int iState;
@@ -151,8 +155,8 @@ void NoteField::DrawBeatBar( const float fBeat )
void NoteField::DrawMarkerBar( const float fBeat )
{
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, 0, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, 0, fYOffset, m_iYReverseOffsetPixels );
m_rectMarkerBar.StretchTo( RectF(-GetWidth()/2, fYPos-ARROW_SIZE/2, GetWidth()/2, fYPos+ARROW_SIZE/2) );
@@ -161,10 +165,10 @@ void NoteField::DrawMarkerBar( const float fBeat )
void NoteField::DrawAreaHighlight( const float fStartBeat, const float fEndBeat )
{
float fYStartOffset = ArrowGetYOffset( m_PlayerNumber, fStartBeat );
float fYStartPos = ArrowGetYPos( m_PlayerNumber, fYStartOffset );
float fYEndOffset = ArrowGetYOffset( m_PlayerNumber, fEndBeat );
float fYEndPos = ArrowGetYPos( m_PlayerNumber, fYEndOffset );
float fYStartOffset = ArrowGetYOffset( m_PlayerNumber, 0, fStartBeat );
float fYStartPos = ArrowGetYPos( m_PlayerNumber, 0, fYStartOffset, m_iYReverseOffsetPixels );
float fYEndOffset = ArrowGetYOffset( m_PlayerNumber, 0, fEndBeat );
float fYEndPos = ArrowGetYPos( m_PlayerNumber, 0, fYEndOffset, m_iYReverseOffsetPixels );
// Something in OpenGL crashes if this is values are too large. Strange. -Chris
fYStartPos = max( fYStartPos, -1000 );
@@ -179,8 +183,8 @@ void NoteField::DrawAreaHighlight( const float fStartBeat, const float fEndBeat
void NoteField::DrawBPMText( const float fBeat, const float fBPM )
{
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, 0, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, 0, fYOffset, m_iYReverseOffsetPixels );
m_textMeasureNumber.SetHorizAlign( Actor::align_right );
m_textMeasureNumber.SetDiffuse( RageColor(1,0,0,1) );
@@ -192,8 +196,8 @@ void NoteField::DrawBPMText( const float fBeat, const float fBPM )
void NoteField::DrawFreezeText( const float fBeat, const float fSecs )
{
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, 0, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, 0, fYOffset, m_iYReverseOffsetPixels );
m_textMeasureNumber.SetHorizAlign( Actor::align_right );
m_textMeasureNumber.SetDiffuse( RageColor(0.8f,0.8f,0,1) );
@@ -205,8 +209,8 @@ void NoteField::DrawFreezeText( const float fBeat, const float fSecs )
void NoteField::DrawBGChangeText( const float fBeat, const CString sNewBGName )
{
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, 0, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, 0, fYOffset, m_iYReverseOffsetPixels );
m_textMeasureNumber.SetHorizAlign( Actor::align_left );
m_textMeasureNumber.SetDiffuse( RageColor(0,1,0,1) );
@@ -225,8 +229,8 @@ void NoteField::DrawPrimitives()
//
// Adjust draw range depending on some effects
//
int iFirstPixelToDraw = m_iFirstPixelToDraw;
int iLastPixelToDraw = m_iLastPixelToDraw;
int iFirstPixelToDraw = m_iStartDrawingPixel;
int iLastPixelToDraw = m_iEndDrawingPixel;
float fDrawScale = 1;
fDrawScale *= 1 + 0.5f * fabsf( GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fPerspectiveTilt );
@@ -246,8 +250,8 @@ void NoteField::DrawPrimitives()
float fFirstBeatToDraw = fSongBeat-4; // Adjust to balance of performance and showing enough notes.
while( fFirstBeatToDraw<fSongBeat )
{
float fYOffset = ArrowGetYOffset(m_PlayerNumber, fFirstBeatToDraw);
float fYPosWOReverse = ArrowGetYPosWithoutReverse(m_PlayerNumber, fYOffset );
float fYOffset = ArrowGetYOffset(m_PlayerNumber, 0, fFirstBeatToDraw);
float fYPosWOReverse = ArrowGetYPosWithoutReverse(m_PlayerNumber, 0, fYOffset );
if( fYPosWOReverse < iFirstPixelToDraw ) // off screen
fFirstBeatToDraw += 0.1f; // move toward fSongBeat
else // on screen
@@ -259,8 +263,8 @@ void NoteField::DrawPrimitives()
float fLastBeatToDraw = fSongBeat+20; // worst case is 0.25x + boost. Adjust to balance of performance and showing enough notes.
while( fLastBeatToDraw>fSongBeat )
{
float fYOffset = ArrowGetYOffset(m_PlayerNumber, fLastBeatToDraw);
float fYPosWOReverse = ArrowGetYPosWithoutReverse(m_PlayerNumber, fYOffset );
float fYOffset = ArrowGetYOffset(m_PlayerNumber, 0, fLastBeatToDraw);
float fYPosWOReverse = ArrowGetYPosWithoutReverse(m_PlayerNumber, 0, fYOffset );
if( fYPosWOReverse > iLastPixelToDraw ) // off screen
fLastBeatToDraw -= 0.1f; // move toward fSongBeat
else // on screen
@@ -392,7 +396,7 @@ void NoteField::DrawPrimitives()
if( m_fBeginMarker!=-1 && m_fEndMarker!=-1 )
bIsInSelectionRange = m_fBeginMarker<=hn.fStartBeat && hn.fStartBeat<=m_fEndMarker && m_fBeginMarker<=hn.fEndBeat && hn.fEndBeat<=m_fEndMarker;
m_NoteDisplay[c].DrawHold( hn, bIsHoldingNote, fLife, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail );
m_NoteDisplay[c].DrawHold( hn, bIsHoldingNote, fLife, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, false, m_iYReverseOffsetPixels );
}
@@ -440,7 +444,7 @@ void NoteField::DrawPrimitives()
bool bIsAddition = (tn == TAP_ADDITION);
bool bIsMine = (tn == TAP_MINE);
m_NoteDisplay[c].DrawTap( c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, bIsAddition, bIsMine, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail );
m_NoteDisplay[c].DrawTap( c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, bIsAddition, bIsMine, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, 1, m_iYReverseOffsetPixels );
}
g_NoteFieldMode[m_PlayerNumber].EndDrawTrack(c);
+8 -4
View File
@@ -14,7 +14,6 @@
#include "Sprite.h"
#include "ActorFrame.h"
#include "song.h"
#include "BitmapText.h"
#include "PrefsManager.h"
#include "StyleDef.h"
@@ -23,7 +22,9 @@
#include "ArrowEffects.h"
#include "NoteDataWithScoring.h"
#include "NoteDisplay.h"
#include "ArrowBackdrop.h"
class Song;
class NoteField : public NoteDataWithScoring, public ActorFrame
{
@@ -32,7 +33,7 @@ public:
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
void Load( NoteData* pNoteData, PlayerNumber pn, int iFirstPixelToDraw, int iLastPixelToDraw );
virtual void Load( NoteData* pNoteData, PlayerNumber pn, int iStartDrawingPixel, int iEndDrawingPixel, int iYReverseOffsetPixels );
void RemoveTapNoteRow( int iIndex );
vector<bool> m_bIsHoldingHoldNote; // hack: Need this to know when to "light up" the center of hold notes
@@ -42,6 +43,7 @@ public:
void FadeToFail();
void ReloadNoteSkin();
protected:
void DrawBeatBar( const float fBeat );
void DrawMarkerBar( const float fBeat );
@@ -54,8 +56,10 @@ protected:
float m_fPercentFadeToFail; // -1 of not fading to fail
PlayerNumber m_PlayerNumber;
int m_iFirstPixelToDraw; // this should be a negative number
int m_iLastPixelToDraw; // this should be a positive number
int m_iStartDrawingPixel; // this should be a negative number
int m_iEndDrawingPixel; // this should be a positive number
int m_iYPosNormal;
int m_iYReverseOffsetPixels;
// color arrows
NoteDisplay m_NoteDisplay[MAX_NOTE_TRACKS];
+177
View File
@@ -0,0 +1,177 @@
#include "global.h"
/*
-----------------------------------------------------------------------------
Class: NoteFieldPlus
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "NoteFieldPlus.h"
#include "GameState.h"
#include "NoteFieldPositioning.h"
#include "NoteSkinManager.h"
NoteFieldPlus::NoteFieldPlus()
{
}
void NoteFieldPlus::Load( NoteData* pNoteData, PlayerNumber pn, int iFirstPixelToDraw, int iLastPixelToDraw, int iYReverseOffset )
{
NoteField::Load( pNoteData, pn, iFirstPixelToDraw, iLastPixelToDraw, iYReverseOffset );
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
m_iNumCols = pStyleDef->m_iColsPerPlayer;
int c;
//
// GrayArrowRow
//
for( c=0; c<m_iNumCols; c++ )
{
CString Button = g_NoteFieldMode[m_PlayerNumber].GrayButtonNames[c];
if(Button == "")
Button = NoteSkinManager::ColToButtonName(c);
CString sPath = NOTESKIN->GetPathTo(pn, Button, "receptor");
m_GrayArrow[c].Load( sPath );
// XXX
if( m_GrayArrow[c].GetNumStates() != 2 &&
m_GrayArrow[c].GetNumStates() != 3 )
RageException::Throw( "'%s' must have 2 or 3 frames", sPath.c_str() );
}
//
// GhostArrowRow
//
for( c=0; c<m_iNumCols; c++ )
{
CString Button = g_NoteFieldMode[m_PlayerNumber].GhostButtonNames[c];
if(Button == "")
Button = NoteSkinManager::ColToButtonName(c);
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") );
}
}
void NoteFieldPlus::Update( float fDelta )
{
NoteField::Update( fDelta );
for( int c=0; c<m_iNumCols; c++ )
{
float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
float fY = ArrowGetYPos( m_PlayerNumber, c, 0, m_iYReverseOffsetPixels );
float fZ = ArrowGetZPos( m_PlayerNumber, c, 0 );
m_GrayArrow[c].Update( fDelta );
m_GrayArrow[c].SetDiffuse( RageColor(1,1,1,1 - GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fDark) );
m_GhostDim[c].Update( fDelta );
m_GhostBright[c].Update( fDelta );
m_GhostMine[c].Update( fDelta );
m_HoldGhost[c].Update( fDelta );
m_GrayArrow[c].SetX( fX );
m_GhostDim[c].SetX( fX );
m_GhostBright[c].SetX( fX );
m_GhostMine[c].SetX( fX );
m_HoldGhost[c].SetX( fX );
m_GrayArrow[c].SetY( fY );
m_GhostDim[c].SetY( fY );
m_GhostBright[c].SetY( fY );
m_GhostMine[c].SetY( fY );
m_HoldGhost[c].SetY( fY );
m_GrayArrow[c].SetZ( fY );
m_GhostDim[c].SetZ( fZ );
m_GhostBright[c].SetZ( fZ );
m_GhostMine[c].SetZ( fZ );
m_HoldGhost[c].SetZ( fZ );
}
}
void NoteFieldPlus::DrawPrimitives()
{
int c;
//
// GrayArrowRow
//
for( c=0; c<m_iNumCols; c++ )
{
g_NoteFieldMode[m_PlayerNumber].BeginDrawTrack(c);
m_GrayArrow[c].Draw();
g_NoteFieldMode[m_PlayerNumber].EndDrawTrack(c);
}
NoteField::DrawPrimitives();
//
// GhostArrowRow
//
for( c=0; c<m_iNumCols; c++ )
{
g_NoteFieldMode[m_PlayerNumber].BeginDrawTrack(c);
m_GhostDim[c].Draw();
m_GhostBright[c].Draw();
m_GhostMine[c].Draw();
m_HoldGhost[c].Draw();
g_NoteFieldMode[m_PlayerNumber].EndDrawTrack(c);
}
}
void NoteFieldPlus::Step( int iCol )
{
ASSERT( iCol >= 0 && iCol < m_iNumCols );
m_GrayArrow[iCol].Step();
}
void NoteFieldPlus::TapNote( int iCol, TapNoteScore score, bool bBright )
{
ASSERT( iCol >= 0 && iCol < m_iNumCols );
if( bBright )
m_GhostBright[iCol].Step( score );
else
m_GhostDim[iCol].Step( score );
}
void NoteFieldPlus::HoldNote( int iCol )
{
ASSERT( iCol >= 0 && iCol < m_iNumCols );
m_HoldGhost[iCol].Step();
}
void NoteFieldPlus::TapMine( int iCol, TapNoteScore score )
{
m_GhostMine[iCol].Step( score );
}
+47
View File
@@ -0,0 +1,47 @@
#ifndef NOTEFIELDPLUS_H
#define NOTEFIELDPLUS_H
/*
-----------------------------------------------------------------------------
Class: NoteFieldPlus
Desc: NoteField + gray and ghost arrows.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "NoteField.h"
#include "GrayArrowRow.h"
#include "GhostArrowRow.h"
class NoteFieldPlus : public NoteField
{
public:
NoteFieldPlus();
virtual void Load( NoteData* pNoteData, PlayerNumber pn, int iFirstPixelToDraw, int iLastPixelToDraw, int iYReverseOffset );
virtual void Update( float fDelta );
virtual void DrawPrimitives();
void Step( int iCol );
void TapNote( int iCol, TapNoteScore score, bool bBright );
void TapMine( int iCol, TapNoteScore score );
void HoldNote( int iCol );
protected:
int m_iNumCols;
GrayArrow m_GrayArrow[MAX_NOTE_TRACKS];
GhostArrow m_GhostDim[MAX_NOTE_TRACKS];
GhostArrow m_GhostBright[MAX_NOTE_TRACKS];
GhostArrow m_GhostMine[MAX_NOTE_TRACKS];
HoldGhostArrow m_HoldGhost[MAX_NOTE_TRACKS];
};
#endif
+13 -21
View File
@@ -75,8 +75,6 @@ Player::Player()
this->AddChild( &m_ArrowBackdrop );
this->AddChild( &m_NoteField );
this->AddChild( &m_GrayArrowRow );
this->AddChild( &m_GhostArrowRow );
this->AddChild( &m_Judgment );
this->AddChild( &m_ProTimingDisplay );
this->AddChild( &m_Combo );
@@ -139,11 +137,9 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, Combine
if( !BackdropName.empty() )
m_ArrowBackdrop.LoadFromAniDir( THEME->GetPathToB( BackdropName ) );
m_NoteField.Load( (NoteData*)this, pn, iStartDrawingAtPixels, iStopDrawingAtPixels );
m_NoteField.SetY( GRAY_ARROWS_Y_STANDARD );
m_NoteField.Load( (NoteData*)this, pn, iStartDrawingAtPixels, iStopDrawingAtPixels, GRAY_ARROWS_Y_REVERSE-GRAY_ARROWS_Y_STANDARD );
m_ArrowBackdrop.SetPlayer( pn );
m_GrayArrowRow.Load( pn );
m_GhostArrowRow.Load( pn );
const bool bReverse = GAMESTATE->m_PlayerOptions[pn].m_fReverseScroll == 1;
bool bPlayerUsingBothSides = GAMESTATE->GetCurrentStyleDef()->m_StyleType==StyleDef::ONE_PLAYER_TWO_CREDITS;
@@ -188,21 +184,19 @@ void Player::Update( float fDeltaTime )
// Update Y positions
//
float fPercentReverse = GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fReverseScroll;
// float fHoldJudgeYPos = SCALE( fPercentReverse, 0.f, 1.f, HOLD_JUDGMENT_Y_STANDARD, HOLD_JUDGMENT_Y_REVERSE );
float fHoldJudgeYPos = SCALE( fPercentReverse, 0.f, 1.f, HOLD_JUDGMENT_Y_STANDARD, HOLD_JUDGMENT_Y_REVERSE );
float fGrayYPos = SCALE( fPercentReverse, 0.f, 1.f, GRAY_ARROWS_Y_STANDARD, GRAY_ARROWS_Y_REVERSE );
int c;
for( c=0; c<GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer; c++ )
m_HoldJudgment[c].SetY( fGrayYPos );
m_HoldJudgment[c].SetY( fHoldJudgeYPos );
m_ArrowBackdrop.SetY( fGrayYPos );
m_NoteField.SetY( fGrayYPos );
m_GrayArrowRow.SetY( fGrayYPos );
m_GhostArrowRow.SetY( fGrayYPos );
// NoteField accounts for reverse on its own now.
// m_NoteField.SetY( fGrayYPos );
float fMiniPercent = GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fEffects[PlayerOptions::EFFECT_MINI];
float fZoom = 1 - fMiniPercent*0.5f;
m_NoteField.SetZoom( fZoom );
m_GrayArrowRow.SetZoom( fZoom );
m_GhostArrowRow.SetZoom( fZoom );
//
// Check for TapNote misses
@@ -251,7 +245,7 @@ void Player::Update( float fDeltaTime )
// Increase life
fLife = 1;
m_GhostArrowRow.HoldNote( hn.iTrack ); // update the "electric ghost" effect
m_NoteField.HoldNote( hn.iTrack ); // update the "electric ghost" effect
}
else
{
@@ -278,7 +272,7 @@ void Player::Update( float fDeltaTime )
{
fLife = 1;
hns = HNS_OK;
m_GhostArrowRow.TapNote( StyleI.col, TNS_PERFECT, true ); // bright ghost flash
m_NoteField.TapNote( StyleI.col, TNS_PERFECT, true ); // bright ghost flash
}
if( hns != HNS_NONE )
@@ -355,9 +349,7 @@ void Player::DrawPrimitives()
DISPLAY->LookAt(Eye, At, Up);
}
m_GrayArrowRow.Draw();
m_NoteField.Draw();
m_GhostArrowRow.Draw();
if( fTilt != 0 )
DISPLAY->ExitPerspective();
@@ -475,7 +467,7 @@ void Player::Step( int col, RageTimer tm )
{
m_soundMineExplosion.Play();
score = TNS_MISS;
m_GhostArrowRow.TapMine( col, TNS_MISS );
m_NoteField.TapMine( col, TNS_MISS );
}
break;
@@ -495,7 +487,7 @@ void Player::Step( int col, RageTimer tm )
{
m_soundMineExplosion.Play();
score = TNS_MISS;
m_GhostArrowRow.TapMine( col, TNS_MISS );
m_NoteField.TapMine( col, TNS_MISS );
}
break;
case PC_AUTOPLAY:
@@ -542,7 +534,7 @@ void Player::Step( int col, RageTimer tm )
}
if( bGrayArrowStep )
m_GrayArrowRow.Step( col );
m_NoteField.Step( col );
}
void Player::HandleAutosync(float fNoteOffset)
@@ -602,7 +594,7 @@ void Player::OnRowCompletelyJudged( int iIndexThatWasSteppedOn )
case TNS_MARVELOUS:
{
bool bBright = GAMESTATE->m_CurStageStats.iCurCombo[m_PlayerNumber]>(int)BRIGHT_GHOST_COMBO_THRESHOLD;
m_GhostArrowRow.TapNote( c, score, bBright );
m_NoteField.TapNote( c, score, bBright );
}
break;
}
+2 -6
View File
@@ -21,9 +21,7 @@
#include "Judgment.h"
#include "HoldJudgment.h"
#include "Combo.h"
#include "NoteField.h"
#include "GrayArrowRow.h"
#include "GhostArrowRow.h"
#include "NoteFieldPlus.h"
#include "NoteDataWithScoring.h"
#include "ArrowBackdrop.h"
#include "RageTimer.h"
@@ -73,9 +71,7 @@ protected:
int m_iOffsetSample; //
ArrowBackdrop m_ArrowBackdrop;
GrayArrowRow m_GrayArrowRow;
NoteField m_NoteField;
GhostArrowRow m_GhostArrowRow;
NoteFieldPlus m_NoteField;
HoldJudgment m_HoldJudgment[MAX_NOTE_TRACKS];
+2
View File
@@ -93,6 +93,7 @@ CString PlayerOptions::GetString()
if( m_fEffects[EFFECT_MINI]==1 ) sReturn += "Mini, ";
if( m_fEffects[EFFECT_FLIP]==1 ) sReturn += "Flip, ";
if( m_fEffects[EFFECT_TORNADO]==1 ) sReturn += "Tornado, ";
if( m_fEffects[EFFECT_TIPSY]==1 ) sReturn += "Tipsy, ";
if( m_fEffects[EFFECT_BUMPY]==1 ) sReturn += "Bumpy, ";
if( m_fEffects[EFFECT_BEAT]==1 ) sReturn += "Beat, ";
@@ -192,6 +193,7 @@ void PlayerOptions::FromString( CString sOptions )
else if( sBit == "mini" ) m_fEffects[EFFECT_MINI] = 1;
else if( sBit == "flip" ) m_fEffects[EFFECT_FLIP] = 1;
else if( sBit == "tornado" ) m_fEffects[EFFECT_TORNADO] = 1;
else if( sBit == "tipsy" ) m_fEffects[EFFECT_TIPSY] = 1;
else if( sBit == "bumpy" ) m_fEffects[EFFECT_BUMPY] = 1;
else if( sBit == "beat" ) m_fEffects[EFFECT_BEAT] = 1;
else if( sBit == "hidden" ) m_fAppearances[APPEARANCE_HIDDEN] = 1;
+1
View File
@@ -35,6 +35,7 @@ struct PlayerOptions
EFFECT_MINI,
EFFECT_FLIP,
EFFECT_TORNADO,
EFFECT_TIPSY,
EFFECT_BUMPY,
EFFECT_BEAT,
NUM_EFFECTS
+2 -2
View File
@@ -255,7 +255,7 @@ ScreenEdit::ScreenEdit() : Screen("ScreenEdit")
m_NoteFieldEdit.SetXY( EDIT_X, EDIT_GRAY_Y );
m_NoteFieldEdit.SetZoom( 0.5f );
m_NoteFieldEdit.Load( &noteData, PLAYER_1, -240, 800 );
m_NoteFieldEdit.Load( &noteData, PLAYER_1, -240, 800, 800 );
m_rectRecordBack.StretchTo( RectI(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) );
m_rectRecordBack.SetDiffuse( RageColor(0,0,0,0) );
@@ -266,7 +266,7 @@ ScreenEdit::ScreenEdit() : Screen("ScreenEdit")
m_NoteFieldRecord.SetXY( EDIT_X, EDIT_GRAY_Y );
m_NoteFieldRecord.SetZoom( 1.0f );
m_NoteFieldRecord.Load( &noteData, PLAYER_1, -150, 350 );
m_NoteFieldRecord.Load( &noteData, PLAYER_1, -150, 350, 350 );
m_Clipboard.SetNumTracks( m_NoteFieldEdit.GetNumTracks() );
+2 -1
View File
@@ -47,7 +47,7 @@ enum {
OptionRow g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = {
OptionRow( "Speed", "x0.25","x0.5","x0.75","x1","x1.5","x2","x3","x5","x8","C200","C300" ),
OptionRow( "Acceler\n-ation", "OFF","BOOST","BRAKE","WAVE","EXPAND","BOOMERANG" ),
OptionRow( "Effect", "OFF","DRUNK","DIZZY","MINI","FLIP","TORNADO" ),
OptionRow( "Effect", "OFF","DRUNK","DIZZY","MINI","FLIP","TORNADO","TIPSY" ),
OptionRow( "Appear\n-ance", "VISIBLE","HIDDEN","SUDDEN","STEALTH","BLINK", "R.VANISH" ),
OptionRow( "Turn", "OFF","MIRROR","LEFT","RIGHT","SHUFFLE","S.SHUFFLE" ),
OptionRow( "Trans\n-form", "OFF","LITTLE","WIDE","BIG","QUICK","SKIPPY","MINES" ),
@@ -67,6 +67,7 @@ static const PlayerOptions::Effect ChoosableEffects[] =
PlayerOptions::EFFECT_MINI,
PlayerOptions::EFFECT_FLIP,
PlayerOptions::EFFECT_TORNADO,
PlayerOptions::EFFECT_TIPSY,
PlayerOptions::NUM_EFFECTS
};
+2
View File
@@ -755,6 +755,8 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
{
unsigned i;
LOG->Trace( "Loading courses." );
//
// Load courses from in Courses dir
//
+24 -1
View File
@@ -1,5 +1,5 @@
# Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# Microsoft Developer Studio Generated Build File, Format Version 60000
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
@@ -98,6 +98,10 @@ XBCP=xbecopy.exe
# ADD BASE XBCP /NOLOGO
# ADD XBCP /NOLOGO
# Begin Special Build Tool
IntDir=.\Debug
TargetDir=\stepmania\stepmania
TargetName=default
SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool
@@ -3170,6 +3174,25 @@ SOURCE=.\NoteField.h
# End Source File
# Begin Source File
SOURCE=.\NoteFieldPlus.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\NoteFieldPlus.h
# End Source File
# Begin Source File
SOURCE=.\Player.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
+6
View File
@@ -1442,6 +1442,12 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File
RelativePath="NoteField.h">
</File>
<File
RelativePath="NoteFieldPlus.cpp">
</File>
<File
RelativePath="NoteFieldPlus.h">
</File>
<File
RelativePath=".\Player.cpp">
</File>