Files
itgmania212121/stepmania/src/ScreenCredits.cpp
T

304 lines
10 KiB
C++
Raw Normal View History

2003-04-03 22:10:40 +00:00
#include "global.h"
#include "ScreenCredits.h"
2004-07-08 00:10:34 +00:00
#include "GameSoundManager.h"
2003-04-03 22:10:40 +00:00
#include "RageLog.h"
#include "SongManager.h"
#include "ThemeManager.h"
#include "AnnouncerManager.h"
#include "Sprite.h"
2003-04-06 15:54:22 +00:00
#include "song.h"
2003-04-03 22:10:40 +00:00
#include "BitmapText.h"
#include "ActorUtil.h"
#include "SongUtil.h"
2003-04-03 22:10:40 +00:00
2004-01-17 23:14:56 +00:00
#define BACKGROUNDS_SPACING_X THEME->GetMetricF("ScreenCredits","BackgroundsSpacingX")
#define BACKGROUNDS_SPACING_Y THEME->GetMetricF("ScreenCredits","BackgroundsSpacingY")
#define BACKGROUNDS_SCROLL_SECONDS_PER_ITEM THEME->GetMetricF("ScreenCredits","BackgroundsScrollSecondsPerItem")
#define BACKGROUNDS_WIDTH THEME->GetMetricF("ScreenCredits","BackgroundsWidth")
#define BACKGROUNDS_HEIGHT THEME->GetMetricF("ScreenCredits","BackgroundsHeight")
#define TEXTS_COLOR_INTRO THEME->GetMetricC("ScreenCredits","TextsColorIntro")
#define TEXTS_COLOR_HEADER THEME->GetMetricC("ScreenCredits","TextsColorHeader")
#define TEXTS_COLOR_NORMAL THEME->GetMetricC("ScreenCredits","TextsColorNormal")
#define TEXTS_ZOOM THEME->GetMetricF("ScreenCredits","TextsZoom")
#define TEXTS_SPACING_X THEME->GetMetricF("ScreenCredits","TextsSpacingX")
#define TEXTS_SPACING_Y THEME->GetMetricF("ScreenCredits","TextsSpacingY")
#define TEXTS_SCROLL_SECONDS_PER_ITEM THEME->GetMetricF("ScreenCredits","TextsScrollSecondsPerItem")
2003-04-03 22:10:40 +00:00
const int NUM_BACKGROUNDS = 20;
struct CreditLine
{
int colorIndex;
const char* text;
};
static const CreditLine CREDIT_LINES[] =
2003-04-03 22:10:40 +00:00
{
{1,"STEPMANIA TEAM"},
{0,""},
{0,""},
{0,""},
{2,"☆☆GRAPHICS☆☆"},
2003-10-17 15:56:02 +00:00
{0,"Lucas “v1ral” Tang"},
2003-10-22 22:10:37 +00:00
// "Who?" = "what is this person's real name", not "what did they do".
// Who knows? Some people might not want to reveal their real name. - Friez.
2004-01-17 23:14:56 +00:00
// Several people have requested that their real names not be shown. -Chris
// This isn't a good place to keep a master list of contributors because
// it's not a very complete list. -Chris
2003-10-22 22:10:37 +00:00
{0,"SPiGuMuS"}, // who?
2003-10-17 15:56:02 +00:00
{0,"Visage"}, // who? makes para para theme graphics for me, wants to do BM and IIDX graphics too. - Friez
{0,"Ryan “DJ McFox” McKanna"},
2003-10-17 15:56:02 +00:00
{0,"Lamden “Cloud34” Travis"}, // ddrmaniax admin / did a graphic or two for me - friez
{0,"Michael “Redcrusher” Curry"}, // ez2 graphics - friez
{0,"Steve “healing_vision” Klise"},
2003-04-03 22:10:40 +00:00
{0,"Mauro Panichella"},
2003-10-22 22:10:37 +00:00
{0,"Popnko"}, // who? makes popnmusic graphics for me - Friez
{0,"Griever (Julian)"}, // who?
{0,"Miguel Moore"},
{0,"Dj “AeON ExOdus” Washington"},
2003-10-22 22:10:37 +00:00
{0,"Xelf"}, // who?
{0,"James “SPDS” Sanders"},
{0,"k0ldx"}, // who?
2003-04-03 22:10:40 +00:00
{0,""},
{0,""},
{0,""},
{2,"☆☆WEB DESIGN☆☆"},
{0,"Brian “Bork” Bugh"},
2003-04-03 22:10:40 +00:00
{0,""},
{0,""},
{0,""},
{2,"☆☆SOUND☆☆"},
{0,"Kyle “KeeL” Ward"},
{0,"Jim “Izlude” Cabeen"},
2003-04-03 22:10:40 +00:00
{0,""},
{0,""},
{0,""},
{2,"☆☆PROGRAMMING☆☆"},
{0,"Chris Danford"},
2003-12-14 08:11:05 +00:00
{0,"Frieza"},
2003-04-03 22:10:40 +00:00
{0,"Glenn Maynard"},
{0,"Bruno Figueiredo"},
{0,"Peter “Dro Kulix” May"},
{0,"Jared “nmspaz” Roberts"},
{0,"Brendan “binarys” Walker"},
{0,"Lance “Neovanglist” Gilbert"},
2003-04-03 22:10:40 +00:00
{0,"Michel Donais"},
{0,"Ben “Mantis” Nordstrom"},
{0,"Chris “Parasyte” Gomez"},
{0,"Michael “dirkthedaring” Patterson"},
{0,"Sauleil “angedelamort” Lamarre"},
2003-10-17 15:56:02 +00:00
2003-04-03 22:10:40 +00:00
{0,"Edwin Evans"},
{0,"Brian “Bork” Bugh"},
{0,"Joel “Elvis314” Maher"},
{0,"Garth “Kefabi” Smith"},
{0,"Pkillah"}, // who?
{0,"Ryan “DJ McFox” McKanna"},
2003-04-03 22:10:40 +00:00
{0,"Robert Kemmetmueller"},
{0,"Ben “Shabach” Andersen"},
{0,"Will “SlinkyWizard” Valladao"},
{0,"TheChip"}, // who?
2003-10-17 15:56:02 +00:00
{0,"David “WarriorBob” H"}, // who? // He does documentation on Stepmania when a release comes out. Thats who - Frieza
2003-04-03 22:10:40 +00:00
{0,"Mike Waltson"},
{0,"Kevin “Miryokuteki” Slaughter"},
{0,"Thad “Coderjoe” Ward"},
2003-09-06 10:53:26 +00:00
{0,"Steve Checkoway"},
2003-09-08 22:21:57 +00:00
{0,"Sean Burke"},
2003-11-15 06:06:43 +00:00
{0,"XPort"},
2004-09-20 05:53:31 +00:00
{0,"Charles Lohr"},
2004-09-20 05:39:47 +00:00
{0,"Josh “Axlecrusher” Allen"},
2003-04-03 22:10:40 +00:00
{0,""},
{0,""},
{0,""},
{2,"☆☆SPECIAL THANKS TO☆☆"},
2003-10-17 15:56:02 +00:00
{0,"SimWolf"}, // dwi
{0,"DJ DraftHorse"}, // also dwi
{0,"Dance With Intensity"}, // DWI!
2003-04-03 22:10:40 +00:00
{0,"BeMaNiRuler"},
{0,"DDRLlama"},
2003-10-17 15:56:02 +00:00
{0,"DDRManiaX"}, // boards and all round support
2003-04-03 22:10:40 +00:00
{0,"NMR"},
{0,"DJ Paranoia"}, // pop'n stuff, general help - friez
{0,"DJ Yuz"}, // same as above
{0,"Reo"}, // pop'n stuff.
2003-10-17 15:56:02 +00:00
{0,"Random Hajile"}, // sent me 3DDX stuff - friez
{0,"Chocobo Ghost"}, // sent me ez2 stuff - friez
{0,"Tyma"}, // sent me popnmusic stuff - friez
2003-12-04 04:28:19 +00:00
{0,"Deluxe"}, // para para noteskins - friez
2003-04-03 22:10:40 +00:00
{0,"Lagged"},
{0,"The Melting Pot"},
{0,"DDRJamz Global BBS"},
{0,"Eric “WaffleKing” Webster"},
{0,"Gotetsu"},
{0,"Mark “Foobly” Verrey"},
2003-04-03 22:10:40 +00:00
{0,"Mandarin Blue"},
// {0,"SailorBob"}, // isnt this the same as warrior bob? // I think so. -Chris
{0,"Kenny “AngelTK” Lai"},
2003-07-16 05:40:19 +00:00
{0,"curewater"},
2003-10-08 22:03:54 +00:00
{0,"Bill “DMAshura” Shillito"},
2003-04-03 22:10:40 +00:00
{0,"Illusionz - Issaquah, WA"},
{0,"Quarters - Kirkland, WA"},
2003-10-17 15:56:02 +00:00
{0,"Pier Amusements - Bournemouth, UK"}, // Pump inspiration
{0,"Westcliff Amusements - Bournemouth, UK"}, // Ez2dancer inspiriation
2003-04-03 22:10:40 +00:00
{0,"Naoki"},
{0,"Konami Computer Entertainment Japan"},
{0,""},
{0,""},
{0,""},
{0,""},
{0,""},
{0,""},
{0,""},
{0,""},
{1,"Join the StepMania team"},
{1,"and help us out!"},
};
2004-11-26 17:28:47 +00:00
REGISTER_SCREEN_CLASS( ScreenCredits );
ScreenCredits::ScreenCredits( CString sName ) : ScreenAttract( sName )
2003-04-03 22:10:40 +00:00
{
vector<Song*> arraySongs;
SONGMAN->GetSongs( arraySongs );
SongUtil::SortSongPointerArrayByTitle( arraySongs );
2003-04-03 22:10:40 +00:00
2004-02-01 03:14:37 +00:00
// FIXME: Redo this screen with a BGA
2004-02-18 05:47:14 +00:00
m_ScrollerBackgrounds.SetName( "Backgrounds" );
m_ScrollerBackgrounds.Load(
BACKGROUNDS_SCROLL_SECONDS_PER_ITEM,
4,
RageVector3(0, 0, 0),
RageVector3(0, 0, 0),
RageVector3(BACKGROUNDS_SPACING_X, BACKGROUNDS_SPACING_Y, 0),
RageVector3(0, 0, 0) );
SET_XY( m_ScrollerBackgrounds );
this->AddChild( &m_ScrollerBackgrounds );
m_ScrollerFrames.SetName( "Backgrounds" );
m_ScrollerFrames.Load(
BACKGROUNDS_SCROLL_SECONDS_PER_ITEM,
4,
RageVector3(0, 0, 0),
RageVector3(0, 0, 0),
RageVector3(BACKGROUNDS_SPACING_X, BACKGROUNDS_SPACING_Y, 0),
RageVector3(0, 0, 0) );
SET_XY( m_ScrollerFrames );
this->AddChild( &m_ScrollerFrames );
2003-04-03 22:10:40 +00:00
2004-02-18 05:47:14 +00:00
float fTime = 0;
2003-04-03 22:10:40 +00:00
{
2004-01-17 23:14:56 +00:00
for( int i=0; i<NUM_BACKGROUNDS; i++ )
2003-04-03 22:10:40 +00:00
{
2004-01-17 23:14:56 +00:00
Song* pSong = NULL;
for( int j=0; j<50; j++ )
{
pSong = arraySongs[ rand()%arraySongs.size() ];
if( pSong->HasBackground() )
break;
}
Sprite* pBackground = new Sprite;
2005-02-06 03:32:53 +00:00
pBackground->LoadBG( pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathG("Common","fallback background") );
2004-01-17 23:14:56 +00:00
pBackground->ScaleToClipped( BACKGROUNDS_WIDTH, BACKGROUNDS_HEIGHT );
m_ScrollerBackgrounds.AddChild( pBackground );
Sprite* pFrame = new Sprite;
2005-02-06 03:32:53 +00:00
pFrame->Load( THEME->GetPathG("ScreenCredits","background frame") );
2004-01-17 23:14:56 +00:00
m_ScrollerFrames.AddChild( pFrame );
2003-04-03 22:10:40 +00:00
}
2004-02-18 05:47:14 +00:00
const int iFirst = -2, iLast = NUM_BACKGROUNDS+2;
m_ScrollerBackgrounds.SetCurrentAndDestinationItem( iFirst );
m_ScrollerBackgrounds.SetDestinationItem( iLast );
m_ScrollerFrames.SetCurrentAndDestinationItem( iFirst );
m_ScrollerFrames.SetDestinationItem( iLast );
fTime = max( fTime, BACKGROUNDS_SCROLL_SECONDS_PER_ITEM*(iLast-iFirst) );
2003-04-03 22:10:40 +00:00
}
2004-01-17 23:14:56 +00:00
2004-02-18 05:47:14 +00:00
m_ScrollerTexts.SetName( "Texts" );
m_ScrollerTexts.Load(
TEXTS_SCROLL_SECONDS_PER_ITEM,
40,
RageVector3(0, 0, 0),
RageVector3(0, 0, 0),
RageVector3(TEXTS_SPACING_X, TEXTS_SPACING_Y, 0),
RageVector3(0, 0, 0) );
SET_XY( m_ScrollerTexts );
2003-04-03 22:10:40 +00:00
this->AddChild( &m_ScrollerTexts );
2004-01-17 23:14:56 +00:00
{
2004-01-26 01:20:12 +00:00
for( unsigned i=0; i<ARRAYSIZE(CREDIT_LINES); i++ )
2004-01-17 23:14:56 +00:00
{
BitmapText* pText = new BitmapText;
2005-02-06 03:32:53 +00:00
pText->LoadFromFont( THEME->GetPathF("ScreenCredits","titles") );
2004-01-17 23:14:56 +00:00
pText->SetText( CREDIT_LINES[i].text );
switch( CREDIT_LINES[i].colorIndex )
{
case 1: pText->SetDiffuse( TEXTS_COLOR_INTRO ); break;
case 2: pText->SetDiffuse( TEXTS_COLOR_HEADER ); break;
case 0: pText->SetDiffuse( TEXTS_COLOR_NORMAL ); break;
default: ASSERT(0);
}
pText->SetZoom( TEXTS_ZOOM );
m_ScrollerTexts.AddChild( pText );
}
2004-02-18 05:47:14 +00:00
const int iFirst = -10, iLast = ARRAYSIZE(CREDIT_LINES)+10;
m_ScrollerTexts.SetCurrentAndDestinationItem( iFirst );
m_ScrollerTexts.SetDestinationItem( iLast );
fTime = max( fTime, TEXTS_SCROLL_SECONDS_PER_ITEM*(iLast-iFirst) );
2004-01-17 23:14:56 +00:00
}
2005-02-06 03:32:53 +00:00
m_Overlay.LoadFromAniDir( THEME->GetPathB("ScreenCredits","overlay") );
m_Overlay.PlayCommand( "On" );
2003-04-03 22:10:40 +00:00
this->AddChild( &m_Overlay );
this->MoveToTail( &m_In ); // put it in the back so it covers up the stuff we just added
this->MoveToTail( &m_Out ); // put it in the back so it covers up the stuff we just added
2003-04-03 22:10:40 +00:00
this->ClearMessageQueue( SM_BeginFadingOut ); // ignore ScreenAttract's SecsToShow
2004-02-18 05:47:14 +00:00
this->PostScreenMessage( SM_BeginFadingOut, fTime );
// this->PostScreenMessage( SM_BeginFadingOut, m_Background.GetLengthSeconds() );
2003-07-26 22:53:22 +00:00
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("credits") );
2003-04-03 22:10:40 +00:00
}
ScreenCredits::~ScreenCredits()
{
2004-01-17 23:14:56 +00:00
m_ScrollerBackgrounds.DeleteAllChildren();
m_ScrollerFrames.DeleteAllChildren();
m_ScrollerTexts.DeleteAllChildren();
2003-04-03 22:10:40 +00:00
}
void ScreenCredits::HandleScreenMessage( const ScreenMessage SM )
{
ScreenAttract::HandleScreenMessage( SM );
2003-04-03 22:10:40 +00:00
}
2004-06-08 05:22:33 +00:00
/*
* (c) 2003-2004 Chris Danford, Glenn Maynard
* 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.
*/