GrayArrow => ReceptorArrow
move ReceptorArrow metrics into NoteSkin ReceptorArrow metrics, code cleanup
This commit is contained in:
@@ -872,7 +872,6 @@ BannerOffCommand=hidden,1
|
|||||||
|
|
||||||
[ScreenGameplay]
|
[ScreenGameplay]
|
||||||
ShowEvaluationOnFail=0
|
ShowEvaluationOnFail=0
|
||||||
PressBlockY=10
|
|
||||||
StaticBGY=240
|
StaticBGY=240
|
||||||
StaticBGX=320
|
StaticBGX=320
|
||||||
PrevScreenArcade=ScreenSelectMusic
|
PrevScreenArcade=ScreenSelectMusic
|
||||||
@@ -2918,8 +2917,8 @@ PulseZoom=1.2
|
|||||||
TweenSeconds=0.05
|
TweenSeconds=0.05
|
||||||
|
|
||||||
[Player]
|
[Player]
|
||||||
GrayArrowsYStandard=96
|
ReceptorArrowsYStandard=96
|
||||||
GrayArrowsYReverse=384
|
ReceptorArrowsYReverse=384
|
||||||
JudgmentXOffsetOneSideP1=0
|
JudgmentXOffsetOneSideP1=0
|
||||||
JudgmentXOffsetOneSideP2=0
|
JudgmentXOffsetOneSideP2=0
|
||||||
JudgmentXOffsetBothSides=0
|
JudgmentXOffsetBothSides=0
|
||||||
@@ -2965,10 +2964,6 @@ LabelX=0
|
|||||||
LabelY=0
|
LabelY=0
|
||||||
LabelOnCommand=horizalign,left
|
LabelOnCommand=horizalign,left
|
||||||
|
|
||||||
[GrayArrow]
|
|
||||||
StepZoom=0.75
|
|
||||||
StepSeconds=0.10
|
|
||||||
|
|
||||||
[CodeDetector]
|
[CodeDetector]
|
||||||
Easier1=Up,Up
|
Easier1=Up,Up
|
||||||
Easier2=MenuUp,MenuUp
|
Easier2=MenuUp,MenuUp
|
||||||
@@ -3620,7 +3615,7 @@ CharsZoomLarge=1.5
|
|||||||
CharsSpacingY=40
|
CharsSpacingY=40
|
||||||
ScrollingCharsColor=0.6,0.8,0.8,1
|
ScrollingCharsColor=0.6,0.8,0.8,1
|
||||||
SelectedCharsColor=0.8,1,1,1
|
SelectedCharsColor=0.8,1,1,1
|
||||||
GrayArrowsY=100
|
ReceptorArrowsY=100
|
||||||
NumCharsToDrawBehind=2
|
NumCharsToDrawBehind=2
|
||||||
NumCharsToDrawTotal=10
|
NumCharsToDrawTotal=10
|
||||||
FakeBeatsPerSec=2.5
|
FakeBeatsPerSec=2.5
|
||||||
|
|||||||
@@ -295,6 +295,7 @@ public:
|
|||||||
static float GetCommandLength( CString command );
|
static float GetCommandLength( CString command );
|
||||||
|
|
||||||
virtual void SetState( int iNewState ) {};
|
virtual void SetState( int iNewState ) {};
|
||||||
|
virtual void SetSecondsIntoAnimation( float fSeconds ) {};
|
||||||
virtual int GetNumStates() { return 1; };
|
virtual int GetNumStates() { return 1; };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -37,9 +37,17 @@ static Actor* LoadActor( CString sPath )
|
|||||||
CString sFileName;
|
CString sFileName;
|
||||||
ini.GetValue( "Actor", "File", sFileName );
|
ini.GetValue( "Actor", "File", sFileName );
|
||||||
|
|
||||||
CString sNewPath = Dirname( sPath ) + sFileName;
|
CString sDir = Dirname( sPath );
|
||||||
|
|
||||||
sNewPath = DerefRedir( sNewPath );
|
CStringArray asFiles;
|
||||||
|
GetDirListing( sDir + sFileName + "*", asFiles );
|
||||||
|
|
||||||
|
if( asFiles.empty() )
|
||||||
|
RageException::Throw( "The actor file '%s' references a file '%s' which doesn't exist.", sPath.c_str(), sFileName.c_str() );
|
||||||
|
else if( asFiles.size() > 1 )
|
||||||
|
RageException::Throw( "The actor file '%s' references a file '%s' which has multiple matches.", sPath.c_str(), sFileName.c_str() );
|
||||||
|
|
||||||
|
CString sNewPath = DerefRedir( sDir + asFiles[0] );
|
||||||
|
|
||||||
/* XXX: How to handle translations? Maybe we should have one metrics section,
|
/* XXX: How to handle translations? Maybe we should have one metrics section,
|
||||||
* "Text", eg:
|
* "Text", eg:
|
||||||
@@ -71,9 +79,6 @@ static Actor* LoadActor( CString sPath )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( !DoesFileExist(sNewPath) )
|
|
||||||
RageException::Throw( "The actor file '%s' references a file '%s' which doesn't exist.", sPath.c_str(), sNewPath.c_str() );
|
|
||||||
|
|
||||||
pActor = MakeActor( sNewPath );
|
pActor = MakeActor( sNewPath );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,110 +0,0 @@
|
|||||||
#include "global.h"
|
|
||||||
/*
|
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
Class: GrayArrow
|
|
||||||
|
|
||||||
Desc: A gray arrow that "receives" ColorNotes.
|
|
||||||
|
|
||||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
||||||
Ben Nordstrom
|
|
||||||
Chris Danford
|
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "GrayArrow.h"
|
|
||||||
#include "PrefsManager.h"
|
|
||||||
#include "GameState.h"
|
|
||||||
#include <math.h>
|
|
||||||
#include "ThemeManager.h"
|
|
||||||
#include "NoteFieldPositioning.h"
|
|
||||||
#include "NoteSkinManager.h"
|
|
||||||
|
|
||||||
#include "RageLog.h"
|
|
||||||
|
|
||||||
CachedThemeMetricF GR_STEP_SECONDS ("GrayArrow","StepSeconds");
|
|
||||||
CachedThemeMetricF GR_STEP_ZOOM ("GrayArrow","StepZoom");
|
|
||||||
|
|
||||||
|
|
||||||
GrayArrow::GrayArrow()
|
|
||||||
{
|
|
||||||
GR_STEP_SECONDS.Refresh();
|
|
||||||
GR_STEP_ZOOM.Refresh();
|
|
||||||
m_bIsPressed = false;
|
|
||||||
StopAnimating();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GrayArrow::Load( CString NoteSkin, PlayerNumber pn, int iColNo )
|
|
||||||
{
|
|
||||||
CString Button = g_NoteFieldMode[pn].GrayButtonNames[iColNo];
|
|
||||||
if( Button == "" )
|
|
||||||
Button = NoteSkinManager::ColToButtonName( iColNo );
|
|
||||||
|
|
||||||
CString sPath = NOTESKIN->GetPathTo( NoteSkin, Button, "receptor" );
|
|
||||||
bool ret = Sprite::Load( sPath );
|
|
||||||
|
|
||||||
// XXX
|
|
||||||
if( GetNumStates() != 2 &&
|
|
||||||
GetNumStates() != 3 )
|
|
||||||
RageException::Throw( "'%s' must have 2 or 3 frames", sPath.c_str() );
|
|
||||||
|
|
||||||
sPath = NOTESKIN->GetPathTo( NoteSkin, Button, "KeypressBlock" );
|
|
||||||
bool ret2 = m_sprPressBlock.Load( sPath );
|
|
||||||
m_sprPressBlock.SetXY(0, THEME->GetMetricF("ScreenGameplay","PressBlockY"));
|
|
||||||
return ret && ret2; // return both loaded or fail
|
|
||||||
}
|
|
||||||
|
|
||||||
void GrayArrow::Update( float fDeltaTime )
|
|
||||||
{
|
|
||||||
ASSERT( Sprite::GetNumStates() > 0 ); // you forgot to call Load()
|
|
||||||
|
|
||||||
Sprite::Update( fDeltaTime );
|
|
||||||
|
|
||||||
/* XXX: get rid of this once we update the note skins */
|
|
||||||
int IdleState = (GetNumStates() == 3)? 0: 1;
|
|
||||||
int OnState = (GetNumStates() == 3)? 1: 0;
|
|
||||||
int OffState = (GetNumStates() == 3)? 2: 1;
|
|
||||||
|
|
||||||
if( !GAMESTATE->m_bPastHereWeGo )
|
|
||||||
{
|
|
||||||
SetState( IdleState );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* These could be metrics or configurable. I'd prefer the flash to
|
|
||||||
* start on the beat, I think ... -glenn */
|
|
||||||
|
|
||||||
/* Start flashing 10% of a beat before the beat starts. */
|
|
||||||
const float flash_offset = -0.1f;
|
|
||||||
|
|
||||||
/* Flash for 20% of a beat. */
|
|
||||||
const float flash_length = 0.2f;
|
|
||||||
|
|
||||||
float cur_beat = GAMESTATE->m_fSongBeat;
|
|
||||||
|
|
||||||
/* Beats can start in very negative territory (many BMR songs, Drop Out
|
|
||||||
* -Remix-). */
|
|
||||||
cur_beat += 100.0f;
|
|
||||||
|
|
||||||
cur_beat -= flash_offset;
|
|
||||||
float fPercentIntoBeat = fmodf(cur_beat, 1);
|
|
||||||
SetState( (fPercentIntoBeat<flash_length)? OnState : OffState );
|
|
||||||
m_sprPressBlock.Update(fDeltaTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GrayArrow::Draw()
|
|
||||||
{
|
|
||||||
Sprite::Draw();
|
|
||||||
if(m_bIsPressed)
|
|
||||||
{
|
|
||||||
m_sprPressBlock.Draw();
|
|
||||||
m_bIsPressed = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GrayArrow::Step()
|
|
||||||
{
|
|
||||||
SetZoom( GR_STEP_ZOOM );
|
|
||||||
StopTweening();
|
|
||||||
BeginTweening( GR_STEP_SECONDS );
|
|
||||||
SetZoom( 1 );
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
#define GRAY_ARROW_H
|
#define GRAY_ARROW_H
|
||||||
/*
|
/*
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Class: GrayArrow
|
Class: ReceptorArrow
|
||||||
|
|
||||||
Desc: A gray arrow that "receives" ColorNotes.
|
Desc: A gray arrow that "receives" ColorNotes.
|
||||||
|
|
||||||
@@ -16,10 +16,10 @@
|
|||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "PlayerNumber.h"
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
class GrayArrow : public Sprite
|
class ReceptorArrow : public ActorFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GrayArrow();
|
ReceptorArrow();
|
||||||
bool Load( CString NoteSkin, PlayerNumber pn, int iColNo );
|
bool Load( CString NoteSkin, PlayerNumber pn, int iColNo );
|
||||||
|
|
||||||
virtual void Draw();
|
virtual void Draw();
|
||||||
@@ -27,6 +27,12 @@ public:
|
|||||||
void Step();
|
void Step();
|
||||||
void UpdateBars() { m_bIsPressed = true; };
|
void UpdateBars() { m_bIsPressed = true; };
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Sprite m_sprReceptorWaiting;
|
||||||
|
Sprite m_sprReceptorGo;
|
||||||
|
|
||||||
|
CString m_sReceptorStepCommand;
|
||||||
|
|
||||||
Sprite m_sprPressBlock;
|
Sprite m_sprPressBlock;
|
||||||
bool m_bIsPressed;
|
bool m_bIsPressed;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -163,8 +163,8 @@ ActorsInGameplay = \
|
|||||||
ArrowBackdrop.cpp ArrowBackdrop.h ArrowEffects.cpp ArrowEffects.h Background.cpp Background.h \
|
ArrowBackdrop.cpp ArrowBackdrop.h ArrowEffects.cpp ArrowEffects.h Background.cpp Background.h \
|
||||||
BeginnerHelper.cpp BeginnerHelper.h \
|
BeginnerHelper.cpp BeginnerHelper.h \
|
||||||
CombinedLifeMeterTug.h CombinedLifeMeterTug.cpp Combo.cpp Combo.h DancingCharacters.cpp DancingCharacters.h \
|
CombinedLifeMeterTug.h CombinedLifeMeterTug.cpp Combo.cpp Combo.h DancingCharacters.cpp DancingCharacters.h \
|
||||||
GhostArrow.cpp GhostArrow.h GhostArrowRow.cpp GhostArrowRow.h GrayArrow.cpp GrayArrow.h \
|
GhostArrow.cpp GhostArrow.h GhostArrowRow.cpp GhostArrowRow.h ReceptorArrow.cpp ReceptorArrow.h \
|
||||||
GrayArrowRow.cpp GrayArrowRow.h HoldGhostArrow.cpp HoldGhostArrow.h HoldJudgment.cpp HoldJudgment.h \
|
ReceptorArrowRow.cpp ReceptorArrowRow.h HoldGhostArrow.cpp HoldGhostArrow.h HoldJudgment.cpp HoldJudgment.h \
|
||||||
Judgment.cpp Judgment.h LifeMeter.h LifeMeterBar.cpp LifeMeterBar.h LifeMeterBattery.cpp LifeMeterBattery.h \
|
Judgment.cpp Judgment.h LifeMeter.h LifeMeterBar.cpp LifeMeterBar.h LifeMeterBattery.cpp LifeMeterBattery.h \
|
||||||
LyricDisplay.cpp LyricDisplay.h NoteDisplay.cpp NoteDisplay.h NoteField.cpp NoteField.h \
|
LyricDisplay.cpp LyricDisplay.h NoteDisplay.cpp NoteDisplay.h NoteField.cpp NoteField.h \
|
||||||
NoteFieldPlus.h NoteFieldPlus.cpp Player.cpp Player.h ProTimingDisplay.cpp ProTimingDisplay.h \
|
NoteFieldPlus.h NoteFieldPlus.cpp Player.cpp Player.h ProTimingDisplay.cpp ProTimingDisplay.h \
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ void NoteField::CacheNoteSkin( CString skin )
|
|||||||
NoteDisplayCols *nd = new NoteDisplayCols;
|
NoteDisplayCols *nd = new NoteDisplayCols;
|
||||||
for( int c=0; c<GetNumTracks(); c++ )
|
for( int c=0; c<GetNumTracks(); c++ )
|
||||||
nd->display[c].Load( c, m_PlayerNumber, skin, m_fYReverseOffsetPixels );
|
nd->display[c].Load( c, m_PlayerNumber, skin, m_fYReverseOffsetPixels );
|
||||||
nd->m_GrayArrowRow.Load( m_PlayerNumber, skin, m_fYReverseOffsetPixels );
|
nd->m_ReceptorArrowRow.Load( m_PlayerNumber, skin, m_fYReverseOffsetPixels );
|
||||||
nd->m_GhostArrowRow.Load( m_PlayerNumber, skin, m_fYReverseOffsetPixels );
|
nd->m_GhostArrowRow.Load( m_PlayerNumber, skin, m_fYReverseOffsetPixels );
|
||||||
|
|
||||||
m_NoteDisplays[ skin ] = nd;
|
m_NoteDisplays[ skin ] = nd;
|
||||||
@@ -156,13 +156,13 @@ void NoteField::Update( float fDeltaTime )
|
|||||||
if( LastDisplay )
|
if( LastDisplay )
|
||||||
{
|
{
|
||||||
cur->m_GhostArrowRow.CopyTweening( LastDisplay->m_GhostArrowRow );
|
cur->m_GhostArrowRow.CopyTweening( LastDisplay->m_GhostArrowRow );
|
||||||
cur->m_GrayArrowRow.CopyTweening( LastDisplay->m_GrayArrowRow );
|
cur->m_ReceptorArrowRow.CopyTweening( LastDisplay->m_ReceptorArrowRow );
|
||||||
}
|
}
|
||||||
|
|
||||||
LastDisplay = cur;
|
LastDisplay = cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
cur->m_GrayArrowRow.Update( fDeltaTime );
|
cur->m_ReceptorArrowRow.Update( fDeltaTime );
|
||||||
cur->m_GhostArrowRow.Update( fDeltaTime );
|
cur->m_GhostArrowRow.Update( fDeltaTime );
|
||||||
|
|
||||||
if( m_fPercentFadeToFail >= 0 )
|
if( m_fPercentFadeToFail >= 0 )
|
||||||
@@ -392,7 +392,7 @@ void NoteField::DrawPrimitives()
|
|||||||
ASSERT( !m_BeatToNoteDisplays.empty() );
|
ASSERT( !m_BeatToNoteDisplays.empty() );
|
||||||
|
|
||||||
NoteDisplayCols *cur = SearchForSongBeat();
|
NoteDisplayCols *cur = SearchForSongBeat();
|
||||||
cur->m_GrayArrowRow.Draw();
|
cur->m_ReceptorArrowRow.Draw();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Adjust draw range depending on some effects
|
// Adjust draw range depending on some effects
|
||||||
@@ -625,8 +625,8 @@ void NoteField::FadeToFail()
|
|||||||
// don't fade all over again if this is called twice
|
// don't fade all over again if this is called twice
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteField::Step( int iCol ) { SearchForSongBeat()->m_GrayArrowRow.Step( iCol ); }
|
void NoteField::Step( int iCol ) { SearchForSongBeat()->m_ReceptorArrowRow.Step( iCol ); }
|
||||||
void NoteField::UpdateBars( int iCol ) { SearchForSongBeat()->m_GrayArrowRow.UpdateBars( iCol ); }
|
void NoteField::SetPressed( int iCol ) { SearchForSongBeat()->m_ReceptorArrowRow.SetPressed( iCol ); }
|
||||||
void NoteField::DidTapNote( int iCol, TapNoteScore score, bool bBright ) { SearchForSongBeat()->m_GhostArrowRow.DidTapNote( iCol, score, bBright ); }
|
void NoteField::DidTapNote( int iCol, TapNoteScore score, bool bBright ) { SearchForSongBeat()->m_GhostArrowRow.DidTapNote( iCol, score, bBright ); }
|
||||||
void NoteField::DidHoldNote( int iCol ) { SearchForSongBeat()->m_GhostArrowRow.DidHoldNote( iCol ); }
|
void NoteField::DidHoldNote( int iCol ) { SearchForSongBeat()->m_GhostArrowRow.DidHoldNote( iCol ); }
|
||||||
void NoteField::DidTapMine( int iCol, TapNoteScore score ) { SearchForSongBeat()->m_GhostArrowRow.DidTapMine( iCol, score ); }
|
void NoteField::DidTapMine( int iCol, TapNoteScore score ) { SearchForSongBeat()->m_GhostArrowRow.DidTapMine( iCol, score ); }
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "NoteDataWithScoring.h"
|
#include "NoteDataWithScoring.h"
|
||||||
#include "NoteDisplay.h"
|
#include "NoteDisplay.h"
|
||||||
#include "ArrowBackdrop.h"
|
#include "ArrowBackdrop.h"
|
||||||
#include "GrayArrowRow.h"
|
#include "ReceptorArrowRow.h"
|
||||||
#include "GhostArrowRow.h"
|
#include "GhostArrowRow.h"
|
||||||
|
|
||||||
class Song;
|
class Song;
|
||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
void CacheNoteSkin( CString skin );
|
void CacheNoteSkin( CString skin );
|
||||||
|
|
||||||
void Step( int iCol );
|
void Step( int iCol );
|
||||||
void UpdateBars( int iCol );
|
void SetPressed( int iCol );
|
||||||
void DidTapNote( int iCol, TapNoteScore score, bool bBright );
|
void DidTapNote( int iCol, TapNoteScore score, bool bBright );
|
||||||
void DidHoldNote( int iCol );
|
void DidHoldNote( int iCol );
|
||||||
void DidTapMine( int iCol, TapNoteScore score );
|
void DidTapMine( int iCol, TapNoteScore score );
|
||||||
@@ -76,7 +76,7 @@ protected:
|
|||||||
struct NoteDisplayCols
|
struct NoteDisplayCols
|
||||||
{
|
{
|
||||||
NoteDisplay display[MAX_NOTE_TRACKS];
|
NoteDisplay display[MAX_NOTE_TRACKS];
|
||||||
GrayArrowRow m_GrayArrowRow;
|
ReceptorArrowRow m_ReceptorArrowRow;
|
||||||
GhostArrowRow m_GhostArrowRow;
|
GhostArrowRow m_GhostArrowRow;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,8 @@
|
|||||||
#include "ScreenGameplay.h" /* for SM_ComboStopped */
|
#include "ScreenGameplay.h" /* for SM_ComboStopped */
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
|
|
||||||
CachedThemeMetricF GRAY_ARROWS_Y_STANDARD ("Player","GrayArrowsYStandard");
|
CachedThemeMetricF GRAY_ARROWS_Y_STANDARD ("Player","ReceptorArrowsYStandard");
|
||||||
CachedThemeMetricF GRAY_ARROWS_Y_REVERSE ("Player","GrayArrowsYReverse");
|
CachedThemeMetricF GRAY_ARROWS_Y_REVERSE ("Player","ReceptorArrowsYReverse");
|
||||||
#define JUDGMENT_X( p, both_sides ) THEME->GetMetricF("Player",both_sides ? "JudgmentXOffsetBothSides" : ssprintf("JudgmentXOffsetOneSideP%d",p+1))
|
#define JUDGMENT_X( p, both_sides ) THEME->GetMetricF("Player",both_sides ? "JudgmentXOffsetBothSides" : ssprintf("JudgmentXOffsetOneSideP%d",p+1))
|
||||||
#define JUDGMENT_Y THEME->GetMetricF("Player","JudgmentY")
|
#define JUDGMENT_Y THEME->GetMetricF("Player","JudgmentY")
|
||||||
#define JUDGMENT_Y_REVERSE THEME->GetMetricF("Player","JudgmentYReverse")
|
#define JUDGMENT_Y_REVERSE THEME->GetMetricF("Player","JudgmentYReverse")
|
||||||
@@ -265,6 +265,9 @@ void PlayerMinus::Update( float fDeltaTime )
|
|||||||
//
|
//
|
||||||
UpdateTapNotesMissedOlderThan( GetMaxStepDistanceSeconds() );
|
UpdateTapNotesMissedOlderThan( GetMaxStepDistanceSeconds() );
|
||||||
|
|
||||||
|
//
|
||||||
|
// update pressed flag
|
||||||
|
//
|
||||||
int iNumCols = GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer;
|
int iNumCols = GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer;
|
||||||
for( int bar=0; bar < iNumCols; bar++ )
|
for( int bar=0; bar < iNumCols; bar++ )
|
||||||
{
|
{
|
||||||
@@ -272,7 +275,7 @@ void PlayerMinus::Update( float fDeltaTime )
|
|||||||
const GameInput GameI = GAMESTATE->GetCurrentStyleDef()->StyleInputToGameInput( StyleI );
|
const GameInput GameI = GAMESTATE->GetCurrentStyleDef()->StyleInputToGameInput( StyleI );
|
||||||
bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI );
|
bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI );
|
||||||
if(bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox)
|
if(bIsHoldingButton && !GAMESTATE->m_bDemonstrationOrJukebox)
|
||||||
m_pNoteField->UpdateBars(bar);
|
m_pNoteField->SetPressed(bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -567,7 +570,7 @@ void PlayerMinus::Step( int col, RageTimer tm )
|
|||||||
|
|
||||||
//LOG->Trace( "iIndexStartLookingAt = %d, iNumElementsToExamine = %d", iIndexStartLookingAt, iNumElementsToExamine );
|
//LOG->Trace( "iIndexStartLookingAt = %d, iNumElementsToExamine = %d", iIndexStartLookingAt, iNumElementsToExamine );
|
||||||
|
|
||||||
bool bGrayArrowStep = true;
|
bool bReceptorArrowStep = true;
|
||||||
|
|
||||||
if( iIndexOverlappingNote != -1 )
|
if( iIndexOverlappingNote != -1 )
|
||||||
{
|
{
|
||||||
@@ -816,7 +819,7 @@ void PlayerMinus::Step( int col, RageTimer tm )
|
|||||||
if( score==TNS_MARVELOUS && !GAMESTATE->ShowMarvelous())
|
if( score==TNS_MARVELOUS && !GAMESTATE->ShowMarvelous())
|
||||||
score = TNS_PERFECT;
|
score = TNS_PERFECT;
|
||||||
|
|
||||||
bGrayArrowStep = score < TNS_GOOD;
|
bReceptorArrowStep = score < TNS_GOOD;
|
||||||
|
|
||||||
// LOG->Trace("Note offset: %f (fSecondsFromPerfect = %f), Score: %i", fNoteOffset, fSecondsFromPerfect, score);
|
// LOG->Trace("Note offset: %f (fSecondsFromPerfect = %f), Score: %i", fNoteOffset, fSecondsFromPerfect, score);
|
||||||
|
|
||||||
@@ -856,7 +859,7 @@ void PlayerMinus::Step( int col, RageTimer tm )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( bGrayArrowStep )
|
if( bReceptorArrowStep )
|
||||||
m_pNoteField->Step( col );
|
m_pNoteField->Step( col );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,14 @@ inline void wrap( int &x, int n)
|
|||||||
x %= n;
|
x %= n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void wrap( float &x, float n)
|
||||||
|
{
|
||||||
|
if (x<0)
|
||||||
|
x += ((-x/n)+1)*n;
|
||||||
|
|
||||||
|
x = fmodf(x,n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
#include "global.h"
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Class: ReceptorArrow
|
||||||
|
|
||||||
|
Desc: See header.
|
||||||
|
|
||||||
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
|
Ben Nordstrom
|
||||||
|
Chris Danford
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ReceptorArrow.h"
|
||||||
|
#include "PrefsManager.h"
|
||||||
|
#include "GameState.h"
|
||||||
|
#include <math.h>
|
||||||
|
#include "ThemeManager.h"
|
||||||
|
#include "NoteFieldPositioning.h"
|
||||||
|
#include "NoteSkinManager.h"
|
||||||
|
#include "RageLog.h"
|
||||||
|
#include "RageUtil.h"
|
||||||
|
|
||||||
|
|
||||||
|
ReceptorArrow::ReceptorArrow()
|
||||||
|
{
|
||||||
|
m_bIsPressed = false;
|
||||||
|
StopAnimating();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ReceptorArrow::Load( CString NoteSkin, PlayerNumber pn, int iColNo )
|
||||||
|
{
|
||||||
|
m_PlayerNumber = pn;
|
||||||
|
m_iColNo = iColNo;
|
||||||
|
|
||||||
|
CString sButton = g_NoteFieldMode[pn].GrayButtonNames[iColNo];
|
||||||
|
if( sButton == "" )
|
||||||
|
sButton = NoteSkinManager::ColToButtonName( iColNo );
|
||||||
|
|
||||||
|
CString sPath;
|
||||||
|
m_pReceptorWaiting.Load( NOTESKIN->GetPathTo(NoteSkin,sButton,"receptor waiting") );
|
||||||
|
m_pReceptorGo.Load( NOTESKIN->GetPathTo(NoteSkin,sButton,"receptor go") );
|
||||||
|
m_sStepCommand = NOTESKIN->GetMetric(GAMESTATE->m_PlayerOptions[pn].m_sNoteSkin,"ReceptorArrow","StepCommand");
|
||||||
|
|
||||||
|
m_pPressBlock.Load( NOTESKIN->GetPathTo(NoteSkin,sButton,"KeypressBlock") );
|
||||||
|
|
||||||
|
this->AddChild( m_pReceptorWaiting );
|
||||||
|
this->AddChild( m_pReceptorGo );
|
||||||
|
this->AddChild( m_pPressBlock );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceptorArrow::Update( float fDeltaTime )
|
||||||
|
{
|
||||||
|
ActorFrame::Update( fDeltaTime );
|
||||||
|
|
||||||
|
float fPercentIntoBeat = GAMESTATE->m_fSongBeat;
|
||||||
|
wrap(fPercentIntoBeat, 1); /* Beats can start in very negative territory */
|
||||||
|
|
||||||
|
// TODO: Generalize this to allow any actor to animate based on the beat.
|
||||||
|
m_pReceptorWaiting->SetSecondsIntoAnimation( fPercentIntoBeat );
|
||||||
|
m_pReceptorGo->SetSecondsIntoAnimation( fPercentIntoBeat );
|
||||||
|
m_pPressBlock->SetSecondsIntoAnimation( fPercentIntoBeat );
|
||||||
|
|
||||||
|
// update pressblock alignment based on scroll direction
|
||||||
|
bool bReverse = GAMESTATE->m_PlayerOptions[m_PlayerNumber].GetReversePercentForColumn(m_iColNo) > 0.5;
|
||||||
|
m_pPressBlock->SetVertAlign( bReverse ? Actor::align_bottom : Actor::align_top );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceptorArrow::Draw()
|
||||||
|
{
|
||||||
|
m_pReceptorGo->SetHidden( !GAMESTATE->m_bPastHereWeGo );
|
||||||
|
m_pReceptorWaiting->SetHidden( GAMESTATE->m_bPastHereWeGo );
|
||||||
|
m_pPressBlock->SetHidden( !m_bIsPressed );
|
||||||
|
|
||||||
|
ActorFrame::Draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceptorArrow::Step()
|
||||||
|
{
|
||||||
|
m_pReceptorGo->Command( m_sStepCommand );
|
||||||
|
m_pReceptorWaiting->Command( m_sStepCommand );
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
#ifndef ReceptorArrow_H
|
||||||
|
#define ReceptorArrow_H
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Class: ReceptorArrow
|
||||||
|
|
||||||
|
Desc: A gray arrow that "receives" the colorful note arrows.
|
||||||
|
|
||||||
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
|
Ben Nordstrom
|
||||||
|
Chris Danford
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "ActorFrame.h"
|
||||||
|
#include "ActorUtil.h"
|
||||||
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
|
class ReceptorArrow : public ActorFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ReceptorArrow();
|
||||||
|
bool Load( CString NoteSkin, PlayerNumber pn, int iColNo );
|
||||||
|
|
||||||
|
virtual void Draw();
|
||||||
|
virtual void Update( float fDeltaTime );
|
||||||
|
void Step();
|
||||||
|
void SetPressed() { m_bIsPressed = true; };
|
||||||
|
private:
|
||||||
|
|
||||||
|
PlayerNumber m_PlayerNumber;
|
||||||
|
int m_iColNo;
|
||||||
|
|
||||||
|
AutoActor m_pReceptorWaiting;
|
||||||
|
AutoActor m_pReceptorGo;
|
||||||
|
CString m_sStepCommand;
|
||||||
|
|
||||||
|
AutoActor m_pPressBlock;
|
||||||
|
bool m_bIsPressed;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
/*
|
/*
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Class: GrayArrowRow
|
Class: ReceptorArrowRow
|
||||||
|
|
||||||
Desc: See header.
|
Desc: See header.
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GrayArrowRow.h"
|
#include "ReceptorArrowRow.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
@@ -20,12 +20,12 @@
|
|||||||
#include "NoteFieldPositioning.h"
|
#include "NoteFieldPositioning.h"
|
||||||
|
|
||||||
|
|
||||||
GrayArrowRow::GrayArrowRow()
|
ReceptorArrowRow::ReceptorArrowRow()
|
||||||
{
|
{
|
||||||
m_iNumCols = 0;
|
m_iNumCols = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrayArrowRow::Load( PlayerNumber pn, CString NoteSkin, float fYReverseOffset )
|
void ReceptorArrowRow::Load( PlayerNumber pn, CString NoteSkin, float fYReverseOffset )
|
||||||
{
|
{
|
||||||
m_PlayerNumber = pn;
|
m_PlayerNumber = pn;
|
||||||
m_fYReverseOffsetPixels = fYReverseOffset;
|
m_fYReverseOffsetPixels = fYReverseOffset;
|
||||||
@@ -35,51 +35,51 @@ void GrayArrowRow::Load( PlayerNumber pn, CString NoteSkin, float fYReverseOffse
|
|||||||
m_iNumCols = pStyleDef->m_iColsPerPlayer;
|
m_iNumCols = pStyleDef->m_iColsPerPlayer;
|
||||||
|
|
||||||
for( int c=0; c<m_iNumCols; c++ )
|
for( int c=0; c<m_iNumCols; c++ )
|
||||||
m_GrayArrow[c].Load( NoteSkin, m_PlayerNumber, c );
|
m_ReceptorArrow[c].Load( NoteSkin, m_PlayerNumber, c );
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrayArrowRow::Update( float fDeltaTime )
|
void ReceptorArrowRow::Update( float fDeltaTime )
|
||||||
{
|
{
|
||||||
for( int c=0; c<m_iNumCols; c++ )
|
for( int c=0; c<m_iNumCols; c++ )
|
||||||
{
|
{
|
||||||
m_GrayArrow[c].Update( fDeltaTime );
|
m_ReceptorArrow[c].Update( fDeltaTime );
|
||||||
m_GrayArrow[c].SetDiffuse( RageColor(1,1,1,1 - GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fDark) );
|
m_ReceptorArrow[c].SetDiffuse( RageColor(1,1,1,1 - GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fDark) );
|
||||||
|
|
||||||
// set arrow XYZ
|
// set arrow XYZ
|
||||||
const float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
|
const float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
|
||||||
const float fY = ArrowGetYPos( m_PlayerNumber, c, 0, m_fYReverseOffsetPixels );
|
const float fY = ArrowGetYPos( m_PlayerNumber, c, 0, m_fYReverseOffsetPixels );
|
||||||
const float fZ = ArrowGetZPos( m_PlayerNumber, c, 0 );
|
const float fZ = ArrowGetZPos( m_PlayerNumber, c, 0 );
|
||||||
m_GrayArrow[c].SetX( fX );
|
m_ReceptorArrow[c].SetX( fX );
|
||||||
m_GrayArrow[c].SetY( fY );
|
m_ReceptorArrow[c].SetY( fY );
|
||||||
m_GrayArrow[c].SetZ( fZ );
|
m_ReceptorArrow[c].SetZ( fZ );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrayArrowRow::DrawPrimitives()
|
void ReceptorArrowRow::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);
|
||||||
m_GrayArrow[c].Draw();
|
m_ReceptorArrow[c].Draw();
|
||||||
g_NoteFieldMode[m_PlayerNumber].EndDrawTrack(c);
|
g_NoteFieldMode[m_PlayerNumber].EndDrawTrack(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrayArrowRow::Step( int iCol )
|
void ReceptorArrowRow::Step( int iCol )
|
||||||
{
|
{
|
||||||
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
||||||
m_GrayArrow[iCol].Step();
|
m_ReceptorArrow[iCol].Step();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrayArrowRow::UpdateBars( int iCol )
|
void ReceptorArrowRow::SetPressed( int iCol )
|
||||||
{
|
{
|
||||||
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
ASSERT( iCol >= 0 && iCol < m_iNumCols );
|
||||||
m_GrayArrow[iCol].UpdateBars();
|
m_ReceptorArrow[iCol].SetPressed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrayArrowRow::CopyTweening( const GrayArrowRow &from )
|
void ReceptorArrowRow::CopyTweening( const ReceptorArrowRow &from )
|
||||||
{
|
{
|
||||||
for( int c=0; c<m_iNumCols; c++ )
|
for( int c=0; c<m_iNumCols; c++ )
|
||||||
m_GrayArrow[c].CopyTweening( from.m_GrayArrow[c] );
|
m_ReceptorArrow[c].CopyTweening( from.m_ReceptorArrow[c] );
|
||||||
ActorFrame::CopyTweening( from );
|
ActorFrame::CopyTweening( from );
|
||||||
}
|
}
|
||||||
@@ -1,42 +1,42 @@
|
|||||||
#ifndef GRAYARROWROW_H
|
#ifndef ReceptorArrowROW_H
|
||||||
#define GRAYARROWROW_H
|
#define ReceptorArrowROW_H
|
||||||
/*
|
/*
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Class: GrayArrowRow
|
Class: ReceptorArrowRow
|
||||||
|
|
||||||
Desc: A row of GrayArrow objects
|
Desc: A row of ReceptorArrow objects
|
||||||
|
|
||||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
Chris Danford
|
Chris Danford
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GrayArrow.h"
|
#include "ReceptorArrow.h"
|
||||||
#include "ActorFrame.h"
|
#include "ActorFrame.h"
|
||||||
#include "StyleDef.h"
|
#include "StyleDef.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
|
|
||||||
class GrayArrowRow : public ActorFrame
|
class ReceptorArrowRow : public ActorFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GrayArrowRow();
|
ReceptorArrowRow();
|
||||||
|
|
||||||
void Load( PlayerNumber pn, CString NoteSkin, float fYReverseOffset );
|
void Load( PlayerNumber pn, CString NoteSkin, float fYReverseOffset );
|
||||||
|
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
virtual void CopyTweening( const GrayArrowRow &from );
|
virtual void CopyTweening( const ReceptorArrowRow &from );
|
||||||
|
|
||||||
void Step( int iCol );
|
void Step( int iCol );
|
||||||
void UpdateBars( int iCol );
|
void SetPressed( int iCol );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_iNumCols;
|
int m_iNumCols;
|
||||||
PlayerNumber m_PlayerNumber;
|
PlayerNumber m_PlayerNumber;
|
||||||
float m_fYReverseOffsetPixels;
|
float m_fYReverseOffsetPixels;
|
||||||
|
|
||||||
GrayArrow m_GrayArrow[MAX_NOTE_TRACKS];
|
ReceptorArrow m_ReceptorArrow[MAX_NOTE_TRACKS];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
#define CHARS_SPACING_Y THEME->GetMetricF("ScreenNameEntry","CharsSpacingY")
|
#define CHARS_SPACING_Y THEME->GetMetricF("ScreenNameEntry","CharsSpacingY")
|
||||||
#define SCROLLING_CHARS_COLOR THEME->GetMetricC("ScreenNameEntry","ScrollingCharsColor")
|
#define SCROLLING_CHARS_COLOR THEME->GetMetricC("ScreenNameEntry","ScrollingCharsColor")
|
||||||
#define SELECTED_CHARS_COLOR THEME->GetMetricC("ScreenNameEntry","SelectedCharsColor")
|
#define SELECTED_CHARS_COLOR THEME->GetMetricC("ScreenNameEntry","SelectedCharsColor")
|
||||||
#define GRAY_ARROWS_Y THEME->GetMetricF("ScreenNameEntry","GrayArrowsY")
|
#define GRAY_ARROWS_Y THEME->GetMetricF("ScreenNameEntry","ReceptorArrowsY")
|
||||||
#define NUM_CHARS_TO_DRAW_BEHIND THEME->GetMetricI("ScreenNameEntry","NumCharsToDrawBehind")
|
#define NUM_CHARS_TO_DRAW_BEHIND THEME->GetMetricI("ScreenNameEntry","NumCharsToDrawBehind")
|
||||||
#define NUM_CHARS_TO_DRAW_TOTAL THEME->GetMetricI("ScreenNameEntry","NumCharsToDrawTotal")
|
#define NUM_CHARS_TO_DRAW_TOTAL THEME->GetMetricI("ScreenNameEntry","NumCharsToDrawTotal")
|
||||||
#define FAKE_BEATS_PER_SEC THEME->GetMetricF("ScreenNameEntry","FakeBeatsPerSec")
|
#define FAKE_BEATS_PER_SEC THEME->GetMetricF("ScreenNameEntry","FakeBeatsPerSec")
|
||||||
@@ -55,7 +55,7 @@ float g_fCharsZoomLarge;
|
|||||||
float g_fCharsSpacingY;
|
float g_fCharsSpacingY;
|
||||||
RageColor g_ScrollingCharsColor;
|
RageColor g_ScrollingCharsColor;
|
||||||
RageColor g_SelectedCharsColor;
|
RageColor g_SelectedCharsColor;
|
||||||
float g_fGrayArrowsY;
|
float g_fReceptorArrowsY;
|
||||||
int g_iNumCharsToDrawBehind;
|
int g_iNumCharsToDrawBehind;
|
||||||
int g_iNumCharsToDrawTotal;
|
int g_iNumCharsToDrawTotal;
|
||||||
float g_fFakeBeatsPerSec;
|
float g_fFakeBeatsPerSec;
|
||||||
@@ -104,7 +104,7 @@ ScreenNameEntry::ScreenNameEntry( CString sClassName ) : Screen( sClassName )
|
|||||||
g_fCharsSpacingY = CHARS_SPACING_Y;
|
g_fCharsSpacingY = CHARS_SPACING_Y;
|
||||||
g_ScrollingCharsColor = SCROLLING_CHARS_COLOR;
|
g_ScrollingCharsColor = SCROLLING_CHARS_COLOR;
|
||||||
g_SelectedCharsColor = SELECTED_CHARS_COLOR;
|
g_SelectedCharsColor = SELECTED_CHARS_COLOR;
|
||||||
g_fGrayArrowsY = GRAY_ARROWS_Y;
|
g_fReceptorArrowsY = GRAY_ARROWS_Y;
|
||||||
g_iNumCharsToDrawBehind = NUM_CHARS_TO_DRAW_BEHIND;
|
g_iNumCharsToDrawBehind = NUM_CHARS_TO_DRAW_BEHIND;
|
||||||
g_iNumCharsToDrawTotal = NUM_CHARS_TO_DRAW_TOTAL;
|
g_iNumCharsToDrawTotal = NUM_CHARS_TO_DRAW_TOTAL;
|
||||||
g_fFakeBeatsPerSec = FAKE_BEATS_PER_SEC;
|
g_fFakeBeatsPerSec = FAKE_BEATS_PER_SEC;
|
||||||
@@ -191,10 +191,10 @@ ScreenNameEntry::ScreenNameEntry( CString sClassName ) : Screen( sClassName )
|
|||||||
/* Ensure that this is up-to-date. */
|
/* Ensure that this is up-to-date. */
|
||||||
GAMESTATE->m_pPosition->Load( (PlayerNumber)p );
|
GAMESTATE->m_pPosition->Load( (PlayerNumber)p );
|
||||||
|
|
||||||
m_GrayArrowRow[p].Load( (PlayerNumber)p, GAMESTATE->m_PlayerOptions[p].m_sNoteSkin, 0 );
|
m_ReceptorArrowRow[p].Load( (PlayerNumber)p, GAMESTATE->m_PlayerOptions[p].m_sNoteSkin, 0 );
|
||||||
m_GrayArrowRow[p].SetX( (float)GAMESTATE->GetCurrentStyleDef()->m_iCenterX[p] );
|
m_ReceptorArrowRow[p].SetX( (float)GAMESTATE->GetCurrentStyleDef()->m_iCenterX[p] );
|
||||||
m_GrayArrowRow[p].SetY( SCREEN_TOP + 100 );
|
m_ReceptorArrowRow[p].SetY( SCREEN_TOP + 100 );
|
||||||
this->AddChild( &m_GrayArrowRow[p] );
|
this->AddChild( &m_ReceptorArrowRow[p] );
|
||||||
|
|
||||||
|
|
||||||
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
const StyleDef* pStyleDef = GAMESTATE->GetCurrentStyleDef();
|
||||||
@@ -368,7 +368,7 @@ void ScreenNameEntry::Input( const DeviceInput& DeviceI, const InputEventType ty
|
|||||||
int StringIndex = m_ColToStringIndex[StyleI.player][StyleI.col];
|
int StringIndex = m_ColToStringIndex[StyleI.player][StyleI.col];
|
||||||
if(StringIndex != -1)
|
if(StringIndex != -1)
|
||||||
{
|
{
|
||||||
m_GrayArrowRow[StyleI.player].Step( StyleI.col );
|
m_ReceptorArrowRow[StyleI.player].Step( StyleI.col );
|
||||||
m_soundStep.Play();
|
m_soundStep.Play();
|
||||||
char c = NAME_CHARS[GetClosestCharIndex(m_fFakeBeat)];
|
char c = NAME_CHARS[GetClosestCharIndex(m_fFakeBeat)];
|
||||||
m_textSelectedChars[StyleI.player][StyleI.col].SetText( ssprintf("%c",c) );
|
m_textSelectedChars[StyleI.player][StyleI.col].SetText( ssprintf("%c",c) );
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "BitmapText.h"
|
#include "BitmapText.h"
|
||||||
#include "Transition.h"
|
#include "Transition.h"
|
||||||
#include "RandomSample.h"
|
#include "RandomSample.h"
|
||||||
#include "GrayArrowRow.h"
|
#include "ReceptorArrowRow.h"
|
||||||
#include "BGAnimation.h"
|
#include "BGAnimation.h"
|
||||||
#include "MenuTimer.h"
|
#include "MenuTimer.h"
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ private:
|
|||||||
|
|
||||||
BGAnimation m_Background;
|
BGAnimation m_Background;
|
||||||
|
|
||||||
GrayArrowRow m_GrayArrowRow[NUM_PLAYERS];
|
ReceptorArrowRow m_ReceptorArrowRow[NUM_PLAYERS];
|
||||||
BitmapText m_textSelectedChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH];
|
BitmapText m_textSelectedChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH];
|
||||||
BitmapText m_textScrollingChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH];
|
BitmapText m_textScrollingChars[NUM_PLAYERS][ABS_MAX_RANKING_NAME_LENGTH];
|
||||||
BitmapText m_textCategory[NUM_PLAYERS];
|
BitmapText m_textCategory[NUM_PLAYERS];
|
||||||
|
|||||||
+39
-11
@@ -24,6 +24,7 @@
|
|||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "SDL_utils.h"
|
#include "SDL_utils.h"
|
||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
|
#include "arch/ArchHooks/ArchHooks.h"
|
||||||
|
|
||||||
Sprite::Sprite()
|
Sprite::Sprite()
|
||||||
{
|
{
|
||||||
@@ -81,6 +82,8 @@ bool Sprite::LoadFromSpriteFile( RageTextureID ID )
|
|||||||
{
|
{
|
||||||
LOG->Trace( ssprintf("Sprite::LoadFromSpriteFile(%s)", ID.filename.c_str()) );
|
LOG->Trace( ssprintf("Sprite::LoadFromSpriteFile(%s)", ID.filename.c_str()) );
|
||||||
|
|
||||||
|
retry:
|
||||||
|
|
||||||
//Init();
|
//Init();
|
||||||
|
|
||||||
m_sSpritePath = ID.filename;
|
m_sSpritePath = ID.filename;
|
||||||
@@ -102,7 +105,20 @@ bool Sprite::LoadFromSpriteFile( RageTextureID ID )
|
|||||||
vector<CString> asElementPaths;
|
vector<CString> asElementPaths;
|
||||||
GetDirListing( ID.filename + "*", asElementPaths, false, true );
|
GetDirListing( ID.filename + "*", asElementPaths, false, true );
|
||||||
if(asElementPaths.size() == 0)
|
if(asElementPaths.size() == 0)
|
||||||
RageException::Throw( "The sprite file '%s' points to a texture '%s' which doesn't exist.", m_sSpritePath.c_str(), ID.filename.c_str() );
|
{
|
||||||
|
CString sMessage = ssprintf( "The sprite file '%s' points to a texture '%s' which doesn't exist.", m_sSpritePath.c_str(), ID.filename.c_str() );
|
||||||
|
switch( HOOKS->MessageBoxAbortRetryIgnore(sMessage) )
|
||||||
|
{
|
||||||
|
case ArchHooks::abort:
|
||||||
|
RageException::Throw( "Error reading value 'Texture' from %s.", m_sSpritePath.c_str() );
|
||||||
|
case ArchHooks::retry:
|
||||||
|
goto retry;
|
||||||
|
case ArchHooks::ignore:
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
ASSERT(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(asElementPaths.size() > 1)
|
if(asElementPaths.size() > 1)
|
||||||
{
|
{
|
||||||
CString message = ssprintf(
|
CString message = ssprintf(
|
||||||
@@ -206,6 +222,20 @@ bool Sprite::LoadFromTexture( RageTextureID ID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Sprite::UpdateAnimationState()
|
||||||
|
{
|
||||||
|
// Don't bother with state switching logic if there's only one state.
|
||||||
|
// We already know what's going to show.
|
||||||
|
if( m_States.size() > 1 )
|
||||||
|
{
|
||||||
|
while( m_fSecsIntoState > m_States[m_iCurState].fDelay ) // it's time to switch frames
|
||||||
|
{
|
||||||
|
// increment frame and reset the counter
|
||||||
|
m_fSecsIntoState -= m_States[m_iCurState].fDelay; // leave the left over time for the next frame
|
||||||
|
m_iCurState = (m_iCurState+1) % m_States.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Sprite::Update( float fDelta )
|
void Sprite::Update( float fDelta )
|
||||||
{
|
{
|
||||||
@@ -217,17 +247,8 @@ void Sprite::Update( float fDelta )
|
|||||||
if( !m_pTexture ) // no texture, nothing to animate
|
if( !m_pTexture ) // no texture, nothing to animate
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//
|
|
||||||
// update animation frame
|
|
||||||
//
|
|
||||||
m_fSecsIntoState += fDelta;
|
m_fSecsIntoState += fDelta;
|
||||||
|
UpdateAnimationState();
|
||||||
while( m_fSecsIntoState > m_States[m_iCurState].fDelay ) // it's time to switch frames
|
|
||||||
{
|
|
||||||
// increment frame and reset the counter
|
|
||||||
m_fSecsIntoState -= m_States[m_iCurState].fDelay; // leave the left over time for the next frame
|
|
||||||
m_iCurState = (m_iCurState+1) % m_States.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// update scrolling
|
// update scrolling
|
||||||
@@ -566,6 +587,13 @@ void Sprite::SetState( int iNewState )
|
|||||||
m_fSecsIntoState = 0.0;
|
m_fSecsIntoState = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sprite::SetSecondsIntoAnimation( float fSeconds )
|
||||||
|
{
|
||||||
|
SetState( 0 ); // rewind to the first state
|
||||||
|
m_fSecsIntoState = fSeconds;
|
||||||
|
UpdateAnimationState();
|
||||||
|
}
|
||||||
|
|
||||||
CString Sprite::GetTexturePath() const
|
CString Sprite::GetTexturePath() const
|
||||||
{
|
{
|
||||||
if( m_pTexture==NULL )
|
if( m_pTexture==NULL )
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public:
|
|||||||
|
|
||||||
virtual void DrawPrimitives();
|
virtual void DrawPrimitives();
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
|
void UpdateAnimationState(); // take m_fSecondsIntoState, and move to a new state
|
||||||
|
|
||||||
/* Just a convenience function; load an image that'll be used in the
|
/* Just a convenience function; load an image that'll be used in the
|
||||||
* background. */
|
* background. */
|
||||||
@@ -37,6 +38,7 @@ public:
|
|||||||
|
|
||||||
virtual void EnableAnimation( bool bEnable );
|
virtual void EnableAnimation( bool bEnable );
|
||||||
virtual void SetState( int iNewState );
|
virtual void SetState( int iNewState );
|
||||||
|
virtual void SetSecondsIntoAnimation( float fSeconds );
|
||||||
|
|
||||||
virtual int GetNumStates() { return m_States.size(); };
|
virtual int GetNumStates() { return m_States.size(); };
|
||||||
CString GetTexturePath() const;
|
CString GetTexturePath() const;
|
||||||
|
|||||||
+46
-46
@@ -58,14 +58,14 @@ BSC32=bscmake.exe
|
|||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
|
# ADD BASE LINK32 $(intdir)\verstub.obj kernel32.lib shell32.lib user32.lib gdi32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe"
|
||||||
# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"../Program/StepMania-debug.exe"
|
# ADD LINK32 $(intdir)\verstub.obj kernel32.lib gdi32.lib shell32.lib user32.lib advapi32.lib winmm.lib /nologo /subsystem:windows /map /debug /machine:I386 /nodefaultlib:"libcmtd.lib" /out:"../../itg/Program/StepMania-debug.exe"
|
||||||
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Debug6
|
IntDir=.\../Debug6
|
||||||
TargetDir=\stepmania\stepmania\Program
|
TargetDir=\stepmania\itg\Program
|
||||||
TargetName=StepMania-debug
|
TargetName=StepMania-debug
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -102,8 +102,8 @@ IntDir=.\Debug
|
|||||||
TargetDir=\stepmania\stepmania
|
TargetDir=\stepmania\stepmania
|
||||||
TargetName=default
|
TargetName=default
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp \
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp \
|
||||||
/Fo$(IntDir)\
|
/Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ IntDir=.\../Release6
|
|||||||
TargetDir=\stepmania\stepmania\Program
|
TargetDir=\stepmania\stepmania\Program
|
||||||
TargetName=StepMania
|
TargetName=StepMania
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -184,8 +184,8 @@ IntDir=.\StepMania___Xbox_Release
|
|||||||
TargetDir=\stepmania\stepmania
|
TargetDir=\stepmania\stepmania
|
||||||
TargetName=default
|
TargetName=default
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp \
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp \
|
||||||
/Fo$(IntDir)\
|
/Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -3277,44 +3277,6 @@ SOURCE=.\GhostArrowRow.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\GrayArrow.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=.\GrayArrow.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\GrayArrowRow.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=.\GrayArrowRow.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\HoldGhostArrow.cpp
|
SOURCE=.\HoldGhostArrow.cpp
|
||||||
|
|
||||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
@@ -3547,6 +3509,44 @@ SOURCE=.\ProTimingDisplay.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ReceptorArrow.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=.\ReceptorArrow.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ReceptorArrowRow.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=.\ReceptorArrowRow.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\ScoreDisplay.cpp
|
SOURCE=.\ScoreDisplay.cpp
|
||||||
|
|
||||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
|
|||||||
@@ -1416,16 +1416,16 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
|||||||
RelativePath="GhostArrowRow.h">
|
RelativePath="GhostArrowRow.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\GrayArrow.cpp">
|
RelativePath=".\ReceptorArrow.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\GrayArrow.h">
|
RelativePath=".\ReceptorArrow.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="GrayArrowRow.cpp">
|
RelativePath="ReceptorArrowRow.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="GrayArrowRow.h">
|
RelativePath="ReceptorArrowRow.h">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\HoldGhostArrow.cpp">
|
RelativePath=".\HoldGhostArrow.cpp">
|
||||||
|
|||||||
Reference in New Issue
Block a user