Added separate icon for smaniac

This commit is contained in:
Chris Danford
2002-10-06 16:56:58 +00:00
parent 393cff9310
commit 107a1521e6
22 changed files with 196 additions and 128 deletions
+9
View File
@@ -13,9 +13,14 @@
[Common] [Common]
ColorP1=0.4,1.0,0.8,1 // sea green ColorP1=0.4,1.0,0.8,1 // sea green
ColorP2=1.0,0.5,0.2,1 // orange ColorP2=1.0,0.5,0.2,1 // orange
[Notes]
ColorEasy=0.9,0.9,0,1 // yellow ColorEasy=0.9,0.9,0,1 // yellow
ColorMedium=1,0.1,0.1,1 // light red ColorMedium=1,0.1,0.1,1 // light red
ColorHard=0.2,1,0.2,1 // light green ColorHard=0.2,1,0.2,1 // light green
ColorSHard=0.8,0.2,1.0,1 // purple
ColorChallenge=0.2,0.6,1.0,1 // blue
ColorBattle=1,0,0,1 // red
[ScreenTitleMenu] [ScreenTitleMenu]
ChoicesX=320 ChoicesX=320
@@ -342,6 +347,10 @@ BannerX=320
BannerY=100 BannerY=100
StageX=320 StageX=320
StageY=64 StageY=64
DifficultyIconP1X=216
DifficultyIconP1Y=132
DifficultyIconP2X=424
DifficultyIconP2Y=132
GradeP1X=94 GradeP1X=94
GradeP2X=546 GradeP2X=546
GradeY=100 GradeY=100
-11
View File
@@ -25,22 +25,11 @@ BannerWithFrame::BannerWithFrame()
this->AddChild( &m_Banner ); this->AddChild( &m_Banner );
this->AddChild( &m_sprBannerFrame ); this->AddChild( &m_sprBannerFrame );
for( int p=0; p<NUM_PLAYERS; p++ )
{
float fX = (m_sprBannerFrame.GetUnzoomedWidth()/2-26) * (p==PLAYER_1 ? -1 : 1 );
float fY = m_sprBannerFrame.GetUnzoomedHeight()/2-26;
m_Icon[p].SetX( fX );
m_Icon[p].SetY( fY );
this->AddChild( &m_Icon[p] );
}
} }
void BannerWithFrame::LoadFromSongAndNotes( Song* pSong, Notes* pNotes[NUM_PLAYERS] ) void BannerWithFrame::LoadFromSongAndNotes( Song* pSong, Notes* pNotes[NUM_PLAYERS] )
{ {
LoadFromSong( pSong ); LoadFromSong( pSong );
for( int p=0; p<NUM_PLAYERS; p++ )
m_Icon[p].SetFromNotes( pNotes[p] ); // NULL pNotes menas icon is hidden
} }
void BannerWithFrame::LoadFromSong( Song* pSong ) void BannerWithFrame::LoadFromSong( Song* pSong )
+1 -3
View File
@@ -3,7 +3,7 @@
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Class: BannerWithFrame Class: BannerWithFrame
Desc: bonus meters and max combo number. Desc: show the banner inside a frame.
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
@@ -13,7 +13,6 @@
#include "ActorFrame.h" #include "ActorFrame.h"
#include "Sprite.h" #include "Sprite.h"
#include "Banner.h" #include "Banner.h"
#include "DifficultyIcon.h"
class Song; class Song;
class Course; class Course;
@@ -31,5 +30,4 @@ protected:
Sprite m_sprBannerFrame; Sprite m_sprBannerFrame;
Banner m_Banner; Banner m_Banner;
DifficultyIcon m_Icon[NUM_PLAYERS];
}; };
+3 -3
View File
@@ -66,16 +66,16 @@ void CourseContentDisplay::Load( int iNum, Song* pSong, Notes* pNotes )
m_textNumber.SetText( ssprintf("%d", iNum) ); m_textNumber.SetText( ssprintf("%d", iNum) );
D3DXCOLOR colorGroup = SONGMAN->GetSongColor( pSong ); D3DXCOLOR colorGroup = SONGMAN->GetSongColor( pSong );
D3DXCOLOR colorDifficulty = DifficultyToColor( pNotes->m_Difficulty ); D3DXCOLOR colorNotes = pNotes->GetColor();
m_TextBanner.LoadFromSong( pSong ); m_TextBanner.LoadFromSong( pSong );
m_TextBanner.SetDiffuse( colorGroup ); m_TextBanner.SetDiffuse( colorGroup );
m_textFoot.SetText( "1" ); m_textFoot.SetText( "1" );
m_textFoot.SetDiffuse( colorDifficulty ); m_textFoot.SetDiffuse( colorNotes );
m_textDifficultyNumber.SetText( ssprintf("%d", pNotes->m_iMeter) ); m_textDifficultyNumber.SetText( ssprintf("%d", pNotes->m_iMeter) );
m_textDifficultyNumber.SetDiffuse( colorDifficulty ); m_textDifficultyNumber.SetDiffuse( colorNotes );
} }
+38 -2
View File
@@ -1,15 +1,51 @@
#include "stdafx.h" #include "stdafx.h"
/* /*
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
File: DifficultyIcon.h Class: DifficultyIcon
Desc: A graphic displayed in the DifficultyIcon during Dancing. Desc: See header.
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
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
#include "DifficultyIcon.h" #include "DifficultyIcon.h"
#include "RageUtil.h"
#include "GameConstantsAndTypes.h"
#include "PrefsManager.h"
#include "RageLog.h"
#include "Notes.h"
#include "GameState.h"
bool DifficultyIcon::Load( CString sPath )
{
Sprite::Load( sPath );
if( GetNumStates() != 6 && GetNumStates() != 12 )
throw RageException( "The difficulty icon graphic '%s' must have 6 or 12 states.", sPath );
StopAnimating();
return true;
}
void DifficultyIcon::SetFromNotes( PlayerNumber pn, Notes* pNotes )
{
if( pNotes == NULL )
{
SetDiffuse( D3DXCOLOR(1,1,1,0) );
return;
}
else
{
SetDiffuse( D3DXCOLOR(1,1,1,1) );
int iStateNo = pNotes->GetNotesDisplayType();
switch( GetNumStates() )
{
case 6: SetState( iStateNo ); break;
case 12: SetState( iStateNo*2+pn ); break;
default: ASSERT(0);
}
}
}
+5 -34
View File
@@ -3,50 +3,21 @@
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Class: DifficultyIcon Class: DifficultyIcon
Desc: A graphic displayed in Select Music above the Groove Radar. Desc: Graphical representation of the difficulty class.
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 "Sprite.h" #include "Sprite.h"
#include "Notes.h" #include "GameConstantsAndTypes.h"
#include "ThemeManager.h" struct Notes;
class DifficultyIcon : public Sprite class DifficultyIcon : public Sprite
{ {
public: public:
DifficultyIcon() bool Load( CString sFilePath );
{
Load( THEME->GetPathTo("Graphics","select music difficulty icons") );
StopAnimating();
SetFromNotes( NULL );
};
void SetFromNotes( const Notes* pNotes )
{
if( pNotes != NULL )
{
SetDiffuse( D3DXCOLOR(1,1,1,1) );
switch( pNotes->m_Difficulty )
{
case DIFFICULTY_EASY: SetState( 0 ); break;
case DIFFICULTY_MEDIUM: SetState( 1 ); break;
case DIFFICULTY_HARD: SetState( 2 ); break;
}
}
else
{
SetDiffuse( D3DXCOLOR(1,1,1,0) );
SetState( 0 );
}
};
private:
void SetFromNotes( PlayerNumber pn, Notes* pNotes );
}; };
+6 -8
View File
@@ -16,6 +16,9 @@
#include "PrefsManager.h" #include "PrefsManager.h"
const int NUM_FEET_IN_METER = 10;
const int GLOW_IF_METER_GREATER_THAN = 9;
FootMeter::FootMeter() FootMeter::FootMeter()
{ {
@@ -30,16 +33,12 @@ void FootMeter::SetFromNotes( Notes* pNotes )
{ {
SetDiffuse( D3DXCOLOR(1,1,1,1) ); SetDiffuse( D3DXCOLOR(1,1,1,1) );
SetNumFeet( pNotes->m_iMeter ); SetNumFeet( pNotes->m_iMeter );
if( pNotes->m_iMeter >= 10 ) if( pNotes->m_iMeter > GLOW_IF_METER_GREATER_THAN )
this->SetEffectGlowing(); this->SetEffectGlowing();
else else
this->SetEffectNone(); this->SetEffectNone();
SetDiffuse( pNotes->GetColor() ); SetDiffuse( pNotes->GetColor() );
// this->StopTweening();
// this->SetZoom( 1.1f );
// this->BeginTweening( 0.3f, TWEEN_BOUNCE_BEGIN );
// this->SetTweenZoom( 1 );
} }
else else
{ {
@@ -52,12 +51,11 @@ void FootMeter::SetFromNotes( Notes* pNotes )
void FootMeter::SetNumFeet( int iNumFeet ) void FootMeter::SetNumFeet( int iNumFeet )
{ {
CString sNewText; CString sNewText;
for( int f=0; f<=9; f++ ) for( int f=0; f<NUM_FEET_IN_METER; f++ )
sNewText += (f<iNumFeet) ? "1" : "0"; sNewText += (f<iNumFeet) ? "1" : "0";
for( f=10; f<=12; f++ ) for( f=NUM_FEET_IN_METER; f<=13; f++ )
if( f<iNumFeet ) if( f<iNumFeet )
sNewText += "1"; sNewText += "1";
SetText( sNewText ); SetText( sNewText );
} }
-14
View File
@@ -15,22 +15,8 @@
#define COLOR_P1 THEME->GetMetricC("Common","ColorP1") #define COLOR_P1 THEME->GetMetricC("Common","ColorP1")
#define COLOR_P2 THEME->GetMetricC("Common","ColorP2") #define COLOR_P2 THEME->GetMetricC("Common","ColorP2")
#define COLOR_EASY THEME->GetMetricC("Common","ColorEasy")
#define COLOR_MEDIUM THEME->GetMetricC("Common","ColorMedium")
#define COLOR_HARD THEME->GetMetricC("Common","ColorHard")
D3DXCOLOR DifficultyToColor( Difficulty dc )
{
switch( dc )
{
case DIFFICULTY_EASY: return COLOR_EASY;
case DIFFICULTY_MEDIUM: return COLOR_MEDIUM;
case DIFFICULTY_HARD: return COLOR_HARD;
default: ASSERT(0); return D3DXCOLOR(); // invalid Difficulty
}
}
CString DifficultyToString( Difficulty dc ) CString DifficultyToString( Difficulty dc )
{ {
switch( dc ) switch( dc )
-2
View File
@@ -52,8 +52,6 @@ enum Difficulty
CLASS_INVALID CLASS_INVALID
}; };
D3DXCOLOR DifficultyToColor( Difficulty dc );
CString DifficultyToString( Difficulty dc ); CString DifficultyToString( Difficulty dc );
Difficulty StringToDifficulty( CString sDC ); Difficulty StringToDifficulty( CString sDC );
+36 -9
View File
@@ -22,8 +22,15 @@
#include "RageException.h" #include "RageException.h"
#include "MsdFile.h" #include "MsdFile.h"
#include "GameManager.h" #include "GameManager.h"
#include "ThemeManager.h"
#define COLOR_EASY THEME->GetMetricC("Notes","ColorEasy")
#define COLOR_MEDIUM THEME->GetMetricC("Notes","ColorMedium")
#define COLOR_HARD THEME->GetMetricC("Notes","ColorHard")
#define COLOR_S_HARD THEME->GetMetricC("Notes","ColorSHard")
#define COLOR_CHALLENGE THEME->GetMetricC("Notes","ColorChallenge")
#define COLOR_BATTLE THEME->GetMetricC("Notes","ColorBattle")
Notes::Notes() Notes::Notes()
@@ -78,17 +85,37 @@ void Notes::GetNoteData( NoteData* pNoteDataOut ) const
} }
// Color is a function of Difficulty and Intended Style // Color is a function of Difficulty and Intended Style
D3DXCOLOR Notes::GetColor() const NotesDisplayType Notes::GetNotesDisplayType() const
{ {
CString sDescription = m_sDescription; CString sDescription = m_sDescription;
sDescription.MakeLower(); sDescription.MakeLower();
if( -1 != sDescription.Find("battle") ) if( -1 != sDescription.Find("battle") ) return NOTES_DISPLAY_BATTLE;
return D3DXCOLOR(1,0.5f,0,1); // orange else if( -1 != sDescription.Find("couple") ) return NOTES_DISPLAY_BATTLE;
else if( -1 != m_sDescription.Find("couple") ) else if( -1 != sDescription.Find("smaniac") ) return NOTES_DISPLAY_S_HARD;
return D3DXCOLOR(0,0,1,1); // blue else if( -1 != sDescription.Find("challenge") ) return NOTES_DISPLAY_CHALLENGE;
else
return DifficultyToColor( m_Difficulty ); switch( m_Difficulty )
{
case DIFFICULTY_EASY: return NOTES_DISPLAY_EASY;
case DIFFICULTY_MEDIUM: return NOTES_DISPLAY_MEDIUM;
case DIFFICULTY_HARD: return NOTES_DISPLAY_HARD;
default: ASSERT(0); return NOTES_DISPLAY_EASY;
}
}
D3DXCOLOR Notes::GetColor() const
{
switch( GetNotesDisplayType() )
{
case NOTES_DISPLAY_EASY: return COLOR_EASY;
case NOTES_DISPLAY_MEDIUM: return COLOR_MEDIUM;
case NOTES_DISPLAY_HARD: return COLOR_HARD;
case NOTES_DISPLAY_S_HARD: return COLOR_S_HARD;
case NOTES_DISPLAY_CHALLENGE: return COLOR_CHALLENGE;
case NOTES_DISPLAY_BATTLE: return COLOR_BATTLE;
default: return COLOR_EASY;
}
} }
void Notes::TidyUpData() void Notes::TidyUpData()
@@ -118,7 +145,7 @@ Difficulty Notes::DifficultyFromDescriptionAndMeter( CString sDescription, int i
"easy", "easy",
"basic", "basic",
"light", "light",
"GARBAGE", // but don't worry - this will never match because the compare string is all lowercase "GARBAGE", // don't worry - this will never match because the compare string is all lowercase
}, },
{ {
"medium", "medium",
@@ -137,7 +164,7 @@ Difficulty Notes::DifficultyFromDescriptionAndMeter( CString sDescription, int i
for( int i=0; i<NUM_DIFFICULTIES; i++ ) for( int i=0; i<NUM_DIFFICULTIES; i++ )
for( int j=0; j<DESCRIPTIONS_PER_CLASS; j++ ) for( int j=0; j<DESCRIPTIONS_PER_CLASS; j++ )
if( sDescription.Find(sDescriptionParts[i][j]) != -1 ) if( sDescription.Find(sDescriptionParts[i][j]) != -1 )
return Difficulty(i); return (Difficulty)i;
// guess difficulty class from meter // guess difficulty class from meter
if( iMeter <= 3 ) return DIFFICULTY_EASY; if( iMeter <= 3 ) return DIFFICULTY_EASY;
+14 -4
View File
@@ -16,6 +16,15 @@
#include "Grade.h" #include "Grade.h"
class NoteData; class NoteData;
enum NotesDisplayType
{
NOTES_DISPLAY_EASY,
NOTES_DISPLAY_MEDIUM,
NOTES_DISPLAY_HARD,
NOTES_DISPLAY_S_HARD,
NOTES_DISPLAY_CHALLENGE,
NOTES_DISPLAY_BATTLE
};
struct Notes struct Notes
{ {
@@ -29,15 +38,16 @@ public:
public: public:
NotesType m_NotesType; NotesType m_NotesType;
CString m_sDescription; // This text is displayed next to thte number of feet when a song is selected CString m_sDescription; // This text is displayed next to thte number of feet when a song is selected
Difficulty m_Difficulty; // this is inferred from m_sDescription Difficulty m_Difficulty; // difficulty classification
int m_iMeter; // difficulty from 1-10 int m_iMeter; // difficulty rating from 1-10
float m_fRadarValues[NUM_RADAR_VALUES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise float m_fRadarValues[NUM_RADAR_VALUES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
CString m_sSMNoteData; CString m_sSMNoteData;
void GetNoteData( NoteData* pNoteDataOut ) const; void GetNoteData( NoteData* pNoteDataOut ) const;
void SetNoteData( NoteData* pNewNoteData ); void SetNoteData( NoteData* pNewNoteData );
D3DXCOLOR GetColor() const; NotesDisplayType GetNotesDisplayType() const;
D3DXCOLOR GetColor() const;
// Statistics // Statistics
Grade m_TopGrade; Grade m_TopGrade;
+14 -10
View File
@@ -203,16 +203,20 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
out.m_apNotes.Add( pNewNotes ); out.m_apNotes.Add( pNewNotes );
if( iNumParams != 7 ) if( iNumParams != 7 )
throw RageException( "The song file '%s' is has %d fields in a #NOTES tag, but should have %d.", sPath, iNumParams, 7 ); {
LOG->Trace( "The song file '%s' is has %d fields in a #NOTES tag, but should have %d.", sPath, iNumParams, 7 );
LoadFromSMTokens( }
sParams[1], else
sParams[2], {
sParams[3], LoadFromSMTokens(
sParams[4], sParams[1],
sParams[5], sParams[2],
sParams[6], sParams[3],
*pNewNotes); sParams[4],
sParams[5],
sParams[6],
*pNewNotes);
}
} }
else else
+18 -1
View File
@@ -28,6 +28,8 @@
#define BANNER_Y THEME->GetMetricF("ScreenEvaluation","BannerY") #define BANNER_Y THEME->GetMetricF("ScreenEvaluation","BannerY")
#define STAGE_X THEME->GetMetricF("ScreenEvaluation","StageX") #define STAGE_X THEME->GetMetricF("ScreenEvaluation","StageX")
#define STAGE_Y THEME->GetMetricF("ScreenEvaluation","StageY") #define STAGE_Y THEME->GetMetricF("ScreenEvaluation","StageY")
#define DIFFICULTY_ICON_X( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("DifficultyIconP%dX",p+1))
#define DIFFICULTY_ICON_Y( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("DifficultyIconP%dY",p+1))
#define GRADE_X( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("GradeP%dX",p+1)) #define GRADE_X( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("GradeP%dX",p+1))
#define GRADE_Y THEME->GetMetricF("ScreenEvaluation","GradeY") #define GRADE_Y THEME->GetMetricF("ScreenEvaluation","GradeY")
#define PERCENT_BASE_X( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("PercentBaseP%dX",p+1)) #define PERCENT_BASE_X( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("PercentBaseP%dX",p+1))
@@ -186,7 +188,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
switch( m_ResultMode ) switch( m_ResultMode )
{ {
case RM_ARCADE_STAGE: case RM_ARCADE_STAGE:
m_BannerWithFrame[0].LoadFromSongAndNotes( GAMESTATE->m_pCurSong, GAMESTATE->m_pCurNotes ); m_BannerWithFrame[0].LoadFromSong( GAMESTATE->m_pCurSong );
m_BannerWithFrame[0].SetXY( BANNER_X, BANNER_Y ); m_BannerWithFrame[0].SetXY( BANNER_X, BANNER_Y );
this->AddChild( &m_BannerWithFrame[0] ); this->AddChild( &m_BannerWithFrame[0] );
@@ -197,6 +199,15 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
m_textStage.SetText( GAMESTATE->GetStageText() + " Stage" ); m_textStage.SetText( GAMESTATE->GetStageText() + " Stage" );
this->AddChild( &m_textStage ); this->AddChild( &m_textStage );
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMESTATE->IsPlayerEnabled(p) )
continue; // skip
m_DifficultyIcon[p].Load( THEME->GetPathTo("graphics","select music difficulty icons 1x6") );
m_DifficultyIcon[p].SetFromNotes( (PlayerNumber)p, GAMESTATE->m_pCurNotes[p] );
m_DifficultyIcon[p].SetXY( DIFFICULTY_ICON_X(p), DIFFICULTY_ICON_Y(p) );
this->AddChild( &m_DifficultyIcon[p] );
}
break; break;
case RM_ARCADE_SUMMARY: case RM_ARCADE_SUMMARY:
{ {
@@ -623,6 +634,9 @@ void ScreenEvaluation::TweenOnScreen()
m_textStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN ); m_textStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
m_textStage.SetTweenY( fOriginalY ); m_textStage.SetTweenY( fOriginalY );
for( p=0; p<NUM_PLAYERS; p++ )
m_DifficultyIcon[p].FadeOn( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME );
for( i=0; i<NUM_JUDGE_LINES; i++ ) for( i=0; i<NUM_JUDGE_LINES; i++ )
{ {
fOriginalY = m_sprJudgeLabels[i].GetY(); fOriginalY = m_sprJudgeLabels[i].GetY();
@@ -713,6 +727,9 @@ void ScreenEvaluation::TweenOffScreen()
m_textStage.FadeOff( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME ); m_textStage.FadeOff( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME );
for( p=0; p<NUM_PLAYERS; p++ )
m_DifficultyIcon[p].FadeOff( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME );
for( i=0; i<NUM_JUDGE_LINES; i++ ) for( i=0; i<NUM_JUDGE_LINES; i++ )
{ {
m_sprJudgeLabels[i].FadeOff( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME ); m_sprJudgeLabels[i].FadeOff( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME );
+2
View File
@@ -20,6 +20,7 @@
#include "ScoreDisplayNormal.h" #include "ScoreDisplayNormal.h"
#include "StageBox.h" #include "StageBox.h"
#include "BannerWithFrame.h" #include "BannerWithFrame.h"
#include "DifficultyIcon.h"
const int NUM_JUDGE_LINES = 7; // perfect, great, good, boo, miss, ok, max_combo const int NUM_JUDGE_LINES = 7; // perfect, great, good, boo, miss, ok, max_combo
@@ -48,6 +49,7 @@ protected:
BannerWithFrame m_BannerWithFrame[STAGES_TO_SHOW_IN_SUMMARY]; BannerWithFrame m_BannerWithFrame[STAGES_TO_SHOW_IN_SUMMARY];
BitmapText m_textStage; BitmapText m_textStage;
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
// used in arcade // used in arcade
Sprite m_sprGradeFrame[NUM_PLAYERS]; Sprite m_sprGradeFrame[NUM_PLAYERS];
+9 -8
View File
@@ -307,8 +307,9 @@ ScreenGameplay::ScreenGameplay()
if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) ) if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
continue; continue;
m_DifficultyBanner[p].SetXY( DIFFICULTY_X(p), DIFFICULTY_Y(p,bExtra,bReverse[p]) ); m_DifficultyIcon[p].Load( THEME->GetPathTo("graphics","gameplay difficulty icons 2x6") );
this->AddChild( &m_DifficultyBanner[p] ); m_DifficultyIcon[p].SetXY( DIFFICULTY_X(p), DIFFICULTY_Y(p,bExtra,bReverse[p]) );
this->AddChild( &m_DifficultyIcon[p] );
} }
@@ -539,7 +540,7 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad )
ShowOniGameOver((PlayerNumber)p); ShowOniGameOver((PlayerNumber)p);
m_DifficultyBanner[p].SetFromNotes( PlayerNumber(p), GAMESTATE->m_pCurNotes[p] ); m_DifficultyIcon[p].SetFromNotes( PlayerNumber(p), GAMESTATE->m_pCurNotes[p] );
NoteData originalNoteData; NoteData originalNoteData;
@@ -1448,12 +1449,12 @@ void ScreenGameplay::TweenOnScreen()
for( p=0; p<NUM_PLAYERS; p++ ) for( p=0; p<NUM_PLAYERS; p++ )
{ {
float fOriginalX = m_DifficultyBanner[p].GetX(); float fOriginalX = m_DifficultyIcon[p].GetX();
m_DifficultyBanner[p].SetX( (p==PLAYER_1) ? fOriginalX-200 : fOriginalX+200 ); m_DifficultyIcon[p].SetX( (p==PLAYER_1) ? fOriginalX-200 : fOriginalX+200 );
if( !GAMESTATE->m_bDemonstration ) if( !GAMESTATE->m_bDemonstration )
m_DifficultyBanner[p].BeginTweening( 0.5f ); // sleep m_DifficultyIcon[p].BeginTweening( 0.5f ); // sleep
m_DifficultyBanner[p].BeginTweening( 1 ); m_DifficultyIcon[p].BeginTweening( 1 );
m_DifficultyBanner[p].SetTweenX( fOriginalX ); m_DifficultyIcon[p].SetTweenX( fOriginalX );
} }
} }
+2 -2
View File
@@ -23,7 +23,7 @@
#include "Background.h" #include "Background.h"
#include "LifeMeter.h" #include "LifeMeter.h"
#include "ScoreDisplay.h" #include "ScoreDisplay.h"
#include "DifficultyBanner.h" #include "DifficultyIcon.h"
#include "TransitionFadeWipe.h" #include "TransitionFadeWipe.h"
#include "TransitionOniFade.h" #include "TransitionOniFade.h"
@@ -113,7 +113,7 @@ private:
Player m_Player[NUM_PLAYERS]; Player m_Player[NUM_PLAYERS];
DifficultyBanner m_DifficultyBanner[NUM_PLAYERS]; DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
Sprite m_sprOniGameOver[NUM_PLAYERS]; Sprite m_sprOniGameOver[NUM_PLAYERS];
void ShowOniGameOver( PlayerNumber pn ); void ShowOniGameOver( PlayerNumber pn );
+2 -1
View File
@@ -107,6 +107,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
case 2: sHeaderFile = "select difficulty hard header"; sPictureFile = "select difficulty hard picture"; break; case 2: sHeaderFile = "select difficulty hard header"; sPictureFile = "select difficulty hard picture"; break;
case 3: sHeaderFile = "select difficulty oni header"; sPictureFile = "select difficulty oni picture"; break; case 3: sHeaderFile = "select difficulty oni header"; sPictureFile = "select difficulty oni picture"; break;
case 4: sHeaderFile = "select difficulty endless header"; sPictureFile = "select difficulty endless picture"; break; case 4: sHeaderFile = "select difficulty endless header"; sPictureFile = "select difficulty endless picture"; break;
default: ASSERT(0);
} }
m_sprPicture[d].Load( THEME->GetPathTo("Graphics",sPictureFile) ); m_sprPicture[d].Load( THEME->GetPathTo("Graphics",sPictureFile) );
m_sprPicture[d].SetXY( ITEM_X(d), ITEM_Y(d) ); m_sprPicture[d].SetXY( ITEM_X(d), ITEM_Y(d) );
@@ -305,7 +306,7 @@ bool ScreenSelectDifficulty::IsItemOnPage2( int iItemIndex )
{ {
ASSERT( iItemIndex >= 0 && iItemIndex < NUM_DIFFICULTY_ITEMS ); ASSERT( iItemIndex >= 0 && iItemIndex < NUM_DIFFICULTY_ITEMS );
return iItemIndex >= NUM_DIFFICULTIES; return iItemIndex >= NUM_ITEMS_ON_PAGE_1;
} }
bool ScreenSelectDifficulty::SelectedSomethingOnPage2() bool ScreenSelectDifficulty::SelectedSomethingOnPage2()
+3 -1
View File
@@ -17,7 +17,9 @@
#include "MenuElements.h" #include "MenuElements.h"
const int NUM_DIFFICULTY_ITEMS = NUM_DIFFICULTIES + 2; // easy, medium, hard, Oni, Endless const int NUM_ITEMS_ON_PAGE_1 = 3; // easy, medium, hard,
const int NUM_ITEMS_ON_PAGE_2 = 2; // Oni, Endless
const int NUM_DIFFICULTY_ITEMS = NUM_ITEMS_ON_PAGE_1 + NUM_ITEMS_ON_PAGE_2;
const int NUM_PAGES = 2; // easy-medium-hard, Oni const int NUM_PAGES = 2; // easy-medium-hard, Oni
class ScreenSelectDifficulty : public Screen class ScreenSelectDifficulty : public Screen
+16 -6
View File
@@ -77,7 +77,6 @@ const float TWEEN_TIME = 0.5f;
const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User+1); const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User+1);
const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2); const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2);
const ScreenMessage SM_PlaySongSample = ScreenMessage(SM_User+3);
@@ -135,6 +134,7 @@ ScreenSelectMusic::ScreenSelectMusic()
m_sprDifficultyFrame[p].SetState( p ); m_sprDifficultyFrame[p].SetState( p );
this->AddChild( &m_sprDifficultyFrame[p] ); this->AddChild( &m_sprDifficultyFrame[p] );
m_DifficultyIcon[p].Load( THEME->GetPathTo("graphics","select music difficulty icons 1x6") );
m_DifficultyIcon[p].SetXY( DIFFICULTY_ICON_X(p), DIFFICULTY_ICON_Y(p) ); m_DifficultyIcon[p].SetXY( DIFFICULTY_ICON_X(p), DIFFICULTY_ICON_Y(p) );
this->AddChild( &m_DifficultyIcon[p] ); this->AddChild( &m_DifficultyIcon[p] );
} }
@@ -234,6 +234,7 @@ ScreenSelectMusic::ScreenSelectMusic()
m_bMadeChoice = false; m_bMadeChoice = false;
m_bGoToOptions = false; m_bGoToOptions = false;
m_fPlaySampleCountdown = 0;
UpdateOptionsDisplays(); UpdateOptionsDisplays();
@@ -378,6 +379,13 @@ void ScreenSelectMusic::Update( float fDeltaTime )
{ {
Screen::Update( fDeltaTime ); Screen::Update( fDeltaTime );
if( m_fPlaySampleCountdown > 0 )
{
m_fPlaySampleCountdown -= fDeltaTime;
if( m_fPlaySampleCountdown < 0 )
this->PlayMusicSample();
}
float fNewRotation = m_sprCDTitle.GetRotationY()+D3DX_PI*fDeltaTime/2; float fNewRotation = m_sprCDTitle.GetRotationY()+D3DX_PI*fDeltaTime/2;
fNewRotation = fmodf( fNewRotation, D3DX_PI*2 ); fNewRotation = fmodf( fNewRotation, D3DX_PI*2 );
m_sprCDTitle.SetRotationY( fNewRotation ); m_sprCDTitle.SetRotationY( fNewRotation );
@@ -530,9 +538,6 @@ void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SetNewScreen( "ScreenStage" ); SCREENMAN->SetNewScreen( "ScreenStage" );
} }
break; break;
case SM_PlaySongSample:
PlayMusicSample();
break;
case SM_SongChanged: case SM_SongChanged:
AfterMusicChange(); AfterMusicChange();
break; break;
@@ -686,7 +691,7 @@ void ScreenSelectMusic::AfterNotesChange( PlayerNumber pn )
if( m_pNotes ) if( m_pNotes )
m_HighScore[pn].SetScore( (float)m_pNotes->m_iTopScore ); m_HighScore[pn].SetScore( (float)m_pNotes->m_iTopScore );
m_DifficultyIcon[pn].SetFromNotes( pNotes ); m_DifficultyIcon[pn].SetFromNotes( pn, pNotes );
m_FootMeter[pn].SetFromNotes( pNotes ); m_FootMeter[pn].SetFromNotes( pNotes );
m_GrooveRadar.SetFromNotes( pn, pNotes ); m_GrooveRadar.SetFromNotes( pn, pNotes );
m_MusicWheel.NotesChanged( pn ); m_MusicWheel.NotesChanged( pn );
@@ -721,7 +726,7 @@ void ScreenSelectMusic::AfterMusicChange()
case TYPE_SONG: case TYPE_SONG:
{ {
MUSIC->Stop(); MUSIC->Stop();
this->SendScreenMessage( SM_PlaySongSample, SAMPLE_MUSIC_DELAY ); m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY;
for( int pn = 0; pn < NUM_PLAYERS; ++pn) { for( int pn = 0; pn < NUM_PLAYERS; ++pn) {
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef(), pn, m_arrayNotes[pn] ); pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef(), pn, m_arrayNotes[pn] );
@@ -743,8 +748,13 @@ void ScreenSelectMusic::AfterMusicChange()
if( !GAMESTATE->IsPlayerEnabled( PlayerNumber(p) ) ) if( !GAMESTATE->IsPlayerEnabled( PlayerNumber(p) ) )
continue; continue;
for( int i=0; i<m_arrayNotes[p].GetSize(); i++ ) for( int i=0; i<m_arrayNotes[p].GetSize(); i++ )
{
if( m_arrayNotes[p][i]->m_Difficulty == GAMESTATE->m_PreferredDifficulty[p] ) if( m_arrayNotes[p][i]->m_Difficulty == GAMESTATE->m_PreferredDifficulty[p] )
{
m_iSelection[p] = i; m_iSelection[p] = i;
break;
}
}
m_iSelection[p] = clamp( m_iSelection[p], 0, m_arrayNotes[p].GetSize() ) ; m_iSelection[p] = clamp( m_iSelection[p], 0, m_arrayNotes[p].GetSize() ) ;
} }
+1
View File
@@ -83,6 +83,7 @@ protected:
bool m_bMadeChoice; bool m_bMadeChoice;
bool m_bGoToOptions; bool m_bGoToOptions;
Sprite m_sprOptionsMessage; Sprite m_sprOptionsMessage;
float m_fPlaySampleCountdown;
RageSoundSample m_soundSelect; RageSoundSample m_soundSelect;
RageSoundSample m_soundChangeNotes; RageSoundSample m_soundChangeNotes;
+15 -1
View File
@@ -33,7 +33,7 @@
#include "NotesLoaderKSF.h" #include "NotesLoaderKSF.h"
#include "NotesWriterDWI.h" #include "NotesWriterDWI.h"
const int FILE_CACHE_VERSION = 97; // increment this when Song or Notes changes to invalidate cache const int FILE_CACHE_VERSION = 99; // increment this when Song or Notes changes to invalidate cache
int CompareBPMSegments(const void *arg1, const void *arg2) int CompareBPMSegments(const void *arg1, const void *arg2)
@@ -544,6 +544,20 @@ void Song::TidyUpData()
else else
m_fLastBeat = max( m_fLastBeat, fLastBeat ); m_fLastBeat = max( m_fLastBeat, fLastBeat );
} }
// challenge notes are encoded as smaniac. If there is only one Notes for
// a NotesType and it's "smaniac", then convert it to "Challenge"
for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) )
{
CArray<Notes*,Notes*> apNotes;
GetNotesThatMatch( nt, apNotes );
if( apNotes.GetSize() == 1 )
if( 0 == apNotes[0]->m_sDescription.CompareNoCase("smaniac") )
{
apNotes[0]->m_sDescription = "Challenge";
apNotes[0]->m_Difficulty = DIFFICULTY_HARD;
}
}
} }
/* Get Notes that match a given style and player. */ /* Get Notes that match a given style and player. */
+2 -8
View File
@@ -678,10 +678,10 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
RelativePath="CroppedSprite.h"> RelativePath="CroppedSprite.h">
</File> </File>
<File <File
RelativePath=".\DifficultyIcon.cpp"> RelativePath="DifficultyIcon.cpp">
</File> </File>
<File <File
RelativePath=".\DifficultyIcon.h"> RelativePath="DifficultyIcon.h">
</File> </File>
<File <File
RelativePath="FadingBanner.cpp"> RelativePath="FadingBanner.cpp">
@@ -843,12 +843,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File <File
RelativePath=".\Combo.h"> RelativePath=".\Combo.h">
</File> </File>
<File
RelativePath="DifficultyBanner.cpp">
</File>
<File
RelativePath="DifficultyBanner.h">
</File>
<File <File
RelativePath=".\FocusingSprite.cpp"> RelativePath=".\FocusingSprite.cpp">
</File> </File>