Long Marathon and Marathon Ver logic and graphics (floating bubble still to come)

This commit is contained in:
Chris Danford
2003-02-10 05:30:12 +00:00
parent 2a65bada15
commit 7a810c1378
34 changed files with 731 additions and 498 deletions
+16
View File
@@ -884,3 +884,19 @@ MachineOptions=
GraphicOptions=
GameplayOptions=
AppearanceOptions=
[TextBanner]
Width=180
Height=40
HorizAlign=0
ArtistPrependString=/
TwoLinesTitleZoom=1.0
TwoLinesArtistZoom=0.6
ThreeLinesTitleZoom=1.0
ThreeLinesSubTitleZoom=0.5
ThreeLinesArtistZoom=0.6
TwoLinesTitleY=-8
TwoLinesArtistY=8
ThreeLinesTitleY=-10
ThreeLinesSubTitleY=0
ThreeLinesArtistY=10
+11 -1
View File
@@ -20,6 +20,7 @@
#include "RageLog.h"
#include "ThemeManager.h"
#include "RageUtil.h"
#include "SongManager.h"
GameState* GAMESTATE = NULL; // global and accessable from anywhere in our program
@@ -120,11 +121,20 @@ int GameState::GetStageIndex()
return m_iCurrentStageIndex;
}
int GameState::GetNumStagesLeft()
{
return PREFSMAN->m_iNumArcadeStages - m_iCurrentStageIndex;
}
bool GameState::IsFinalStage()
{
if( PREFSMAN->m_bEventMode )
return false;
return m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages-1;
int iPredictedStageForCurSong = 1;
if( m_pCurSong != NULL )
iPredictedStageForCurSong = SongManager::GetNumStagesForSong( m_pCurSong );
return m_iCurrentStageIndex + iPredictedStageForCurSong == PREFSMAN->m_iNumArcadeStages;
}
bool GameState::IsExtraStage()
+1
View File
@@ -70,6 +70,7 @@ public:
int m_iCurrentStageIndex; // incremented on Eval screen
int GetStageIndex();
int GetNumStagesLeft();
bool IsFinalStage();
bool IsExtraStage();
bool IsExtraStage2();
+2 -17
View File
@@ -51,25 +51,10 @@ MusicBannerWheel::MusicBannerWheel()
this->AddChild( &m_ScrollingList );
if( 0 == stricmp(GAMESTATE->m_sPreferredGroup, "All Music") )
{
SONGMAN->GetAllSongs( arraySongs );
}
SONGMAN->GetSongs( arraySongs, GAMESTATE->GetNumStagesLeft() );
else // Get the Group They Want
{
vector<Song*> apAllSongs;
SONGMAN->GetAllSongs( apAllSongs );
SONGMAN->GetSongs( arraySongs, GAMESTATE->m_sPreferredGroup, GAMESTATE->GetNumStagesLeft() );
for( unsigned i=0; i<apAllSongs.size(); i++ )
{
Song* pSong = apAllSongs[i];
if( GAMESTATE->m_sPreferredGroup != "ALL MUSIC" && pSong->m_sGroupName != GAMESTATE->m_sPreferredGroup )
continue;
else
arraySongs.push_back(pSong);
}
}
if( arraySongs.size() > 0)
{
+44 -42
View File
@@ -20,64 +20,66 @@
#include "ThemeManager.h"
MusicStatusDisplay::MusicStatusDisplay()
{
Load( THEME->GetPathTo("Graphics","music status icons 1x5") );
Load( THEME->GetPathTo("Graphics","music status icons 4x2") );
StopAnimating();
SetType( none );
}
void MusicStatusDisplay::SetType( Type type )
void MusicStatusDisplay::SetFlags( Flags flags )
{
m_type = type;
m_vIconsToShow.clear();
SetDiffuse( RageColor(1,1,1,1) );
// push onto vector in highest to lowest priority
switch( type )
switch( flags.iPlayersBestNumber )
{
case none:
SetEffectNone();
SetDiffuse( RageColor(1,1,1,0) );
break;
case easy:
SetEffectNone();
SetState( 0 );
break;
case crown1:
SetState( 1 );
break;
case crown2:
SetState( 2 );
break;
case crown3:
SetState( 3 );
break;
default:
ASSERT(0);
case 1: m_vIconsToShow.push_back( best1 ); break;
case 2: m_vIconsToShow.push_back( best2 ); break;
case 3: m_vIconsToShow.push_back( best3 ); break;
}
}
void MusicStatusDisplay::Update( float fDeltaTime )
{
Sprite::Update( fDeltaTime );
if( flags.bEdits )
m_vIconsToShow.push_back( edits );
switch( flags.iStagesForSong )
{
case 1: break;
case 2: m_vIconsToShow.push_back( long_ver ); break;
case 3: m_vIconsToShow.push_back( marathon ); break;
default: ASSERT(0);
}
if( flags.bHasBeginnerOr1Meter )
m_vIconsToShow.push_back( training );
// HACK: Make players best blink if it's the only icon
if( m_vIconsToShow.size() == 1 )
{
if( m_vIconsToShow[0] >= best1 && m_vIconsToShow[0] <= best3 )
m_vIconsToShow.push_back( empty );
}
m_vIconsToShow.resize( min(m_vIconsToShow.size(),2u) ); // crop to most important 2
if( m_vIconsToShow.size() == 0 )
Sprite::SetDiffuse( RageColor(1,1,1,0) );
else
Sprite::SetDiffuse( RageColor(1,1,1,1) );
}
void MusicStatusDisplay::DrawPrimitives()
{
switch( m_type )
float fSecondFraction = fmodf(RageTimer::GetTimeSinceStart(), 1 );
if( m_vIconsToShow.size() > 0 )
{
case none:
case easy:
break;
case crown1:
case crown2:
case crown3:
if( fmodf(RageTimer::GetTimeSinceStart(), 1) > 0.5f )
return; // blink
break;
default:
ASSERT(0);
int index = (int)(fSecondFraction*m_vIconsToShow.size());
Sprite::SetState( m_vIconsToShow[index] );
}
Sprite::DrawPrimitives();
}
+14 -5
View File
@@ -21,14 +21,23 @@ class MusicStatusDisplay : public Sprite
public:
MusicStatusDisplay();
enum Type { none, easy, crown1, crown2, crown3, edits };
void SetType( Type type );
struct Flags
{
Flags() { bHasBeginnerOr1Meter = bEdits = false; iPlayersBestNumber = iStagesForSong = 0; }
bool bHasBeginnerOr1Meter;
int iPlayersBestNumber;
bool bEdits;
int iStagesForSong;
};
void SetFlags( Flags flags );
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
protected:
Type m_type;
enum Icons { training=0, best1, best2, best3, edits, long_ver, marathon, empty };
vector<Icons> m_vIconsToShow;
};
#endif
+13 -247
View File
@@ -1,13 +1,14 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: MusicWheel
Class: MusicWheelItem
Desc: See header.
Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved.
Chris Danford
Chris Gomez
Glenn Maynard
-----------------------------------------------------------------------------
*/
@@ -25,18 +26,6 @@
#include "ThemeManager.h"
// WheelItem stuff
#define ICON_X THEME->GetMetricF("WheelItemDisplay","IconX")
#define SONG_NAME_X THEME->GetMetricF("WheelItemDisplay","SongNameX")
#define SECTION_NAME_X THEME->GetMetricF("WheelItemDisplay","SectionNameX")
#define SECTION_ZOOM THEME->GetMetricF("WheelItemDisplay","SectionZoom")
#define ROULETTE_X THEME->GetMetricF("WheelItemDisplay","RouletteX")
#define ROULETTE_ZOOM THEME->GetMetricF("WheelItemDisplay","RouletteZoom")
#define COURSE_X THEME->GetMetricF("WheelItemDisplay","CourseX")
#define COURSE_ZOOM THEME->GetMetricF("WheelItemDisplay","CourseZoom")
#define GRADE_X( p ) THEME->GetMetricF("WheelItemDisplay",ssprintf("GradeP%dX",p+1))
#define DEFAULT_SCROLL_DIRECTION THEME->GetMetricI("Notes","DefaultScrollDirection")
// MusicWheel stuff
#define FADE_SECONDS THEME->GetMetricF("MusicWheel","FadeSeconds")
#define SWITCH_SECONDS THEME->GetMetricF("MusicWheel","SwitchSeconds")
@@ -49,6 +38,8 @@
#define ITEM_SPACING_Y THEME->GetMetricF("MusicWheel","ItemSpacingY")
#define NUM_SECTION_COLORS THEME->GetMetricI("MusicWheel","NumSectionColors")
#define SECTION_COLORS( i ) THEME->GetMetricC("MusicWheel",ssprintf("SectionColor%d",i+1))
#define DEFAULT_SCROLL_DIRECTION THEME->GetMetricI("Notes","DefaultScrollDirection")
const int MAX_WHEEL_SOUND_SPEED = 15;
float g_fItemSpacingY, g_fItemCurveX; // cache
@@ -60,233 +51,6 @@ inline RageColor GetNextSectionColor() {
}
WheelItemData::WheelItemData( WheelItemType wit, Song* pSong, const CString &sSectionName, Course* pCourse, const RageColor color )
{
m_WheelItemType = wit;
m_pSong = pSong;
m_sSectionName = sSectionName;
m_pCourse = pCourse;
m_color = color;
m_Type = MusicStatusDisplay::none;
}
WheelItemDisplay::WheelItemDisplay()
{
data = NULL;
m_fPercentGray = 0;
m_MusicStatusDisplay.SetXY( ICON_X, 0 );
m_TextBanner.SetHorizAlign( align_left );
m_TextBanner.SetXY( SONG_NAME_X, 0 );
m_sprSongBar.Load( THEME->GetPathTo("Graphics","select music song bar") );
m_sprSongBar.SetXY( 0, 0 );
m_sprSectionBar.Load( THEME->GetPathTo("Graphics","select music section bar") );
m_sprSectionBar.SetXY( 0, 0 );
m_textSectionName.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel section") );
m_textSectionName.TurnShadowOff();
m_textSectionName.SetVertAlign( align_middle );
m_textSectionName.SetXY( SECTION_NAME_X, 0 );
m_textSectionName.SetZoom( SECTION_ZOOM );
m_textRoulette.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel roulette") );
m_textRoulette.TurnShadowOff();
m_textRoulette.TurnRainbowOn();
m_textRoulette.SetZoom( ROULETTE_ZOOM );
m_textRoulette.SetXY( ROULETTE_X, 0 );
for( int p=0; p<NUM_PLAYERS; p++ )
{
m_GradeDisplay[p].SetZoom( 1.0f );
m_GradeDisplay[p].SetXY( GRADE_X(p), 0 );
}
m_textCourse.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel course") );
m_textCourse.TurnShadowOff();
m_textCourse.SetZoom( COURSE_ZOOM );
m_textCourse.SetHorizAlign( align_left );
m_textCourse.SetXY( COURSE_X, 0 );
}
void WheelItemDisplay::LoadFromWheelItemData( WheelItemData* pWID )
{
ASSERT( pWID != NULL );
data = pWID;
/*
// copy all data items
this->m_WheelItemType = pWID->m_WheelItemType;
this->m_sSectionName = pWID->m_sSectionName;
this->m_pCourse = pWID->m_pCourse;
this->m_pSong = pWID->m_pSong;
this->m_color = pWID->m_color;
this->m_Type = pWID->m_Type; */
// init type specific stuff
switch( pWID->m_WheelItemType )
{
case TYPE_SECTION:
case TYPE_COURSE:
{
CString sDisplayName;
BitmapText *bt;
if(pWID->m_WheelItemType == TYPE_SECTION)
{
sDisplayName = SONGMAN->ShortenGroupName(data->m_sSectionName);
bt = &m_textSectionName;
}
else
{
sDisplayName = data->m_pCourse->m_sName;
bt = &m_textCourse;
}
bt->SetZoom( 1 );
bt->SetText( sDisplayName );
bt->SetDiffuse( data->m_color );
bt->TurnRainbowOff();
float fSourcePixelWidth = (float)bt->GetWidestLineWidthInSourcePixels();
float fMaxTextWidth = 200;
if( fSourcePixelWidth > fMaxTextWidth )
bt->SetZoomX( fMaxTextWidth / fSourcePixelWidth );
}
break;
case TYPE_SONG:
{
m_TextBanner.LoadFromSong( data->m_pSong );
m_TextBanner.SetDiffuse( data->m_color );
m_MusicStatusDisplay.SetType( data->m_Type );
RefreshGrades();
}
break;
case TYPE_ROULETTE:
m_textRoulette.SetText( "ROULETTE" );
break;
case TYPE_RANDOM:
m_textRoulette.SetText( "RANDOM" );
break;
default:
ASSERT( 0 ); // invalid type
}
}
void WheelItemDisplay::RefreshGrades()
{
// Refresh Grades
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !data->m_pSong || // this isn't a song display
!GAMESTATE->IsPlayerEnabled(p) ||
!SONGMAN->IsUsingMemoryCard((PlayerNumber)p) )
{
m_GradeDisplay[p].SetDiffuse( RageColor(1,1,1,0) );
continue;
}
Difficulty dc;
if( GAMESTATE->m_pCurNotes[p] )
dc = GAMESTATE->m_pCurNotes[p]->GetDifficulty();
else
dc = GAMESTATE->m_PreferredDifficulty[p];
const Grade grade = data->m_pSong->GetGradeForDifficulty( GAMESTATE->GetCurrentStyleDef(), (PlayerNumber)p, dc );
m_GradeDisplay[p].SetGrade( (PlayerNumber)p, grade );
}
}
void WheelItemDisplay::Update( float fDeltaTime )
{
Actor::Update( fDeltaTime );
switch( data->m_WheelItemType )
{
case TYPE_SECTION:
m_sprSectionBar.Update( fDeltaTime );
m_textSectionName.Update( fDeltaTime );
break;
case TYPE_ROULETTE:
case TYPE_RANDOM:
m_sprSectionBar.Update( fDeltaTime );
m_textRoulette.Update( fDeltaTime );
break;
case TYPE_SONG:
{
m_sprSongBar.Update( fDeltaTime );
m_MusicStatusDisplay.Update( fDeltaTime );
m_TextBanner.Update( fDeltaTime );
for( int p=0; p<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Update( fDeltaTime );
}
break;
case TYPE_COURSE:
m_sprSongBar.Update( fDeltaTime );
m_textCourse.Update( fDeltaTime );
break;
default:
ASSERT(0);
}
}
void WheelItemDisplay::DrawPrimitives()
{
Sprite *bar = NULL;
switch( data->m_WheelItemType )
{
case TYPE_SECTION:
case TYPE_ROULETTE:
case TYPE_RANDOM: bar = &m_sprSectionBar; break;
case TYPE_SONG:
case TYPE_COURSE: bar = &m_sprSongBar; break;
default: ASSERT(0);
}
bar->Draw();
switch( data->m_WheelItemType )
{
case TYPE_SECTION:
m_textSectionName.Draw();
break;
case TYPE_ROULETTE:
case TYPE_RANDOM:
m_textRoulette.Draw();
break;
case TYPE_SONG:
m_TextBanner.Draw();
m_MusicStatusDisplay.Draw();
int p;
for( p=0; p<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Draw();
break;
case TYPE_COURSE:
m_textCourse.Draw();
break;
default:
ASSERT(0);
}
if( m_fPercentGray > 0 )
{
bar->SetGlow( RageColor(0,0,0,m_fPercentGray) );
bar->SetDiffuse( RageColor(0,0,0,0) );
bar->Draw();
bar->SetDiffuse( RageColor(0,0,0,1) );
bar->SetGlow( RageColor(0,0,0,0) );
}
}
MusicWheel::MusicWheel()
{
LOG->Trace( "MusicWheel::MusicWheel()" );
@@ -331,7 +95,7 @@ MusicWheel::MusicWheel()
// init m_mapGroupNameToBannerColor
vector<Song*> arraySongs;
SONGMAN->GetAllSongs( arraySongs );
SONGMAN->GetSongs( arraySongs, GAMESTATE->GetNumStagesLeft() );
SortSongPointerArrayByGroup( arraySongs );
m_iSelection = 0;
@@ -479,7 +243,7 @@ bool MusicWheel::SelectCourse( const Course *p )
void MusicWheel::GetSongList(vector<Song*> &arraySongs, bool bRoulette )
{
vector<Song*> apAllSongs;
SONGMAN->GetAllSongs( apAllSongs );
SONGMAN->GetSongs( apAllSongs, GAMESTATE->GetNumStagesLeft() );
// copy only songs that have at least one Notes for the current GameMode
for( unsigned i=0; i<apAllSongs.size(); i++ )
@@ -498,7 +262,7 @@ void MusicWheel::GetSongList(vector<Song*> &arraySongs, bool bRoulette )
}
vector<Notes*> arraySteps;
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, arraySteps );
pSong->GetNotes( arraySteps, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
if( !arraySteps.empty() )
arraySongs.push_back( pSong );
@@ -670,25 +434,27 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
ASSERT(0); // invalid PlayMode
}
// init crowns
// init music status icons
for( i=0; i<arrayWheelItemDatas.size(); i++ )
{
Song* pSong = arrayWheelItemDatas[i].m_pSong;
if( pSong == NULL )
continue;
bool bIsEasy = pSong->IsEasy( GAMESTATE->GetCurrentStyleDef()->m_NotesType );
WheelItemData& WID = arrayWheelItemDatas[i];
WID.m_Type = bIsEasy ? MusicStatusDisplay::easy : MusicStatusDisplay::none;
WID.m_Flags.bHasBeginnerOr1Meter = pSong->IsEasy( NOTES_TYPE_DANCE_SINGLE );
WID.m_Flags.bEdits = pSong->HasEdits( NOTES_TYPE_DANCE_SINGLE );
WID.m_Flags.iStagesForSong = SongManager::GetNumStagesForSong( pSong );
}
// init crowns
if( so == SORT_MOST_PLAYED )
{
// init crown icons
for( i=0; i< min(3u,arrayWheelItemDatas.size()); i++ )
{
WheelItemData& WID = arrayWheelItemDatas[i];
WID.m_Type = MusicStatusDisplay::Type(MusicStatusDisplay::crown1 + i);
WID.m_Flags.iPlayersBestNumber = i+1;
}
}
+1 -48
View File
@@ -27,6 +27,7 @@
#include "ScrollBar.h"
#include "Course.h"
#include "RageTimer.h"
#include "MusicWheelItem.h"
const int NUM_WHEEL_ITEMS_TO_DRAW = 13;
@@ -36,54 +37,6 @@ const ScreenMessage SM_SongChanged = ScreenMessage(SM_User+47); // this should
const ScreenMessage SM_SortOrderChanged = ScreenMessage(SM_User+48);
enum WheelItemType { TYPE_SECTION, TYPE_SONG, TYPE_ROULETTE, TYPE_RANDOM, TYPE_COURSE };
struct WheelItemData
{
public:
WheelItemData() {}
WheelItemData( WheelItemType wit, Song* pSong, const CString &sSectionName, Course* pCourse, const RageColor color );
WheelItemType m_WheelItemType;
CString m_sSectionName;
Course* m_pCourse;
Song* m_pSong;
RageColor m_color; // either text color or section background color
MusicStatusDisplay::Type m_Type;
};
class WheelItemDisplay: public ActorFrame
{
public:
WheelItemDisplay();
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
void LoadFromWheelItemData( WheelItemData* pWID );
void RefreshGrades();
WheelItemData *data;
float m_fPercentGray;
// for TYPE_SECTION and TYPE_ROULETTE
Sprite m_sprSectionBar;
// for TYPE_SECTION
BitmapText m_textSectionName;
// for TYPE_ROULETTE
BitmapText m_textRoulette;
// for a TYPE_MUSIC
Sprite m_sprSongBar;
MusicStatusDisplay m_MusicStatusDisplay;
TextBanner m_TextBanner;
SmallGradeDisplay m_GradeDisplay[NUM_PLAYERS];
// for TYPE_COURSE
BitmapText m_textCourse;
};
enum { SORT_ROULETTE = NUM_SORT_ORDERS+1 };
+268
View File
@@ -0,0 +1,268 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: MusicWheelItem
Desc: See header.
Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved.
Chris Danford
Chris Gomez
Glenn Maynard
-----------------------------------------------------------------------------
*/
#include "MusicWheel.h"
#include "RageUtil.h"
#include "SongManager.h"
#include "GameManager.h"
#include "PrefsManager.h"
#include "RageSoundManager.h"
#include "ScreenManager.h" // for sending SM_PlayMusicSample
#include "RageLog.h"
#include "GameConstantsAndTypes.h"
#include "GameState.h"
#include <math.h>
#include "ThemeManager.h"
// WheelItem stuff
#define ICON_X THEME->GetMetricF("WheelItemDisplay","IconX")
#define SONG_NAME_X THEME->GetMetricF("WheelItemDisplay","SongNameX")
#define SECTION_NAME_X THEME->GetMetricF("WheelItemDisplay","SectionNameX")
#define SECTION_ZOOM THEME->GetMetricF("WheelItemDisplay","SectionZoom")
#define ROULETTE_X THEME->GetMetricF("WheelItemDisplay","RouletteX")
#define ROULETTE_ZOOM THEME->GetMetricF("WheelItemDisplay","RouletteZoom")
#define COURSE_X THEME->GetMetricF("WheelItemDisplay","CourseX")
#define COURSE_ZOOM THEME->GetMetricF("WheelItemDisplay","CourseZoom")
#define GRADE_X( p ) THEME->GetMetricF("WheelItemDisplay",ssprintf("GradeP%dX",p+1))
WheelItemData::WheelItemData( WheelItemType wit, Song* pSong, const CString &sSectionName, Course* pCourse, const RageColor color )
{
m_WheelItemType = wit;
m_pSong = pSong;
m_sSectionName = sSectionName;
m_pCourse = pCourse;
m_color = color;
m_Flags = MusicStatusDisplay::Flags();
}
WheelItemDisplay::WheelItemDisplay()
{
data = NULL;
m_fPercentGray = 0;
m_MusicStatusDisplay.SetXY( ICON_X, 0 );
m_TextBanner.SetHorizAlign( align_left );
m_TextBanner.SetXY( SONG_NAME_X, 0 );
m_sprSongBar.Load( THEME->GetPathTo("Graphics","select music song bar") );
m_sprSongBar.SetXY( 0, 0 );
m_sprSectionBar.Load( THEME->GetPathTo("Graphics","select music section bar") );
m_sprSectionBar.SetXY( 0, 0 );
m_textSectionName.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel section") );
m_textSectionName.TurnShadowOff();
m_textSectionName.SetVertAlign( align_middle );
m_textSectionName.SetXY( SECTION_NAME_X, 0 );
m_textSectionName.SetZoom( SECTION_ZOOM );
m_textRoulette.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel roulette") );
m_textRoulette.TurnShadowOff();
m_textRoulette.TurnRainbowOn();
m_textRoulette.SetZoom( ROULETTE_ZOOM );
m_textRoulette.SetXY( ROULETTE_X, 0 );
for( int p=0; p<NUM_PLAYERS; p++ )
{
m_GradeDisplay[p].SetZoom( 1.0f );
m_GradeDisplay[p].SetXY( GRADE_X(p), 0 );
}
m_textCourse.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel course") );
m_textCourse.TurnShadowOff();
m_textCourse.SetZoom( COURSE_ZOOM );
m_textCourse.SetHorizAlign( align_left );
m_textCourse.SetXY( COURSE_X, 0 );
}
void WheelItemDisplay::LoadFromWheelItemData( WheelItemData* pWID )
{
ASSERT( pWID != NULL );
data = pWID;
/*
// copy all data items
this->m_WheelItemType = pWID->m_WheelItemType;
this->m_sSectionName = pWID->m_sSectionName;
this->m_pCourse = pWID->m_pCourse;
this->m_pSong = pWID->m_pSong;
this->m_color = pWID->m_color;
this->m_Type = pWID->m_Type; */
// init type specific stuff
switch( pWID->m_WheelItemType )
{
case TYPE_SECTION:
case TYPE_COURSE:
{
CString sDisplayName;
BitmapText *bt;
if(pWID->m_WheelItemType == TYPE_SECTION)
{
sDisplayName = SONGMAN->ShortenGroupName(data->m_sSectionName);
bt = &m_textSectionName;
}
else
{
sDisplayName = data->m_pCourse->m_sName;
bt = &m_textCourse;
}
bt->SetZoom( 1 );
bt->SetText( sDisplayName );
bt->SetDiffuse( data->m_color );
bt->TurnRainbowOff();
float fSourcePixelWidth = (float)bt->GetWidestLineWidthInSourcePixels();
float fMaxTextWidth = 200;
if( fSourcePixelWidth > fMaxTextWidth )
bt->SetZoomX( fMaxTextWidth / fSourcePixelWidth );
}
break;
case TYPE_SONG:
{
m_TextBanner.LoadFromSong( data->m_pSong );
m_TextBanner.SetDiffuse( data->m_color );
m_MusicStatusDisplay.SetFlags( data->m_Flags );
RefreshGrades();
}
break;
case TYPE_ROULETTE:
m_textRoulette.SetText( "ROULETTE" );
break;
case TYPE_RANDOM:
m_textRoulette.SetText( "RANDOM" );
break;
default:
ASSERT( 0 ); // invalid type
}
}
void WheelItemDisplay::RefreshGrades()
{
// Refresh Grades
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !data->m_pSong || // this isn't a song display
!GAMESTATE->IsPlayerEnabled(p) ||
!SONGMAN->IsUsingMemoryCard((PlayerNumber)p) )
{
m_GradeDisplay[p].SetDiffuse( RageColor(1,1,1,0) );
continue;
}
Difficulty dc;
if( GAMESTATE->m_pCurNotes[p] )
dc = GAMESTATE->m_pCurNotes[p]->GetDifficulty();
else
dc = GAMESTATE->m_PreferredDifficulty[p];
const Grade grade = data->m_pSong->GetGradeForDifficulty( GAMESTATE->GetCurrentStyleDef(), (PlayerNumber)p, dc );
m_GradeDisplay[p].SetGrade( (PlayerNumber)p, grade );
}
}
void WheelItemDisplay::Update( float fDeltaTime )
{
Actor::Update( fDeltaTime );
switch( data->m_WheelItemType )
{
case TYPE_SECTION:
m_sprSectionBar.Update( fDeltaTime );
m_textSectionName.Update( fDeltaTime );
break;
case TYPE_ROULETTE:
case TYPE_RANDOM:
m_sprSectionBar.Update( fDeltaTime );
m_textRoulette.Update( fDeltaTime );
break;
case TYPE_SONG:
{
m_sprSongBar.Update( fDeltaTime );
m_MusicStatusDisplay.Update( fDeltaTime );
m_TextBanner.Update( fDeltaTime );
for( int p=0; p<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Update( fDeltaTime );
}
break;
case TYPE_COURSE:
m_sprSongBar.Update( fDeltaTime );
m_textCourse.Update( fDeltaTime );
break;
default:
ASSERT(0);
}
}
void WheelItemDisplay::DrawPrimitives()
{
Sprite *bar = NULL;
switch( data->m_WheelItemType )
{
case TYPE_SECTION:
case TYPE_ROULETTE:
case TYPE_RANDOM: bar = &m_sprSectionBar; break;
case TYPE_SONG:
case TYPE_COURSE: bar = &m_sprSongBar; break;
default: ASSERT(0);
}
bar->Draw();
switch( data->m_WheelItemType )
{
case TYPE_SECTION:
m_textSectionName.Draw();
break;
case TYPE_ROULETTE:
case TYPE_RANDOM:
m_textRoulette.Draw();
break;
case TYPE_SONG:
m_TextBanner.Draw();
m_MusicStatusDisplay.Draw();
int p;
for( p=0; p<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Draw();
break;
case TYPE_COURSE:
m_textCourse.Draw();
break;
default:
ASSERT(0);
}
if( m_fPercentGray > 0 )
{
bar->SetGlow( RageColor(0,0,0,m_fPercentGray) );
bar->SetDiffuse( RageColor(0,0,0,0) );
bar->Draw();
bar->SetDiffuse( RageColor(0,0,0,1) );
bar->SetGlow( RageColor(0,0,0,0) );
}
}
+80
View File
@@ -0,0 +1,80 @@
#ifndef MUSICWHEELITEM_H
#define MUSICWHEELITEM_H
/*
-----------------------------------------------------------------------------
Class: MusicWheelItem
Desc: An item on the music wheel
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
//#include "Sprite.h"
//#include "Song.h"
//#include "ActorFrame.h"
//#include "BitmapText.h"
//#include "Quad.h"
//#include "TextBanner.h"
//#include "RandomSample.h"
//#include "SmallGradeDisplay.h"
//#include "GameConstantsAndTypes.h"
//#include "MusicSortDisplay.h"
//#include "MusicStatusDisplay.h"
//#include "Screen.h" // for ScreenMessage
//#include "ScoreDisplayNormal.h"
//#include "ScrollBar.h"
//#include "Course.h"
//#include "RageTimer.h"
enum WheelItemType { TYPE_SECTION, TYPE_SONG, TYPE_ROULETTE, TYPE_RANDOM, TYPE_COURSE };
struct WheelItemData
{
public:
WheelItemData() {}
WheelItemData( WheelItemType wit, Song* pSong, const CString &sSectionName, Course* pCourse, const RageColor color );
WheelItemType m_WheelItemType;
CString m_sSectionName;
Course* m_pCourse;
Song* m_pSong;
RageColor m_color; // either text color or section background color
MusicStatusDisplay::Flags m_Flags;
};
class WheelItemDisplay: public ActorFrame
{
public:
WheelItemDisplay();
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
void LoadFromWheelItemData( WheelItemData* pWID );
void RefreshGrades();
WheelItemData *data;
float m_fPercentGray;
// for TYPE_SECTION and TYPE_ROULETTE
Sprite m_sprSectionBar;
// for TYPE_SECTION
BitmapText m_textSectionName;
// for TYPE_ROULETTE
BitmapText m_textRoulette;
// for a TYPE_MUSIC
Sprite m_sprSongBar;
MusicStatusDisplay m_MusicStatusDisplay;
TextBanner m_TextBanner;
SmallGradeDisplay m_GradeDisplay[NUM_PLAYERS];
// for TYPE_COURSE
BitmapText m_textCourse;
};
#endif
+8
View File
@@ -87,6 +87,9 @@ PrefsManager::PrefsManager()
* stage CRS files) don't get it changed around on them */
m_bPickExtraStage = false;
m_fLongVerSongSeconds = 60*3;
m_fMarathonVerSongSeconds = 60*5;
/* I'd rather get occasional people asking for support for this even though it's
* already here than lots of people asking why songs aren't being displayed. */
m_bHiddenSongs = false;
@@ -158,6 +161,9 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
ini.GetValueI( "Options", "BoostAppPriority", m_iBoostAppPriority );
ini.GetValueI( "Options", "PolygonRadar", m_iPolygonRadar );
ini.GetValueB( "Options", "PickExtraStage", m_bPickExtraStage );
ini.GetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
ini.GetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
m_asAdditionalSongFolders.clear();
CString sAdditionalSongFolders;
@@ -224,6 +230,8 @@ void PrefsManager::SaveGlobalPrefsToDisk()
ini.SetValueI( "Options", "BoostAppPriority", m_iBoostAppPriority );
ini.SetValueI( "Options", "PolygonRadar", m_iPolygonRadar );
ini.SetValueB( "Options", "PickExtraStage", m_bPickExtraStage );
ini.SetValueF( "Options", "LongVerSeconds", m_fLongVerSongSeconds );
ini.SetValueF( "Options", "MarathonVerSeconds", m_fMarathonVerSongSeconds );
/* Only write these if they aren't the default. This ensures that we can change
* the default and have it take effect for everyone (except people who
+2 -1
View File
@@ -63,7 +63,8 @@ public:
int m_iCoinsPerCredit;
bool m_bJointPremium;
bool m_bPickExtraStage;
float m_fLongVerSongSeconds;
float m_fMarathonVerSongSeconds;
/* 0 = no; 1 = yes; -1 = auto (do whatever is appropriate for the arch). */
+1 -1
View File
@@ -62,7 +62,7 @@ bool SetUpSongOptions() // always return true.
continue; // skip
vector<Notes*> apNotes;
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, apNotes );
pSong->GetNotes( apNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
if( apNotes.empty() )
continue; // skip
+9 -4
View File
@@ -810,9 +810,7 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn )
m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic );
else if( m_ResultMode == RM_ARCADE_STAGE )
{
if( GAMESTATE->m_iCurrentStageIndex < PREFSMAN->m_iNumArcadeStages-1 )
m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic );
else
if( GAMESTATE->IsFinalStage() )
{
/* Tween the screen out, but leave the MenuElements where they are.
* Play the "swoosh" sound manually (would normally be played by the ME
@@ -821,6 +819,10 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn )
TweenOffScreen();
SCREENMAN->SendMessageToTopScreen( SM_GoToFinalEvaluation, MENU_ELEMENTS_TWEEN_TIME );
}
else
{
m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic );
}
}
else
m_Menu.TweenOffScreenToBlack( SM_GoToGameFinished, false );
@@ -829,7 +831,10 @@ void ScreenEvaluation::MenuStart( PlayerNumber pn )
switch( m_ResultMode )
{
case RM_ARCADE_STAGE:
GAMESTATE->m_iCurrentStageIndex++; // Increment the stage counter.
// Increment the stage counter.
int iNumStagesOfLastSong;
iNumStagesOfLastSong = SongManager::GetNumStagesForSong( GAMESTATE->m_pCurSong );
GAMESTATE->m_iCurrentStageIndex += iNumStagesOfLastSong;
// add current stage stats to accumulated total only if this song was passed
{
+1 -1
View File
@@ -472,7 +472,7 @@ void ScreenEz2SelectMusic::MusicChanged()
for( pn = 0; pn < NUM_PLAYERS; ++pn)
{
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, m_arrayNotes[pn] );
pSong->GetNotes( m_arrayNotes[pn], GAMESTATE->GetCurrentStyleDef()->m_NotesType );
SortNotesArrayByDifficulty( m_arrayNotes[pn] );
}
+1 -1
View File
@@ -58,7 +58,7 @@ bool PrepareForJukebox() // always return true.
continue; // skip
vector<Notes*> apNotes;
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, apNotes );
pSong->GetNotes( apNotes, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
if( apNotes.empty() )
continue; // skip
+1 -1
View File
@@ -150,7 +150,7 @@ ScreenMusicScroll::ScreenMusicScroll()
vector<Song*> arraySongs;
SONGMAN->GetAllSongs( arraySongs );
SONGMAN->GetSongs( arraySongs );
SortSongPointerArrayByTitle( arraySongs );
m_iNumLines = 0;
+6 -5
View File
@@ -117,10 +117,11 @@ ScreenNameEntry::ScreenNameEntry()
// reset Player and Song Options
for( int p=0; p<NUM_PLAYERS; p++ )
GAMESTATE->m_PlayerOptions[p] = PlayerOptions();
GAMESTATE->m_SongOptions = SongOptions();
{
for( int p=0; p<NUM_PLAYERS; p++ )
GAMESTATE->m_PlayerOptions[p] = PlayerOptions();
GAMESTATE->m_SongOptions = SongOptions();
}
// Find out if any of the players deserve to enter their name
@@ -186,7 +187,7 @@ ScreenNameEntry::ScreenNameEntry()
m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations","name entry") );
this->AddChild( &m_Background );
for( p=0; p<NUM_PLAYERS; p++ )
for( int p=0; p<NUM_PLAYERS; p++ )
{
bool bNewHighScore = GAMESTATE->m_iLastRankingIndex[p] != -1;
m_bStillEnteringName[p] = bNewHighScore; // false if they made a new high score
+2 -2
View File
@@ -185,7 +185,7 @@ void ScreenRanking::SetPage( PageToShow pts )
CString sName = SONGMAN->m_MachineScores[pts.nt][pts.category][l].sName;
float fScore = SONGMAN->m_MachineScores[pts.nt][pts.category][l].fScore;
m_textNames[l].SetText( sName );
m_textScores[l].SetText( ssprintf("%.0f",fScore) );
m_textScores[l].SetText( ssprintf("%9.0f",fScore) );
m_textNames[l].SetDiffuse( NAMES_COLOR );
m_textScores[l].SetDiffuse( SCORES_COLOR );
@@ -220,7 +220,7 @@ void ScreenRanking::SetPage( PageToShow pts )
CString sName = pts.pCourse->m_MachineScores[pts.nt][l].sName;
int iDancePoints = pts.pCourse->m_MachineScores[pts.nt][l].iDancePoints;
m_textNames[l].SetText( sName );
m_textScores[l].SetText( ssprintf("%d",iDancePoints) );
m_textScores[l].SetText( ssprintf("%4d",iDancePoints) );
m_textNames[l].SetDiffuse( NAMES_COLOR );
m_textScores[l].SetDiffuse( SCORES_COLOR );
for( int p=0; p<NUM_PLAYERS; p++ )
+1 -1
View File
@@ -83,7 +83,7 @@ ScreenSelectGroup::ScreenSelectGroup()
// causes a crash when there are duplicate song names.
vector<Song*> aAllSongs;
SONGMAN->GetAllSongs( aAllSongs );
SONGMAN->GetSongs( aAllSongs );
// Filter out Songs that can't be played by the current Style
for( j=aAllSongs.size()-1; j>=0; j-- ) // foreach Song, back to front
+9 -10
View File
@@ -109,13 +109,10 @@ ScreenSelectMusic::ScreenSelectMusic()
m_BPMDisplay.SetZoom( BPM_ZOOM );
this->AddChild( &m_BPMDisplay );
m_textStage.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
m_textStage.TurnShadowOff();
m_textStage.SetZoom( STAGE_ZOOM );
m_textStage.SetXY( STAGE_X, STAGE_Y );
m_textStage.SetText( GAMESTATE->GetStageText() );
m_textStage.SetDiffuse( GAMESTATE->GetStageColor() );
this->AddChild( &m_textStage );
m_StageDisplay.SetZoom( STAGE_ZOOM );
m_StageDisplay.SetXY( STAGE_X, STAGE_Y );
m_StageDisplay.Refresh();
this->AddChild( &m_StageDisplay );
m_sprCDTitle.Load( THEME->GetPathTo("Graphics","fallback cd title") );
m_sprCDTitle.TurnShadowOff();
@@ -266,7 +263,7 @@ void ScreenSelectMusic::TweenOnScreen()
m_sprBannerFrame.FadeOn( 0, "bounce left", TWEEN_TIME );
m_Banner.FadeOn( 0, "bounce left", TWEEN_TIME );
m_BPMDisplay.FadeOn( 0, "bounce left", TWEEN_TIME );
m_textStage.FadeOn( 0, "bounce left", TWEEN_TIME );
m_StageDisplay.FadeOn( 0, "bounce left", TWEEN_TIME );
m_sprCDTitle.FadeOn( 0, "bounce left", TWEEN_TIME );
for( p=0; p<NUM_PLAYERS; p++ )
@@ -309,7 +306,7 @@ void ScreenSelectMusic::TweenOffScreen()
m_sprBannerFrame.FadeOff( 0, "bounce left", TWEEN_TIME*2 );
m_Banner.FadeOff( 0, "bounce left", TWEEN_TIME*2 );
m_BPMDisplay.FadeOff( 0, "bounce left", TWEEN_TIME*2 );
m_textStage.FadeOff( 0, "bounce left", TWEEN_TIME*2 );
m_StageDisplay.FadeOff( 0, "bounce left", TWEEN_TIME*2 );
m_sprCDTitle.FadeOff( 0, "bounce left", TWEEN_TIME*2 );
int p;
@@ -774,6 +771,8 @@ void ScreenSelectMusic::AfterMusicChange()
Song* pSong = m_MusicWheel.GetSelectedSong();
GAMESTATE->m_pCurSong = pSong;
m_StageDisplay.Refresh();
int pn;
for( pn = 0; pn < NUM_PLAYERS; ++pn)
m_arrayNotes[pn].clear();
@@ -813,7 +812,7 @@ void ScreenSelectMusic::AfterMusicChange()
m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY;
for( int pn = 0; pn < NUM_PLAYERS; ++pn) {
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, m_arrayNotes[pn] );
pSong->GetNotes( m_arrayNotes[pn], GAMESTATE->GetCurrentStyleDef()->m_NotesType );
SortNotesArrayByDifficulty( m_arrayNotes[pn] );
}
+2 -1
View File
@@ -22,6 +22,7 @@
#include "DifficultyIcon.h"
#include "FootMeter.h"
#include "OptionIconRow.h"
#include "StageDisplay.h"
class ScreenSelectMusic : public Screen
@@ -63,7 +64,7 @@ protected:
Sprite m_sprBannerFrame;
FadingBanner m_Banner;
BPMDisplay m_BPMDisplay;
BitmapText m_textStage;
StageDisplay m_StageDisplay;
Sprite m_sprCDTitle;
Sprite m_sprDifficultyFrame[NUM_PLAYERS];
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
+18 -6
View File
@@ -758,7 +758,7 @@ void Song::ReCalculateRadarValuesAndLastBeat()
}
}
void Song::GetNotesThatMatch( NotesType nt, vector<Notes*>& arrayAddTo, bool bIncludeAutoGen ) const
void Song::GetNotes( vector<Notes*>& arrayAddTo, NotesType nt, bool bIncludeAutoGen ) const
{
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Notes
if( m_apNotes[i]->m_NotesType == nt )
@@ -766,7 +766,7 @@ void Song::GetNotesThatMatch( NotesType nt, vector<Notes*>& arrayAddTo, bool bIn
arrayAddTo.push_back( m_apNotes[i] );
}
Notes* Song::GetNotesThatMatch( NotesType nt, Difficulty dc, bool bIncludeAutoGen ) const
Notes* Song::GetNotes( NotesType nt, Difficulty dc, bool bIncludeAutoGen ) const
{
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Notes
if( m_apNotes[i]->m_NotesType==nt && m_apNotes[i]->GetDifficulty()==dc )
@@ -775,6 +775,11 @@ Notes* Song::GetNotesThatMatch( NotesType nt, Difficulty dc, bool bIncludeAutoGe
return NULL;
}
void Song::GetEdits( vector<Notes*>& arrayAddTo, NotesType nt, bool bIncludeAutoGen ) const
{
}
/* Return whether the song is playable in the given style. */
bool Song::SongCompleteForStyle( const StyleDef *st ) const
{
@@ -879,7 +884,7 @@ void Song::AddAutoGenNotes()
for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) )
{
vector<Notes*> apNotes;
this->GetNotesThatMatch( nt, apNotes );
this->GetNotes( apNotes, nt );
if(apNotes.empty() || apNotes[0]->IsAutogen())
continue; /* can't autogen from other autogen */
@@ -931,7 +936,7 @@ Grade Song::GetGradeForDifficulty( const StyleDef *st, PlayerNumber pn, Difficul
{
// return max grade of notes in difficulty class
vector<Notes*> aNotes;
this->GetNotesThatMatch( st->m_NotesType, aNotes );
this->GetNotes( aNotes, st->m_NotesType );
SortNotesArrayByDifficulty( aNotes );
Grade grade = GRADE_NO_DATA;
@@ -966,6 +971,13 @@ bool Song::IsEasy( NotesType nt ) const
return false;
}
bool Song::HasEdits( NotesType nt ) const
{
vector<Notes*> vpNotes;
this->GetEdits( vpNotes, nt );
return vpNotes.size() > 0;
}
/////////////////////////////////////
// Sorting
/////////////////////////////////////
@@ -995,8 +1007,8 @@ int CompareSongPointersByDifficulty(const Song *pSong1, const Song *pSong2)
vector<Notes*> aNotes1;
vector<Notes*> aNotes2;
pSong1->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes1 );
pSong2->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes2 );
pSong1->GetNotes( aNotes1, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
pSong2->GetNotes( aNotes2, GAMESTATE->GetCurrentStyleDef()->m_NotesType );
int iEasiestMeter1 = 1000; // infinity
int iEasiestMeter2 = 1000; // infinity
+36 -33
View File
@@ -372,22 +372,14 @@ RageColor SongManager::GetSongColor( const Song* pSong )
return GetGroupColor( pSong->m_sGroupName );
}
void SongManager::GetAllSongs( vector<Song*> &AddTo ) const
{
AddTo = m_pSongs;
}
void SongManager::GetSongsInGroup( const CString sGroupName, vector<Song*> &AddTo )
void SongManager::GetSongs( vector<Song*> &AddTo, CString sGroupName, int iMaxStages ) const
{
AddTo.clear();
for( unsigned i=0; i<m_pSongs.size(); i++ )
{
Song* pSong = m_pSongs[i];
if( sGroupName == m_pSongs[i]->m_sGroupName )
AddTo.push_back( pSong );
}
if( sGroupName=="" || sGroupName==m_pSongs[i]->m_sGroupName )
if( GetNumStagesForSong(m_pSongs[i])<=iMaxStages )
AddTo.push_back( m_pSongs[i] );
}
int SongManager::GetNumSongs() const
@@ -400,25 +392,35 @@ int SongManager::GetNumGroups() const
return m_arrayGroupNames.size();
}
CString SongManager::ShortenGroupName( const CString &sOrigGroupName )
CString SongManager::ShortenGroupName( CString sLongGroupName )
{
CString sShortName = sOrigGroupName;
sShortName.Replace( "Dance Dance Revolution", "DDR" );
sShortName.Replace( "dance dance revolution", "DDR" );
sShortName.Replace( "DANCE DANCE REVOLUTION", "DDR" );
sShortName.Replace( "Pump It Up", "PIU" );
sShortName.Replace( "pump it up", "PIU" );
sShortName.Replace( "PUMP IT UP", "PIU" );
sShortName.Replace( "ParaParaParadise", "PPP" );
sShortName.Replace( "paraparaparadise", "PPP" );
sShortName.Replace( "PARAPARAPARADISE", "PPP" );
sShortName.Replace( "Para Para Paradise", "PPP" );
sShortName.Replace( "para para paradise", "PPP" );
sShortName.Replace( "PARA PARA PARADISE", "PPP" );
sShortName.Replace( "Dancing Stage", "DS" );
sShortName.Replace( "Dancing Stage", "DS" );
sShortName.Replace( "Dancing Stage", "DS" );
return sShortName;
sLongGroupName.Replace( "Dance Dance Revolution", "DDR" );
sLongGroupName.Replace( "dance dance revolution", "DDR" );
sLongGroupName.Replace( "DANCE DANCE REVOLUTION", "DDR" );
sLongGroupName.Replace( "Pump It Up", "PIU" );
sLongGroupName.Replace( "pump it up", "PIU" );
sLongGroupName.Replace( "PUMP IT UP", "PIU" );
sLongGroupName.Replace( "ParaParaParadise", "PPP" );
sLongGroupName.Replace( "paraparaparadise", "PPP" );
sLongGroupName.Replace( "PARAPARAPARADISE", "PPP" );
sLongGroupName.Replace( "Para Para Paradise", "PPP" );
sLongGroupName.Replace( "para para paradise", "PPP" );
sLongGroupName.Replace( "PARA PARA PARADISE", "PPP" );
sLongGroupName.Replace( "Dancing Stage", "DS" );
sLongGroupName.Replace( "Dancing Stage", "DS" );
sLongGroupName.Replace( "Dancing Stage", "DS" );
return sLongGroupName;
}
int SongManager::GetNumStagesForSong( const Song* pSong )
{
ASSERT( pSong );
if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fMarathonVerSongSeconds )
return 3;
if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fLongVerSongSeconds )
return 2;
else
return 1;
}
void SongManager::InitCoursesFromDisk()
@@ -448,7 +450,7 @@ void SongManager::InitCoursesFromDisk()
{
CString sGroupName = saGroupNames[g];
vector<Song*> apGroupSongs;
GetSongsInGroup( sGroupName, apGroupSongs );
GetSongs( apGroupSongs, sGroupName );
for( Difficulty dc=DIFFICULTY_EASY; dc<=DIFFICULTY_HARD; dc=Difficulty(dc+1) ) // foreach Difficulty
{
@@ -597,13 +599,14 @@ void SongManager::GetExtraStageInfo( bool bExtra2, CString sPreferredGroup, cons
Notes* pExtra2Notes = NULL;
vector<Song*> apSongs;
SONGMAN->GetSongsInGroup( (GAMESTATE->m_sPreferredGroup == "ALL MUSIC" ? GAMESTATE->m_pCurSong->m_sGroupName : GAMESTATE->m_sPreferredGroup), apSongs );
CString sGroup = GAMESTATE->m_sPreferredGroup=="ALL MUSIC" ? GAMESTATE->m_pCurSong->m_sGroupName : GAMESTATE->m_sPreferredGroup;
SONGMAN->GetSongs( apSongs, sGroup );
for( unsigned s=0; s<apSongs.size(); s++ ) // foreach song
{
Song* pSong = apSongs[s];
vector<Notes*> apNotes;
pSong->GetNotesThatMatch( sd->m_NotesType, apNotes );
pSong->GetNotes( apNotes, sd->m_NotesType );
for( unsigned n=0; n<apNotes.size(); n++ ) // foreach Notes
{
Notes* pNotes = apNotes[n];
+5 -4
View File
@@ -36,8 +36,8 @@ public:
RageColor GetGroupColor( const CString &sGroupName );
RageColor GetSongColor( const Song* pSong );
static CString ShortenGroupName( const CString &sOrigGroupName );
static CString ShortenGroupName( CString sLongGroupName );
static int GetNumStagesForSong( const Song* pSong ); // LongVer songs take 2 stages, MarathonVer take 3
//
@@ -52,9 +52,10 @@ public:
// Lookup
void GetAllSongs( vector<Song*> &AddTo ) const;
const vector<Song*> &GetAllSongs() const { return m_pSongs; }
void GetSongsInGroup( const CString sGroupName, vector<Song*> &AddTo );
void GetSongs( vector<Song*> &AddTo, CString sGroupName, int iMaxStages = 100000 /*inf*/ ) const;
void GetSongs( vector<Song*> &AddTo, int iMaxStages ) const { GetSongs(AddTo,"",iMaxStages); }
void GetSongs( vector<Song*> &AddTo ) const { GetSongs(AddTo,"",100000 /*inf*/ ); }
int GetNumSongs() const;
int GetNumGroups() const;
Song* GetRandomSong();
+3 -3
View File
@@ -234,7 +234,7 @@ void SongSelector::OnRowValueChanged( Row row )
m_textValue[ROW_GROUP].SetText( SONGMAN->ShortenGroupName(GetSelectedGroup()) );
m_GroupBanner.LoadFromGroup( GetSelectedGroup() );
m_pSongs.clear();
SONGMAN->GetSongsInGroup( GetSelectedGroup(), m_pSongs );
SONGMAN->GetSongs( m_pSongs, GetSelectedGroup() );
m_iSelection[ROW_SONG] = 0;
// fall through
case ROW_SONG:
@@ -289,10 +289,10 @@ void SongSelector::OnRowValueChanged( Row row )
Notes* SongSelector::GetSelectedNotes()
{
return GetSelectedSong()->GetNotesThatMatch(GetSelectedNotesType(),GetSelectedDifficulty(), false);
return GetSelectedSong()->GetNotes(GetSelectedNotesType(),GetSelectedDifficulty(), false);
}
Notes* SongSelector::GetSelectedSourceNotes()
{
return GetSelectedSong()->GetNotesThatMatch(GetSelectedSourceNotesType(),GetSelectedSourceDifficulty(), false);
return GetSelectedSong()->GetNotes(GetSelectedSourceNotesType(),GetSelectedSourceDifficulty(), false);
}
+29
View File
@@ -0,0 +1,29 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: StageDisplay
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "StageDisplay.h"
#include "GameState.h"
#include "ThemeManager.h"
StageDisplay::StageDisplay()
{
LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
TurnShadowOff();
Refresh();
}
void StageDisplay::Refresh()
{
SetText( GAMESTATE->GetStageText() );
SetDiffuse( GAMESTATE->GetStageColor() );
}
+30
View File
@@ -0,0 +1,30 @@
#ifndef StageDisplay_H
#define StageDisplay_H
/*
-----------------------------------------------------------------------------
Class: StageDisplay
Desc: Shows stage number
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Sprite.h"
#include "Song.h"
#include "BitmapText.h"
#include "PrefsManager.h"
class StageDisplay : public BitmapText
{
public:
StageDisplay();
void Refresh();
private:
};
#endif
+20 -4
View File
@@ -57,10 +57,10 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /pdb:none
# Begin Special Build Tool
IntDir=.\../Release6
TargetDir=\Stepmania\stepmania
TargetDir=\stepmania\stepmania
TargetName=StepMania
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 ia32.vdi
# End Special Build Tool
@@ -92,10 +92,10 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
# Begin Special Build Tool
IntDir=.\../Debug6
TargetDir=\Stepmania\stepmania
TargetDir=\stepmania\stepmania
TargetName=StepMania-debug
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 ia32.vdi
# End Special Build Tool
@@ -1060,6 +1060,14 @@ SOURCE=.\MusicWheel.h
# End Source File
# Begin Source File
SOURCE=.\MusicWheelItem.cpp
# End Source File
# Begin Source File
SOURCE=.\MusicWheelItem.h
# End Source File
# Begin Source File
SOURCE=.\OptionIcon.cpp
# End Source File
# Begin Source File
@@ -1124,6 +1132,14 @@ SOURCE=.\SongSelector.h
# End Source File
# Begin Source File
SOURCE=.\StageDisplay.cpp
# End Source File
# Begin Source File
SOURCE=.\StageDisplay.h
# End Source File
# Begin Source File
SOURCE=.\TextBanner.cpp
# End Source File
# Begin Source File
+12
View File
@@ -1020,6 +1020,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File
RelativePath=".\MusicWheel.h">
</File>
<File
RelativePath="MusicWheelItem.cpp">
</File>
<File
RelativePath="MusicWheelItem.h">
</File>
<File
RelativePath="OptionIcon.cpp">
</File>
@@ -1074,6 +1080,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File
RelativePath="SongSelector.h">
</File>
<File
RelativePath="StageDisplay.cpp">
</File>
<File
RelativePath="StageDisplay.h">
</File>
<File
RelativePath=".\TextBanner.cpp">
</File>
+75 -55
View File
@@ -15,25 +15,69 @@
#include "Song.h"
#include "PrefsManager.h"
#include "ThemeManager.h"
#include "SongManager.h"
const float TEXT_BANNER_WIDTH = 180;
const float TEXT_BANNER_HEIGHT = 40;
#define WIDTH THEME->GetMetricF("TextBanner","Width")
#define HEIGHT THEME->GetMetricF("TextBanner","Height")
#define HORIZ_ALIGN THEME->GetMetricI("TextBanner","HorizAlign")
#define ARTIST_PREPEND_STRING THEME->GetMetric( "TextBanner","ArtistPrependString")
#define TWO_LINES_TITLE_ZOOM THEME->GetMetricF("TextBanner","TwoLinesTitleZoom")
#define TWO_LINES_ARTIST_ZOOM THEME->GetMetricF("TextBanner","TwoLinesArtistZoom")
#define THREE_LINES_TITLE_ZOOM THEME->GetMetricF("TextBanner","ThreeLinesTitleZoom")
#define THREE_LINES_SUB_TITLE_ZOOM THEME->GetMetricF("TextBanner","ThreeLinesSubTitleZoom")
#define THREE_LINES_ARTIST_ZOOM THEME->GetMetricF("TextBanner","ThreeLinesArtistZoom")
#define TWO_LINES_TITLE_Y THEME->GetMetricF("TextBanner","TwoLinesTitleY")
#define TWO_LINES_ARTIST_Y THEME->GetMetricF("TextBanner","TwoLinesArtistY")
#define THREE_LINES_TITLE_Y THEME->GetMetricF("TextBanner","ThreeLinesTitleY")
#define THREE_LINES_SUB_TITLE_Y THEME->GetMetricF("TextBanner","ThreeLinesSubTitleY")
#define THREE_LINES_ARTIST_Y THEME->GetMetricF("TextBanner","ThreeLinesArtistY")
// metrics cache
float g_fWidth;
float g_fHeight;
int g_iHorizAlign;
CString g_sArtistPrependString;
float g_fTwoLinesTitleZoom;
float g_fTwoLinesArtistZoom;
float g_fThreeLinesTitleZoom;
float g_fThreeLinesSubTitleZoom;
float g_fThreeLinesArtistZoom;
float g_fTwoLinesTitleY;
float g_fTwoLinesArtistY;
float g_fThreeLinesTitleY;
float g_fThreeLinesSubTitleY;
float g_fThreeLinesArtistY;
TextBanner::TextBanner()
{
g_fWidth = WIDTH;
g_fHeight = HEIGHT;
g_iHorizAlign = HORIZ_ALIGN;
g_sArtistPrependString = ARTIST_PREPEND_STRING;
g_fTwoLinesTitleZoom = TWO_LINES_TITLE_ZOOM;
g_fTwoLinesArtistZoom = TWO_LINES_ARTIST_ZOOM;
g_fThreeLinesTitleZoom = THREE_LINES_TITLE_ZOOM;
g_fThreeLinesSubTitleZoom = THREE_LINES_SUB_TITLE_ZOOM;
g_fThreeLinesArtistZoom = THREE_LINES_ARTIST_ZOOM;
g_fTwoLinesTitleY = TWO_LINES_TITLE_Y;
g_fTwoLinesArtistY = TWO_LINES_ARTIST_Y;
g_fThreeLinesTitleY = THREE_LINES_TITLE_Y;
g_fThreeLinesSubTitleY = THREE_LINES_SUB_TITLE_Y;
g_fThreeLinesArtistY = THREE_LINES_ARTIST_Y;
m_textTitle.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
m_textSubTitle.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
m_textArtist.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
m_textTitle.SetX( -TEXT_BANNER_WIDTH/2 );
m_textSubTitle.SetX( -TEXT_BANNER_WIDTH/2 );
m_textArtist.SetX( -TEXT_BANNER_WIDTH/2 );
m_textTitle.SetX( -g_fWidth/2 );
m_textSubTitle.SetX( -g_fWidth/2 );
m_textArtist.SetX( -g_fWidth/2 );
m_textTitle.SetHorizAlign( align_left );
m_textSubTitle.SetHorizAlign( align_left );
m_textArtist.SetHorizAlign( align_left );
m_textTitle.SetHorizAlign( (Actor::HorizAlign)g_iHorizAlign );
m_textSubTitle.SetHorizAlign( (Actor::HorizAlign)g_iHorizAlign );
m_textArtist.SetHorizAlign( (Actor::HorizAlign)g_iHorizAlign );
m_textTitle.TurnShadowOff();
m_textSubTitle.TurnShadowOff();
@@ -45,7 +89,7 @@ TextBanner::TextBanner()
}
bool TextBanner::LoadFromSong( Song* pSong )
bool TextBanner::LoadFromSong( const Song* pSong )
{
if( pSong == NULL )
{
@@ -55,60 +99,36 @@ bool TextBanner::LoadFromSong( Song* pSong )
return true;
}
CString sMainTitle = pSong->m_sMainTitle;
CString sSubTitle = pSong->m_sSubTitle;
m_textTitle.SetText( pSong->m_sMainTitle );
m_textSubTitle.SetText( pSong->m_sSubTitle );
m_textArtist.SetText( g_sArtistPrependString + pSong->m_sArtist );
m_textTitle.SetText( sMainTitle );
m_textSubTitle.SetText( sSubTitle );
m_textArtist.SetText( "/" + pSong->m_sArtist );
bool bTwoLines = pSong->m_sSubTitle.length() == 0;
float fTitleZoom = bTwoLines ? g_fTwoLinesTitleZoom : g_fThreeLinesTitleZoom;
float fSubTitleZoom = bTwoLines ? 0 : g_fThreeLinesSubTitleZoom;
float fArtistZoom = bTwoLines ? g_fTwoLinesArtistZoom : g_fThreeLinesArtistZoom;
float fTitleZoom, fSubTitleZoom, fArtistZoom;
m_textTitle.SetZoomY( fTitleZoom );
m_textSubTitle.SetZoomY( fSubTitleZoom );
m_textArtist.SetZoomY( fArtistZoom );
if( sSubTitle == "" )
{
fTitleZoom = 1.0f;
fSubTitleZoom = 0.0f;
fArtistZoom = 0.6f;
}
else
{
fTitleZoom = 1.0f;
fSubTitleZoom = 0.5f;
fArtistZoom = 0.6f;
}
fTitleZoom = min( fTitleZoom, g_fWidth/m_textTitle.GetWidestLineWidthInSourcePixels() );
fSubTitleZoom = min( fSubTitleZoom, g_fWidth/m_textSubTitle.GetWidestLineWidthInSourcePixels() );
fArtistZoom = min( fArtistZoom, g_fWidth/m_textArtist.GetWidestLineWidthInSourcePixels() );
m_textTitle.SetZoom( fTitleZoom );
m_textSubTitle.SetZoom( fSubTitleZoom );
m_textArtist.SetZoom( fArtistZoom );
m_textTitle.SetZoomX( fTitleZoom );
m_textSubTitle.SetZoomX( fSubTitleZoom );
m_textArtist.SetZoomX( fArtistZoom );
float fTitleY = bTwoLines ? g_fTwoLinesTitleY : g_fThreeLinesTitleY;
float fSubTitleY = bTwoLines ? 0 : g_fThreeLinesSubTitleY;
float fArtistY = bTwoLines ? g_fTwoLinesArtistY : g_fThreeLinesArtistY;
float fZoomedTitleWidth = m_textTitle.GetWidestLineWidthInSourcePixels() * fTitleZoom;
float fZoomedSubTitleWidth = m_textSubTitle.GetWidestLineWidthInSourcePixels() * fSubTitleZoom;
float fZoomedArtistWidth = m_textArtist.GetWidestLineWidthInSourcePixels() * fArtistZoom;
m_textTitle.SetY( fTitleY );
m_textSubTitle.SetY( fSubTitleY );
m_textArtist.SetY( fArtistY );
// check to see if any of the lines run over the edge of the banner
if( fZoomedTitleWidth > TEXT_BANNER_WIDTH )
m_textTitle.SetZoomX( TEXT_BANNER_WIDTH / m_textTitle.GetWidestLineWidthInSourcePixels() );
if( fZoomedSubTitleWidth > TEXT_BANNER_WIDTH )
m_textSubTitle.SetZoomX( TEXT_BANNER_WIDTH / m_textSubTitle.GetWidestLineWidthInSourcePixels() );
if( fZoomedArtistWidth > TEXT_BANNER_WIDTH )
m_textArtist.SetZoomX( TEXT_BANNER_WIDTH / m_textArtist.GetWidestLineWidthInSourcePixels() );
if( sSubTitle == "" )
{
m_textTitle.SetY( -8 );
m_textSubTitle.SetY( 0 );
m_textArtist.SetY( 8 );
}
else
{
m_textTitle.SetY( -10 );
m_textSubTitle.SetY( 0 );
m_textArtist.SetY( 10 );
}
return true;
}
+1 -1
View File
@@ -19,7 +19,7 @@ class TextBanner : public ActorFrame
{
public:
TextBanner();
bool LoadFromSong( Song* pSong );
bool LoadFromSong( const Song* pSong );
private:
BitmapText m_textTitle, m_textSubTitle, m_textArtist;
+4 -2
View File
@@ -195,11 +195,13 @@ public:
bool SongCompleteForStyle( const StyleDef *st ) const;
bool SongHasNotesType( NotesType nt ) const;
bool SongHasNotesTypeAndDifficulty( NotesType nt, Difficulty dc ) const;
void GetNotesThatMatch( NotesType nt, vector<Notes*>& arrayAddTo, bool bIncludeAutoGen = true ) const;
Notes* GetNotesThatMatch( NotesType nt, Difficulty dc, bool bIncludeAutoGen = true ) const;
void GetNotes( vector<Notes*>& arrayAddTo, NotesType nt, bool bIncludeAutoGen = true ) const;
Notes* GetNotes( NotesType nt, Difficulty dc, bool bIncludeAutoGen = true ) const;
void GetEdits( vector<Notes*>& arrayAddTo, NotesType nt, bool bIncludeAutoGen = true ) const;
int GetNumTimesPlayed() const;
bool IsNew() const;
bool IsEasy( NotesType nt ) const;
bool HasEdits( NotesType nt ) const;
Grade GetGradeForDifficulty( const StyleDef *s, PlayerNumber pn, Difficulty dc ) const;
bool NormallyDisplayed() const;
bool RouletteDisplayed() const;
+5 -2
View File
@@ -19,7 +19,7 @@
!define PRODUCT_NAME_VER "${PRODUCT_NAME} ${VERSION}"
Name "${PRODUCT_NAME}"
OutFile "stepmania-CVS-20030205.exe"
OutFile "stepmania-CVS-20030207.exe"
;OutFile "stepmania301.exe"
; Some default compiler settings (uncomment and change at will):
@@ -136,9 +136,11 @@ RMDir /r "$INSTDIR\NoteSkins\dance\note"
SetOutPath "$INSTDIR\NoteSkins"
File "NoteSkins\instructions.txt"
CreateDirectory "$INSTDIR\NoteSkins\dance\default"
CreateDirectory "$INSTDIR\NoteSkins\dance\flat"
CreateDirectory "$INSTDIR\NoteSkins\dance\note"
SetOutPath "$INSTDIR\NoteSkins\dance"
File /r "NoteSkins\dance\default"
File /r "NoteSkins\dance\flat"
File /r "NoteSkins\dance\note"
SetOutPath "$INSTDIR\NoteSkins\pump"
@@ -295,13 +297,14 @@ Delete "$INSTDIR\zliba.dll"
Delete "$INSTDIR\SDL.dll"
Delete "$INSTDIR\SDL_image.dll"
Delete "$INSTDIR\COPYING.txt"
Delete "$INSTDIR\README-FIRST.TXT"
Delete "$INSTDIR\README-FIRST.htm"
Delete "$INSTDIR\NEWS"
Delete "$INSTDIR\stepmania.exe"
Delete "$INSTDIR\stepmania.ini"
Delete "$INSTDIR\smpackage.exe"
Delete "$INSTDIR\StepMania.vdi"
Delete "$INSTDIR\log.txt"
Delete "$INSTDIR\info.txt"
RMDir "$INSTDIR" ; will delete only if empty