2003-04-05 03:49:03 +00:00
|
|
|
#include "global.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenHowToPlay
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenHowToPlay.h"
|
|
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "GameDef.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "SongManager.h"
|
|
|
|
|
#include "NoteFieldPositioning.h"
|
2003-05-26 09:18:44 +00:00
|
|
|
#include "GameManager.h"
|
2003-04-05 03:49:03 +00:00
|
|
|
|
2003-05-26 09:18:44 +00:00
|
|
|
#define SONG_BPM THEME->GetMetricF("ScreenHowToPlay","SongBPM")
|
2003-05-19 08:18:21 +00:00
|
|
|
#define SECONDS_TO_SHOW THEME->GetMetricF("ScreenHowToPlay","SecondsToShow")
|
2003-04-05 03:49:03 +00:00
|
|
|
|
|
|
|
|
ScreenHowToPlay::ScreenHowToPlay() : ScreenAttract("ScreenHowToPlay")
|
|
|
|
|
{
|
2003-05-09 00:18:37 +00:00
|
|
|
switch(GAMESTATE->m_CurGame) // which style should we use to demonstrate?
|
|
|
|
|
{
|
2003-05-26 09:18:44 +00:00
|
|
|
case GAME_DANCE: GAMESTATE->m_CurStyle = STYLE_DANCE_SINGLE; break;
|
|
|
|
|
case GAME_PUMP: GAMESTATE->m_CurStyle = STYLE_PUMP_SINGLE; break;
|
|
|
|
|
case GAME_EZ2: GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE; break;
|
|
|
|
|
case GAME_PARA: GAMESTATE->m_CurStyle = STYLE_PARA_SINGLE; break;
|
|
|
|
|
case GAME_DS3DDX: GAMESTATE->m_CurStyle = STYLE_DS3DDX_SINGLE; break;
|
|
|
|
|
case GAME_BM: GAMESTATE->m_CurStyle = STYLE_BM_SINGLE; break;
|
|
|
|
|
default: ASSERT(0); // we should cover all gametypes....
|
2003-05-09 00:18:37 +00:00
|
|
|
}
|
2003-04-05 03:49:03 +00:00
|
|
|
|
2003-05-26 09:18:44 +00:00
|
|
|
NotesType nt = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
|
|
|
|
|
int iNumOfTracks = GAMEMAN->NotesTypeToNumTracks( nt );
|
|
|
|
|
|
|
|
|
|
ASSERT(iNumOfTracks > 0); // crazy to have less than 1 track....
|
|
|
|
|
|
2003-04-05 03:49:03 +00:00
|
|
|
m_LifeMeter.Load( PLAYER_1 );
|
|
|
|
|
m_LifeMeter.SetXY( 480, 40 );
|
|
|
|
|
this->AddChild( &m_LifeMeter );
|
|
|
|
|
|
|
|
|
|
NoteData* pND = new NoteData;
|
2003-05-09 00:18:37 +00:00
|
|
|
pND->SetNumTracks( iNumOfTracks );
|
2003-04-05 03:49:03 +00:00
|
|
|
pND->SetTapNote( 0, ROWS_PER_BEAT*12, TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 1, ROWS_PER_BEAT*16, TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 2, ROWS_PER_BEAT*20, TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 0, ROWS_PER_BEAT*24, TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 3, ROWS_PER_BEAT*24, TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 0, ROWS_PER_BEAT*28, TAP_TAP );
|
2003-04-05 21:18:31 +00:00
|
|
|
pND->AddHoldNote( HoldNote(2, 32, 35) );
|
|
|
|
|
pND->AddHoldNote( HoldNote(0, 36, 39) );
|
|
|
|
|
pND->AddHoldNote( HoldNote(3, 36, 39) );
|
|
|
|
|
pND->AddHoldNote( HoldNote(2, 40, 43) );
|
|
|
|
|
pND->SetTapNote( 0, ROWS_PER_BEAT*44, TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 1, (int)(ROWS_PER_BEAT*44.5f), TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 2, ROWS_PER_BEAT*45, TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 3, (int)(ROWS_PER_BEAT*45.5f), TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 0, ROWS_PER_BEAT*46, TAP_TAP );
|
|
|
|
|
pND->SetTapNote( 2, ROWS_PER_BEAT*46, TAP_TAP );
|
2003-04-05 03:49:03 +00:00
|
|
|
|
|
|
|
|
m_pSong = new Song;
|
2003-05-26 09:18:44 +00:00
|
|
|
float fSongBPM = SONG_BPM; // need this on a separate line, otherwise VC6 release build screws up and returns 0
|
|
|
|
|
m_pSong->AddBPMSegment( BPMSegment(0.0,fSongBPM) );
|
2003-05-19 08:18:21 +00:00
|
|
|
m_pSong->AddStopSegment( StopSegment(15,2) );
|
2003-04-05 03:49:03 +00:00
|
|
|
m_pSong->AddStopSegment( StopSegment(16,2) );
|
|
|
|
|
m_pSong->AddStopSegment( StopSegment(20,2) );
|
|
|
|
|
m_pSong->AddStopSegment( StopSegment(24,2) );
|
|
|
|
|
m_pSong->AddStopSegment( StopSegment(28,2) );
|
2003-05-19 08:18:21 +00:00
|
|
|
|
2003-04-05 03:49:03 +00:00
|
|
|
GAMESTATE->m_pCurSong = m_pSong;
|
|
|
|
|
GAMESTATE->m_bPastHereWeGo = true;
|
2003-04-21 02:41:10 +00:00
|
|
|
GAMESTATE->m_PlayerController[PLAYER_1] = PC_AUTOPLAY;
|
2003-05-19 08:18:21 +00:00
|
|
|
m_Player.Load( PLAYER_1, pND, &m_LifeMeter, NULL, NULL, NULL );
|
|
|
|
|
|
2003-04-05 03:49:03 +00:00
|
|
|
m_Player.SetX( 480 );
|
2003-05-19 08:47:10 +00:00
|
|
|
m_Player.DontShowJudgement();
|
2003-04-05 03:49:03 +00:00
|
|
|
this->AddChild( &m_Player );
|
|
|
|
|
|
|
|
|
|
delete pND;
|
|
|
|
|
|
|
|
|
|
m_fFakeSecondsIntoSong = 0;
|
2003-05-19 08:18:21 +00:00
|
|
|
this->ClearMessageQueue();
|
|
|
|
|
this->PostScreenMessage( SM_BeginFadingOut, SECONDS_TO_SHOW );
|
2003-04-05 03:49:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScreenHowToPlay::~ScreenHowToPlay()
|
|
|
|
|
{
|
|
|
|
|
delete m_pSong;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenHowToPlay::Update( float fDelta )
|
|
|
|
|
{
|
|
|
|
|
m_fFakeSecondsIntoSong += fDelta;
|
|
|
|
|
GAMESTATE->UpdateSongPosition( m_fFakeSecondsIntoSong );
|
2003-05-19 08:18:21 +00:00
|
|
|
|
2003-04-05 03:49:03 +00:00
|
|
|
ScreenAttract::Update( fDelta );
|
2003-05-19 08:18:21 +00:00
|
|
|
}
|
2003-05-26 09:18:44 +00:00
|
|
|
|
|
|
|
|
void ScreenHowToPlay::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
|
|
|
|
case SM_BeginFadingOut:
|
|
|
|
|
GAMESTATE->m_pCurSong = NULL;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
ScreenAttract::HandleScreenMessage( SM );
|
|
|
|
|
}
|