Files
itgmania212121/stepmania/src/ScreenRanking.cpp
T

955 lines
28 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
2003-01-26 07:33:03 +00:00
#include "ScreenRanking.h"
#include "ThemeManager.h"
#include "SongManager.h"
#include "GameState.h"
#include "GameManager.h"
2003-07-17 20:10:07 +00:00
#include "Course.h"
2003-10-15 01:44:35 +00:00
#include "song.h"
2003-12-18 03:40:57 +00:00
#include "Steps.h"
2003-09-09 03:24:34 +00:00
#include "PrefsManager.h"
2003-11-02 16:32:45 +00:00
#include "ActorUtil.h"
#include "ProfileManager.h"
2004-01-29 01:46:08 +00:00
#include "RageLog.h"
2005-02-21 06:22:46 +00:00
#include "UnlockManager.h"
#include "ScreenDimensions.h"
#include "PercentageDisplay.h"
2003-01-26 07:33:03 +00:00
2004-05-02 03:01:27 +00:00
static const CString PageTypeNames[NUM_PAGE_TYPES] = {
"Category",
"Course",
"AllSteps",
"AllCourses",
};
2005-03-05 21:50:33 +00:00
XToString( PageType, NUM_PAGE_TYPES );
2004-05-02 03:01:27 +00:00
2003-12-28 08:20:48 +00:00
#define COURSES_TO_SHOW PREFSMAN->m_sCoursesToShowRanking
2005-02-28 17:18:01 +00:00
#define COURSES_TO_SHOW2 THEME->GetMetric(m_sName,"CoursesToShow")
2004-01-29 01:46:08 +00:00
2003-12-28 08:20:48 +00:00
#define BULLET_X(row) (BULLET_START_X+ROW_SPACING_X*row)
#define BULLET_Y(row) (BULLET_START_Y+ROW_SPACING_Y*row)
#define NAME_X(row) (NAME_START_X+ROW_SPACING_X*row)
#define NAME_Y(row) (NAME_START_Y+ROW_SPACING_Y*row)
#define SCORE_X(row) (SCORE_START_X+ROW_SPACING_X*row)
#define SCORE_Y(row) (SCORE_START_Y+ROW_SPACING_Y*row)
#define POINTS_X(row) (POINTS_START_X+ROW_SPACING_X*row)
#define POINTS_Y(row) (POINTS_START_Y+ROW_SPACING_Y*row)
#define TIME_X(row) (TIME_START_X+ROW_SPACING_X*row)
#define TIME_Y(row) (TIME_START_Y+ROW_SPACING_Y*row)
#define DIFFICULTY_X(col) (DIFFICULTY_START_X+COL_SPACING_X*col)
#define STEPS_SCORE_OFFSET_X(col) (STEPS_SCORE_OFFSET_START_X+COL_SPACING_X*col)
2003-01-26 07:33:03 +00:00
2004-01-29 01:46:08 +00:00
#define COURSE_DIFFICULTY_X(col) (COURSE_DIFFICULTY_START_X+COL_SPACING_X*col)
#define COURSE_SCORE_OFFSET_X(col) (COURSE_SCORE_OFFSET_START_X+COL_SPACING_X*col)
AutoScreenMessage( SM_ShowNextPage )
AutoScreenMessage( SM_HidePage )
2003-01-26 20:49:05 +00:00
2003-01-26 07:33:03 +00:00
static void GetAllSongsToShow( vector<Song*> &vpOut )
{
vpOut.clear();
FOREACH_CONST( Song*, SONGMAN->GetAllSongs(), s )
{
if( UNLOCKMAN->SongIsLocked(*s) )
continue; // skip
if( !(*s)->ShowInDemonstrationAndRanking() )
continue; // skip
vpOut.push_back( *s );
}
}
static void GetAllCoursesToShow( vector<Course*> &vpOut )
{
vpOut.clear();
vector<Course*> vpCourses;
SONGMAN->GetAllCourses( vpCourses, false );
FOREACH_CONST( Course*, vpCourses, c)
{
if( UNLOCKMAN->CourseIsLocked(*c) )
continue; // skip
if( !(*c)->ShowInDemonstrationAndRanking() )
continue; // skip
vpOut.push_back( *c );
}
}
2005-03-23 21:04:40 +00:00
CString STEPS_TYPE_COLOR_NAME( size_t i ) { return ssprintf("StepsTypeColor%d",int(i+1)); }
2005-02-28 17:18:01 +00:00
2004-11-26 17:28:47 +00:00
REGISTER_SCREEN_CLASS( ScreenRanking );
2005-02-28 17:18:01 +00:00
ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName ),
STEPS_TYPES_TO_SHOW (m_sName,"StepsTypesToHide"),
DIFFICULTIES_TO_SHOW (m_sName,"DifficultiesToShow"),
2005-02-28 17:18:01 +00:00
SHOW_CATEGORIES (m_sName,"ShowCategories"),
SHOW_ALL_STEPS_SCORES (m_sName,"ShowAllStepsScores"),
SHOW_ALL_COURSE_SCORES (m_sName,"ShowAllCourseScores"),
SECONDS_PER_PAGE (m_sName,"SecondsPerPage"),
PAGE_FADE_SECONDS (m_sName,"PageFadeSeconds"),
NO_SCORE_NAME (m_sName,"NoScoreName"),
ROW_SPACING_X (m_sName,"RowSpacingX"),
ROW_SPACING_Y (m_sName,"RowSpacingY"),
COL_SPACING_X (m_sName,"ColSpacingX"),
COL_SPACING_Y (m_sName,"ColSpacingY"),
STEPS_TYPE_COLOR (m_sName,STEPS_TYPE_COLOR_NAME,5),
SONG_SCORE_ROWS_TO_SHOW (m_sName,"SongScoreRowsToShow"),
SONG_SCORE_SECONDS_PER_ROW (m_sName,"SongScoreSecondsPerRow"),
2005-02-28 18:49:17 +00:00
MANUAL_SCROLLING (m_sName,"ManualScroling"),
2005-02-28 17:18:01 +00:00
BULLET_START_X (m_sName,"BulletStartX"),
BULLET_START_Y (m_sName,"BulletStartY"),
NAME_START_X (m_sName,"NameStartX"),
NAME_START_Y (m_sName,"NameStartY"),
SCORE_START_X (m_sName,"ScoreStartX"),
SCORE_START_Y (m_sName,"ScoreStartY"),
POINTS_START_X (m_sName,"PointsStartX"),
POINTS_START_Y (m_sName,"PointsStartY"),
TIME_START_X (m_sName,"TimeStartX"),
TIME_START_Y (m_sName,"TimeStartY"),
DIFFICULTY_START_X (m_sName,"DifficultyStartX"),
DIFFICULTY_Y (m_sName,"DifficultyY"),
COURSE_DIFFICULTY_START_X (m_sName,"CourseDifficultyStartX"),
COURSE_DIFFICULTY_Y (m_sName,"CourseDifficultyY"),
SONG_TITLE_OFFSET_X (m_sName,"SongTitleOffsetX"),
SONG_TITLE_OFFSET_Y (m_sName,"SongTitleOffsetY"),
SONG_FRAME_OFFSET_X (m_sName,"SongFrameOffsetX"),
SONG_FRAME_OFFSET_Y (m_sName,"SongFrameOffsetY"),
STEPS_SCORE_OFFSET_START_X (m_sName,"StepsScoreOffsetStartX"),
STEPS_SCORE_OFFSET_Y (m_sName,"StepsScoreOffsetY"),
COURSE_SCORE_OFFSET_START_X (m_sName,"CourseListScoreOffsetStartX"),
COURSE_SCORE_OFFSET_Y (m_sName,"CourseListScoreOffsetY")
2003-01-26 07:33:03 +00:00
{
}
void ScreenRanking::Init()
{
ScreenAttract::Init();
2003-12-28 08:20:48 +00:00
// init Actors for category and course
{
m_Banner.SetName( "Banner" );
m_Banner.SetHidden( true );
this->AddChild( &m_Banner );
2003-01-26 07:33:03 +00:00
2003-12-28 08:20:48 +00:00
m_sprBannerFrame.SetName( "BannerFrame" );
m_sprBannerFrame.SetHidden( true );
this->AddChild( &m_sprBannerFrame );
2003-10-20 01:06:26 +00:00
2003-12-28 08:20:48 +00:00
m_textCategory.SetName( "Category" );
2005-02-28 16:48:13 +00:00
m_textCategory.LoadFromFont( THEME->GetPathF(m_sName,"category") );
m_textCategory.SetShadowLength( 0 );
2003-12-28 08:20:48 +00:00
m_textCategory.SetHidden( true );
this->AddChild( &m_textCategory );
2003-12-18 20:26:48 +00:00
m_textCourseTitle.SetName( "CourseTitle" );
2005-02-28 16:48:13 +00:00
m_textCourseTitle.LoadFromFont( THEME->GetPathF(m_sName,"course title") );
m_textCourseTitle.SetShadowLength( 0 );
m_textCourseTitle.SetHidden( true );
this->AddChild( &m_textCourseTitle );
2003-12-28 08:20:48 +00:00
m_textStepsType.SetName( "StepsType" );
2005-02-28 16:48:13 +00:00
m_textStepsType.LoadFromFont( THEME->GetPathF(m_sName,"steps type") );
m_textStepsType.SetShadowLength( 0 );
2003-12-28 08:20:48 +00:00
m_textStepsType.SetHidden( true );
this->AddChild( &m_textStepsType );
2003-01-26 07:33:03 +00:00
2003-12-28 08:20:48 +00:00
for( int l=0; l<NUM_RANKING_LINES; l++ )
{
m_sprBullets[l].SetName( ssprintf("Bullet%d",l+1) );
2005-02-28 16:48:13 +00:00
m_sprBullets[l].Load( THEME->GetPathG( m_sName, ssprintf("bullets 1x%d",NUM_RANKING_LINES) ) );
2003-12-28 08:20:48 +00:00
m_sprBullets[l].SetState( l );
m_sprBullets[l].StopAnimating();
m_sprBullets[l].SetHidden( true );
this->AddChild( &m_sprBullets[l] );
m_textNames[l].SetName( ssprintf("Name%d",l+1) );
2005-02-28 16:48:13 +00:00
m_textNames[l].LoadFromFont( THEME->GetPathF(m_sName,"name") );
2003-12-28 08:20:48 +00:00
m_textNames[l].SetHidden( true );
this->AddChild( &m_textNames[l] );
m_textScores[l].SetName( ssprintf("Score%d",l+1) );
2005-02-28 16:48:13 +00:00
m_textScores[l].LoadFromFont( THEME->GetPathF(m_sName,"score") );
2003-12-28 08:20:48 +00:00
m_textScores[l].SetHidden( true );
this->AddChild( &m_textScores[l] );
m_textPoints[l].SetName( ssprintf("Points%d",l+1) );
2005-02-28 16:48:13 +00:00
m_textPoints[l].LoadFromFont( THEME->GetPathF(m_sName,"points") );
2003-12-28 08:20:48 +00:00
m_textPoints[l].SetHidden( true );
this->AddChild( &m_textPoints[l] );
m_textTime[l].SetName( ssprintf("Time%d",l+1) );
2005-02-28 16:48:13 +00:00
m_textTime[l].LoadFromFont( THEME->GetPathF(m_sName,"time") );
2003-12-28 08:20:48 +00:00
m_textTime[l].SetHidden( true );
this->AddChild( &m_textTime[l] );
// TODO: Think of a better way to handle this
if( PREFSMAN->m_sCoursesToShowRanking == "" )
2005-02-28 17:18:01 +00:00
PREFSMAN->m_sCoursesToShowRanking = COURSES_TO_SHOW2;
2003-12-28 08:20:48 +00:00
}
}
2003-12-28 08:20:48 +00:00
//
2003-01-26 20:49:05 +00:00
// fill m_vPagesToShow
2003-12-28 08:20:48 +00:00
//
2003-01-26 07:33:03 +00:00
if( SHOW_CATEGORIES )
{
for( unsigned i=0; i<STEPS_TYPES_TO_SHOW.GetValue().size(); i++ )
2003-01-26 07:33:03 +00:00
{
2003-01-26 20:49:05 +00:00
for( int c=0; c<NUM_RANKING_CATEGORIES; c++ )
2003-01-26 07:33:03 +00:00
{
2003-01-26 20:49:05 +00:00
PageToShow pts;
2004-05-02 03:01:27 +00:00
pts.type = PAGE_TYPE_CATEGORY;
pts.colorIndex = i;
2003-01-26 20:49:05 +00:00
pts.category = (RankingCategory)c;
pts.nt = STEPS_TYPES_TO_SHOW.GetValue()[i];
2003-01-26 20:49:05 +00:00
m_vPagesToShow.push_back( pts );
2003-01-26 07:33:03 +00:00
}
}
}
{
vector<CString> asCoursePaths;
split( COURSES_TO_SHOW, ",", asCoursePaths, true );
for( unsigned i=0; i<STEPS_TYPES_TO_SHOW.GetValue().size(); i++ )
2003-01-26 07:33:03 +00:00
{
for( unsigned c=0; c<asCoursePaths.size(); c++ )
{
PageToShow pts;
2004-06-03 20:47:37 +00:00
pts.type = PAGE_TYPE_TRAIL;
pts.colorIndex = i;
pts.nt = STEPS_TYPES_TO_SHOW.GetValue()[i];
pts.pCourse = SONGMAN->GetCourseFromPath( asCoursePaths[c] );
2004-06-03 20:47:37 +00:00
if( pts.pCourse == NULL )
continue;
pts.pTrail = pts.pCourse->GetTrail( pts.nt );
2004-06-03 20:47:37 +00:00
if( pts.pTrail == NULL )
continue;
m_vPagesToShow.push_back( pts );
}
2003-01-26 07:33:03 +00:00
}
}
const vector<Difficulty> &v = DIFFICULTIES_TO_SHOW.GetValue();
FOREACH_Difficulty( d )
{
bool bShowThis = find( v.begin(), v.end(), d ) != v.end();
if( !bShowThis )
continue; // skip
m_sprDifficulty[d].Load( THEME->GetPathG(m_sName,"difficulty "+DifficultyToString(d)) );
m_sprDifficulty[d]->SetName( ssprintf("Difficulty%d",d) );
m_sprDifficulty[d]->SetHidden( true );
this->AddChild( m_sprDifficulty[d] );
}
FOREACH_ShownCourseDifficulty(d)
{
CString cd = CourseDifficultyToString(d);
m_sprCourseDifficulty[d].Load( THEME->GetPathG(m_sName,"CourseDifficulty "+cd) );
m_sprCourseDifficulty[d]->SetName( ssprintf("CourseDifficulty%s",cd.c_str()) );
m_sprCourseDifficulty[d]->SetHidden( true );
this->AddChild( m_sprCourseDifficulty[d] );
}
ASSERT( !SHOW_ALL_STEPS_SCORES || !SHOW_ALL_COURSE_SCORES ); // Can't do both on the same screen
2003-12-28 08:20:48 +00:00
if( SHOW_ALL_STEPS_SCORES )
{
m_vScoreRowItem.clear();
vector<Song*> vpSongs;
GetAllSongsToShow( vpSongs );
m_vScoreRowItem.resize( vpSongs.size() );
FOREACH_CONST( Song*, vpSongs, s )
{
int i = s - vpSongs.begin();
Song *pSong = *s;
ScoreRowItem &item = m_vScoreRowItem[i];
item.m_pSong = pSong;
item.m_sprFrame.Load( THEME->GetPathG(m_sName,"song frame") );
item.m_sprFrame->SetName( "SongFrame" );
item.m_sprFrame->SetHidden( true );
item.AddChild( item.m_sprFrame );
item.m_textTitle.SetName( "SongTitle" );
item.m_textTitle.SetHidden( true );
item.m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"song title") );
item.AddChild( &item.m_textTitle );
for( int d=0; d<NUM_DIFFICULTIES; d++ )
{
item.m_textScore[d].SetName( "StepsScore" );
item.m_textScore[d].LoadFromFont( THEME->GetPathF(m_sName,"steps score") );
item.m_textScore[d].SetHidden( true );
item.AddChild( &item.m_textScore[d] );
}
}
m_ListScoreRowItems.SetName( "ListScoreRowItems" );
this->AddChild( &m_ListScoreRowItems );
if( !vpSongs.empty() )
{
for( unsigned i=0; i<STEPS_TYPES_TO_SHOW.GetValue().size(); i++ )
{
2003-12-28 08:20:48 +00:00
PageToShow pts;
2004-05-02 03:01:27 +00:00
pts.type = PAGE_TYPE_ALL_STEPS;
2003-12-28 08:20:48 +00:00
pts.colorIndex = i;
pts.nt = STEPS_TYPES_TO_SHOW.GetValue()[i];
2003-12-28 08:20:48 +00:00
m_vPagesToShow.push_back( pts );
}
}
}
2004-01-29 01:46:08 +00:00
if( SHOW_ALL_COURSE_SCORES )
{
vector<Course*> vpCourses;
GetAllCoursesToShow( vpCourses );
LOG->Trace("rankings: adding %u courses", vpCourses.size());
m_vScoreRowItem.resize( vpCourses.size() );
FOREACH_CONST( Course*, vpCourses, c )
{
Course* pCourse = *c;
int i = c - vpCourses.begin();
ScoreRowItem &item = m_vScoreRowItem[i];
item.m_pCourse = pCourse;
item.m_sprFrame.Load( THEME->GetPathG(m_sName,"course frame") );
item.m_sprFrame->SetName( "CourseListFrame" );
item.m_sprFrame->SetHidden( true );
item.AddChild( item.m_sprFrame );
item.m_textTitle.SetName( "CourseListTitle" );
item.m_textTitle.SetHidden( true );
item.m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"course list title") );
item.AddChild( &item.m_textTitle );
FOREACH_ShownCourseDifficulty(d)
{
item.m_textScore[d].SetName( "CourseListScore" );
item.m_textScore[d].LoadFromFont( THEME->GetPathF(m_sName,"course list score") );
item.m_textScore[d].SetHidden( true );
item.AddChild( &item.m_textScore[d] );
}
}
m_ListScoreRowItems.SetName( "ListScoreRowItems" );
this->AddChild( &m_ListScoreRowItems );
m_ListScoreRowItems.SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y );
if( !vpCourses.empty() )
2004-01-29 01:46:08 +00:00
{
for( unsigned i=0; i<STEPS_TYPES_TO_SHOW.GetValue().size(); i++ )
2004-01-29 01:46:08 +00:00
{
PageToShow pts;
2004-05-02 03:01:27 +00:00
pts.type = PAGE_TYPE_ALL_COURSES;
2004-01-29 01:46:08 +00:00
pts.colorIndex = i;
pts.nt = STEPS_TYPES_TO_SHOW.GetValue()[i];
2004-01-29 01:46:08 +00:00
m_vPagesToShow.push_back( pts );
}
}
}
2003-03-25 21:17:29 +00:00
this->PostScreenMessage( SM_ShowNextPage, 0.5f );
2003-01-26 07:33:03 +00:00
}
2003-12-28 08:20:48 +00:00
ScreenRanking::~ScreenRanking()
{
}
2005-02-28 18:49:17 +00:00
void ScreenRanking::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->Trace( "ScreenRanking::Input()" );
// If manually scrolling, then pass the input to Scree::Input so it will call Menu*
if( (bool)MANUAL_SCROLLING )
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
else
ScreenAttract::Input( DeviceI, type, GameI, MenuI, StyleI );
}
void ScreenRanking::Scroll( int iDir )
{
float fDest = m_ListScoreRowItems.GetDestinationItem();
float fOldDest = fDest;
fDest += iDir;
2005-04-10 23:42:47 +00:00
CLAMP( fDest, (SONG_SCORE_ROWS_TO_SHOW-1)/2.0f, m_vScoreRowItem.size()-(SONG_SCORE_ROWS_TO_SHOW-1)/2.0f-1 );
2005-02-28 18:49:17 +00:00
if( fOldDest != fDest )
{
// TODO: play sound
m_ListScoreRowItems.SetDestinationItem( fDest );
m_ListScoreRowItems.SetDestinationItem( fDest );
2005-02-28 18:49:17 +00:00
}
}
void ScreenRanking::MenuStart( PlayerNumber pn )
{
if( !IsTransitioning() )
StartTransitioning( SM_GoToNextScreen );
}
void ScreenRanking::MenuBack( PlayerNumber pn )
{
if( !IsTransitioning() )
StartTransitioning( SM_GoToNextScreen );
}
2003-01-26 07:33:03 +00:00
void ScreenRanking::HandleScreenMessage( const ScreenMessage SM )
{
if( SM == SM_ShowNextPage )
2003-01-26 07:33:03 +00:00
{
2003-01-26 20:49:05 +00:00
if( m_vPagesToShow.size() > 0 )
2003-01-26 07:33:03 +00:00
{
2003-12-28 08:20:48 +00:00
float fSecsToShow = SetPage( m_vPagesToShow[0] );
2004-05-02 03:01:27 +00:00
this->SortByDrawOrder();
2003-01-26 20:49:05 +00:00
m_vPagesToShow.erase( m_vPagesToShow.begin() );
2005-02-28 18:49:17 +00:00
// If manually scrolling, don't automatically change pages.
if( !(bool)MANUAL_SCROLLING )
this->PostScreenMessage( SM_HidePage, fSecsToShow-PAGE_FADE_SECONDS );
2003-01-26 07:33:03 +00:00
}
else
{
2005-02-28 18:49:17 +00:00
StartTransitioning(SM_GoToNextScreen);
2003-01-26 07:33:03 +00:00
}
}
else if( SM == SM_HidePage )
{
2003-01-26 20:49:05 +00:00
TweenPageOffScreen();
2003-10-22 10:49:21 +00:00
this->PostScreenMessage( SM_ShowNextPage, PAGE_FADE_SECONDS );
2003-01-26 07:33:03 +00:00
}
ScreenAttract::HandleScreenMessage( SM );
}
2003-12-28 08:20:48 +00:00
float ScreenRanking::SetPage( PageToShow pts )
2003-01-26 07:33:03 +00:00
{
2005-02-28 07:17:10 +00:00
// This is going to take a while to load. Possibly longer than one frame.
// So, zero the next update so we don't skip.
SCREENMAN->ZeroNextUpdate();
2003-12-28 08:20:48 +00:00
bool bBanner = false;
bool bBannerFrame = false;
bool bShowCategory = false;
bool bShowCourseTitle = false;
2003-12-28 08:20:48 +00:00
bool bShowStepsType = false;
bool bShowBullets = false;
bool bShowNames = false;
bool bShowScores = false;
bool bShowPoints = false;
bool bShowTime = false;
bool bShowDifficulty = false;
bool bShowStepsScore = false;
2004-01-29 01:46:08 +00:00
bool bShowCourseDifficulty = false;
bool bShowCourseScore = false;
2003-10-22 09:45:23 +00:00
switch( pts.type )
{
2004-05-02 03:01:27 +00:00
case PAGE_TYPE_CATEGORY:
2003-12-28 08:20:48 +00:00
bBanner = false;
bBannerFrame = false;
bShowCategory = true;
bShowCourseTitle = false;
2003-12-28 08:20:48 +00:00
bShowStepsType = true;
bShowBullets = true;
2003-10-22 09:45:23 +00:00
bShowNames = true;
bShowScores = true;
bShowPoints = false;
bShowTime = false;
bShowDifficulty = false;
2003-12-28 08:20:48 +00:00
bShowStepsScore = false;
2003-10-22 09:45:23 +00:00
break;
2004-06-03 20:47:37 +00:00
case PAGE_TYPE_TRAIL:
2003-12-28 08:20:48 +00:00
bBanner = true;
bBannerFrame = true;
bShowCategory = false;
bShowCourseTitle = true;
2003-12-28 08:20:48 +00:00
bShowStepsType = true;
bShowBullets = true;
2003-10-22 09:45:23 +00:00
bShowNames = true;
bShowScores = !pts.pCourse->IsOni();
bShowPoints = pts.pCourse->IsOni();
bShowTime = pts.pCourse->IsOni();
bShowDifficulty = false;
2003-12-28 08:20:48 +00:00
bShowStepsScore = false;
2003-10-22 09:45:23 +00:00
break;
2004-05-02 03:01:27 +00:00
case PAGE_TYPE_ALL_STEPS:
2003-12-28 08:20:48 +00:00
bBanner = false;
bBannerFrame = false;
bShowCategory = false;
bShowCourseTitle = false;
2003-12-28 08:20:48 +00:00
bShowStepsType = true;
bShowBullets = false;
2003-10-22 09:45:23 +00:00
bShowNames = false;
bShowScores = false;
bShowPoints = false;
bShowTime = false;
bShowDifficulty = true;
2003-12-28 08:20:48 +00:00
bShowStepsScore = true;
2003-10-22 09:45:23 +00:00
break;
2004-05-02 03:01:27 +00:00
case PAGE_TYPE_ALL_COURSES:
2004-01-29 01:46:08 +00:00
bShowStepsType = true;
bShowCourseScore = true;
bShowCourseDifficulty = true;
break;
2003-10-22 09:45:23 +00:00
default:
ASSERT(0);
}
2003-10-22 09:45:23 +00:00
// Reset
2003-12-28 08:20:48 +00:00
m_Banner.SetHidden( !bBanner );
if( bBanner )
{
2003-12-28 08:20:48 +00:00
m_Banner.Reset();
SET_XY_AND_ON_COMMAND( m_Banner );
}
2003-10-22 09:45:23 +00:00
2003-12-28 08:20:48 +00:00
m_sprBannerFrame.SetHidden( !bBannerFrame );
if( bBannerFrame )
{
m_sprBannerFrame.Reset();
SET_XY_AND_ON_COMMAND( m_sprBannerFrame );
}
2003-10-22 09:45:23 +00:00
2003-12-28 08:20:48 +00:00
m_textCategory.SetHidden( !bShowCategory );
if( bShowCategory )
{
m_textCategory.Reset();
SET_XY_AND_ON_COMMAND( m_textCategory );
}
m_textCourseTitle.SetHidden( !bShowCourseTitle );
if( bShowCourseTitle )
{
m_textCourseTitle.Reset();
SET_XY_AND_ON_COMMAND( m_textCourseTitle );
}
2003-12-28 08:20:48 +00:00
m_textStepsType.SetHidden( !bShowStepsType );
if( bShowStepsType )
{
m_textStepsType.Reset();
SET_XY_AND_ON_COMMAND( m_textStepsType );
}
2003-10-22 09:45:23 +00:00
2004-05-02 03:01:27 +00:00
// UGLY: We have to call AddChild every time we re-load an AutoActor
// because the internal Actor* changes.
if( (Actor*)m_sprPageType )
this->RemoveChild( m_sprPageType );
m_sprPageType.Load( THEME->GetPathG(m_sName, "PageType "+PageTypeToString(pts.type)) );
m_sprPageType->SetName( "PageType" );
this->AddChild( m_sprPageType );
SET_XY_AND_ON_COMMAND( m_sprPageType );
for( int l=0; l<NUM_RANKING_LINES; l++ )
2003-12-28 08:20:48 +00:00
{
m_sprBullets[l].SetHidden( !bShowBullets );
if( bShowBullets )
2003-10-22 09:45:23 +00:00
{
m_sprBullets[l].Reset();
m_sprBullets[l].StopAnimating();
m_sprBullets[l].SetState( l );
m_sprBullets[l].SetXY( BULLET_X(l), BULLET_Y(l) );
ON_COMMAND( m_sprBullets[l] );
}
2003-12-28 08:20:48 +00:00
m_textNames[l].SetHidden( !bShowNames );
if( bShowNames )
{
m_textNames[l].Reset();
m_textNames[l].SetXY( NAME_X(l), NAME_Y(l) );
m_textNames[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textNames[l] );
}
2003-12-28 08:20:48 +00:00
m_textScores[l].SetHidden( !bShowScores );
if( bShowScores )
{
m_textScores[l].Reset();
m_textScores[l].SetXY( SCORE_X(l), SCORE_Y(l) );
m_textScores[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textScores[l] );
}
m_textPoints[l].SetHidden( !bShowPoints );
if( bShowPoints )
{
m_textPoints[l].Reset();
m_textPoints[l].SetXY( POINTS_X(l), POINTS_Y(l) );
m_textPoints[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textPoints[l] );
}
m_textTime[l].SetHidden( !bShowTime );
if( bShowTime )
{
m_textTime[l].Reset();
m_textTime[l].SetXY( TIME_X(l), TIME_Y(l) );
m_textTime[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( m_textTime[l] );
2003-10-22 09:45:23 +00:00
}
}
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
2003-10-22 09:45:23 +00:00
{
m_sprDifficulty[*iter]->SetHidden( !bShowDifficulty );
if( bShowDifficulty )
2003-10-22 09:45:23 +00:00
{
m_sprDifficulty[*iter]->Reset();
m_sprDifficulty[*iter]->SetXY( DIFFICULTY_X(*iter), DIFFICULTY_Y );
ON_COMMAND( m_sprDifficulty[*iter] );
2003-10-22 09:45:23 +00:00
}
}
2003-10-22 09:45:23 +00:00
m_ListScoreRowItems.SetVisible( bShowCourseScore || bShowStepsScore );
if( bShowStepsScore )
{
m_ListScoreRowItems.Reset();
SET_XY_AND_ON_COMMAND( m_ListScoreRowItems );
2003-12-28 08:20:48 +00:00
for( unsigned i=0; i<m_vScoreRowItem.size(); i++ )
2005-04-10 23:42:47 +00:00
m_ListScoreRowItems.AddChild( &m_vScoreRowItem[i] );
m_ListScoreRowItems.Load2( (float)SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0 );
2003-12-28 08:20:48 +00:00
if( (bool)MANUAL_SCROLLING )
{
2005-04-10 23:42:47 +00:00
m_ListScoreRowItems.SetCurrentAndDestinationItem( (SONG_SCORE_ROWS_TO_SHOW-1)/2.0f );
}
2005-02-28 18:49:17 +00:00
for( unsigned s=0; s<m_vScoreRowItem.size(); s++ )
{
ScoreRowItem &item = m_vScoreRowItem[s];
item.m_sprFrame->Reset();
item.m_sprFrame->SetXY( SONG_FRAME_OFFSET_X, SONG_FRAME_OFFSET_Y );
item.m_sprFrame->SetUseZBuffer( true );
ON_COMMAND( item.m_sprFrame );
item.m_textTitle.Reset();
item.m_textTitle.SetXY( SONG_TITLE_OFFSET_X, SONG_TITLE_OFFSET_Y );
item.m_textTitle.SetUseZBuffer( true );
ON_COMMAND( item.m_textTitle );
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
2003-10-22 09:45:23 +00:00
{
item.m_textScore[*iter].Reset();
item.m_textScore[*iter].SetXY( STEPS_SCORE_OFFSET_X(*iter), STEPS_SCORE_OFFSET_Y );
item.m_textScore[*iter].SetUseZBuffer( true );
item.m_textScore[*iter].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( item.m_textScore[*iter] );
2003-10-22 09:45:23 +00:00
}
}
}
FOREACH_ShownCourseDifficulty(d)
2004-01-29 01:46:08 +00:00
{
m_sprCourseDifficulty[d]->SetHidden( !bShowCourseDifficulty );
if( bShowCourseDifficulty )
2004-01-29 01:46:08 +00:00
{
m_sprCourseDifficulty[d]->Reset();
m_sprCourseDifficulty[d]->SetXY( COURSE_DIFFICULTY_X(d), COURSE_DIFFICULTY_Y );
ON_COMMAND( m_sprCourseDifficulty[d] );
2004-01-29 01:46:08 +00:00
}
}
if( bShowCourseScore )
{
m_ListScoreRowItems.Reset();
SET_XY_AND_ON_COMMAND( m_ListScoreRowItems );
vector<Actor*> vpActors;
for( unsigned i=0; i<m_vScoreRowItem.size(); i++ )
2005-04-10 23:42:47 +00:00
m_ListScoreRowItems.AddChild( &m_vScoreRowItem[i] );
m_ListScoreRowItems.Load2( (float)SONG_SCORE_ROWS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, SONG_SCORE_SECONDS_PER_ROW, 0 );
2004-01-29 01:46:08 +00:00
if( (bool)MANUAL_SCROLLING )
2004-01-29 01:46:08 +00:00
{
2005-04-10 23:42:47 +00:00
m_ListScoreRowItems.SetCurrentAndDestinationItem( (SONG_SCORE_ROWS_TO_SHOW-1)/2.0f );
}
2004-01-29 01:46:08 +00:00
for( unsigned s=0; s<m_vScoreRowItem.size(); s++ )
{
ScoreRowItem &item = m_vScoreRowItem[s];
item.m_sprFrame->Reset();
item.m_sprFrame->SetXY( SONG_FRAME_OFFSET_X, SONG_FRAME_OFFSET_Y );
item.m_sprFrame->SetUseZBuffer( true );
ON_COMMAND( item.m_sprFrame );
2004-01-29 01:46:08 +00:00
item.m_textTitle.Reset();
item.m_textTitle.SetXY( SONG_TITLE_OFFSET_X, SONG_TITLE_OFFSET_Y );
item.m_textTitle.SetUseZBuffer( true );
ON_COMMAND( item.m_textTitle );
2005-03-08 01:22:50 +00:00
FOREACH_ShownCourseDifficulty(d)
2004-01-29 01:46:08 +00:00
{
item.m_textScore[d].Reset();
item.m_textScore[d].SetXY( COURSE_SCORE_OFFSET_X(d), COURSE_SCORE_OFFSET_Y );
item.m_textScore[d].SetUseZBuffer( true );
item.m_textScore[d].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
ON_COMMAND( item.m_textScore[d] );
2004-01-29 01:46:08 +00:00
}
}
}
2003-12-28 08:20:48 +00:00
// get ranking feat list
2003-10-22 09:45:23 +00:00
2003-12-28 08:20:48 +00:00
//
2003-10-22 09:45:23 +00:00
// init page
2003-12-28 08:20:48 +00:00
//
2003-01-26 20:49:05 +00:00
switch( pts.type )
2003-01-26 07:33:03 +00:00
{
2004-05-02 03:01:27 +00:00
case PAGE_TYPE_CATEGORY:
2003-01-26 07:33:03 +00:00
{
2003-12-28 08:20:48 +00:00
m_textCategory.SetText( ssprintf("Type %c", 'A'+pts.category) );
2004-07-12 02:19:24 +00:00
m_textStepsType.SetText( GameManager::StepsTypeToThemedString(pts.nt) );
2003-10-22 09:45:23 +00:00
2003-01-27 02:00:38 +00:00
for( int l=0; l<NUM_RANKING_LINES; l++ )
2003-01-26 07:33:03 +00:00
{
2004-02-09 06:26:13 +00:00
HighScoreList& hsl = PROFILEMAN->GetMachineProfile()->GetCategoryHighScoreList(pts.nt,pts.category);
HighScore hs;
2003-12-28 08:20:48 +00:00
bool bRecentHighScore = false;
2004-02-09 06:26:13 +00:00
if( l < (int)hsl.vHighScores.size() )
2003-12-28 08:20:48 +00:00
{
2004-02-09 06:26:13 +00:00
hs = hsl.vHighScores[l];
CString *psName = &hsl.vHighScores[l].sName;
2003-12-28 08:20:48 +00:00
bRecentHighScore = find( GAMESTATE->m_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end();
}
2003-12-24 23:38:56 +00:00
else
2003-12-28 08:20:48 +00:00
{
hs.sName = NO_SCORE_NAME;
}
2004-03-08 02:50:46 +00:00
m_textNames[l].SetText( hs.GetDisplayName() );
m_textScores[l].SetText( ssprintf("%09i",hs.iScore) );
2005-02-28 17:18:01 +00:00
m_textNames[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
m_textScores[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
if( bRecentHighScore )
{
2003-03-02 01:43:33 +00:00
m_textNames[l].SetEffectGlowBlink(0.1f);
m_textScores[l].SetEffectGlowBlink(0.1f);
}
else
{
m_textNames[l].SetEffectNone();
m_textScores[l].SetEffectNone();
2003-01-27 02:00:38 +00:00
}
2003-01-26 07:33:03 +00:00
}
}
2003-12-28 08:20:48 +00:00
return SECONDS_PER_PAGE;
2004-06-03 20:47:37 +00:00
case PAGE_TYPE_TRAIL:
2003-01-26 07:33:03 +00:00
{
2004-07-11 10:02:38 +00:00
m_textCourseTitle.SetText( pts.pCourse->GetFullDisplayTitle() );
2003-12-28 08:20:48 +00:00
m_Banner.LoadFromCourse( pts.pCourse );
2004-07-12 02:19:24 +00:00
m_textStepsType.SetText( GameManager::StepsTypeToThemedString(pts.nt) );
2004-06-03 20:47:37 +00:00
const HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList( pts.pCourse, pts.pTrail );
2003-01-27 02:00:38 +00:00
for( int l=0; l<NUM_RANKING_LINES; l++ )
2003-01-26 07:33:03 +00:00
{
2004-02-09 06:26:13 +00:00
HighScore hs;
2003-12-28 08:20:48 +00:00
bool bRecentHighScore = false;
2004-02-09 06:26:13 +00:00
if( l < (int)hsl.vHighScores.size() )
2003-12-28 08:20:48 +00:00
{
2004-02-09 06:26:13 +00:00
hs = hsl.vHighScores[l];
const CString *psName = &hsl.vHighScores[l].sName;
2003-12-28 08:20:48 +00:00
bRecentHighScore = find( GAMESTATE->m_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end();
}
2003-12-24 23:38:56 +00:00
else
2003-12-28 08:20:48 +00:00
{
hs.sName = NO_SCORE_NAME;
}
2004-02-09 06:26:13 +00:00
2004-03-08 02:50:46 +00:00
m_textNames[l].SetText( hs.GetDisplayName() );
2003-06-30 08:06:47 +00:00
if( pts.pCourse->IsOni() )
{
m_textPoints[l].SetText( ssprintf("%04d",hs.iScore) );
2004-02-22 19:51:46 +00:00
m_textTime[l].SetText( SecondsToMMSSMsMs(hs.fSurviveSeconds) );
2003-06-30 08:06:47 +00:00
m_textScores[l].SetText( "" );
} else {
m_textPoints[l].SetText( "" );
m_textTime[l].SetText( "" );
m_textScores[l].SetText( ssprintf("%09d",hs.iScore) );
2003-06-30 08:06:47 +00:00
}
2005-02-28 17:18:01 +00:00
m_textNames[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
m_textPoints[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
m_textTime[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
m_textScores[l].SetDiffuse( STEPS_TYPE_COLOR.GetValue(pts.colorIndex) );
2003-12-28 08:20:48 +00:00
if( bRecentHighScore )
2003-01-27 02:00:38 +00:00
{
2003-12-28 08:20:48 +00:00
m_textNames[l].SetEffectGlowBlink(0.1f);
m_textScores[l].SetEffectGlowBlink(0.1f);
}
else
{
m_textNames[l].SetEffectNone();
m_textScores[l].SetEffectNone();
2003-01-27 02:00:38 +00:00
}
2003-01-26 07:33:03 +00:00
}
}
2003-12-28 08:20:48 +00:00
return SECONDS_PER_PAGE;
2004-05-02 03:01:27 +00:00
case PAGE_TYPE_ALL_STEPS:
{
2004-07-12 02:19:24 +00:00
m_textStepsType.SetText( GameManager::StepsTypeToThemedString(pts.nt) );
for( unsigned s=0; s<m_vScoreRowItem.size(); s++ )
{
ScoreRowItem &item = m_vScoreRowItem[s];
const Song* pSong = item.m_pSong;
item.m_textTitle.SetText( pSong->GetFullDisplayTitle() );
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
2003-12-28 08:20:48 +00:00
{
const Steps* pSteps = pSong->GetStepsByDifficulty( pts.nt, *iter, false );
BitmapText* pTextStepsScore = &item.m_textScore[*iter];
if( pSteps == NULL )
{
2003-12-28 08:20:48 +00:00
pTextStepsScore->SetHidden( true );
}
else
{
HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetStepsHighScoreList(pSong,pSteps);
2004-02-09 06:26:13 +00:00
HighScore hs = hsl.GetTopScore();
2003-12-28 08:20:48 +00:00
bool bRecentHighScore = false;
2004-02-09 06:26:13 +00:00
if( !hsl.vHighScores.empty() )
2003-12-28 08:20:48 +00:00
{
2004-02-09 06:26:13 +00:00
hs = hsl.GetTopScore();
const CString *psName = &hsl.GetTopScore().sName;
2003-12-28 08:20:48 +00:00
bRecentHighScore = find( GAMESTATE->m_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end();
}
2003-12-24 23:38:56 +00:00
else
2003-12-28 08:20:48 +00:00
{
hs.sName = NO_SCORE_NAME;
}
CString s = hs.GetDisplayName() + "\n" + PercentageDisplay::FormatPercentScore( hs.fPercentDP );
2003-12-28 08:20:48 +00:00
pTextStepsScore->SetText( s );
}
}
}
}
2003-12-28 08:20:48 +00:00
return m_ListScoreRowItems.GetSecondsForCompleteScrollThrough();
2004-05-02 03:01:27 +00:00
case PAGE_TYPE_ALL_COURSES:
2004-01-29 01:46:08 +00:00
{
2004-07-12 02:19:24 +00:00
m_textStepsType.SetText( GameManager::StepsTypeToThemedString(pts.nt) );
2004-01-29 01:46:08 +00:00
for( unsigned c=0; c<m_vScoreRowItem.size(); c++ )
2004-01-29 01:46:08 +00:00
{
ScoreRowItem &item = m_vScoreRowItem[c];
const Course* pCourse = item.m_pCourse;
2004-01-29 01:46:08 +00:00
item.m_textTitle.SetText( pCourse->GetFullDisplayTitle() );
2004-05-20 22:27:45 +00:00
FOREACH_ShownCourseDifficulty( cd )
2004-01-29 01:46:08 +00:00
{
BitmapText* pTextStepsScore = &item.m_textScore[cd];
2004-06-03 20:47:37 +00:00
2004-05-23 09:17:10 +00:00
Trail *pTrail = pCourse->GetTrail( pts.nt, cd );
2004-06-03 20:47:37 +00:00
pTextStepsScore->SetHidden( pTrail==NULL );
if( pTrail == NULL )
continue;
2004-05-23 09:17:10 +00:00
const HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList( pCourse, pTrail );
2004-01-29 01:46:08 +00:00
2004-02-09 06:26:13 +00:00
HighScore hs;
2004-01-29 01:46:08 +00:00
bool bRecentHighScore = false;
2004-02-09 06:26:13 +00:00
if( !hsl.vHighScores.empty() )
2004-01-29 01:46:08 +00:00
{
2004-02-09 06:26:13 +00:00
hs = hsl.vHighScores[0];
const CString *psName = &hsl.GetTopScore().sName;
2004-01-29 01:46:08 +00:00
bRecentHighScore = find( GAMESTATE->m_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end();
}
else
{
hs.sName = NO_SCORE_NAME;
}
CString s = hs.GetDisplayName() + "\n" + PercentageDisplay::FormatPercentScore( hs.fPercentDP );
2004-01-29 01:46:08 +00:00
pTextStepsScore->SetText( s );
}
}
}
return m_ListScoreRowItems.GetSecondsForCompleteScrollThrough();
2003-01-26 07:33:03 +00:00
default:
ASSERT(0);
2003-12-28 08:20:48 +00:00
return 0;
2003-01-26 07:33:03 +00:00
}
2003-01-26 20:49:05 +00:00
}
void ScreenRanking::TweenPageOffScreen()
{
2003-12-28 08:20:48 +00:00
OFF_COMMAND( m_Banner );
2003-12-18 20:26:48 +00:00
OFF_COMMAND( m_sprBannerFrame );
OFF_COMMAND( m_textCourseTitle );
2003-11-02 16:32:45 +00:00
OFF_COMMAND( m_textCategory );
2003-12-28 08:20:48 +00:00
OFF_COMMAND( m_textStepsType );
2004-05-02 03:01:27 +00:00
OFF_COMMAND( m_sprPageType );
2003-10-22 09:45:23 +00:00
2003-12-28 08:20:48 +00:00
for( int l=0; l<NUM_RANKING_LINES; l++ )
2003-01-26 07:33:03 +00:00
{
2003-12-28 08:20:48 +00:00
OFF_COMMAND( m_sprBullets[l] );
OFF_COMMAND( m_textNames[l] );
OFF_COMMAND( m_textScores[l] );
OFF_COMMAND( m_textPoints[l] );
OFF_COMMAND( m_textTime[l] );
}
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter )
2003-12-28 08:20:48 +00:00
{
if( !m_sprDifficulty[*iter]->GetHidden() )
OFF_COMMAND( m_sprDifficulty[*iter] );
2003-01-26 07:33:03 +00:00
}
2004-05-20 22:27:45 +00:00
FOREACH_ShownCourseDifficulty(d)
2004-01-29 09:24:56 +00:00
{
2004-06-11 08:52:41 +00:00
if( !m_sprCourseDifficulty[d]->GetHidden() )
2004-01-29 09:24:56 +00:00
OFF_COMMAND( m_sprCourseDifficulty[d] );
}
if( !m_ListScoreRowItems.GetHidden() )
OFF_COMMAND( m_ListScoreRowItems );
2003-01-26 07:33:03 +00:00
}
2004-06-08 05:22:33 +00:00
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/