big checkin - new noteskin format and XY positioning. I probably broke a lot of things.
This commit is contained in:
@@ -159,8 +159,8 @@ CString AnnouncerManager::GetPathTo( AnnouncerElement ae, CString sAnnouncerName
|
||||
case ANNOUNCER_STAGE_4: sAssetDir = "stage 4"; break;
|
||||
case ANNOUNCER_STAGE_5: sAssetDir = "stage 5"; break;
|
||||
case ANNOUNCER_STAGE_FINAL: sAssetDir = "stage final"; break;
|
||||
case ANNOUNCER_STAGE_EXTRA: sAssetDir = "stage extra"; break;
|
||||
case ANNOUNCER_STAGE_ANOTHER_EXTRA: sAssetDir = "stage another extra"; break;
|
||||
case ANNOUNCER_STAGE_EXTRA1: sAssetDir = "stage extra1"; break;
|
||||
case ANNOUNCER_STAGE_EXTRA2: sAssetDir = "stage extra2"; break;
|
||||
case ANNOUNCER_STAGE_ONI: sAssetDir = "stage oni"; break;
|
||||
case ANNOUNCER_STAGE_ENDLESS: sAssetDir = "stage endless"; break;
|
||||
case ANNOUNCER_TITLE_MENU_ATTRACT: sAssetDir = "title menu attract"; break;
|
||||
@@ -169,5 +169,7 @@ CString AnnouncerManager::GetPathTo( AnnouncerElement ae, CString sAnnouncerName
|
||||
default: ASSERT(0); // Unhandled Announcer element
|
||||
}
|
||||
|
||||
return GetAnnouncerDirFromName( sAnnouncerName ) + sAssetDir;
|
||||
CString sFullDir = GetAnnouncerDirFromName( sAnnouncerName ) + sAssetDir;
|
||||
ASSERT( DoesFileExist(sFullDir) ); // the announcer directory doesn't exist. Did we type the name wrong above?
|
||||
return sFullDir;
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ enum AnnouncerElement {
|
||||
ANNOUNCER_STAGE_4,
|
||||
ANNOUNCER_STAGE_5,
|
||||
ANNOUNCER_STAGE_FINAL,
|
||||
ANNOUNCER_STAGE_EXTRA,
|
||||
ANNOUNCER_STAGE_ANOTHER_EXTRA,
|
||||
ANNOUNCER_STAGE_EXTRA1,
|
||||
ANNOUNCER_STAGE_EXTRA2,
|
||||
ANNOUNCER_STAGE_ONI,
|
||||
ANNOUNCER_STAGE_ENDLESS,
|
||||
ANNOUNCER_TITLE_MENU_ATTRACT,
|
||||
|
||||
@@ -9,20 +9,21 @@
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "ArrowEffects.h"
|
||||
#include "Notes.h"
|
||||
#include "ColorNote.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "GameManager.h"
|
||||
#include "GameState.h"
|
||||
#include "RageException.h"
|
||||
#include "RageTimer.h"
|
||||
#include "NoteDisplay.h"
|
||||
|
||||
|
||||
float ArrowGetYOffset( const PlayerNumber pn, float fStepIndex )
|
||||
float ArrowGetYOffset2( const PlayerNumber pn, float fNoteBeat )
|
||||
{
|
||||
float fSongBeat = GAMESTATE->m_fSongBeat;
|
||||
float fBeatsUntilStep = NoteRowToBeat( fStepIndex ) - fSongBeat;
|
||||
float fBeatsUntilStep = fNoteBeat - fSongBeat;
|
||||
float fYOffset = fBeatsUntilStep * ARROW_GAP;
|
||||
switch( GAMESTATE->m_PlayerOptions[pn].m_EffectType )
|
||||
{
|
||||
@@ -36,7 +37,7 @@ float ArrowGetYOffset( const PlayerNumber pn, float fStepIndex )
|
||||
return fYOffset;
|
||||
}
|
||||
|
||||
float ArrowGetXPos( const PlayerNumber pn, int iColNum, float fYOffset )
|
||||
float ArrowGetXPos2( const PlayerNumber pn, int iColNum, float fYPos )
|
||||
{
|
||||
float fSongBeat = GAMESTATE->m_fSongBeat;
|
||||
float fPixelOffsetFromCenter = GAMESTATE->GetCurrentStyleDef()->m_ColumnInfo[PLAYER_1][iColNum].fXOffset;
|
||||
@@ -44,7 +45,7 @@ float ArrowGetXPos( const PlayerNumber pn, int iColNum, float fYOffset )
|
||||
switch( GAMESTATE->m_PlayerOptions[pn].m_EffectType )
|
||||
{
|
||||
case PlayerOptions::EFFECT_DRUNK:
|
||||
fPixelOffsetFromCenter += cosf( TIMER->GetTimeSinceStart() + iColNum*0.2f + fYOffset*6/SCREEN_HEIGHT) * ARROW_SIZE*0.5f;
|
||||
fPixelOffsetFromCenter += cosf( TIMER->GetTimeSinceStart() + iColNum*0.2f + fYPos*6/SCREEN_HEIGHT) * ARROW_SIZE*0.5f;
|
||||
break;
|
||||
}
|
||||
return fPixelOffsetFromCenter;
|
||||
@@ -85,10 +86,10 @@ float ArrowGetAlpha( const PlayerNumber pn, float fYPos )
|
||||
fAlpha = 1;
|
||||
break;
|
||||
case PlayerOptions::APPEARANCE_HIDDEN:
|
||||
fAlpha = ((bReverse?-fYPos:fYPos)-100)/200;
|
||||
fAlpha = ((bReverse?-fYPos:fYPos)-100)/100;
|
||||
break;
|
||||
case PlayerOptions::APPEARANCE_SUDDEN:
|
||||
fAlpha = ((SCREEN_HEIGHT-(bReverse?-fYPos:fYPos))-260)/200;
|
||||
fAlpha = ((SCREEN_HEIGHT-(bReverse?-fYPos:fYPos))-260)/100;
|
||||
break;
|
||||
case PlayerOptions::APPEARANCE_STEALTH:
|
||||
fAlpha = 0;
|
||||
@@ -138,7 +139,7 @@ float ArrowGetAlpha( const PlayerNumber pn, float fYPos )
|
||||
else if( bReverse && fYPos > 0 )
|
||||
fAlpha = 1;
|
||||
|
||||
return fAlpha;
|
||||
return clamp( fAlpha, 0, 1 );
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: ArrowEffects.h
|
||||
@@ -9,24 +10,18 @@
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef _ArrowEffects_H_
|
||||
#define _ArrowEffects_H_
|
||||
|
||||
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "StyleDef.h"
|
||||
|
||||
const int ARROW_SIZE = 64;
|
||||
const float ARROW_GAP = ARROW_SIZE;// + 2;
|
||||
|
||||
|
||||
// fYOffset is a vertical position in pixels relative to the center.
|
||||
// (positive if has not yet been stepped on, negative if has already passed).
|
||||
// The ArrowEffect is applied in this stage.
|
||||
float ArrowGetYOffset( const PlayerNumber pn, float fStepIndex );
|
||||
|
||||
|
||||
// fXPos is a horizontal position in pixels relative to the center of the field.
|
||||
// This depends on the column of the arrow and possibly the Arrow effect and
|
||||
// fYOffset (in the case of EFFECT_DRUNK).
|
||||
float ArrowGetXPos( const PlayerNumber pn, int iCol, float fYOffset );
|
||||
float ArrowGetYOffset2( const PlayerNumber pn, float fNoteBeat );
|
||||
|
||||
|
||||
// fRotation is Z rotation of an arrow. This will depend on the column of
|
||||
@@ -41,9 +36,13 @@ float ArrowGetRotation( const PlayerNumber pn, int iCol, float fYOffset );
|
||||
float ArrowGetYPos( const PlayerNumber pn, float fYOffset );
|
||||
|
||||
|
||||
// fXPos is a horizontal position in pixels relative to the center of the field.
|
||||
// This depends on the column of the arrow and possibly the Arrow effect and
|
||||
// fYPos (in the case of EFFECT_DRUNK).
|
||||
float ArrowGetXPos2( const PlayerNumber pn, int iCol, float fYPos );
|
||||
|
||||
|
||||
// fAlpha is the transparency of the arrow. It depends on fYPos and the
|
||||
// ArrowAppearance.
|
||||
float ArrowGetAlpha( const PlayerNumber pn, float fYPos );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@ BPMDisplay::BPMDisplay()
|
||||
m_rectFrame.SetZoomX( 120 );
|
||||
m_rectFrame.SetZoomY( 40 );
|
||||
|
||||
m_textBPM.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textBPM.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textBPM.TurnShadowOff();
|
||||
m_textBPM.SetXY( CENTER_X, SCREEN_HEIGHT - 50 );
|
||||
//m_textBPM.SetSequence( ssprintf("999") );
|
||||
@@ -35,7 +35,7 @@ BPMDisplay::BPMDisplay()
|
||||
m_textBPM.SetDiffuseColorTopEdge( D3DXCOLOR(1,1,0,1) ); // yellow
|
||||
m_textBPM.SetDiffuseColorBottomEdge( D3DXCOLOR(1,0.5f,0,1) ); // orange
|
||||
|
||||
m_textLabel.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textLabel.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textLabel.TurnShadowOff();
|
||||
m_textLabel.SetXY( 34, 2 );
|
||||
m_textLabel.SetText( "BPM" );
|
||||
|
||||
@@ -59,10 +59,10 @@ Background::Background()
|
||||
|
||||
m_sprDanger.SetZoom( 2 );
|
||||
m_sprDanger.SetEffectWagging();
|
||||
m_sprDanger.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_DANGER_TEXT) );
|
||||
m_sprDanger.Load( THEME->GetPathTo("Graphics","gameplay danger text") );
|
||||
m_sprDanger.SetXY( CENTER_X, CENTER_Y );
|
||||
|
||||
m_sprDangerBackground.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_DANGER_BACKGROUND) );
|
||||
m_sprDangerBackground.Load( THEME->GetPathTo("Graphics","gameplay danger background") );
|
||||
m_sprDangerBackground.StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
|
||||
|
||||
m_quadBGBrightness.StretchTo( CRect(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) );
|
||||
@@ -100,7 +100,7 @@ bool Background::LoadFromSong( Song* pSong, bool bDisableVisualizations )
|
||||
else
|
||||
m_BackgroundMode = MODE_ANIMATIONS;
|
||||
|
||||
m_sprSongBackground.Load( pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathTo(GRAPHIC_FALLBACK_BACKGROUND), true, 4, 0, true );
|
||||
m_sprSongBackground.Load( pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathTo("Graphics","fallback background"), true, 4, 0, true );
|
||||
|
||||
m_sprSongBackground.StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
|
||||
|
||||
@@ -112,7 +112,7 @@ bool Background::LoadFromSong( Song* pSong, bool bDisableVisualizations )
|
||||
case MODE_MOVIE_BG:
|
||||
m_sprMovieBackground.Load( pSong->GetMovieBackgroundPath() );
|
||||
m_sprMovieBackground.StretchTo( CRect(SCREEN_LEFT+10,SCREEN_TOP+16,SCREEN_RIGHT-10,SCREEN_BOTTOM-16) );
|
||||
m_sprMovieBackground.SetZoomY( m_sprMovieBackground.GetZoomY()*-1 );
|
||||
m_sprMovieBackground.SetZoomY( m_sprMovieBackground.GetZoomY() );
|
||||
m_sprMovieBackground.StopAnimating( );
|
||||
break;
|
||||
case MODE_MOVIE_VIS:
|
||||
|
||||
@@ -50,10 +50,10 @@ bool Banner::LoadFromSong( Song* pSong ) // NULL means no song
|
||||
|
||||
Sprite::TurnShadowOff();
|
||||
|
||||
if( pSong == NULL ) Banner::Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BANNER) );
|
||||
if( pSong == NULL ) Banner::Load( THEME->GetPathTo("Graphics","fallback banner") );
|
||||
else if( pSong->HasBanner() ) Banner::Load( pSong->GetBannerPath() );
|
||||
// else if( pSong->HasBackground() ) Banner::Load( pSong->GetBackgroundPath() );
|
||||
else Banner::Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BANNER) );
|
||||
else Banner::Load( THEME->GetPathTo("Graphics","fallback banner") );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -64,10 +64,12 @@ bool Banner::LoadFromGroup( CString sGroupName )
|
||||
|
||||
CString sGroupBannerPath = SONGMAN->GetGroupBannerPath( sGroupName );
|
||||
|
||||
if( sGroupBannerPath != "" )
|
||||
if( sGroupName == "ALL MUSIC" )
|
||||
Banner::Load( THEME->GetPathTo("Graphics","all music banner") );
|
||||
else if( sGroupBannerPath != "" )
|
||||
Banner::Load( sGroupBannerPath );
|
||||
else
|
||||
Banner::Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_SECTION_BANNER) );
|
||||
Banner::Load( THEME->GetPathTo("Graphics","select music section banner") );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -78,16 +80,16 @@ bool Banner::LoadFromCourse( Course* pCourse ) // NULL means no course
|
||||
|
||||
Sprite::TurnShadowOff();
|
||||
|
||||
if( pCourse == NULL ) Banner::Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BANNER) );
|
||||
if( pCourse == NULL ) Banner::Load( THEME->GetPathTo("Graphics","fallback banner") );
|
||||
else if( pCourse->m_sBannerPath != "" ) Banner::Load( pCourse->m_sBannerPath );
|
||||
else Banner::Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BANNER) );
|
||||
else Banner::Load( THEME->GetPathTo("Graphics","fallback banner") );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Banner::LoadRoulette()
|
||||
{
|
||||
Banner::Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_ROULETTE_BANNER), false, 0, 0, false, false );
|
||||
Banner::Load( THEME->GetPathTo("Graphics","select music roulette banner"), false, 0, 0, false, false );
|
||||
m_bScrolling = true;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
-----------------------------------------------------------------------------
|
||||
File: Banner.h
|
||||
|
||||
Desc: The song's banner displayed in SelectSong.
|
||||
Desc: The song's banner displayed in SelectSong. Must call SetCroppedSize.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
@@ -12,11 +12,6 @@
|
||||
|
||||
#include "CroppedSprite.h"
|
||||
#include "Song.h"
|
||||
|
||||
|
||||
const float BANNER_WIDTH = 286;
|
||||
const float BANNER_HEIGHT = 92;
|
||||
|
||||
class Course;
|
||||
|
||||
|
||||
@@ -27,9 +22,6 @@ public:
|
||||
{
|
||||
m_bScrolling = false;
|
||||
m_fPercentScrolling = 0;
|
||||
|
||||
m_fCropWidth = BANNER_WIDTH;
|
||||
m_fCropHeight = BANNER_HEIGHT;
|
||||
};
|
||||
|
||||
virtual bool Load( CString sFilePath, bool bForceReload = false, int iMipMaps = 0, int iAlphaBits = 0, bool bDither = false, bool bStretch = false );
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
BannerWithFrame::BannerWithFrame()
|
||||
{
|
||||
m_sprBannerFrame.Load( THEME->GetPathTo(GRAPHIC_EVALUATION_BANNER_FRAME) );
|
||||
m_sprBannerFrame.Load( THEME->GetPathTo("Graphics","evaluation banner frame") );
|
||||
m_Banner.SetCroppedSize( m_sprBannerFrame.GetUnzoomedWidth()-6, m_sprBannerFrame.GetUnzoomedHeight()-6 );
|
||||
|
||||
this->AddSubActor( &m_Banner );
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "RageLog.h"
|
||||
#include "RageException.h"
|
||||
#include "RageTimer.h"
|
||||
#include "PrefsManager.h"
|
||||
|
||||
|
||||
|
||||
@@ -59,12 +60,12 @@ BitmapText::~BitmapText()
|
||||
FONT->UnloadFont( m_pFont->m_sFontFilePath );
|
||||
}
|
||||
|
||||
bool BitmapText::Load( const CString &sFontFilePath )
|
||||
bool BitmapText::LoadFromFont( CString sFontFilePath )
|
||||
{
|
||||
LOG->Trace( "BitmapText::LoadFromFontName(%s)", sFontFilePath );
|
||||
|
||||
// load font
|
||||
m_pFont = FONT->LoadFont( sFontFilePath );
|
||||
m_pFont = FONT->LoadFont( sFontFilePath, "" );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -134,6 +135,12 @@ void BitmapText::SetText( CString sText )
|
||||
// draw text at x, y using colorTop blended down to colorBottom, with size multiplied by scale
|
||||
void BitmapText::DrawPrimitives()
|
||||
{
|
||||
// offset so that pixels are aligned to texels
|
||||
if( PREFSMAN->m_iDisplayResolution == 320 )
|
||||
DISPLAY->TranslateLocal( -1, -1, 0 );
|
||||
else
|
||||
DISPLAY->TranslateLocal( -0.5f, -0.5f, 0 );
|
||||
|
||||
if( m_iNumLines == 0 )
|
||||
return;
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ public:
|
||||
~BitmapText();
|
||||
|
||||
|
||||
bool Load( const CString &sFontName );
|
||||
bool LoadFromFont( CString sFontName );
|
||||
bool LoadFromTextureAndChars( CString sTexturePath, CString sChars );
|
||||
void SetText( CString sText );
|
||||
|
||||
int GetWidestLineWidthInSourcePixels() { return m_iWidestLineWidth; };
|
||||
|
||||
@@ -21,13 +21,13 @@ Combo::Combo()
|
||||
m_iCurCombo = 0;
|
||||
m_iMaxCombo = 0;
|
||||
|
||||
m_sprCombo.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_COMBO) );
|
||||
m_sprCombo.Load( THEME->GetPathTo("Graphics", "gameplay combo") );
|
||||
m_sprCombo.TurnShadowOn();
|
||||
m_sprCombo.StopAnimating();
|
||||
m_sprCombo.SetX( 40 );
|
||||
m_sprCombo.SetZoom( 1.0f );
|
||||
|
||||
m_textComboNumber.Load( THEME->GetPathTo(FONT_COMBO_NUMBERS) );
|
||||
m_textComboNumber.LoadFromFont( THEME->GetPathTo("Fonts","combo numbers") );
|
||||
m_textComboNumber.TurnShadowOn();
|
||||
m_textComboNumber.SetHorizAlign( Actor::align_right );
|
||||
m_textComboNumber.SetX( -0 );
|
||||
|
||||
@@ -38,10 +38,10 @@ const float CONTENTS_BAR_HEIGHT = 44;
|
||||
|
||||
CourseContentDisplay::CourseContentDisplay()
|
||||
{
|
||||
m_sprFrame.Load( THEME->GetPathTo(GRAPHIC_SELECT_COURSE_CONTENT_BAR) );
|
||||
m_sprFrame.Load( THEME->GetPathTo("Graphics","select course content bar") );
|
||||
this->AddSubActor( &m_sprFrame );
|
||||
|
||||
m_textNumber.Load( THEME->GetPathTo(FONT_HEADER2) );
|
||||
m_textNumber.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
m_textNumber.SetXY( NUMBER_X, NUMBER_Y );
|
||||
m_textNumber.TurnShadowOff();
|
||||
this->AddSubActor( &m_textNumber );
|
||||
@@ -49,12 +49,12 @@ CourseContentDisplay::CourseContentDisplay()
|
||||
m_TextBanner.SetXY( TEXT_BANNER_X, TEXT_BANNER_Y );
|
||||
this->AddSubActor( &m_TextBanner );
|
||||
|
||||
m_textFoot.Load( THEME->GetPathTo(FONT_METER) );
|
||||
m_textFoot.LoadFromFont( THEME->GetPathTo("Fonts","meter") );
|
||||
m_textFoot.SetXY( FOOT_X, FOOT_Y );
|
||||
m_textFoot.TurnShadowOff();
|
||||
this->AddSubActor( &m_textFoot );
|
||||
|
||||
m_textDifficultyNumber.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textDifficultyNumber.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textDifficultyNumber.SetXY( DIFFICULTY_X, DIFFICULTY_Y );
|
||||
m_textDifficultyNumber.SetZoom( 0.8f );
|
||||
m_textDifficultyNumber.TurnShadowOff();
|
||||
|
||||
@@ -16,6 +16,25 @@
|
||||
#include "RageBitmapTexture.h"
|
||||
|
||||
|
||||
CroppedSprite::CroppedSprite()
|
||||
{
|
||||
m_fCropWidth = m_fCropHeight = 100;
|
||||
}
|
||||
|
||||
bool CroppedSprite::Load( CString sFilePath, bool bForceReload, int iMipMaps, int iAlphaBits, bool bDither, bool bStretch )
|
||||
{
|
||||
Sprite::Load( sFilePath, bForceReload, iMipMaps, iAlphaBits, bDither, bStretch );
|
||||
CropToSize( m_fCropWidth, m_fCropHeight );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CroppedSprite::SetCroppedSize( float fWidth, float fHeight )
|
||||
{
|
||||
m_fCropWidth = fWidth;
|
||||
m_fCropHeight = fHeight;
|
||||
}
|
||||
|
||||
void CroppedSprite::CropToSize( float fWidth, float fHeight )
|
||||
{
|
||||
m_fCropWidth = fWidth;
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: CroppedSprite.h
|
||||
Class: CroppedSprite
|
||||
|
||||
Desc: The song's CroppedSprite displayed in SelectSong.
|
||||
Desc: The a bitmap that is cropped and zoomed to fill a box.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef _CroppedSprite_H_
|
||||
#define _CroppedSprite_H_
|
||||
|
||||
|
||||
#include "Sprite.h"
|
||||
#include "Song.h"
|
||||
@@ -19,24 +18,10 @@
|
||||
class CroppedSprite : public Sprite
|
||||
{
|
||||
public:
|
||||
CroppedSprite()
|
||||
{
|
||||
m_fCropWidth = m_fCropHeight = 100;
|
||||
};
|
||||
CroppedSprite();
|
||||
|
||||
bool Load( CString sFilePath, bool bForceReload = false, int iMipMaps = 4, int iAlphaBits = 4, bool bDither = false, bool bStretch = false )
|
||||
{
|
||||
Sprite::Load( sFilePath, bForceReload, iMipMaps, iAlphaBits, bDither, bStretch );
|
||||
CropToSize( m_fCropWidth, m_fCropHeight );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetCroppedSize( float fWidth, float fHeight )
|
||||
{
|
||||
m_fCropWidth = fWidth;
|
||||
m_fCropHeight = fHeight;
|
||||
}
|
||||
bool Load( CString sFilePath, bool bForceReload = false, int iMipMaps = 4, int iAlphaBits = 4, bool bDither = false, bool bStretch = false );
|
||||
void SetCroppedSize( float fWidth, float fHeight );
|
||||
|
||||
protected:
|
||||
void CropToSize( float fWidth, float fHeight );
|
||||
@@ -44,7 +29,3 @@ protected:
|
||||
float m_fCropWidth, m_fCropHeight;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,7 @@ class DifficultyIcon : public Sprite
|
||||
public:
|
||||
DifficultyIcon()
|
||||
{
|
||||
Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_DIFFICULTY_ICONS) );
|
||||
Load( THEME->GetPathTo("Graphics","select music difficulty icons") );
|
||||
StopAnimating();
|
||||
|
||||
SetFromNotes( NULL );
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: FadingBanner
|
||||
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "FadingBanner.h"
|
||||
#include "RageUtil.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "RageLog.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
FadingBanner::FadingBanner()
|
||||
{
|
||||
// these guys get loaded on the Set* methods
|
||||
this->AddSubActor( &m_Banner[0] );
|
||||
this->AddSubActor( &m_Banner[1] );
|
||||
}
|
||||
|
||||
void FadingBanner::SetCroppedSize( float fWidth, float fHeight )
|
||||
{
|
||||
m_Banner[0].SetCroppedSize( fWidth, fHeight );
|
||||
m_Banner[1].SetCroppedSize( fWidth, fHeight );
|
||||
}
|
||||
|
||||
void FadingBanner::Update( float fDeltaTime )
|
||||
{
|
||||
ActorFrame::Update( fDeltaTime );
|
||||
|
||||
}
|
||||
|
||||
void FadingBanner::BeforeChange()
|
||||
{
|
||||
// move the back banner to the front in preparation for a cross fade
|
||||
if( m_Banner[0].GetTexturePath() != "" )
|
||||
{
|
||||
m_Banner[1].Load( m_Banner[0].GetTexturePath() );
|
||||
m_Banner[1].SetScrolling( m_Banner[0].IsScrolling() );
|
||||
}
|
||||
|
||||
m_Banner[1].SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
m_Banner[1].BeginTweening( 0.25f ); // fade out
|
||||
m_Banner[1].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
|
||||
}
|
||||
|
||||
void FadingBanner::SetFromSong( Song* pSong )
|
||||
{
|
||||
ASSERT( pSong != NULL );
|
||||
BeforeChange();
|
||||
m_Banner[0].LoadFromSong( pSong );
|
||||
}
|
||||
|
||||
void FadingBanner::SetFromGroup( const CString &sGroupName )
|
||||
{
|
||||
BeforeChange();
|
||||
m_Banner[0].LoadFromGroup( sGroupName );
|
||||
}
|
||||
|
||||
void FadingBanner::SetRoulette()
|
||||
{
|
||||
BeforeChange();
|
||||
m_Banner[0].LoadRoulette();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: FadingBanner
|
||||
|
||||
Desc: Fades between two banners.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "Banner.h"
|
||||
#include "ActorFrame.h"
|
||||
|
||||
|
||||
class FadingBanner : public ActorFrame
|
||||
{
|
||||
public:
|
||||
FadingBanner();
|
||||
|
||||
void SetCroppedSize( float fWidth, float fHeight );
|
||||
|
||||
void Update( float fDeltaTime );
|
||||
|
||||
void SetFromSong( Song* pSong );
|
||||
void SetFromGroup( const CString &sGroupName );
|
||||
void SetRoulette();
|
||||
//void SetFromTexture( const CString &sTexturePath );
|
||||
|
||||
protected:
|
||||
void BeforeChange();
|
||||
|
||||
Banner m_Banner[2]; // front and back
|
||||
};
|
||||
@@ -131,7 +131,11 @@ Font::Font( const CString &sFontFilePath )
|
||||
m_sFontFilePath, asCharWidths.GetSize(), m_pTexture->GetNumFrames() );
|
||||
|
||||
for( int i=0; i<asCharWidths.GetSize(); i++ )
|
||||
{
|
||||
m_iFrameNoToWidth[i] = atoi( asCharWidths[i] );
|
||||
if( m_iFrameNoToWidth[i]%2 == 1 )
|
||||
m_iFrameNoToWidth[i]++;
|
||||
}
|
||||
}
|
||||
else // The font file creator didn't supply widths. Assume each character is the width of the frame.
|
||||
{
|
||||
@@ -143,6 +147,60 @@ Font::Font( const CString &sFontFilePath )
|
||||
}
|
||||
|
||||
|
||||
Font::Font( const CString &sTexturePath, const CString& sCharacters )
|
||||
{
|
||||
//LOG->Trace( "Font::LoadFromFontName(%s)", sFontFilePath );
|
||||
int i;
|
||||
for( i=0; i<MAX_FONT_CHARS; i++ )
|
||||
{
|
||||
m_iCharToFrameNo[i] = -1;
|
||||
m_iFrameNoToWidth[i] = -1;
|
||||
}
|
||||
|
||||
m_bCapitalsOnly = false;
|
||||
m_fDrawExtraPercent = 0;
|
||||
|
||||
|
||||
m_iRefCount = 1;
|
||||
|
||||
m_sFontFilePath = sTexturePath; // save
|
||||
|
||||
|
||||
//
|
||||
// load texture
|
||||
//
|
||||
m_sTexturePath = sTexturePath; // save the path of the new texture
|
||||
m_sTexturePath.MakeLower();
|
||||
|
||||
|
||||
m_pTexture = TEXTUREMAN->LoadTexture( m_sTexturePath );
|
||||
assert( m_pTexture != NULL );
|
||||
|
||||
|
||||
//
|
||||
// find out what characters are in this font
|
||||
//
|
||||
// sanity check
|
||||
if( sCharacters.GetLength() != m_pTexture->GetNumFrames() )
|
||||
throw RageException( "The characters in '%s' does not match the number of frames in the texture."
|
||||
"The font has %d frames, and the texture has %d frames.",
|
||||
m_sFontFilePath, sCharacters.GetLength(), m_pTexture->GetNumFrames() );
|
||||
|
||||
// set the char to frame number map
|
||||
for( i=0; i<sCharacters.GetLength(); i++ )
|
||||
{
|
||||
char c = sCharacters[i];
|
||||
int iFrameNo = i;
|
||||
|
||||
m_iCharToFrameNo[c] = iFrameNo;
|
||||
}
|
||||
|
||||
// Assume each character is the width of the frame.
|
||||
for( i=0; i<(int)m_pTexture->GetNumFrames(); i++ )
|
||||
m_iFrameNoToWidth[i] = m_pTexture->GetSourceFrameWidth();
|
||||
}
|
||||
|
||||
|
||||
Font::~Font()
|
||||
{
|
||||
if( m_pTexture != NULL )
|
||||
|
||||
@@ -21,6 +21,7 @@ protected:
|
||||
|
||||
public:
|
||||
Font( const CString &sFontPath );
|
||||
Font( const CString &sTexturePath, const CString& sChars );
|
||||
~Font();
|
||||
|
||||
int GetLineWidthInSourcePixels( LPCTSTR szLine, int iLength );
|
||||
|
||||
@@ -51,9 +51,9 @@ FontManager::~FontManager()
|
||||
//-----------------------------------------------------------------------------
|
||||
// Load/Unload textures from disk
|
||||
//-----------------------------------------------------------------------------
|
||||
Font* FontManager::LoadFont( CString sFontFilePath )
|
||||
Font* FontManager::LoadFont( CString sFontOrTextureFilePath, CString sChars )
|
||||
{
|
||||
sFontFilePath.MakeLower();
|
||||
sFontOrTextureFilePath.MakeLower();
|
||||
|
||||
// LOG->Trace( "FontManager::LoadFont(%s).", sFontFilePath );
|
||||
|
||||
@@ -65,7 +65,7 @@ Font* FontManager::LoadFont( CString sFontFilePath )
|
||||
|
||||
Font* pFont = NULL;
|
||||
|
||||
if( m_mapPathToFont.Lookup( sFontFilePath, pFont ) ) // if the texture already exists in the map
|
||||
if( m_mapPathToFont.Lookup( sFontOrTextureFilePath, pFont ) ) // if the texture already exists in the map
|
||||
{
|
||||
// LOG->Trace( ssprintf("FontManager: The Font '%s' now has %d references.", sFontFilePath, pFont->m_iRefCount) );
|
||||
pFont->m_iRefCount++;
|
||||
@@ -73,13 +73,16 @@ Font* FontManager::LoadFont( CString sFontFilePath )
|
||||
else // the texture is not already loaded
|
||||
{
|
||||
CString sDrive, sDir, sFName, sExt;
|
||||
splitpath( FALSE, sFontFilePath, sDrive, sDir, sFName, sExt );
|
||||
splitpath( FALSE, sFontOrTextureFilePath, sDrive, sDir, sFName, sExt );
|
||||
|
||||
pFont = (Font*) new Font( sFontFilePath );
|
||||
if( sChars == "" )
|
||||
pFont = (Font*) new Font( sFontOrTextureFilePath );
|
||||
else
|
||||
pFont = (Font*) new Font( sFontOrTextureFilePath, sChars );
|
||||
|
||||
// LOG->Trace( "FontManager: Loading '%s' from disk.", sFontFilePath);
|
||||
|
||||
m_mapPathToFont.SetAt( sFontFilePath, pFont );
|
||||
m_mapPathToFont.SetAt( sFontOrTextureFilePath, pFont );
|
||||
}
|
||||
|
||||
return pFont;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: FontManager
|
||||
@@ -9,10 +10,6 @@
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef _FontManager_H_
|
||||
#define _FontManager_H_
|
||||
|
||||
|
||||
#include "Font.h"
|
||||
|
||||
|
||||
@@ -25,7 +22,7 @@ public:
|
||||
FontManager();
|
||||
~FontManager();
|
||||
|
||||
Font* LoadFont( CString sFontPath );
|
||||
Font* LoadFont( CString sFontOrTextureFilePath, CString sChars );
|
||||
bool IsFontLoaded( CString sFontPath );
|
||||
void UnloadFont( CString sFontPath );
|
||||
|
||||
@@ -36,4 +33,3 @@ protected:
|
||||
|
||||
extern FontManager* FONT; // global and accessable from anywhere in our program
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
FootMeter::FootMeter()
|
||||
{
|
||||
Load( THEME->GetPathTo(FONT_METER) );
|
||||
LoadFromFont( THEME->GetPathTo("Fonts","meter") );
|
||||
|
||||
SetFromNotes( NULL );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: Game
|
||||
|
||||
Desc: .
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
enum Game
|
||||
{
|
||||
GAME_DANCE, // Dance Dance Revolution
|
||||
GAME_PUMP, // Pump It Up
|
||||
GAME_EZ2, // Ez2dancer
|
||||
NUM_GAMES, // leave this at the end
|
||||
GAME_INVALID,
|
||||
};
|
||||
@@ -13,60 +13,6 @@
|
||||
#include "GameConstantsAndTypes.h"
|
||||
|
||||
|
||||
D3DXCOLOR NoteTypeToColor( NoteType nt )
|
||||
{
|
||||
switch( nt )
|
||||
{
|
||||
case NOTE_4TH: return D3DXCOLOR(1,0,0,1); // red
|
||||
case NOTE_8TH: return D3DXCOLOR(0,0,1,1); // blue
|
||||
case NOTE_12TH: return D3DXCOLOR(1,0,1,1); // purple
|
||||
case NOTE_16TH: return D3DXCOLOR(1,1,0,1); // yellow
|
||||
default: ASSERT( false ); return D3DXCOLOR(1,1,1,1);
|
||||
}
|
||||
};
|
||||
|
||||
float NoteTypeToBeat( NoteType nt )
|
||||
{
|
||||
switch( nt )
|
||||
{
|
||||
case NOTE_4TH: return 1.0f; // quarter notes
|
||||
case NOTE_8TH: return 1.0f/2; // eighth notes
|
||||
case NOTE_12TH: return 1.0f/3; // triplets
|
||||
case NOTE_16TH: return 1.0f/4; // sixteenth notes
|
||||
default: ASSERT( false ); return 0;
|
||||
}
|
||||
};
|
||||
|
||||
NoteType GetNoteType( int iNoteIndex )
|
||||
{
|
||||
if( iNoteIndex % (ELEMENTS_PER_MEASURE/4) == 0)
|
||||
return NOTE_4TH;
|
||||
else if( iNoteIndex % (ELEMENTS_PER_MEASURE/8) == 0)
|
||||
return NOTE_8TH;
|
||||
else if( iNoteIndex % (ELEMENTS_PER_MEASURE/12) == 0)
|
||||
return NOTE_12TH;
|
||||
else if( iNoteIndex % (ELEMENTS_PER_MEASURE/16) == 0)
|
||||
return NOTE_16TH;
|
||||
// ASSERT(0);
|
||||
return NOTE_INVALID;
|
||||
};
|
||||
|
||||
bool IsNoteOfType( int iNoteIndex, NoteType t )
|
||||
{
|
||||
return GetNoteType(iNoteIndex) == t;
|
||||
};
|
||||
|
||||
D3DXCOLOR GetNoteColorFromIndex( int iStepIndex )
|
||||
{
|
||||
for( int t=0; t<NUM_NOTE_TYPES; t++ )
|
||||
{
|
||||
if( IsNoteOfType( iStepIndex, (NoteType)t ) )
|
||||
return NoteTypeToColor( (NoteType)t );
|
||||
}
|
||||
return D3DXCOLOR(0.5f,0.5f,0.5f,1);
|
||||
};
|
||||
|
||||
|
||||
|
||||
D3DXCOLOR DifficultyClassToColor( DifficultyClass dc )
|
||||
{
|
||||
@@ -106,19 +52,19 @@ int NotesTypeToNumTracks( NotesType nt )
|
||||
{
|
||||
switch( nt )
|
||||
{
|
||||
case NOTES_TYPE_DANCE_SINGLE: return 4;
|
||||
case NOTES_TYPE_DANCE_DOUBLE: return 8;
|
||||
case NOTES_TYPE_DANCE_COUPLE: return 8;
|
||||
case NOTES_TYPE_DANCE_SOLO: return 6;
|
||||
case NOTES_TYPE_PUMP_SINGLE: return 5;
|
||||
case NOTES_TYPE_PUMP_DOUBLE: return 10;
|
||||
case NOTES_TYPE_EZ2_SINGLE: return 5; // Single: TL,LHH,D,RHH,TR
|
||||
case NOTES_TYPE_EZ2_SINGLE_HARD: return 5; // Single: TL,LHH,D,RHH,TR
|
||||
case NOTES_TYPE_EZ2_DOUBLE: return 10; // Double: Single x2
|
||||
case NOTES_TYPE_EZ2_REAL: return 7; // Real: TL,LHH,LHL,D,RHL,RHH,TR
|
||||
case NOTES_TYPE_EZ2_SINGLE_VERSUS: return 10;
|
||||
case NOTES_TYPE_EZ2_SINGLE_HARD_VERSUS: return 10;
|
||||
case NOTES_TYPE_EZ2_REAL_VERSUS: return 10;
|
||||
case NOTES_TYPE_DANCE_SINGLE: return 4;
|
||||
case NOTES_TYPE_DANCE_DOUBLE: return 8;
|
||||
case NOTES_TYPE_DANCE_COUPLE: return 8;
|
||||
case NOTES_TYPE_DANCE_SOLO: return 6;
|
||||
case NOTES_TYPE_PUMP_SINGLE: return 5;
|
||||
case NOTES_TYPE_PUMP_DOUBLE: return 10;
|
||||
case NOTES_TYPE_EZ2_SINGLE: return 5; // Single: TL,LHH,D,RHH,TR
|
||||
case NOTES_TYPE_EZ2_SINGLE_HARD: return 5; // Single: TL,LHH,D,RHH,TR
|
||||
case NOTES_TYPE_EZ2_DOUBLE: return 10; // Double: Single x2
|
||||
case NOTES_TYPE_EZ2_REAL: return 7; // Real: TL,LHH,LHL,D,RHL,RHH,TR
|
||||
// case NOTES_TYPE_EZ2_SINGLE_VERSUS: return 10;
|
||||
// case NOTES_TYPE_EZ2_SINGLE_HARD_VERSUS: return 10;
|
||||
// case NOTES_TYPE_EZ2_REAL_VERSUS: return 10;
|
||||
default: ASSERT(0); return -1; // invalid NotesType
|
||||
}
|
||||
}
|
||||
@@ -155,8 +101,9 @@ CString NotesTypeToString( NotesType nt )
|
||||
case NOTES_TYPE_EZ2_SINGLE_HARD: return "ez2-single-hard";
|
||||
case NOTES_TYPE_EZ2_DOUBLE: return "ez2-double";
|
||||
case NOTES_TYPE_EZ2_REAL: return "ez2-real";
|
||||
// case NOTES_TYPE_EZ2_REAL_VERSUS: return "ez2-real-versus";
|
||||
// case NOTES_TYPE_EZ2_SINGLE_VERSUS: return "ez2-single-versus";
|
||||
// case NOTES_TYPE_EZ2_REAL_VERSUS: return "ez2-real-versus";
|
||||
// case NOTES_TYPE_EZ2_SINGLE_VERSUS: return "ez2-single-versus";
|
||||
// case NOTES_TYPE_EZ2_SINGLE_HARD_VERSUS: return "ez2-single-hard-versus";
|
||||
default: ASSERT(0); return ""; // invalid NotesType
|
||||
}
|
||||
}
|
||||
@@ -181,6 +128,8 @@ D3DXCOLOR PlayerToColor( int p )
|
||||
|
||||
|
||||
|
||||
/* This was a dumb idea. I'm change Style so that it knows what game it belongs to.
|
||||
|
||||
Game StyleToGame( Style s )
|
||||
{
|
||||
switch( s )
|
||||
@@ -208,3 +157,4 @@ Game StyleToGame( Style s )
|
||||
return GAME_DANCE;
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -30,56 +30,6 @@
|
||||
/////////////////////////
|
||||
// Note definitions
|
||||
/////////////////////////
|
||||
typedef unsigned char TapNote;
|
||||
|
||||
enum
|
||||
{
|
||||
TRACK_1 = 0,
|
||||
TRACK_2,
|
||||
TRACK_3,
|
||||
TRACK_4,
|
||||
TRACK_5,
|
||||
TRACK_6,
|
||||
TRACK_7,
|
||||
TRACK_8,
|
||||
TRACK_9,
|
||||
TRACK_10,
|
||||
TRACK_11,
|
||||
TRACK_12,
|
||||
TRACK_13,
|
||||
MAX_NOTE_TRACKS // leave this at the end
|
||||
};
|
||||
|
||||
const int MAX_BEATS = 1500; // BMR's Pulse has about 1300
|
||||
const int BEATS_PER_MEASURE = 4;
|
||||
const int MAX_MEASURES = MAX_BEATS / BEATS_PER_MEASURE;
|
||||
|
||||
const int ELEMENTS_PER_BEAT = 12; // It is important that this number is evenly divisible by 2, 3, and 4.
|
||||
const int ELEMENTS_PER_MEASURE = ELEMENTS_PER_BEAT * BEATS_PER_MEASURE;
|
||||
const int MAX_TAP_NOTE_ROWS = MAX_BEATS*ELEMENTS_PER_BEAT;
|
||||
|
||||
const int MAX_HOLD_NOTES = 400; // BMR's Connected has about 300
|
||||
|
||||
enum NoteType
|
||||
{
|
||||
NOTE_4TH, // quarter notes
|
||||
NOTE_8TH, // eighth notes
|
||||
NOTE_12TH, // triplets
|
||||
NOTE_16TH, // sixteenth notes
|
||||
NUM_NOTE_TYPES,
|
||||
NOTE_INVALID
|
||||
};
|
||||
|
||||
D3DXCOLOR NoteTypeToColor( NoteType nt );
|
||||
|
||||
float NoteTypeToBeat( NoteType nt );
|
||||
|
||||
NoteType GetNoteType( int iNoteIndex );
|
||||
|
||||
bool IsNoteOfType( int iNoteIndex, NoteType t );
|
||||
|
||||
D3DXCOLOR GetNoteColorFromIndex( int iStepIndex );
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -121,9 +71,9 @@ enum NotesType
|
||||
NOTES_TYPE_EZ2_SINGLE_HARD,
|
||||
NOTES_TYPE_EZ2_DOUBLE,
|
||||
NOTES_TYPE_EZ2_REAL,
|
||||
NOTES_TYPE_EZ2_SINGLE_VERSUS,
|
||||
NOTES_TYPE_EZ2_SINGLE_HARD_VERSUS,
|
||||
NOTES_TYPE_EZ2_REAL_VERSUS,
|
||||
// NOTES_TYPE_EZ2_SINGLE_VERSUS, // Chris: these should only be styles, not NotesTypes
|
||||
// NOTES_TYPE_EZ2_SINGLE_HARD_VERSUS,
|
||||
// NOTES_TYPE_EZ2_REAL_VERSUS,
|
||||
NUM_NOTES_TYPES, // leave this at the end
|
||||
NOTES_TYPE_INVALID,
|
||||
};
|
||||
@@ -167,253 +117,6 @@ enum SongSortOrder {
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////
|
||||
// Game/Style definition stuff
|
||||
///////////////////////////////
|
||||
enum Game
|
||||
{
|
||||
GAME_DANCE, // Dance Dance Revolution
|
||||
GAME_PUMP, // Pump It Up
|
||||
GAME_EZ2, // Ez2dancer
|
||||
NUM_GAMES, // leave this at the end
|
||||
GAME_INVALID,
|
||||
};
|
||||
|
||||
enum Style
|
||||
{
|
||||
STYLE_DANCE_SINGLE,
|
||||
STYLE_DANCE_VERSUS,
|
||||
STYLE_DANCE_DOUBLE,
|
||||
STYLE_DANCE_COUPLE,
|
||||
STYLE_DANCE_SOLO,
|
||||
STYLE_PUMP_SINGLE,
|
||||
STYLE_PUMP_VERSUS,
|
||||
STYLE_PUMP_DOUBLE,
|
||||
STYLE_EZ2_SINGLE,
|
||||
STYLE_EZ2_SINGLE_HARD,
|
||||
STYLE_EZ2_DOUBLE,
|
||||
STYLE_EZ2_REAL,
|
||||
STYLE_EZ2_SINGLE_VERSUS,
|
||||
STYLE_EZ2_SINGLE_HARD_VERSUS,
|
||||
STYLE_EZ2_REAL_VERSUS,
|
||||
NUM_STYLES, // leave this at the end
|
||||
STYLE_NONE,
|
||||
};
|
||||
|
||||
Game StyleToGame( Style s );
|
||||
|
||||
/*
|
||||
|
||||
Chris:
|
||||
|
||||
Very cool system :-)
|
||||
|
||||
However, the NotesType is a property of the StyleDef, so we can look it up there.
|
||||
Get the the NotesType for a style with:
|
||||
GAMESTATE->GetCurrentStyleDef()->m_NotesType - or -
|
||||
GAMEMAN->GetStyleDefForStyle(style)->m_NotesType
|
||||
I'll add a new method to GAMEMAN called GetStyleThatPlaysNotesType():
|
||||
Style s = GAMEMAN->GetStyleThatPlaysNotesType( nt );
|
||||
|
||||
////////////////////////////////
|
||||
// NotesType/Style conversions
|
||||
////////////////////////////////
|
||||
|
||||
// Dro Kulix: This part really is necessary.
|
||||
// Several subroutines call for conversions between
|
||||
// NotesType and Style, both ways. It would make
|
||||
// things a bit easier to keep them central.
|
||||
|
||||
// The next two functions have self-explanatory
|
||||
// names, NotesTypeToStyle(nt) and
|
||||
// StyleToNotesType(s).
|
||||
|
||||
// Both of these functions involve a tedious
|
||||
// switch-based one-to-one mapping between
|
||||
// NotesTypes and Styles. I have written a
|
||||
// Perl script which will actually write both
|
||||
// of the functions for you. All you need to do
|
||||
// is keep updated the list of Styles and
|
||||
// NotesTypes near the beginning of the script.
|
||||
|
||||
// If you need a copy of Perl for Win32,
|
||||
// http://www.activeperl.com/Products/ActivePerl/
|
||||
// will suit nicely.
|
||||
|
||||
/*
|
||||
|
||||
Begin Perl file ->
|
||||
|
||||
# StyleNotesType.pl
|
||||
|
||||
# Perl script to write StyleToNotesType and
|
||||
# NotesTypeToStyle functions for StepMania.
|
||||
|
||||
# Usage: perl StyleNotesType.pl > code.txt
|
||||
# (outputs C++ functions to file code.txt)
|
||||
|
||||
# Keep the following list updated to produce
|
||||
# correct code.
|
||||
|
||||
# First column is Styles, second is NotesTypes.
|
||||
|
||||
# These mapping sequences only make the first possible
|
||||
# mapping. That is, STYLE_DANCE_SINGLE will map to
|
||||
# NOTES_TYPE_DANCE_SINGLE, and STYLE_DANCE_VERSUS will
|
||||
# map to NOTES_TYPE_DANCE_SINGLE, but
|
||||
# NOTES_TYPE_DANCE_SINGLE will only map to
|
||||
# STYLE_DANCE_SINGLE.
|
||||
|
||||
my @Types = qw[
|
||||
DANCE_SINGLE DANCE_SINGLE
|
||||
DANCE_VERSUS DANCE_SINGLE
|
||||
DANCE_DOUBLE DANCE_DOUBLE
|
||||
DANCE_COUPLE DANCE_COUPLE
|
||||
DANCE_SOLO DANCE_SOLO
|
||||
PUMP_SINGLE PUMP_SINGLE
|
||||
PUMP_VERSUS PUMP_SINGLE
|
||||
PUMP_DOUBLE PUMP_DOUBLE
|
||||
EZ2_SINGLE EZ2_SINGLE
|
||||
EZ2_DOUBLE EZ2_DOUBLE
|
||||
EZ2_REAL EZ2_REAL
|
||||
EZ2_SINGLE_VERSUS EZ2_SINGLE_VERSUS
|
||||
EZ2_REAL_VERSUS EZ2_REAL_VERSUS
|
||||
NONE INVALID
|
||||
];
|
||||
|
||||
|
||||
|
||||
my %StyleToNotesType = ();
|
||||
{
|
||||
my @tmpTypes = @Types;
|
||||
# Map Style to NotesType
|
||||
while (@tmpTypes) {
|
||||
my $key = shift(@tmpTypes);
|
||||
my $value = shift(@tmpTypes);
|
||||
if (!exists($StyleToNotesType{$key})) {
|
||||
$StyleToNotesType{$key} = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my %NotesTypeToStyle = ();
|
||||
{
|
||||
my @tmpTypes = @Types;
|
||||
# Map NotesType to Style
|
||||
while (@tmpTypes) {
|
||||
my $value = shift(@tmpTypes);
|
||||
my $key = shift(@tmpTypes);
|
||||
if (!exists($NotesTypeToStyle{$key})) {
|
||||
$NotesTypeToStyle{$key} = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Produce NotesTypeToStyle
|
||||
print "
|
||||
//
|
||||
// NotesTypeToStyle(nt): Converts nt to a Style
|
||||
//
|
||||
inline Style NotesTypeToStyle ( NotesType nt )
|
||||
{
|
||||
switch ( nt )
|
||||
{
|
||||
";
|
||||
|
||||
foreach (sort keys %NotesTypeToStyle) {
|
||||
my $key = "NOTES_TYPE_$_";
|
||||
my $value = 'STYLE_' . $NotesTypeToStyle{$_};
|
||||
print "\t\tcase $key:\treturn $value;\n";
|
||||
}
|
||||
|
||||
print "\t\tdefault:\treturn STYLE_NONE;
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
# Produce StyleToNotesType
|
||||
print "
|
||||
//
|
||||
// StyleToNotesType(s): Converts s to a NotesType
|
||||
//
|
||||
inline NotesType StyleToNotesType ( Style s )
|
||||
{
|
||||
switch ( s )
|
||||
{
|
||||
";
|
||||
|
||||
foreach (sort keys %StyleToNotesType) {
|
||||
my $key = "STYLE_$_";
|
||||
my $value = 'NOTES_TYPE_' . $StyleToNotesType{$_};
|
||||
print "\t\tcase $key:\treturn $value;\n";
|
||||
}
|
||||
|
||||
print "\t\tdefault:\treturn NOTES_TYPE_INVALID;
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
# Finished.
|
||||
|
||||
<- End of Perl file
|
||||
*/
|
||||
|
||||
/*
|
||||
//
|
||||
// NotesTypeToStyle(nt): Converts nt to a Style
|
||||
//
|
||||
inline Style NotesTypeToStyle ( NotesType nt )
|
||||
{
|
||||
switch ( nt )
|
||||
{
|
||||
case NOTES_TYPE_DANCE_COUPLE: return STYLE_DANCE_COUPLE;
|
||||
case NOTES_TYPE_DANCE_DOUBLE: return STYLE_DANCE_DOUBLE;
|
||||
case NOTES_TYPE_DANCE_SINGLE: return STYLE_DANCE_SINGLE;
|
||||
case NOTES_TYPE_DANCE_SOLO: return STYLE_DANCE_SOLO;
|
||||
case NOTES_TYPE_EZ2_DOUBLE: return STYLE_EZ2_DOUBLE;
|
||||
case NOTES_TYPE_EZ2_REAL: return STYLE_EZ2_REAL;
|
||||
case NOTES_TYPE_EZ2_REAL_VERSUS: return STYLE_EZ2_REAL_VERSUS;
|
||||
case NOTES_TYPE_EZ2_SINGLE: return STYLE_EZ2_SINGLE;
|
||||
case NOTES_TYPE_EZ2_SINGLE_HARD: return STYLE_EZ2_SINGLE_HARD;
|
||||
case NOTES_TYPE_EZ2_SINGLE_VERSUS: return STYLE_EZ2_SINGLE_VERSUS;
|
||||
case NOTES_TYPE_EZ2_SINGLE_HARD_VERSUS: return STYLE_EZ2_SINGLE_HARD_VERSUS;
|
||||
case NOTES_TYPE_INVALID: return STYLE_NONE;
|
||||
case NOTES_TYPE_PUMP_DOUBLE: return STYLE_PUMP_DOUBLE;
|
||||
case NOTES_TYPE_PUMP_SINGLE: return STYLE_PUMP_SINGLE;
|
||||
default: return STYLE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// StyleToNotesType(s): Converts s to a NotesType
|
||||
//
|
||||
inline NotesType StyleToNotesType ( Style s )
|
||||
{
|
||||
switch ( s )
|
||||
{
|
||||
case STYLE_DANCE_COUPLE: return NOTES_TYPE_DANCE_COUPLE;
|
||||
case STYLE_DANCE_DOUBLE: return NOTES_TYPE_DANCE_DOUBLE;
|
||||
case STYLE_DANCE_SINGLE: return NOTES_TYPE_DANCE_SINGLE;
|
||||
case STYLE_DANCE_SOLO: return NOTES_TYPE_DANCE_SOLO;
|
||||
case STYLE_DANCE_VERSUS: return NOTES_TYPE_DANCE_SINGLE;
|
||||
case STYLE_EZ2_DOUBLE: return NOTES_TYPE_EZ2_DOUBLE;
|
||||
case STYLE_EZ2_REAL: return NOTES_TYPE_EZ2_REAL;
|
||||
case STYLE_EZ2_REAL_VERSUS: return NOTES_TYPE_EZ2_REAL_VERSUS;
|
||||
case STYLE_EZ2_SINGLE: return NOTES_TYPE_EZ2_SINGLE;
|
||||
case STYLE_EZ2_SINGLE_HARD: return NOTES_TYPE_EZ2_SINGLE_HARD;
|
||||
case STYLE_EZ2_SINGLE_VERSUS: return NOTES_TYPE_EZ2_SINGLE_VERSUS;
|
||||
case STYLE_EZ2_SINGLE_HARD_VERSUS: return NOTES_TYPE_EZ2_SINGLE_HARD_VERSUS;
|
||||
case STYLE_NONE: return NOTES_TYPE_INVALID;
|
||||
case STYLE_PUMP_DOUBLE: return NOTES_TYPE_PUMP_DOUBLE;
|
||||
case STYLE_PUMP_SINGLE: return NOTES_TYPE_PUMP_SINGLE;
|
||||
case STYLE_PUMP_VERSUS: return NOTES_TYPE_PUMP_SINGLE;
|
||||
default: return NOTES_TYPE_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
///////////////////////////
|
||||
// Scoring stuff
|
||||
///////////////////////////
|
||||
|
||||
+15
-11
@@ -27,15 +27,15 @@ CString GameDef::ElementToGraphicSuffix( const SkinElement gbg )
|
||||
|
||||
switch( gbg )
|
||||
{
|
||||
case GRAPHIC_NOTE_COLOR_PART: sAssetPath = "note color part"; break;
|
||||
case GRAPHIC_NOTE_GRAY_PART: sAssetPath = "note gray part"; break;
|
||||
case GRAPHIC_TAP_PARTS: sAssetPath = "tap parts"; break;
|
||||
case GRAPHIC_HOLD_PARTS: sAssetPath = "hold parts"; break;
|
||||
case GRAPHIC_RECEPTOR: sAssetPath = "receptor"; break;
|
||||
case GRAPHIC_HOLD_EXPLOSION: sAssetPath = "hold explosion"; break;
|
||||
case GRAPHIC_TAP_EXPLOSION_BRIGHT: sAssetPath = "tap explosion bright"; break;
|
||||
case GRAPHIC_TAP_EXPLOSION_DIM: sAssetPath = "tap explosion dim"; break;
|
||||
|
||||
default:
|
||||
throw RageException( ssprintf("Unhandled StyleElement %d", gbg) );
|
||||
ASSERT(0); // invalid SkinElement
|
||||
}
|
||||
|
||||
return sAssetPath;
|
||||
@@ -56,6 +56,7 @@ CString GameDef::GetPathToGraphic( const CString sSkinName, const CString sButto
|
||||
if( arrayPossibleFileNames.GetSize() > 0 )
|
||||
return sSkinDir + arrayPossibleFileNames[0];
|
||||
|
||||
ASSERT(0);
|
||||
throw RageException( "The game button graphic '%s%s %s' is missing.", sSkinDir, sButtonName, sGraphicSuffix );
|
||||
return "";
|
||||
}
|
||||
@@ -86,6 +87,9 @@ void GameDef::GetTapTweenColors( const CString sSkinName, const CString sButtonN
|
||||
aTapColorsOut.Add( color );
|
||||
} while( bSuccess );
|
||||
|
||||
if( aTapColorsOut.GetSize() == 0 )
|
||||
aTapColorsOut.Add( D3DXCOLOR(1,1,1,1) );
|
||||
|
||||
fclose( fp );
|
||||
return;
|
||||
}
|
||||
@@ -173,17 +177,17 @@ MenuInput GameDef::GameInputToMenuInput( GameInput GameI )
|
||||
{
|
||||
PlayerNumber pn;
|
||||
|
||||
StyleDef::StyleType type = StyleDef::TWO_PLAYERS_USE_TWO_SIDES;
|
||||
StyleDef::StyleType type = StyleDef::TWO_PLAYERS_TWO_CREDITS;
|
||||
if( GAMESTATE->m_CurStyle != STYLE_NONE )
|
||||
type = GAMESTATE->GetCurrentStyleDef()->m_StyleType;
|
||||
switch( type )
|
||||
{
|
||||
case StyleDef::ONE_PLAYER_USES_ONE_SIDE:
|
||||
case StyleDef::TWO_PLAYERS_USE_TWO_SIDES:
|
||||
case StyleDef::ONE_PLAYER_ONE_CREDIT:
|
||||
case StyleDef::TWO_PLAYERS_TWO_CREDITS:
|
||||
pn = (PlayerNumber)GameI.controller;
|
||||
break;
|
||||
case StyleDef::ONE_PLAYER_USES_TWO_SIDES:
|
||||
pn = GAMESTATE->m_MasterPlayerNumber;
|
||||
case StyleDef::ONE_PLAYER_TWO_CREDITS:
|
||||
pn = GAMESTATE->m_bIsJoined[PLAYER_1] ? PLAYER_1 : PLAYER_2;
|
||||
break;
|
||||
default:
|
||||
ASSERT(0); // invalid m_StyleType
|
||||
@@ -213,12 +217,12 @@ void GameDef::MenuInputToGameInput( MenuInput MenuI, GameInput GameIout[4] )
|
||||
int iNumSidesUsing = 1;
|
||||
switch( GAMESTATE->GetCurrentStyleDef()->m_StyleType )
|
||||
{
|
||||
case StyleDef::ONE_PLAYER_USES_ONE_SIDE:
|
||||
case StyleDef::TWO_PLAYERS_USE_TWO_SIDES:
|
||||
case StyleDef::ONE_PLAYER_ONE_CREDIT:
|
||||
case StyleDef::TWO_PLAYERS_TWO_CREDITS:
|
||||
controller[0] = (GameController)MenuI.player;
|
||||
iNumSidesUsing = 1;
|
||||
break;
|
||||
case StyleDef::ONE_PLAYER_USES_TWO_SIDES:
|
||||
case StyleDef::ONE_PLAYER_TWO_CREDITS:
|
||||
controller[0] = GAME_CONTROLLER_1;
|
||||
controller[1] = GAME_CONTROLLER_2;
|
||||
iNumSidesUsing = 2;
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
const int MAX_STYLES_PER_GAME = 10;
|
||||
|
||||
enum SkinElement {
|
||||
GRAPHIC_NOTE_COLOR_PART,
|
||||
GRAPHIC_NOTE_GRAY_PART,
|
||||
GRAPHIC_TAP_PARTS,
|
||||
GRAPHIC_HOLD_PARTS,
|
||||
GRAPHIC_RECEPTOR,
|
||||
GRAPHIC_TAP_EXPLOSION_BRIGHT,
|
||||
GRAPHIC_TAP_EXPLOSION_DIM,
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
int m_iNumControllers;
|
||||
int m_iButtonsPerController;
|
||||
char m_szButtonNames[MAX_GAME_BUTTONS][60]; // The name used by the button graphics system. e.g. "left", "right", "middle C", "snare"
|
||||
char m_szButtonDescriptions[MAX_GAME_BUTTONS][60]; // just a longer name shown in the mapping screen
|
||||
char m_szSecondaryFunction[MAX_GAME_BUTTONS][60]; // displayed on the mapping screen
|
||||
GameButton m_DedicatedMenuButton[NUM_MENU_BUTTONS];
|
||||
GameButton m_SecondaryMenuButton[NUM_MENU_BUTTONS];
|
||||
int m_iDefaultKeyboardKey[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS]; // default keyboard keys only have an effect the current game is this game
|
||||
|
||||
+119
-72
@@ -62,19 +62,19 @@ GameDef g_GameDefs[NUM_GAMES] =
|
||||
"MenuUp",
|
||||
"MenuDown",
|
||||
},
|
||||
{ // m_szButtonDescriptions
|
||||
"Left (MenuLeft)",
|
||||
"Right (MenuRight)",
|
||||
"Up (MenuUp)",
|
||||
"Down (MenuDown)",
|
||||
"UpLeft",
|
||||
"UpRight",
|
||||
"Start",
|
||||
"Back",
|
||||
"MenuLeft (dedicated)",
|
||||
"MenuRight (dedicated)",
|
||||
"MenuUp (dedicated)",
|
||||
"MenuDown (dedicated)",
|
||||
{ // m_szSecondaryFunction
|
||||
"(MenuLeft)",
|
||||
"(MenuRight)",
|
||||
"(MenuUp)",
|
||||
"(MenuDown)",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"(dedicated)",
|
||||
"(dedicated)",
|
||||
"(dedicated)",
|
||||
"(dedicated)",
|
||||
},
|
||||
{ // m_DedicatedMenuButton
|
||||
DANCE_BUTTON_MENULEFT, // MENU_BUTTON_LEFT
|
||||
@@ -141,18 +141,18 @@ GameDef g_GameDefs[NUM_GAMES] =
|
||||
"MenuUp",
|
||||
"MenuDown",
|
||||
},
|
||||
{ // m_szButtonDescriptions
|
||||
"UpLeft (MenuLeft)",
|
||||
"UpRight (MenuRight)",
|
||||
"Center (Start)",
|
||||
"DownLeft (MenuUp)",
|
||||
"DownRight (MenuDown)",
|
||||
"Start (dedicated)",
|
||||
"Back",
|
||||
"MenuLeft (dedicated)",
|
||||
"MenuRight (dedicated)",
|
||||
"MenuUp (dedicated)",
|
||||
"MenuDown (dedicated)",
|
||||
{ // m_szSecondaryFunction
|
||||
"(MenuLeft)",
|
||||
"(MenuRight)",
|
||||
"(Start)",
|
||||
"(MenuUp)",
|
||||
"(MenuDown)",
|
||||
"(dedicated)",
|
||||
"",
|
||||
"(dedicated)",
|
||||
"(dedicated)",
|
||||
"(dedicated)",
|
||||
"(dedicated)",
|
||||
},
|
||||
{ // m_DedicatedMenuButton
|
||||
PUMP_BUTTON_MENULEFT, // MENU_BUTTON_LEFT
|
||||
@@ -219,20 +219,20 @@ GameDef g_GameDefs[NUM_GAMES] =
|
||||
"MenuUp",
|
||||
"MenuDown",
|
||||
},
|
||||
{ // m_szButtonDescriptions
|
||||
"FootUpLeft (MenuUp)",
|
||||
"FootUpRight (MenuDown)",
|
||||
"FootDown (Start)",
|
||||
"HandUpLeft (MenuLeft)",
|
||||
"HandUpRight (MenuRight)",
|
||||
"HandLrLeft",
|
||||
"HandLrRight",
|
||||
"Start (dedicated)",
|
||||
"Back",
|
||||
"MenuLeft (dedicated)",
|
||||
"MenuRight (dedicated)",
|
||||
"MenuUp (dedicated)",
|
||||
"MenuDown (dedicated)",
|
||||
{ // m_szSecondaryFunction
|
||||
"(MenuUp)",
|
||||
"(MenuDown)",
|
||||
"(Start)",
|
||||
"(MenuLeft)",
|
||||
"(MenuRight)",
|
||||
"",
|
||||
"",
|
||||
"(dedicated)",
|
||||
"",
|
||||
"(dedicated)",
|
||||
"(dedicated)",
|
||||
"(dedicated)",
|
||||
"(dedicated)",
|
||||
},
|
||||
{ // m_DedicatedMenuButton
|
||||
EZ2_BUTTON_MENULEFT, // MENU_BUTTON_LEFT
|
||||
@@ -289,9 +289,10 @@ GameDef g_GameDefs[NUM_GAMES] =
|
||||
StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
{
|
||||
{ // STYLE_DANCE_SINGLE
|
||||
GAME_DANCE, // m_Game
|
||||
"dance-single", // m_szName
|
||||
NOTES_TYPE_DANCE_SINGLE, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_ONE_SIDE, // m_StyleType
|
||||
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
4, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -313,11 +314,12 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // STYLE_DANCE_VERSUS
|
||||
"dance-versus", // m_szName
|
||||
NOTES_TYPE_DANCE_SINGLE, // m_NotesType
|
||||
StyleDef::TWO_PLAYERS_USE_TWO_SIDES, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
4, // m_iColsPerPlayer
|
||||
GAME_DANCE, // m_Game
|
||||
"dance-versus", // m_szName
|
||||
NOTES_TYPE_DANCE_SINGLE, // m_NotesType
|
||||
StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
4, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, GAME_CONTROLLER_1, DANCE_BUTTON_LEFT, -DANCE_COL_SPACING*1.5f },
|
||||
@@ -337,11 +339,12 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // STYLE_DANCE_DOUBLE
|
||||
"dance-double", // m_szName
|
||||
NOTES_TYPE_DANCE_DOUBLE, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_TWO_SIDES, // m_StyleType
|
||||
{ 320, 320 }, // m_iCenterX
|
||||
8, // m_iColsPerPlayer
|
||||
GAME_DANCE, // m_Game
|
||||
"dance-double", // m_szName
|
||||
NOTES_TYPE_DANCE_DOUBLE, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType
|
||||
{ 320, 320 }, // m_iCenterX
|
||||
8, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, GAME_CONTROLLER_1, DANCE_BUTTON_LEFT, -DANCE_COL_SPACING*3.5f },
|
||||
@@ -369,11 +372,12 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // StyleDef
|
||||
"dance-couple", // m_szName
|
||||
NOTES_TYPE_DANCE_SINGLE, // m_NotesType
|
||||
StyleDef::TWO_PLAYERS_USE_TWO_SIDES, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
4, // m_iColsPerPlayer
|
||||
GAME_DANCE, // m_Game
|
||||
"dance-couple", // m_szName
|
||||
NOTES_TYPE_DANCE_SINGLE, // m_NotesType
|
||||
StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
4, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
{ TRACK_1, GAME_CONTROLLER_1, DANCE_BUTTON_LEFT, -DANCE_COL_SPACING*1.5f },
|
||||
@@ -393,10 +397,11 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // STYLE_DANCE_SOLO
|
||||
GAME_DANCE, // m_Game
|
||||
"dance-solo", // m_szName
|
||||
NOTES_TYPE_DANCE_SOLO, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_ONE_SIDE, // m_StyleType
|
||||
{ 240, 400 }, // m_iCenterX
|
||||
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
|
||||
{ 320, 320 }, // m_iCenterX
|
||||
6, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
{ // PLAYER_1
|
||||
@@ -423,7 +428,7 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
/* { // STYLE_DANCE_SOLO_VERSUS
|
||||
"dance-solo-versus", // m_szName
|
||||
NOTES_TYPE_DANCE_SOLO, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_ONE_SIDE, // m_StyleType
|
||||
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
6, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -449,9 +454,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
*/ { // PUMP_STYLE_SINGLE
|
||||
GAME_PUMP, // m_Game
|
||||
"pump-single", // m_szName
|
||||
NOTES_TYPE_PUMP_SINGLE, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_ONE_SIDE, // m_StyleType
|
||||
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
5, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -475,9 +481,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // PUMP_STYLE_VERSUS
|
||||
GAME_PUMP, // m_Game
|
||||
"pump-versus", // m_szName
|
||||
NOTES_TYPE_PUMP_SINGLE, // m_NotesType
|
||||
StyleDef::TWO_PLAYERS_USE_TWO_SIDES, // m_StyleType
|
||||
StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
5, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -501,9 +508,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // PUMP_STYLE_DOUBLE
|
||||
GAME_PUMP, // m_Game
|
||||
"pump-double", // m_szName
|
||||
NOTES_TYPE_PUMP_SINGLE, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_TWO_SIDES, // m_StyleType
|
||||
NOTES_TYPE_PUMP_DOUBLE, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
10, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -539,9 +547,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
|
||||
|
||||
{ // EZ2_STYLE_SINGLE
|
||||
GAME_EZ2, // m_Game
|
||||
"ez2-single", // m_szName
|
||||
NOTES_TYPE_EZ2_SINGLE, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_ONE_SIDE, // m_StyleType
|
||||
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
5, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -565,9 +574,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // EZ2_STYLE_SINGLE_HARD
|
||||
GAME_EZ2, // m_Game
|
||||
"ez2-single-hard", // m_szName
|
||||
NOTES_TYPE_EZ2_SINGLE_HARD, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_ONE_SIDE, // m_StyleType
|
||||
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
5, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -591,9 +601,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // EZ2_STYLE_DOUBLE
|
||||
GAME_EZ2, // m_Game
|
||||
"ez2-double", // m_szName
|
||||
NOTES_TYPE_EZ2_DOUBLE, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_TWO_SIDES, // m_StyleType
|
||||
StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
10, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -627,9 +638,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // EZ2_STYLE_REAL
|
||||
GAME_EZ2, // m_Game
|
||||
"ez2-real", // m_szName
|
||||
NOTES_TYPE_EZ2_REAL, // m_NotesType
|
||||
StyleDef::ONE_PLAYER_USES_ONE_SIDE, // m_StyleType
|
||||
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
7, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -657,9 +669,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // EZ2_STYLE_SINGLE_VERSUS
|
||||
GAME_EZ2, // m_Game
|
||||
"ez2-single-versus", // m_szName
|
||||
NOTES_TYPE_EZ2_SINGLE, // m_NotesType
|
||||
StyleDef::TWO_PLAYERS_USE_TWO_SIDES, // m_StyleType
|
||||
StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
5, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -683,9 +696,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
},
|
||||
{ // EZ2_STYLE_SINGLE_VERSUS
|
||||
GAME_EZ2, // m_Game
|
||||
"ez2-single-hard-versus", // m_szName
|
||||
NOTES_TYPE_EZ2_SINGLE_HARD, // m_NotesType
|
||||
StyleDef::TWO_PLAYERS_USE_TWO_SIDES, // m_StyleType
|
||||
StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
5, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -710,9 +724,10 @@ StyleDef g_StyleDefs[NUM_STYLES] =
|
||||
},
|
||||
|
||||
{ // EZ2_STYLE_REAL_VERSUS
|
||||
GAME_EZ2, // m_Game
|
||||
"ez2-real-versus", // m_szName
|
||||
NOTES_TYPE_EZ2_REAL, // m_NotesType
|
||||
StyleDef::TWO_PLAYERS_USE_TWO_SIDES, // m_StyleType
|
||||
StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType
|
||||
{ 160, 480 }, // m_iCenterX
|
||||
7, // m_iColsPerPlayer
|
||||
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
|
||||
@@ -768,18 +783,38 @@ Style GameManager::GetStyleThatPlaysNotesType( NotesType nt )
|
||||
return STYLE_NONE;
|
||||
}
|
||||
|
||||
void GameManager::GetGameNames( CStringArray &AddTo )
|
||||
void GameManager::GetStylesForGame( Game game, CArray<Style,Style>& aStylesAddTo )
|
||||
{
|
||||
for( int i=0; i<NUM_GAMES; i++ )
|
||||
AddTo.Add( g_GameDefs[i].m_szName );
|
||||
for( int s=0; s<NUM_STYLES; s++ )
|
||||
if( g_StyleDefs[s].m_Game == game )
|
||||
aStylesAddTo.Add( (Style)s );
|
||||
}
|
||||
|
||||
void GameManager::GetNotesTypesForGame( Game game, CArray<NotesType,NotesType>& aNotesTypeAddTo )
|
||||
{
|
||||
for( int nt=0; nt<NUM_NOTES_TYPES; nt++ )
|
||||
{
|
||||
for( int s=0; s<NUM_STYLES; s++ )
|
||||
{
|
||||
if( g_StyleDefs[s].m_Game == game && g_StyleDefs[s].m_NotesType == nt )
|
||||
{
|
||||
aNotesTypeAddTo.Add( (NotesType)nt );
|
||||
break; // next NotesType
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameManager::GetNoteSkinNames( CStringArray &AddTo )
|
||||
{
|
||||
GAMESTATE->GetCurrentGameDef()->GetSkinNames( AddTo );
|
||||
}
|
||||
|
||||
void GameManager::GetNoteSkinNames( Game game, CStringArray &AddTo )
|
||||
{
|
||||
GetGameDefForGame(game)->GetSkinNames( AddTo );
|
||||
}
|
||||
|
||||
bool GameManager::DoesNoteSkinExist( CString sSkinName )
|
||||
{
|
||||
CStringArray asSkinNames;
|
||||
@@ -838,3 +873,15 @@ void GameManager::GetHoldTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR>
|
||||
CString sButtonName = pGameDef->m_szButtonNames[GI.button];
|
||||
pGameDef->GetHoldTweenColors( m_sCurNoteSkin, sButtonName, aHoldTweenColorsAddTo );
|
||||
}
|
||||
|
||||
void GameManager::GetEnabledGames( CArray<Game,Game>& aGamesOut )
|
||||
{
|
||||
for( int g=0; g<NUM_GAMES; g++ )
|
||||
{
|
||||
Game game = (Game)g;
|
||||
CStringArray asNoteSkins;
|
||||
GetNoteSkinNames( game, asNoteSkins );
|
||||
if( asNoteSkins.GetSize() > 0 )
|
||||
aGamesOut.Add( game );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
*/
|
||||
#include "GameDef.h"
|
||||
#include "StyleDef.h"
|
||||
#include "Style.h"
|
||||
#include "Game.h"
|
||||
|
||||
|
||||
class GameManager
|
||||
@@ -24,8 +26,11 @@ public:
|
||||
|
||||
Style GetStyleThatPlaysNotesType( NotesType nt );
|
||||
|
||||
void GetGameNames( CStringArray &AddTo );
|
||||
bool DoesGameExist( CString sGameName );
|
||||
void GetStylesForGame( Game game, CArray<Style,Style>& aStylesAddTo );
|
||||
void GetNotesTypesForGame( Game game, CArray<NotesType,NotesType>& aNotesTypeAddTo );
|
||||
|
||||
// void GetGameNames( CStringArray &AddTo );
|
||||
// bool DoesGameExist( CString sGameName );
|
||||
|
||||
void GetNoteSkinNames( CStringArray &AddTo ); // looks up current Game in GAMESTATE
|
||||
bool DoesNoteSkinExist( CString sSkinName ); // looks up current Game in GAMESTATE
|
||||
@@ -36,7 +41,10 @@ public:
|
||||
void GetTapTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR> &aTapTweenColorsAddTo ); // looks in GAMESTATE for the current Style
|
||||
void GetHoldTweenColors( const int col, CArray<D3DXCOLOR,D3DXCOLOR> &aHoldTweenColorsAddTo ); // looks in GAMESTATE for the current Style
|
||||
|
||||
void GetEnabledGames( CArray<Game,Game>& aGamesOut );
|
||||
|
||||
protected:
|
||||
void GetNoteSkinNames( Game game, CStringArray &AddTo );
|
||||
|
||||
CString m_sCurNoteSkin;
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@ void GameState::Reset()
|
||||
int p;
|
||||
|
||||
m_CurStyle = STYLE_NONE;
|
||||
m_MasterPlayerNumber = PLAYER_INVALID;
|
||||
m_bPlayersCanJoin = false;
|
||||
for( int i=0; i<2; i++ )
|
||||
m_bIsJoined[i] = false;
|
||||
m_sPreferredGroup = "";
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
m_PreferredDifficultyClass[p] = CLASS_INVALID;
|
||||
@@ -264,8 +266,17 @@ bool GameState::IsPlayerEnabled( PlayerNumber pn )
|
||||
if( m_CurStyle == STYLE_NONE ) // if no style set (we're in TitleMenu, ConfigInstruments or something)
|
||||
return true; // allow input from both sides
|
||||
|
||||
return ( pn == m_MasterPlayerNumber ) ||
|
||||
( GetCurrentStyleDef()->m_StyleType == StyleDef::TWO_PLAYERS_USE_TWO_SIDES );
|
||||
switch( GetCurrentStyleDef()->m_StyleType )
|
||||
{
|
||||
case StyleDef::TWO_PLAYERS_TWO_CREDITS:
|
||||
return true;
|
||||
case StyleDef::ONE_PLAYER_ONE_CREDIT:
|
||||
case StyleDef::ONE_PLAYER_TWO_CREDITS:
|
||||
return m_bIsJoined[pn];
|
||||
default:
|
||||
ASSERT(0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
float GameState::GetElapsedSeconds()
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PlayerOptions.h"
|
||||
#include "SongOptions.h"
|
||||
#include "Game.h"
|
||||
#include "Style.h"
|
||||
|
||||
|
||||
class Song;
|
||||
@@ -34,7 +36,8 @@ public:
|
||||
//
|
||||
Game m_CurGame;
|
||||
Style m_CurStyle;
|
||||
PlayerNumber m_MasterPlayerNumber;
|
||||
bool m_bPlayersCanJoin; // true if it's not too late for a player to join
|
||||
bool m_bIsJoined[2]; // left side, and right side
|
||||
|
||||
GameDef* GetCurrentGameDef();
|
||||
StyleDef* GetCurrentStyleDef();
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: GhostArrowRow.h
|
||||
Class: GhostArrowRow
|
||||
|
||||
Desc: A graphic displayed in the GhostArrowRow during Dancing.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -13,7 +14,6 @@
|
||||
#include "RageUtil.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "ColorNote.h"
|
||||
#include "ArrowEffects.h"
|
||||
#include "GameManager.h"
|
||||
#include "GameState.h"
|
||||
@@ -62,7 +62,7 @@ void GhostArrowRow::DrawPrimitives()
|
||||
{
|
||||
for( int c=0; c<m_iNumCols; c++ )
|
||||
{
|
||||
float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
|
||||
float fX = ArrowGetXPos2( m_PlayerNumber, c, 0 );
|
||||
m_GhostArrowRow[c].SetX( fX );
|
||||
m_GhostArrowRowBright[c].SetX( fX );
|
||||
m_HoldGhostArrowRow[c].SetX( fX );
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "GradeDisplay.h"
|
||||
#include "RageUtil.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
@@ -26,7 +24,7 @@ const float GRADES_TO_SCROLL = NUM_GRADE_FRAMES*4;
|
||||
|
||||
GradeDisplay::GradeDisplay()
|
||||
{
|
||||
Load( THEME->GetPathTo(GRAPHIC_EVALUATION_GRADES) );
|
||||
Load( THEME->GetPathTo("Graphics","evaluation grades") );
|
||||
StopAnimating();
|
||||
|
||||
m_fTimeLeftInScroll = 0;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "RageUtil.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "ColorNote.h"
|
||||
#include "ArrowEffects.h"
|
||||
#include "GameManager.h"
|
||||
#include "GameState.h"
|
||||
@@ -59,7 +58,7 @@ void GrayArrowRow::DrawPrimitives()
|
||||
for( int c=0; c<m_iNumCols; c++ )
|
||||
{
|
||||
// set arrow X
|
||||
float fX = ArrowGetXPos( m_PlayerNumber, c, 0 );
|
||||
float fX = ArrowGetXPos2( m_PlayerNumber, c, 0 );
|
||||
m_GrayArrow[c].SetX( fX );
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ GrooveRadar::GrooveRadar()
|
||||
const float fY = -sinf(fRotation) * fRadius * 1.15f;
|
||||
|
||||
|
||||
m_sprRadarLabels[c].Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_RADAR_WORDS) );
|
||||
m_sprRadarLabels[c].Load( THEME->GetPathTo("Graphics","select music radar words") );
|
||||
m_sprRadarLabels[c].StopAnimating();
|
||||
m_sprRadarLabels[c].SetState( c );
|
||||
m_sprRadarLabels[c].SetXY( fX, fY );
|
||||
@@ -90,7 +90,7 @@ void GrooveRadar::TweenOffScreen()
|
||||
|
||||
GrooveRadar::GrooveRadarValueMap::GrooveRadarValueMap()
|
||||
{
|
||||
m_sprRadarBase.Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_RADAR_BASE) );
|
||||
m_sprRadarBase.Load( THEME->GetPathTo("Graphics","select music radar base") );
|
||||
this->AddSubActor( &m_sprRadarBase );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: HoldJudgement.h
|
||||
Class: HoldJudgement
|
||||
|
||||
Desc: A graphic displayed in the HoldJudgement during Dancing.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -15,13 +16,13 @@
|
||||
#include "PrefsManager.h"
|
||||
|
||||
|
||||
const float JUDGEMENT_DISPLAY_TIME = 0.6f;
|
||||
#define JUDGEMENT_DISPLAY_TIME THEME->GetMetricF("HoldJudgement","DisplayTime")
|
||||
|
||||
|
||||
HoldJudgement::HoldJudgement()
|
||||
{
|
||||
m_fDisplayCountdown = 0;
|
||||
m_sprJudgement.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_JUDGEMENT) );
|
||||
m_sprJudgement.Load( THEME->GetPathTo("Graphics","gameplay hold judgement") );
|
||||
m_sprJudgement.StopAnimating();
|
||||
m_sprJudgement.TurnShadowOn();
|
||||
this->AddSubActor( &m_sprJudgement );
|
||||
@@ -51,8 +52,8 @@ void HoldJudgement::SetHoldJudgement( HoldNoteScore hns )
|
||||
switch( hns )
|
||||
{
|
||||
case HNS_NONE: m_sprJudgement.SetState( 0 ); break;
|
||||
case HNS_OK: m_sprJudgement.SetState( 7 ); break;
|
||||
case HNS_NG: m_sprJudgement.SetState( 8 ); break;
|
||||
case HNS_OK: m_sprJudgement.SetState( 0 ); break;
|
||||
case HNS_NG: m_sprJudgement.SetState( 1 ); break;
|
||||
default: ASSERT( false );
|
||||
}
|
||||
|
||||
|
||||
@@ -74,9 +74,13 @@ bool IniFile::ReadFile()
|
||||
}
|
||||
else //if a value
|
||||
{
|
||||
valuename = line.Left(line.Find("="));
|
||||
value = line.Right(line.GetLength()-valuename.GetLength()-1);
|
||||
SetValue(keyname,valuename,value);
|
||||
int iEqualIndex = line.Find("=");
|
||||
if( iEqualIndex != -1 )
|
||||
{
|
||||
valuename = line.Left(iEqualIndex);
|
||||
value = line.Right(line.GetLength()-valuename.GetLength()-1);
|
||||
SetValue(keyname,valuename,value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,25 +38,24 @@ void InputMapper::ClearAllMappings()
|
||||
m_GItoDI[i][j][k].MakeInvalid();
|
||||
}
|
||||
|
||||
void InputMapper::ClearDefaultMappings()
|
||||
void InputMapper::AddDefaultMappingsForCurrentGameIfUnmapped()
|
||||
{
|
||||
// default mappings are in the third slot
|
||||
// Clear default mappings. Default mappings are in the third slot.
|
||||
for( int i=0; i<MAX_GAME_CONTROLLERS; i++ )
|
||||
for( int j=0; j<MAX_GAME_BUTTONS; j++ )
|
||||
m_GItoDI[i][j][2].MakeInvalid();
|
||||
}
|
||||
ClearFromInputMap( GameInput((GameController)i,(GameButton)j), 2 );
|
||||
|
||||
void InputMapper::AddDefaultMappingsForCurrentGame()
|
||||
{
|
||||
GameDef* pGameDef = GAMESTATE->GetCurrentGameDef();
|
||||
for( int c=0; c<MAX_GAME_CONTROLLERS; c++ )
|
||||
{
|
||||
for( int b=0; b<pGameDef->m_iButtonsPerController; b++ )
|
||||
{
|
||||
int key = pGameDef->m_iDefaultKeyboardKey[c][b];
|
||||
if( key == -1 ) // "no key" marker"
|
||||
continue;
|
||||
DeviceInput DeviceI( DEVICE_KEYBOARD, key );
|
||||
GameInput GameI( (GameController)c, (GameButton)b );
|
||||
if( key != -1 && !IsMapped(DeviceI) )
|
||||
if( !IsMapped(DeviceI) ) // if this key isn't already being used by another user-made mapping
|
||||
SetInputMap( DeviceI, GameI, 2 );
|
||||
}
|
||||
}
|
||||
@@ -71,9 +70,8 @@ void InputMapper::ReadMappingsFromDisk()
|
||||
CString sPath = GAMESTATE->GetCurrentGameDef()->m_szName + CString("Map.ini");
|
||||
IniFile ini;
|
||||
ini.SetPath( sPath );
|
||||
if( !ini.ReadFile() ) {
|
||||
if( !ini.ReadFile() )
|
||||
LOG->Warn( "could not input mapping file '%s'.", sPath );
|
||||
}
|
||||
|
||||
IniFile::key* pKey = ini.GetKey( "Input" );
|
||||
|
||||
@@ -100,8 +98,7 @@ void InputMapper::ReadMappingsFromDisk()
|
||||
}
|
||||
}
|
||||
|
||||
ClearDefaultMappings();
|
||||
AddDefaultMappingsForCurrentGame();
|
||||
AddDefaultMappingsForCurrentGameIfUnmapped();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,13 +33,12 @@ public:
|
||||
void SaveMappingsToDisk();
|
||||
|
||||
void ClearAllMappings();
|
||||
void ClearDefaultMappings();
|
||||
|
||||
void SetInputMap( DeviceInput DeviceI, GameInput GameI, int iSlotIndex );
|
||||
void ClearFromInputMap( DeviceInput DeviceI );
|
||||
void ClearFromInputMap( GameInput GameI, int iSlotIndex );
|
||||
|
||||
void AddDefaultMappingsForCurrentGame();
|
||||
void AddDefaultMappingsForCurrentGameIfUnmapped();
|
||||
|
||||
bool IsMapped( DeviceInput DeviceI );
|
||||
bool IsMapped( GameInput GameI );
|
||||
|
||||
@@ -22,7 +22,7 @@ const float JUDGEMENT_DISPLAY_TIME = 0.8f;
|
||||
Judgement::Judgement()
|
||||
{
|
||||
m_fDisplayCountdown = 0;
|
||||
m_sprJudgement.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_JUDGEMENT) );
|
||||
m_sprJudgement.Load( THEME->GetPathTo("Graphics","gameplay judgement") );
|
||||
m_sprJudgement.StopAnimating();
|
||||
m_sprJudgement.TurnShadowOn();
|
||||
this->AddSubActor( &m_sprJudgement );
|
||||
@@ -60,6 +60,8 @@ void Judgement::SetJudgement( TapNoteScore score )
|
||||
default: ASSERT( false );
|
||||
}
|
||||
|
||||
// Chris: Resize the graphic file itself if you want the size different for Ez2.
|
||||
/*
|
||||
if ( GAMESTATE->m_CurGame == GAME_EZ2 ) // Resize Judgement graphics for Ez2.
|
||||
{
|
||||
m_sprJudgement.SetHeight( 22.0f * 2.1f );
|
||||
@@ -70,6 +72,7 @@ void Judgement::SetJudgement( TapNoteScore score )
|
||||
m_sprJudgement.SetWidth( 143.0f * 2.8f );
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME;
|
||||
|
||||
|
||||
@@ -16,18 +16,13 @@
|
||||
#include "RageTimer.h"
|
||||
#include "GameState.h"
|
||||
|
||||
const int NUM_LIFE_STREAM_SECTIONS = 3;
|
||||
const float LIFE_STREAM_SECTION_WIDTH = 1.0f/NUM_LIFE_STREAM_SECTIONS;
|
||||
|
||||
const float METER_WIDTH = 258;
|
||||
const float METER_HEIGHT = 20;
|
||||
|
||||
const float DANGER_THRESHOLD = 0.4f;
|
||||
#define METER_WIDTH THEME->GetMetricF("LifeMeterBar","MeterWidth")
|
||||
#define METER_HEIGHT THEME->GetMetricF("LifeMeterBar","MeterHeight")
|
||||
#define DANGER_THRESHOLD THEME->GetMetricF("LifeMeterBar","DangerThreshold")
|
||||
const float FAIL_THRESHOLD = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
LifeMeterBar::LifeMeterBar()
|
||||
{
|
||||
switch( GAMESTATE->m_SongOptions.m_DrainType )
|
||||
@@ -48,13 +43,13 @@ LifeMeterBar::LifeMeterBar()
|
||||
m_quadBlackBackground.SetZoomY( METER_HEIGHT );
|
||||
m_frame.AddSubActor( &m_quadBlackBackground );
|
||||
|
||||
m_sprStreamNormal.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_LIFEMETER_STREAM_NORMAL) );
|
||||
m_sprStreamNormal.Load( THEME->GetPathTo("Graphics","gameplay lifemeter stream normal") );
|
||||
m_frame.AddSubActor( &m_sprStreamNormal );
|
||||
|
||||
m_sprStreamHot.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_LIFEMETER_STREAM_HOT) );
|
||||
m_sprStreamHot.Load( THEME->GetPathTo("Graphics","gameplay lifemeter stream hot") );
|
||||
m_frame.AddSubActor( &m_sprStreamHot );
|
||||
|
||||
m_sprFrame.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_LIFEMETER_BAR) );
|
||||
m_sprFrame.Load( THEME->GetPathTo("Graphics","gameplay lifemeter bar") );
|
||||
m_frame.AddSubActor( &m_sprFrame );
|
||||
|
||||
this->AddSubActor( &m_frame );
|
||||
@@ -199,7 +194,7 @@ void LifeMeterBar::Update( float fDeltaTime )
|
||||
|
||||
void LifeMeterBar::DrawPrimitives()
|
||||
{
|
||||
float fPercentRed = IsInDanger() ? sinf( TIMER->GetTimeSinceStart()*D3DX_PI*4 )/2+0.5f : 0;
|
||||
float fPercentRed = (m_fTrailingLifePercentage<DANGER_THRESHOLD) ? sinf( TIMER->GetTimeSinceStart()*D3DX_PI*4 )/2+0.5f : 0;
|
||||
m_quadBlackBackground.SetDiffuseColor( D3DXCOLOR(fPercentRed*0.8f,0,0,1) );
|
||||
|
||||
if( !GAMESTATE->IsPlayerEnabled(m_PlayerNumber) )
|
||||
|
||||
@@ -35,8 +35,8 @@ LifeMeterBattery::LifeMeterBattery()
|
||||
m_fBatteryBlinkTime = 0;
|
||||
|
||||
|
||||
m_soundGainLife.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ONI_GAIN_LIFE) );
|
||||
m_soundLoseLife.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ONI_LOSE_LIFE) );
|
||||
m_soundGainLife.Load( THEME->GetPathTo("Sounds","gameplay oni gain life") );
|
||||
m_soundLoseLife.Load( THEME->GetPathTo("Sounds","gameplay oni lose life") );
|
||||
}
|
||||
|
||||
void LifeMeterBattery::Load( PlayerNumber pn )
|
||||
@@ -45,22 +45,22 @@ void LifeMeterBattery::Load( PlayerNumber pn )
|
||||
|
||||
bool bPlayerEnabled = GAMESTATE->IsPlayerEnabled(pn);
|
||||
|
||||
m_sprFrame.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_LIFEMETER_ONI) );
|
||||
m_sprFrame.Load( THEME->GetPathTo("Graphics","gameplay lifemeter oni") );
|
||||
this->AddSubActor( &m_sprFrame );
|
||||
|
||||
m_sprBattery.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_LIFEMETER_BATTERY) );
|
||||
m_sprBattery.Load( THEME->GetPathTo("Graphics","gameplay lifemeter battery") );
|
||||
m_sprBattery.StopAnimating();
|
||||
if( bPlayerEnabled )
|
||||
this->AddSubActor( &m_sprBattery );
|
||||
|
||||
m_textNumLives.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textNumLives.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textNumLives.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // pink
|
||||
m_textNumLives.SetZoom( 1.1f );
|
||||
m_textNumLives.TurnShadowOff();
|
||||
if( bPlayerEnabled )
|
||||
this->AddSubActor( &m_textNumLives );
|
||||
|
||||
m_textPercent.Load( THEME->GetPathTo(FONT_SCORE_NUMBERS) );
|
||||
m_textPercent.LoadFromFont( THEME->GetPathTo("Fonts","score numbers") );
|
||||
m_textPercent.TurnShadowOff();
|
||||
m_textPercent.SetZoom( 0.7f );
|
||||
m_textPercent.SetText( "00.0" );
|
||||
|
||||
@@ -33,8 +33,6 @@ const float STYLE_ICON_LOCAL_Y = 6;
|
||||
const float TIMER_LOCAL_X = 270;
|
||||
const float TIMER_LOCAL_Y = 0;
|
||||
|
||||
const float CREDIT_X[NUM_PLAYERS] = {160,480};
|
||||
const float CREDIT_Y[NUM_PLAYERS] = {SCREEN_BOTTOM-8, SCREEN_BOTTOM-8};
|
||||
|
||||
|
||||
MenuElements::MenuElements()
|
||||
@@ -49,8 +47,6 @@ MenuElements::MenuElements()
|
||||
this->AddSubActor( &m_frameTopBar );
|
||||
this->AddSubActor( &m_frameBottomBar );
|
||||
this->AddSubActor( &m_textHelp );
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
this->AddSubActor( &m_textCreditInfo[p] );
|
||||
|
||||
m_KeepAlive.SetZ( -2 );
|
||||
m_KeepAlive.SetOpened();
|
||||
@@ -77,7 +73,7 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
|
||||
m_sprTopEdge.Load( sTopEdgePath );
|
||||
m_sprTopEdge.TurnShadowOff();
|
||||
|
||||
m_sprStyleIcon.Load( THEME->GetPathTo(GRAPHIC_MENU_STYLE_ICONS) );
|
||||
m_sprStyleIcon.Load( THEME->GetPathTo("Graphics","menu style icons") );
|
||||
m_sprStyleIcon.StopAnimating();
|
||||
m_sprStyleIcon.SetXY( STYLE_ICON_LOCAL_X, STYLE_ICON_LOCAL_Y );
|
||||
m_sprStyleIcon.SetZ( -1 );
|
||||
@@ -99,7 +95,7 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
|
||||
|
||||
m_frameBottomBar.SetZ( -1 );
|
||||
|
||||
m_sprBottomEdge.Load( THEME->GetPathTo(GRAPHIC_MENU_BOTTOM_EDGE) );
|
||||
m_sprBottomEdge.Load( THEME->GetPathTo("Graphics","menu bottom edge") );
|
||||
m_sprBottomEdge.TurnShadowOff();
|
||||
|
||||
m_textHelp.SetXY( HELP_X, HELP_Y );
|
||||
@@ -110,28 +106,9 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString
|
||||
//m_textHelp.SetText( sHelpText );
|
||||
m_textHelp.SetZoom( 0.5f );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_textCreditInfo[p].Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textCreditInfo[p].SetXY( CREDIT_X[p], CREDIT_Y[p] );
|
||||
m_textCreditInfo[p].SetZ( -1 );
|
||||
|
||||
if( GAMESTATE->m_CurStyle == STYLE_NONE )
|
||||
m_textCreditInfo[p].SetText( "PRESS START" );
|
||||
else if( GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
||||
m_textCreditInfo[p].SetText( "" );
|
||||
else // not enabled
|
||||
m_textCreditInfo[p].SetText( "NOT PRESENT" );
|
||||
|
||||
|
||||
m_textCreditInfo[p].SetZoom( 0.5f );
|
||||
m_textCreditInfo[p].SetDiffuseColor( D3DXCOLOR(0,0,0,1) );
|
||||
m_textCreditInfo[p].TurnShadowOff();
|
||||
}
|
||||
|
||||
m_soundSwoosh.Load( THEME->GetPathTo(SOUND_MENU_SWOOSH) );
|
||||
m_soundBack.Load( THEME->GetPathTo(SOUND_MENU_BACK) );
|
||||
|
||||
m_soundSwoosh.Load( THEME->GetPathTo("Sounds","menu swoosh") );
|
||||
m_soundBack.Load( THEME->GetPathTo("Sounds","menu back") );
|
||||
|
||||
|
||||
m_frameTopBar.SetXY( CENTER_X, m_sprTopEdge.GetZoomedHeight()/2 );
|
||||
@@ -233,9 +210,6 @@ void MenuElements::DrawTopLayer()
|
||||
m_frameTopBar.Draw();
|
||||
m_frameBottomBar.Draw();
|
||||
m_textHelp.Draw();
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
m_textCreditInfo[p].Draw();
|
||||
|
||||
m_KeepAlive.Draw();
|
||||
m_Wipe.Draw();
|
||||
}
|
||||
@@ -250,7 +224,3 @@ void MenuElements::StopTimer()
|
||||
m_MenuTimer.StopTimer();
|
||||
}
|
||||
|
||||
void MenuElements::OverrideCreditsMessage( PlayerNumber p, CString sNewString )
|
||||
{
|
||||
m_textCreditInfo[p].SetText( sNewString );
|
||||
}
|
||||
|
||||
@@ -39,8 +39,6 @@ public:
|
||||
void SetTimer( int iTimerSeconds );
|
||||
void StopTimer();
|
||||
|
||||
void OverrideCreditsMessage( PlayerNumber p, CString sNewString );
|
||||
|
||||
void DrawTopLayer();
|
||||
void DrawBottomLayer();
|
||||
|
||||
@@ -73,7 +71,6 @@ protected:
|
||||
// stuff in the main frame
|
||||
Sprite m_sprBG;
|
||||
TipDisplay m_textHelp;
|
||||
BitmapText m_textCreditInfo[NUM_PLAYERS];
|
||||
|
||||
TransitionFadeWipe m_Wipe;
|
||||
TransitionKeepAlive m_KeepAlive;
|
||||
|
||||
@@ -25,17 +25,17 @@ MenuTimer::MenuTimer()
|
||||
m_fStallSeconds = 0;
|
||||
m_bTimerStopped = false;
|
||||
|
||||
m_textDigit1.Load( THEME->GetPathTo(FONT_TIMER_NUMBERS) );
|
||||
m_textDigit1.LoadFromFont( THEME->GetPathTo("Fonts","timer numbers") );
|
||||
m_textDigit1.TurnShadowOff();
|
||||
m_textDigit1.SetXY( -18, 0 );
|
||||
this->AddSubActor( &m_textDigit1 );
|
||||
|
||||
m_textDigit2.Load( THEME->GetPathTo(FONT_TIMER_NUMBERS) );
|
||||
m_textDigit2.LoadFromFont( THEME->GetPathTo("Fonts","timer numbers") );
|
||||
m_textDigit2.TurnShadowOff();
|
||||
m_textDigit2.SetXY( +18, 0 );
|
||||
this->AddSubActor( &m_textDigit2 );
|
||||
|
||||
m_soundBeep.Load( THEME->GetPathTo(SOUND_MENU_TIMER) );
|
||||
m_soundBeep.Load( THEME->GetPathTo("Sounds","menu timer") );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
MusicSortDisplay::MusicSortDisplay()
|
||||
{
|
||||
Load( THEME->GetPathTo(GRAPHIC_MUSIC_SORT_ICONS) );
|
||||
Load( THEME->GetPathTo("Graphics","music sort icons") );
|
||||
StopAnimating();
|
||||
TurnShadowOff();
|
||||
//SetXY( ON_SCREEN_X, ON_SCREEN_Y );
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: MusicStatusDisplay.h
|
||||
Class: MusicStatusDisplay
|
||||
|
||||
Desc: A graphic displayed in the MusicStatusDisplay during Dancing.
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
MusicStatusDisplay::MusicStatusDisplay()
|
||||
{
|
||||
Load( THEME->GetPathTo(GRAPHIC_MUSIC_STATUS_ICONS) );
|
||||
Load( THEME->GetPathTo("Graphics","music status icons") );
|
||||
StopAnimating();
|
||||
|
||||
SetType( TYPE_NONE );
|
||||
|
||||
+94
-166
@@ -21,49 +21,52 @@
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
const float FADE_TIME = 1.0f;
|
||||
|
||||
const float SWITCH_MUSIC_TIME = 0.10f;
|
||||
const float SAMPLE_MUSIC_DELAY = 0.20f;
|
||||
const float ROULETTE_SWITCH_MUSIC_TIME = SWITCH_MUSIC_TIME/2;
|
||||
const int ROULETTE_SWITCHES_IN_SLOWING_DOWN = 5;
|
||||
|
||||
const float LOCKED_WHEEL_INITIAL_VELOCITY = 7;
|
||||
|
||||
const float SORT_ICON_ON_SCREEN_X = -140;
|
||||
const float SORT_ICON_ON_SCREEN_Y = -180;
|
||||
|
||||
const float SORT_ICON_OFF_SCREEN_X = SORT_ICON_ON_SCREEN_X;
|
||||
const float SORT_ICON_OFF_SCREEN_Y = SORT_ICON_ON_SCREEN_Y - 64;
|
||||
// WheelItem stuff
|
||||
#define ICON_X THEME->GetMetricF("WheelItem","IconX")
|
||||
#define SONG_NAME_X THEME->GetMetricF("WheelItem","SongNameX")
|
||||
#define SECTION_NAME_X THEME->GetMetricF("WheelItem","SectionNameX")
|
||||
#define SECTION_ZOOM THEME->GetMetricF("WheelItem","SectionZoom")
|
||||
#define ROULETTE_X THEME->GetMetricF("WheelItem","RouletteX")
|
||||
#define ROULETTE_ZOOM THEME->GetMetricF("WheelItem","RouletteZoom")
|
||||
#define COURSE_X THEME->GetMetricF("WheelItem","CourseX")
|
||||
#define COURSE_ZOOM THEME->GetMetricF("WheelItem","CourseZoom")
|
||||
#define GRADE_P1_X THEME->GetMetricF("WheelItem","GradeP1X")
|
||||
#define GRADE_P2_X THEME->GetMetricF("WheelItem","GradeP2Y")
|
||||
|
||||
|
||||
const float SCORE_X = 58;
|
||||
const float SCORE_Y[NUM_PLAYERS] = { -40, 40 };
|
||||
// MusicWheel stuff
|
||||
#define FADE_SECONDS THEME->GetMetricF("MusicWheel","FadeSeconds")
|
||||
#define SWITCH_SECONDS THEME->GetMetricF("MusicWheel","SwitchSeconds")
|
||||
#define SAMPLE_MUSIC_DELAY THEME->GetMetricF("MusicWheel","SampleMusicDelay")
|
||||
#define ROULETTE_SWITCH_SECONDS THEME->GetMetricF("MusicWheel","RouletteSwitchSeconds")
|
||||
#define ROULETTE_SLOW_DOWN_SWITCHES THEME->GetMetricI("MusicWheel","RouletteSlowDownSwitches")
|
||||
#define LOCKED_INITIAL_VELOCITY THEME->GetMetricF("MusicWheel","LockedInitialVelocity")
|
||||
#define SCROLL_BAR_X THEME->GetMetricF("MusicWheel","ScrollBarX")
|
||||
#define SECTION_COLOR_1 THEME->GetMetricC("MusicWheel","SectionColor1")
|
||||
#define SECTION_COLOR_2 THEME->GetMetricC("MusicWheel","SectionColor2")
|
||||
#define SECTION_COLOR_3 THEME->GetMetricC("MusicWheel","SectionColor3")
|
||||
#define SECTION_COLOR_4 THEME->GetMetricC("MusicWheel","SectionColor4")
|
||||
#define SECTION_COLOR_5 THEME->GetMetricC("MusicWheel","SectionColor5")
|
||||
#define SECTION_COLOR_6 THEME->GetMetricC("MusicWheel","SectionColor6")
|
||||
#define SECTION_COLOR_7 THEME->GetMetricC("MusicWheel","SectionColor7")
|
||||
const int NUM_SECTION_COLORS = 7;
|
||||
|
||||
const float SCROLLBAR_X = 150;
|
||||
|
||||
D3DXCOLOR COLOR_SECTION_TEXT = D3DXCOLOR(1,1,0.3f,1);
|
||||
|
||||
|
||||
D3DXCOLOR SECTION_COLORS[] = {
|
||||
D3DXCOLOR( 0.9f, 0.0f, 0.2f, 1 ), // red
|
||||
D3DXCOLOR( 0.6f, 0.0f, 0.4f, 1 ), // pink
|
||||
D3DXCOLOR( 0.2f, 0.1f, 0.3f, 1 ), // purple
|
||||
D3DXCOLOR( 0.0f, 0.4f, 0.8f, 1 ), // sky blue
|
||||
D3DXCOLOR( 0.0f, 0.6f, 0.6f, 1 ), // sea green
|
||||
D3DXCOLOR( 0.0f, 0.6f, 0.2f, 1 ), // green
|
||||
D3DXCOLOR( 0.8f, 0.6f, 0.0f, 1 ), // orange
|
||||
};
|
||||
const int NUM_SECTION_COLORS = sizeof(SECTION_COLORS)/sizeof(D3DXCOLOR);
|
||||
|
||||
|
||||
|
||||
inline D3DXCOLOR GetNextSectionColor()
|
||||
{
|
||||
D3DXCOLOR SECTION_COLORS( int i ) {
|
||||
switch( i ) {
|
||||
case 0: return SECTION_COLOR_1;
|
||||
case 1: return SECTION_COLOR_2;
|
||||
case 2: return SECTION_COLOR_3;
|
||||
case 3: return SECTION_COLOR_4;
|
||||
case 4: return SECTION_COLOR_5;
|
||||
case 5: return SECTION_COLOR_6;
|
||||
case 6: return SECTION_COLOR_7;
|
||||
default: ASSERT(0); return D3DXCOLOR(1,1,1,1);
|
||||
}
|
||||
}
|
||||
inline D3DXCOLOR GetNextSectionColor() {
|
||||
static int i=0;
|
||||
i = i % NUM_SECTION_COLORS;
|
||||
return SECTION_COLORS[i++];
|
||||
return SECTION_COLORS(i++);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,54 +79,47 @@ WheelItemData::WheelItemData( WheelItemType wit, Song* pSong, const CString &sSe
|
||||
m_color = color;
|
||||
}
|
||||
|
||||
|
||||
WheelItemDisplay::WheelItemDisplay()
|
||||
{
|
||||
m_fPercentGray = 0;
|
||||
|
||||
m_MusicStatusDisplay.SetXY( -136, 0 );
|
||||
m_MusicStatusDisplay.SetXY( ICON_X, 0 );
|
||||
|
||||
m_TextBanner.SetHorizAlign( align_left );
|
||||
m_TextBanner.SetXY( -30, 0 );
|
||||
m_TextBanner.SetXY( SONG_NAME_X, 0 );
|
||||
|
||||
m_sprSongBar.Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_SONG_BAR) );
|
||||
m_sprSongBar.Load( THEME->GetPathTo("Graphics","select music song bar") );
|
||||
m_sprSongBar.SetXY( 0, 0 );
|
||||
|
||||
m_sprSectionBar.Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_SECTION_BAR) );
|
||||
m_sprSectionBar.Load( THEME->GetPathTo("Graphics","select music section bar") );
|
||||
m_sprSectionBar.SetXY( 0, 0 );
|
||||
|
||||
m_textSectionName.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textSectionName.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textSectionName.TurnShadowOff();
|
||||
m_textSectionName.SetHorizAlign( align_left );
|
||||
m_textSectionName.SetVertAlign( align_middle );
|
||||
m_textSectionName.SetXY( m_sprSectionBar.GetX() - m_sprSectionBar.GetUnzoomedWidth()/2 + 30, 0 );
|
||||
m_textSectionName.SetZoom( 1.0f );
|
||||
m_textSectionName.SetXY( SECTION_NAME_X, 0 );
|
||||
m_textSectionName.SetZoom( SECTION_ZOOM );
|
||||
|
||||
|
||||
|
||||
m_textRoulette.Load( THEME->GetPathTo(FONT_TEXT_BANNER) );
|
||||
m_textRoulette.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
||||
m_textRoulette.TurnShadowOff();
|
||||
m_textRoulette.SetText( "ROULETTE" );
|
||||
m_textRoulette.TurnRainbowOn();
|
||||
m_textRoulette.SetZoom( 1.3f );
|
||||
m_textRoulette.SetHorizAlign( align_left );
|
||||
m_textRoulette.SetXY( -120, 0 );
|
||||
m_textRoulette.SetZoom( ROULETTE_ZOOM );
|
||||
m_textRoulette.SetXY( ROULETTE_X, 0 );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_GradeDisplay[p].Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_SMALL_GRADES) );
|
||||
m_GradeDisplay[p].Load( THEME->GetPathTo("Graphics","select music small grades 1x7") );
|
||||
m_GradeDisplay[p].SetZoom( 1.0f );
|
||||
m_GradeDisplay[p].SetXY( 86.0f + p*26.0f, 0 );
|
||||
m_GradeDisplay[p].SetXY( p==PLAYER_1 ? GRADE_P1_X : GRADE_P2_X, 0 );
|
||||
}
|
||||
|
||||
m_textCourse.Load( THEME->GetPathTo(FONT_TEXT_BANNER) );
|
||||
m_textCourse.LoadFromFont( THEME->GetPathTo("Fonts","text banner") );
|
||||
m_textCourse.TurnShadowOff();
|
||||
m_textCourse.SetText( "ROULETTE" );
|
||||
m_textCourse.TurnRainbowOn();
|
||||
m_textCourse.SetZoom( 1.3f );
|
||||
m_textCourse.SetZoom( COURSE_ZOOM );
|
||||
m_textCourse.SetHorizAlign( align_left );
|
||||
m_textCourse.SetXY( -120, 0 );
|
||||
|
||||
m_textCourse.SetXY( COURSE_X, 0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -296,54 +292,24 @@ MusicWheel::MusicWheel()
|
||||
{
|
||||
LOG->Trace( "MusicWheel::MusicWheel()" );
|
||||
|
||||
|
||||
// for debugging
|
||||
if( GAMESTATE->m_CurStyle == STYLE_NONE )
|
||||
GAMESTATE->m_CurStyle = STYLE_DANCE_SINGLE;
|
||||
|
||||
|
||||
m_frameOverlay.SetXY( 0, 0 );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
|
||||
continue; // skip
|
||||
|
||||
m_sprHighScoreFrame[p].Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_SCORE_FRAME) );
|
||||
m_sprHighScoreFrame[p].SetXY( SCORE_X, SCORE_Y[p] );
|
||||
m_frameOverlay.AddSubActor( &m_sprHighScoreFrame[p] );
|
||||
|
||||
m_HighScore[p].SetXY( SCORE_X, SCORE_Y[p]*0.97f );
|
||||
m_HighScore[p].SetZoom( 0.6f );
|
||||
m_HighScore[p].SetDiffuseColor( PlayerToColor(p) );
|
||||
m_frameOverlay.AddSubActor( &m_HighScore[p] );
|
||||
}
|
||||
|
||||
m_sprHighScoreFrame[1].SetZoomY( -1 ); // flip vertically
|
||||
|
||||
|
||||
m_sprSelectionOverlay.Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_SONG_HIGHLIGHT) );
|
||||
m_sprSelectionOverlay.Load( THEME->GetPathTo("Graphics","select music song highlight") );
|
||||
m_sprSelectionOverlay.SetXY( 0, 0 );
|
||||
m_sprSelectionOverlay.SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
m_sprSelectionOverlay.SetEffectGlowing( 1.0f, D3DXCOLOR(1,1,1,0.4f), D3DXCOLOR(1,1,1,1) );
|
||||
m_frameOverlay.AddSubActor( &m_sprSelectionOverlay );
|
||||
AddSubActor( &m_sprSelectionOverlay );
|
||||
|
||||
m_MusicSortDisplay.SetXY( SORT_ICON_ON_SCREEN_X, SORT_ICON_ON_SCREEN_Y );
|
||||
m_MusicSortDisplay.SetEffectGlowing( 1.0f );
|
||||
m_frameOverlay.AddSubActor( &m_MusicSortDisplay );
|
||||
|
||||
this->AddSubActor( &m_frameOverlay );
|
||||
|
||||
|
||||
m_ScrollBar.SetX( SCROLLBAR_X );
|
||||
m_ScrollBar.SetX( SCROLL_BAR_X );
|
||||
this->AddSubActor( &m_ScrollBar );
|
||||
|
||||
|
||||
m_soundChangeMusic.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_CHANGE_MUSIC), 16 );
|
||||
m_soundChangeSort.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_CHANGE_SORT) );
|
||||
m_soundExpand.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_SECTION_EXPAND) );
|
||||
m_soundStart.Load( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
m_soundLocked.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_WHEEL_LOCKED) );
|
||||
m_soundChangeMusic.Load( THEME->GetPathTo("Sounds","select music change music"), 16 );
|
||||
m_soundChangeSort.Load( THEME->GetPathTo("Sounds","select music change sort") );
|
||||
m_soundExpand.Load( THEME->GetPathTo("Sounds","select music section expand") );
|
||||
m_soundStart.Load( THEME->GetPathTo("Sounds","menu start") );
|
||||
m_soundLocked.Load( THEME->GetPathTo("Sounds","select music wheel locked") );
|
||||
|
||||
|
||||
m_fTimeLeftBeforePlayMusicSample = 0;
|
||||
@@ -354,18 +320,10 @@ MusicWheel::MusicWheel()
|
||||
arraySongs.Copy( SONGMAN->m_pSongs );
|
||||
SortSongPointerArrayByGroup( arraySongs );
|
||||
|
||||
|
||||
|
||||
m_SortOrder = GAMESTATE->m_SongSortOrder;
|
||||
m_MusicSortDisplay.Set( m_SortOrder );
|
||||
m_MusicSortDisplay.SetXY( SORT_ICON_ON_SCREEN_X, SORT_ICON_ON_SCREEN_Y );
|
||||
|
||||
|
||||
m_sExpandedSectionName = "";
|
||||
|
||||
m_iSelection = 0;
|
||||
|
||||
|
||||
m_WheelState = STATE_SELECTING_MUSIC;
|
||||
m_fTimeLeftInState = 0;
|
||||
m_fPositionOffsetFromSelection = 0;
|
||||
@@ -456,7 +414,11 @@ MusicWheel::MusicWheel()
|
||||
|
||||
MusicWheel::~MusicWheel()
|
||||
{
|
||||
GAMESTATE->m_SongSortOrder = m_SortOrder;
|
||||
}
|
||||
|
||||
CArray<WheelItemData, WheelItemData&>& MusicWheel::GetCurWheelItemDatas()
|
||||
{
|
||||
return m_WheelItemDatas[GAMESTATE->m_SongSortOrder];
|
||||
}
|
||||
|
||||
void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arrayWheelItemDatas, SongSortOrder so, bool bRoulette )
|
||||
@@ -543,7 +505,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
continue;
|
||||
if( sThisSection != sLastSection) // new section, make a section item
|
||||
{
|
||||
colorSection = (so==SORT_GROUP) ? SONGMAN->GetGroupColor(pSong->m_sGroupName) : SECTION_COLORS[iSectionColorIndex];
|
||||
colorSection = (so==SORT_GROUP) ? SONGMAN->GetGroupColor(pSong->m_sGroupName) : SECTION_COLORS(iSectionColorIndex);
|
||||
iSectionColorIndex = (iSectionColorIndex+1) % NUM_SECTION_COLORS;
|
||||
arrayWheelItemDatas.Add( WheelItemData(TYPE_SECTION, NULL, sThisSection, NULL, colorSection) );
|
||||
sLastSection = sThisSection;
|
||||
@@ -625,7 +587,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
|
||||
if( arrayWheelItemDatas.GetSize() == 0 )
|
||||
{
|
||||
arrayWheelItemDatas.Add( WheelItemData(TYPE_SECTION, NULL, "EMPTY", NULL, D3DXCOLOR(1,0,0,1)) );
|
||||
arrayWheelItemDatas.Add( WheelItemData(TYPE_SECTION, NULL, "- EMPTY -", NULL, D3DXCOLOR(1,0,0,1)) );
|
||||
}
|
||||
else if( GAMESTATE->m_PlayMode == PLAY_MODE_ARCADE && !bRoulette )
|
||||
{
|
||||
@@ -655,12 +617,12 @@ float MusicWheel::GetBannerAlpha( float fPosOffsetsFromMiddle )
|
||||
if( m_WheelState == STATE_FLYING_OFF_BEFORE_NEXT_SORT
|
||||
|| m_WheelState == STATE_TWEENING_OFF_SCREEN )
|
||||
{
|
||||
return m_fTimeLeftInState / FADE_TIME;
|
||||
return m_fTimeLeftInState / FADE_SECONDS;
|
||||
}
|
||||
else if( m_WheelState == STATE_FLYING_ON_AFTER_NEXT_SORT
|
||||
|| m_WheelState == STATE_TWEENING_ON_SCREEN )
|
||||
{
|
||||
return 1 - (m_fTimeLeftInState / FADE_TIME);
|
||||
return 1 - (m_fTimeLeftInState / FADE_SECONDS);
|
||||
}
|
||||
else if( m_WheelState == STATE_WAITING_OFF_SCREEN )
|
||||
{
|
||||
@@ -729,9 +691,6 @@ void MusicWheel::NotesChanged( PlayerNumber pn ) // update grade graphics and to
|
||||
Song* pSong = GAMESTATE->m_pCurSong;
|
||||
Notes* m_pNotes = GAMESTATE->m_pCurNotes[ pn ];
|
||||
|
||||
if( m_pNotes )
|
||||
m_HighScore[pn].SetScore( (float)m_pNotes->m_iTopScore );
|
||||
|
||||
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ )
|
||||
{
|
||||
WheelItemDisplay& display = m_WheelItemDisplays[i];
|
||||
@@ -814,23 +773,16 @@ void MusicWheel::Update( float fDeltaTime )
|
||||
case STATE_FLYING_OFF_BEFORE_NEXT_SORT:
|
||||
{
|
||||
m_WheelState = STATE_FLYING_ON_AFTER_NEXT_SORT;
|
||||
m_fTimeLeftInState = FADE_TIME;
|
||||
m_fTimeLeftInState = FADE_SECONDS;
|
||||
|
||||
Song* pPrevSelectedSong = GetCurWheelItemDatas()[m_iSelection].m_pSong;
|
||||
CString sPrevSelectedSection = GetCurWheelItemDatas()[m_iSelection].m_sSectionName;
|
||||
|
||||
// change the sort order
|
||||
m_SortOrder = SongSortOrder(m_SortOrder+1);
|
||||
if( m_SortOrder > NUM_SORT_ORDERS-1 )
|
||||
m_SortOrder = (SongSortOrder)0;
|
||||
m_sExpandedSectionName = GetSectionNameFromSongAndSort( pPrevSelectedSong, m_SortOrder );
|
||||
GAMESTATE->m_SongSortOrder = SongSortOrder( (GAMESTATE->m_SongSortOrder+1) % NUM_SORT_ORDERS );
|
||||
m_sExpandedSectionName = GetSectionNameFromSongAndSort( pPrevSelectedSong, GAMESTATE->m_SongSortOrder );
|
||||
//RebuildWheelItems();
|
||||
|
||||
m_MusicSortDisplay.Set( m_SortOrder );
|
||||
m_MusicSortDisplay.BeginTweening( FADE_TIME, TWEEN_BIAS_BEGIN );
|
||||
m_MusicSortDisplay.SetTweenXY( SORT_ICON_ON_SCREEN_X, SORT_ICON_ON_SCREEN_Y );
|
||||
|
||||
|
||||
m_iSelection = 0;
|
||||
|
||||
if( pPrevSelectedSong != NULL ) // the previous selected item was a song
|
||||
@@ -948,7 +900,7 @@ void MusicWheel::Update( float fDeltaTime )
|
||||
{
|
||||
m_fPositionOffsetFromSelection = clamp( m_fPositionOffsetFromSelection, -0.3f, +0.3f );
|
||||
|
||||
float fSpringForce = - m_fPositionOffsetFromSelection*LOCKED_WHEEL_INITIAL_VELOCITY;
|
||||
float fSpringForce = - m_fPositionOffsetFromSelection * LOCKED_INITIAL_VELOCITY;
|
||||
m_fLockedWheelVelocity += fSpringForce;
|
||||
|
||||
float fDrag = -m_fLockedWheelVelocity * fDeltaTime*4;
|
||||
@@ -967,9 +919,9 @@ void MusicWheel::Update( float fDeltaTime )
|
||||
// "rotate" wheel toward selected song
|
||||
float fSpinSpeed;
|
||||
if( m_WheelState == STATE_ROULETTE_SPINNING )
|
||||
fSpinSpeed = 1.0f/ROULETTE_SWITCH_MUSIC_TIME;
|
||||
fSpinSpeed = 1.0f/ROULETTE_SWITCH_SECONDS;
|
||||
else
|
||||
fSpinSpeed = 0.6f + fabsf(m_fPositionOffsetFromSelection)/SWITCH_MUSIC_TIME;
|
||||
fSpinSpeed = 0.6f + fabsf(m_fPositionOffsetFromSelection)/SWITCH_SECONDS;
|
||||
|
||||
if( m_fPositionOffsetFromSelection > 0 )
|
||||
{
|
||||
@@ -997,7 +949,7 @@ void MusicWheel::PrevMusic( bool bSendSongChangedMessage )
|
||||
{
|
||||
if( m_WheelState == STATE_LOCKED )
|
||||
{
|
||||
m_fLockedWheelVelocity = LOCKED_WHEEL_INITIAL_VELOCITY;
|
||||
m_fLockedWheelVelocity = LOCKED_INITIAL_VELOCITY;
|
||||
m_soundLocked.Play();
|
||||
return;
|
||||
}
|
||||
@@ -1042,7 +994,7 @@ void MusicWheel::NextMusic( bool bSendSongChangedMessage )
|
||||
{
|
||||
if( m_WheelState == STATE_LOCKED )
|
||||
{
|
||||
m_fLockedWheelVelocity = -LOCKED_WHEEL_INITIAL_VELOCITY;
|
||||
m_fLockedWheelVelocity = -LOCKED_INITIAL_VELOCITY;
|
||||
m_soundLocked.Play();
|
||||
return;
|
||||
}
|
||||
@@ -1102,13 +1054,11 @@ void MusicWheel::NextSort()
|
||||
}
|
||||
|
||||
m_soundChangeSort.Play();
|
||||
m_MusicSortDisplay.BeginTweening( FADE_TIME, TWEEN_BIAS_END );
|
||||
m_MusicSortDisplay.SetTweenXY( SORT_ICON_OFF_SCREEN_X, SORT_ICON_OFF_SCREEN_Y );
|
||||
|
||||
TweenOffScreen();
|
||||
|
||||
m_WheelState = STATE_FLYING_OFF_BEFORE_NEXT_SORT;
|
||||
m_fTimeLeftInState = FADE_TIME;
|
||||
m_fTimeLeftInState = FADE_SECONDS;
|
||||
}
|
||||
|
||||
bool MusicWheel::Select() // return true of a playable item was chosen
|
||||
@@ -1118,7 +1068,7 @@ bool MusicWheel::Select() // return true of a playable item was chosen
|
||||
if( m_WheelState == STATE_ROULETTE_SPINNING )
|
||||
{
|
||||
m_WheelState = STATE_ROULETTE_SLOWING_DOWN;
|
||||
m_iSwitchesLeftInSpinDown = ROULETTE_SWITCHES_IN_SLOWING_DOWN/2+1 + rand()%(ROULETTE_SWITCHES_IN_SLOWING_DOWN/2);
|
||||
m_iSwitchesLeftInSpinDown = ROULETTE_SLOW_DOWN_SWITCHES/2+1 + rand()%(ROULETTE_SLOW_DOWN_SWITCHES/2);
|
||||
m_fTimeLeftInState = 0.1f;
|
||||
return false;
|
||||
}
|
||||
@@ -1157,9 +1107,7 @@ bool MusicWheel::Select() // return true of a playable item was chosen
|
||||
case TYPE_ROULETTE:
|
||||
m_soundExpand.Play();
|
||||
m_WheelState = STATE_ROULETTE_SPINNING;
|
||||
m_SortOrder = SORT_GROUP;
|
||||
m_MusicSortDisplay.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
m_MusicSortDisplay.SetEffectNone();
|
||||
GAMESTATE->m_SongSortOrder = SORT_GROUP;
|
||||
BuildWheelItemDatas( m_WheelItemDatas[SORT_GROUP], SORT_GROUP, true );
|
||||
return false;
|
||||
|
||||
@@ -1173,24 +1121,17 @@ bool MusicWheel::Select() // return true of a playable item was chosen
|
||||
void MusicWheel::TweenOnScreen()
|
||||
{
|
||||
m_WheelState = STATE_TWEENING_ON_SCREEN;
|
||||
m_fTimeLeftInState = FADE_TIME;
|
||||
|
||||
|
||||
m_MusicSortDisplay.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
m_MusicSortDisplay.BeginTweening( FADE_TIME );
|
||||
m_MusicSortDisplay.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
|
||||
m_fTimeLeftInState = FADE_SECONDS;
|
||||
|
||||
|
||||
float fX, fY;
|
||||
|
||||
fX = GetBannerX(0);
|
||||
fY = GetBannerY(0);
|
||||
m_frameOverlay.SetXY( fX+320, fY );
|
||||
m_frameOverlay.BeginTweeningQueued( 0.5f ); // sleep
|
||||
m_frameOverlay.BeginTweeningQueued( 0.4f, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_frameOverlay.SetTweenX( fX );
|
||||
|
||||
m_sprSelectionOverlay.SetXY( fX+320, fY );
|
||||
m_sprSelectionOverlay.BeginTweeningQueued( 0.5f ); // sleep
|
||||
m_sprSelectionOverlay.BeginTweeningQueued( 0.4f, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_sprSelectionOverlay.SetTweenX( fX );
|
||||
|
||||
|
||||
fX = m_ScrollBar.GetX();
|
||||
@@ -1218,29 +1159,16 @@ void MusicWheel::TweenOnScreen()
|
||||
void MusicWheel::TweenOffScreen()
|
||||
{
|
||||
m_WheelState = STATE_TWEENING_OFF_SCREEN;
|
||||
m_fTimeLeftInState = FADE_TIME;
|
||||
|
||||
|
||||
m_MusicSortDisplay.SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
m_MusicSortDisplay.SetEffectNone();
|
||||
m_MusicSortDisplay.BeginTweening( FADE_TIME );
|
||||
m_MusicSortDisplay.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
// m_HighScore[p].BeginTweening( 0.2f, Actor::TWEEN_BIAS_END );
|
||||
// m_HighScore[p].SetTweenX( m_HighScore[p].GetX()+320 );
|
||||
}
|
||||
m_fTimeLeftInState = FADE_SECONDS;
|
||||
|
||||
|
||||
float fX, fY;
|
||||
fX = GetBannerX(0);
|
||||
fY = GetBannerY(0);
|
||||
m_frameOverlay.SetXY( fX, fY );
|
||||
m_frameOverlay.BeginTweeningQueued( 0 ); // sleep
|
||||
m_frameOverlay.BeginTweeningQueued( 0.2f, Actor::TWEEN_BIAS_END );
|
||||
m_frameOverlay.SetTweenX( fX+320 );
|
||||
m_sprSelectionOverlay.SetXY( fX, fY );
|
||||
m_sprSelectionOverlay.BeginTweeningQueued( 0 ); // sleep
|
||||
m_sprSelectionOverlay.BeginTweeningQueued( 0.2f, Actor::TWEEN_BIAS_END );
|
||||
m_sprSelectionOverlay.SetTweenX( fX+320 );
|
||||
|
||||
|
||||
m_ScrollBar.BeginTweeningQueued( 0 );
|
||||
|
||||
@@ -125,23 +125,11 @@ protected:
|
||||
void RebuildWheelItemDisplays();
|
||||
void SwitchSortOrder();
|
||||
|
||||
|
||||
ScrollBar m_ScrollBar;
|
||||
|
||||
|
||||
SongSortOrder m_SortOrder;
|
||||
MusicSortDisplay m_MusicSortDisplay;
|
||||
|
||||
ActorFrame m_frameOverlay;
|
||||
|
||||
// Actors inside of m_frameOverlay
|
||||
ScrollBar m_ScrollBar;
|
||||
Sprite m_sprSelectionOverlay;
|
||||
Sprite m_sprHighScoreFrame[NUM_PLAYERS];
|
||||
ScoreDisplayNormal m_HighScore[NUM_PLAYERS];
|
||||
|
||||
|
||||
CArray<WheelItemData, WheelItemData&> m_WheelItemDatas[NUM_SORT_ORDERS];
|
||||
CArray<WheelItemData, WheelItemData&> &GetCurWheelItemDatas() { return m_WheelItemDatas[m_SortOrder]; };
|
||||
CArray<WheelItemData, WheelItemData&> &GetCurWheelItemDatas();
|
||||
|
||||
WheelItemDisplay m_WheelItemDisplays[NUM_WHEEL_ITEMS_TO_DRAW];
|
||||
|
||||
|
||||
+70
-74
@@ -176,8 +176,10 @@ void NoteData::ClearRange( int iNoteIndexBegin, int iNoteIndexEnd )
|
||||
for( iIndexRead = 0; iIndexRead < iOrigNumHoldNotes; iIndexRead++ )
|
||||
{
|
||||
HoldNote &hn = m_HoldNotes[iIndexRead];
|
||||
if( (hn.m_iStartIndex >= iNoteIndexBegin && hn.m_iStartIndex <= iNoteIndexEnd) ||
|
||||
(hn.m_iEndIndex >= iNoteIndexBegin && hn.m_iEndIndex <= iNoteIndexEnd) ) // overlap (kinda)
|
||||
int iHoldStartIndex = BeatToNoteRow( hn.m_fStartBeat );
|
||||
int iHoldEndIndex = BeatToNoteRow( hn.m_fEndBeat );
|
||||
if( (iHoldStartIndex >= iNoteIndexBegin && iHoldStartIndex <= iNoteIndexEnd) ||
|
||||
(iHoldEndIndex >= iNoteIndexBegin && iHoldEndIndex <= iNoteIndexEnd) ) // overlap (kinda)
|
||||
{
|
||||
; // do nothing
|
||||
}
|
||||
@@ -227,63 +229,64 @@ void NoteData::AddHoldNote( HoldNote add )
|
||||
{
|
||||
HoldNote &other = m_HoldNotes[i];
|
||||
if( add.m_iTrack == other.m_iTrack && // the notes correspond
|
||||
other.m_iStartIndex <= add.m_iEndIndex &&
|
||||
other.m_iEndIndex >= add.m_iStartIndex ) // these HoldNotes overlap (this isn't entirely correct!)
|
||||
other.m_fStartBeat <= add.m_fEndBeat &&
|
||||
other.m_fEndBeat >= add.m_fStartBeat ) // these HoldNotes overlap (this isn't entirely correct!)
|
||||
{
|
||||
add.m_iStartIndex = min(add.m_iStartIndex, other.m_iStartIndex);
|
||||
add.m_iEndIndex = max(add.m_iEndIndex, other.m_iEndIndex);
|
||||
add.m_fStartBeat = min(add.m_fStartBeat, other.m_fStartBeat);
|
||||
add.m_fEndBeat = max(add.m_fEndBeat, other.m_fEndBeat);
|
||||
|
||||
// delete this HoldNote
|
||||
for( int j=i; j<m_iNumHoldNotes-1; j++ )
|
||||
{
|
||||
m_HoldNotes[j] = m_HoldNotes[j+1];
|
||||
}
|
||||
|
||||
m_iNumHoldNotes--;
|
||||
}
|
||||
}
|
||||
|
||||
int iAddStartIndex = BeatToNoteRow(add.m_fStartBeat);
|
||||
int iAddEndIndex = BeatToNoteRow(add.m_fEndBeat);
|
||||
|
||||
// delete TapNotes under this HoldNote
|
||||
for( i=add.m_iStartIndex+1; i<=add.m_iEndIndex; i++ )
|
||||
{
|
||||
for( i=iAddStartIndex+1; i<=iAddEndIndex; i++ )
|
||||
m_TapNotes[add.m_iTrack][i] = '0';
|
||||
};
|
||||
|
||||
// add a tap note at the start of this hold
|
||||
m_TapNotes[add.m_iTrack][add.m_iStartIndex] = '1';
|
||||
m_TapNotes[add.m_iTrack][iAddStartIndex] = '2'; // '2' means a Hold begin marker. Don't draw this, but do grade it.
|
||||
|
||||
ASSERT( m_iNumHoldNotes < MAX_HOLD_NOTES );
|
||||
m_HoldNotes[m_iNumHoldNotes++] = add;
|
||||
}
|
||||
|
||||
void NoteData::RemoveHoldNote( int index )
|
||||
void NoteData::RemoveHoldNote( int iHoldIndex )
|
||||
{
|
||||
ASSERT( index > 0 && index < m_iNumHoldNotes );
|
||||
ASSERT( iHoldIndex > 0 && iHoldIndex < m_iNumHoldNotes );
|
||||
|
||||
HoldNote& hn = m_HoldNotes[iHoldIndex];
|
||||
|
||||
int iHoldStartIndex = BeatToNoteRow(hn.m_fStartBeat);
|
||||
int iHoldEndIndex = BeatToNoteRow(hn.m_fEndBeat);
|
||||
|
||||
// delete a tap note at the start of this hold
|
||||
HoldNote &hn = m_HoldNotes[index];
|
||||
m_TapNotes[hn.m_iTrack][hn.m_iStartIndex] = '0';
|
||||
m_TapNotes[hn.m_iTrack][iHoldStartIndex] = '0';
|
||||
|
||||
// remove from list
|
||||
for( int j=index; j<m_iNumHoldNotes-1; j++ )
|
||||
{
|
||||
for( int j=iHoldIndex; j<m_iNumHoldNotes-1; j++ )
|
||||
m_HoldNotes[j] = m_HoldNotes[j+1];
|
||||
}
|
||||
|
||||
m_iNumHoldNotes--;
|
||||
}
|
||||
|
||||
bool NoteData::IsThereANoteAtRow( int iRow )
|
||||
{
|
||||
for( int t=0; t<m_iNumTracks; t++ )
|
||||
{
|
||||
if( m_TapNotes[t][iRow] != '0' )
|
||||
return true;
|
||||
}
|
||||
|
||||
for( int i=0; i<m_iNumHoldNotes; i++ ) // for each HoldNote
|
||||
{
|
||||
if( m_HoldNotes[i].m_iStartIndex == iRow )
|
||||
return true;
|
||||
}
|
||||
// There is a tap note at the beginning of every HoldNote start
|
||||
//
|
||||
// for( int i=0; i<m_iNumHoldNotes; i++ ) // for each HoldNote
|
||||
// if( m_HoldNotes[i].m_iStartIndex == NoteRowToBeatRow(iRow) )
|
||||
// return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -291,61 +294,62 @@ bool NoteData::IsThereANoteAtRow( int iRow )
|
||||
|
||||
int NoteData::GetFirstRow()
|
||||
{
|
||||
int iFirstIndexFoundSoFar = MAX_TAP_NOTE_ROWS-1;
|
||||
|
||||
int i;
|
||||
|
||||
for( i=0; i<MAX_TAP_NOTE_ROWS, i<iFirstIndexFoundSoFar; i++ ) // iterate back to front
|
||||
{
|
||||
if( !IsRowEmpty(i) )
|
||||
{
|
||||
iFirstIndexFoundSoFar = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for( i=0; i<m_iNumHoldNotes; i++ )
|
||||
{
|
||||
if( m_HoldNotes[i].m_iStartIndex < iFirstIndexFoundSoFar )
|
||||
iFirstIndexFoundSoFar = m_HoldNotes[i].m_iStartIndex;
|
||||
}
|
||||
|
||||
|
||||
return iFirstIndexFoundSoFar;
|
||||
return BeatToNoteRow( GetFirstBeat() );
|
||||
}
|
||||
|
||||
float NoteData::GetFirstBeat()
|
||||
{
|
||||
return NoteRowToBeat( GetFirstRow() );
|
||||
float fEarliestBeatFoundSoFar = MAX_BEATS;
|
||||
|
||||
int i;
|
||||
|
||||
for( i=0; i<MAX_TAP_NOTE_ROWS; i++ )
|
||||
{
|
||||
if( !IsRowEmpty(i) )
|
||||
{
|
||||
fEarliestBeatFoundSoFar = NoteRowToBeat(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for( i=0; i<m_iNumHoldNotes; i++ )
|
||||
if( m_HoldNotes[i].m_fStartBeat < fEarliestBeatFoundSoFar )
|
||||
fEarliestBeatFoundSoFar = m_HoldNotes[i].m_fStartBeat;
|
||||
|
||||
|
||||
if( fEarliestBeatFoundSoFar == MAX_BEATS ) // there are no notes
|
||||
return 0;
|
||||
else
|
||||
return fEarliestBeatFoundSoFar;
|
||||
}
|
||||
|
||||
int NoteData::GetLastRow()
|
||||
{
|
||||
int iOldestIndexFoundSoFar = 0;
|
||||
return BeatToNoteRow( GetLastBeat() );
|
||||
}
|
||||
|
||||
float NoteData::GetLastBeat()
|
||||
{
|
||||
float fOldestBeatFoundSoFar = 0;
|
||||
|
||||
int i;
|
||||
|
||||
for( i=MAX_TAP_NOTE_ROWS-1; i>=iOldestIndexFoundSoFar; i-- ) // iterate back to front
|
||||
for( i=MAX_TAP_NOTE_ROWS-1; i>=0; i-- ) // iterate back to front
|
||||
{
|
||||
if( !IsRowEmpty(i) )
|
||||
{
|
||||
iOldestIndexFoundSoFar = i;
|
||||
fOldestBeatFoundSoFar = NoteRowToBeat(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for( i=0; i<m_iNumHoldNotes; i++ )
|
||||
{
|
||||
if( m_HoldNotes[i].m_iEndIndex > iOldestIndexFoundSoFar )
|
||||
iOldestIndexFoundSoFar = m_HoldNotes[i].m_iEndIndex;
|
||||
if( m_HoldNotes[i].m_fEndBeat > fOldestBeatFoundSoFar )
|
||||
fOldestBeatFoundSoFar = m_HoldNotes[i].m_fEndBeat;
|
||||
}
|
||||
|
||||
return iOldestIndexFoundSoFar;
|
||||
}
|
||||
|
||||
float NoteData::GetLastBeat()
|
||||
{
|
||||
return NoteRowToBeat( GetLastRow() );
|
||||
return fOldestBeatFoundSoFar;
|
||||
}
|
||||
|
||||
int NoteData::GetNumTapNotes( const float fStartBeat, const float fEndBeat )
|
||||
@@ -356,13 +360,9 @@ int NoteData::GetNumTapNotes( const float fStartBeat, const float fEndBeat )
|
||||
int iEndIndex = BeatToNoteRow( fEndBeat );
|
||||
|
||||
for( int i=iStartIndex; i<min(iEndIndex, MAX_TAP_NOTE_ROWS); i++ )
|
||||
{
|
||||
for( int t=0; t<m_iNumTracks; t++ )
|
||||
{
|
||||
if( m_TapNotes[t][i] != '0' )
|
||||
iNumNotes++;
|
||||
}
|
||||
}
|
||||
|
||||
return iNumNotes;
|
||||
}
|
||||
@@ -393,13 +393,10 @@ int NoteData::GetNumHoldNotes( const float fStartBeat, const float fEndBeat )
|
||||
{
|
||||
int iNumHolds = 0;
|
||||
|
||||
int iStartIndex = BeatToNoteRow( fStartBeat );
|
||||
int iEndIndex = BeatToNoteRow( fEndBeat );
|
||||
|
||||
for( int i=0; i<m_iNumHoldNotes; i++ )
|
||||
{
|
||||
HoldNote &hn = m_HoldNotes[i];
|
||||
if( iStartIndex <= hn.m_iStartIndex && hn.m_iEndIndex <= iEndIndex )
|
||||
if( fStartBeat <= hn.m_fStartBeat && hn.m_fEndBeat <= fEndBeat )
|
||||
iNumHolds++;
|
||||
}
|
||||
return iNumHolds;
|
||||
@@ -495,7 +492,7 @@ void NoteData::RemoveHoldNotes()
|
||||
{
|
||||
HoldNote &hn = m_HoldNotes[i];
|
||||
|
||||
int iIndex = hn.m_iStartIndex;
|
||||
int iIndex = BeatToNoteRow(hn.m_fStartBeat);
|
||||
int iCol = hn.m_iTrack;
|
||||
|
||||
m_TapNotes[iCol][iIndex] = '1';
|
||||
@@ -562,9 +559,6 @@ void NoteData::Turn( PlayerOptions::TurnType tt )
|
||||
case NOTES_TYPE_EZ2_SINGLE_HARD:
|
||||
case NOTES_TYPE_EZ2_DOUBLE:
|
||||
case NOTES_TYPE_EZ2_REAL:
|
||||
case NOTES_TYPE_EZ2_SINGLE_VERSUS:
|
||||
case NOTES_TYPE_EZ2_SINGLE_HARD_VERSUS:
|
||||
case NOTES_TYPE_EZ2_REAL_VERSUS:
|
||||
// identity transform. What should we do here?
|
||||
iTakeFromTrack[0] = 0;
|
||||
iTakeFromTrack[1] = 1;
|
||||
@@ -643,7 +637,7 @@ void NoteData::Convert2sAnd3sToHoldNotes()
|
||||
{
|
||||
if( m_TapNotes[col][j] != '0' ) // end hold on the next note we see
|
||||
{
|
||||
HoldNote hn = { col, i, j };
|
||||
HoldNote hn = { col, NoteRowToBeat(i), NoteRowToBeat(j) };
|
||||
AddHoldNote( hn );
|
||||
break;
|
||||
}
|
||||
@@ -659,8 +653,10 @@ void NoteData::ConvertHoldNotesTo2sAnd3s()
|
||||
for( int i=0; i<m_iNumHoldNotes; i++ )
|
||||
{
|
||||
HoldNote &hn = m_HoldNotes[i];
|
||||
m_TapNotes[hn.m_iTrack][hn.m_iStartIndex] = '2';
|
||||
m_TapNotes[hn.m_iTrack][hn.m_iEndIndex] = '3';
|
||||
int iHoldStartIndex = BeatToNoteRow(hn.m_fStartBeat);
|
||||
int iHoldEndIndex = BeatToNoteRow(hn.m_fEndBeat);
|
||||
m_TapNotes[hn.m_iTrack][iHoldStartIndex] = '2';
|
||||
m_TapNotes[hn.m_iTrack][iHoldEndIndex] = '3';
|
||||
}
|
||||
m_iNumHoldNotes = 0;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,9 @@
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "GameConstantsAndTypes.h"
|
||||
//#include "GameConstantsAndTypes.h"
|
||||
#include "PlayerOptions.h"
|
||||
#include "NoteTypes.h"
|
||||
|
||||
// '1' = tap note
|
||||
// '2' = hold note begin
|
||||
@@ -23,23 +24,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
struct HoldNote
|
||||
{
|
||||
int m_iTrack;
|
||||
int m_iStartIndex;
|
||||
int m_iEndIndex;
|
||||
};
|
||||
|
||||
|
||||
inline int BeatToNoteRow( float fBeatNum ) { return int( fBeatNum * ELEMENTS_PER_BEAT + 0.5f); }; // round
|
||||
inline int BeatToNoteRowNotRounded( float fBeatNum ) { return (int)( fBeatNum * ELEMENTS_PER_BEAT ); };
|
||||
inline float NoteRowToBeat( float fNoteIndex ) { return fNoteIndex / (float)ELEMENTS_PER_BEAT; };
|
||||
inline float NoteRowToBeat( int iNoteIndex ) { return NoteRowToBeat( (float)iNoteIndex ); };
|
||||
|
||||
|
||||
|
||||
class NoteData
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -87,13 +87,10 @@ int NoteDataWithScoring::GetNumSuccessfulHoldNotes( const float fStartBeat, cons
|
||||
{
|
||||
int iNumSuccessfulHolds = 0;
|
||||
|
||||
int iStartIndex = BeatToNoteRow( fStartBeat );
|
||||
int iEndIndex = BeatToNoteRow( fEndBeat );
|
||||
|
||||
for( int i=0; i<m_iNumHoldNotes; i++ )
|
||||
{
|
||||
HoldNote &hn = m_HoldNotes[i];
|
||||
if( iStartIndex <= hn.m_iStartIndex && hn.m_iEndIndex <= iEndIndex && m_HoldNoteScores[i] == HNS_OK )
|
||||
if( fStartBeat <= hn.m_fStartBeat && hn.m_fEndBeat <= fEndBeat && m_HoldNoteScores[i] == HNS_OK )
|
||||
iNumSuccessfulHolds++;
|
||||
}
|
||||
return iNumSuccessfulHolds;
|
||||
|
||||
@@ -0,0 +1,665 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: NoteDisplay
|
||||
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Brian Bugh
|
||||
Ben Nordstrom
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "NoteDisplay.h"
|
||||
#include "Notes.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "GameState.h"
|
||||
#include "GameManager.h"
|
||||
#include "RageException.h"
|
||||
#include "ArrowEffects.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
|
||||
NoteDisplay::NoteDisplay()
|
||||
{
|
||||
// the owner of the NoteDisplay must call load on the gray and color parts
|
||||
|
||||
// m_sprHoldParts.Load( THEME->GetPathTo(GRAPHIC_COLOR_ARROW_GRAY_PART) );
|
||||
// m_sprTapParts.Load( THEME->GetPathTo(GRAPHIC_COLOR_ARROW_COLOR_PART) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void NoteDisplay::Load( int iColNum, PlayerNumber pn )
|
||||
{
|
||||
m_PlayerNumber = pn;
|
||||
|
||||
CString sPath;
|
||||
|
||||
sPath = GAMEMAN->GetPathTo(iColNum, GRAPHIC_TAP_PARTS);
|
||||
m_sprTapParts.Load( sPath );
|
||||
if( m_sprTapParts.GetNumStates() % 2 != 0 )
|
||||
throw RageException( "Tap Parts '%s' must have an even number of frames.", sPath );
|
||||
|
||||
sPath = GAMEMAN->GetPathTo(iColNum, GRAPHIC_HOLD_PARTS);
|
||||
m_sprHoldParts.Load( sPath );
|
||||
if( m_sprHoldParts.GetNumStates() != 16 )
|
||||
throw RageException( "Hold Parts '%s' must have 16 frames.", sPath );
|
||||
|
||||
m_sprTapParts.StopAnimating();
|
||||
m_sprTapParts.TurnShadowOff();
|
||||
m_sprHoldParts.StopAnimating();
|
||||
m_sprHoldParts.TurnShadowOff();
|
||||
m_colorTapTweens.RemoveAll();
|
||||
GAMEMAN->GetTapTweenColors( iColNum, m_colorTapTweens );
|
||||
}
|
||||
|
||||
|
||||
int NoteDisplay::GetTapGrayFrameNo( const float fNoteBeat )
|
||||
{
|
||||
const int iNumGrayPartFrames = m_sprTapParts.GetNumStates()/2;
|
||||
|
||||
const float fSongBeat = GAMESTATE->m_fSongBeat;
|
||||
const float fPercentIntoBeat = fSongBeat - (int)fSongBeat;
|
||||
int iFrameNo = int(fPercentIntoBeat * iNumGrayPartFrames) % iNumGrayPartFrames;
|
||||
if( iFrameNo < 0 )
|
||||
iFrameNo += iNumGrayPartFrames;
|
||||
|
||||
return iFrameNo * 2;
|
||||
}
|
||||
|
||||
int NoteDisplay::GetTapColorFrameNo( const float fNoteBeat )
|
||||
{
|
||||
return GetTapGrayFrameNo(fNoteBeat) + 1;
|
||||
}
|
||||
|
||||
void NoteDisplay::GetTapEdgeColors( const float fNoteBeat, D3DXCOLOR &colorLeadingOut, D3DXCOLOR &colorTrailingOut )
|
||||
{
|
||||
// Chris: If EZ2 doesn't use these values, it can just ignore them.
|
||||
//
|
||||
// Andy:
|
||||
// if (GAMESTATE->m_CurGame == GAME_EZ2)
|
||||
// {
|
||||
// return; // Get out of this, as it breaks EZ2, and besides, Ez2 doesn't use COLOR ARROWS
|
||||
// }
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// ADDED 2-14-2002 - BrianB
|
||||
//
|
||||
// This section has been added for the different arrow
|
||||
// display types:
|
||||
//
|
||||
// Note: Each note has a different color, but does not tween
|
||||
// Flat: Each note has the same color, and does tween
|
||||
// Plain: Each note has the same color, but does not tween
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
const PlayerOptions::ColorType ct = GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_ColorType;
|
||||
const float fNotePercentIntoBeat = fNoteBeat - (int)fNoteBeat;
|
||||
const float fSongBeat = GAMESTATE->m_fSongBeat;
|
||||
float fPercentThroughColors = fmodf( fSongBeat, (float)BEATS_PER_MEASURE ) / BEATS_PER_MEASURE;
|
||||
|
||||
switch( ct )
|
||||
{
|
||||
case PlayerOptions::COLOR_VIVID:
|
||||
case PlayerOptions::COLOR_NOTE:
|
||||
fPercentThroughColors += fNotePercentIntoBeat;
|
||||
break;
|
||||
}
|
||||
if( fPercentThroughColors < 0 )
|
||||
fPercentThroughColors += 1;
|
||||
else
|
||||
fPercentThroughColors -= (int)fPercentThroughColors;
|
||||
|
||||
|
||||
|
||||
float fPercentThroughColorsLeading; // fill these in below
|
||||
float fPercentThroughColorsTrailing;
|
||||
switch( ct )
|
||||
{
|
||||
case PlayerOptions::COLOR_VIVID:
|
||||
case PlayerOptions::COLOR_NOTE:
|
||||
case PlayerOptions::COLOR_FLAT:
|
||||
// use different edge colors so that the arrows look more colorful
|
||||
fPercentThroughColorsLeading = fPercentThroughColors;
|
||||
fPercentThroughColorsTrailing = fmodf( fPercentThroughColors + 0.20f, 1 );
|
||||
break;
|
||||
case PlayerOptions::COLOR_PLAIN:
|
||||
// use same colors for both edges, making it look "plain"
|
||||
fPercentThroughColorsLeading = fPercentThroughColors;
|
||||
fPercentThroughColorsTrailing = fPercentThroughColors;
|
||||
break;
|
||||
default:
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
|
||||
if( ct == PlayerOptions::COLOR_NOTE )
|
||||
{
|
||||
D3DXCOLOR color = GetNoteColorFromBeat( fNoteBeat );
|
||||
colorLeadingOut = color;
|
||||
colorTrailingOut = color;
|
||||
|
||||
// add a little bit of white so the note doesn't look so plain
|
||||
colorLeadingOut.r += 0.3f * fabsf( fPercentThroughColorsLeading - 0.5f );
|
||||
colorLeadingOut.g += 0.3f * fabsf( fPercentThroughColorsLeading - 0.5f );
|
||||
colorLeadingOut.b += 0.3f * fabsf( fPercentThroughColorsLeading - 0.5f );
|
||||
colorTrailingOut.r += 0.3f * fabsf( fPercentThroughColorsTrailing - 0.5f );
|
||||
colorTrailingOut.g += 0.3f * fabsf( fPercentThroughColorsTrailing - 0.5f );
|
||||
colorTrailingOut.b += 0.3f * fabsf( fPercentThroughColorsTrailing - 0.5f );
|
||||
return;
|
||||
}
|
||||
|
||||
float fLeadingColorIndex = fPercentThroughColorsLeading * m_colorTapTweens.GetSize();
|
||||
float fTrailingColorIndex = fPercentThroughColorsTrailing* m_colorTapTweens.GetSize();
|
||||
|
||||
float fLeadingColorWeightOf2 = fLeadingColorIndex - int(fLeadingColorIndex);
|
||||
int iLeadingColor1 = int(fLeadingColorIndex);
|
||||
int iLeadingColor2 = (iLeadingColor1 + 1) % m_colorTapTweens.GetSize();
|
||||
colorLeadingOut = m_colorTapTweens[iLeadingColor1] * (1-fLeadingColorWeightOf2) + m_colorTapTweens[iLeadingColor2] * fLeadingColorWeightOf2;
|
||||
|
||||
float fTrailingColorWeightOf2 = fTrailingColorIndex - int(fTrailingColorIndex);
|
||||
int iTrailingColor1 = int(fTrailingColorIndex);
|
||||
int iTrailingColor2 = (iTrailingColor1 + 1) % m_colorTapTweens.GetSize();
|
||||
colorTrailingOut = m_colorTapTweens[iTrailingColor1] * (1-fTrailingColorWeightOf2) + m_colorTapTweens[iTrailingColor2] * fTrailingColorWeightOf2;
|
||||
}
|
||||
|
||||
/*
|
||||
D3DXCOLOR NoteDisplay::GetHoldColor( const float fY, const float fYTop, const float fYBottom )
|
||||
{
|
||||
if( fY == fYTop )
|
||||
return m_colorHoldTweens[0];
|
||||
|
||||
float fDistFromEnd = fYBottom - fY;
|
||||
float fArrowSizesFromEnd = fDistFromEnd / (float)ARROW_SIZE;
|
||||
float fPercentThroughColors = fmodf( fArrowSizesFromEnd, 2 ) / 2.0f;
|
||||
float fIndex = fPercentThroughColors * (m_colorHoldTweens.GetSize()-1);
|
||||
float fWeightOf2 = fIndex - int(fIndex);
|
||||
int iColor1 = int(fIndex);
|
||||
int iColor2 = (iColor1+1) % m_colorHoldTweens.GetSize();
|
||||
return m_colorHoldTweens[iColor1] * (1-fWeightOf2) + m_colorHoldTweens[iColor2] * fWeightOf2;
|
||||
}
|
||||
*/
|
||||
|
||||
float NoteDisplay::GetAddAlpha( float fDiffuseAlpha, float fPercentFadeToFail )
|
||||
{
|
||||
if( fPercentFadeToFail != -1 )
|
||||
return 1-fPercentFadeToFail;
|
||||
|
||||
float fDistFromCenter = fabsf( 0.5f - fDiffuseAlpha );
|
||||
return clamp( 1-fDistFromCenter*2, 0, 1 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void NoteDisplay::DrawList( int iCount, NoteDisplayInstance cni[], bool bDrawAddPass )
|
||||
{
|
||||
int iNumV;
|
||||
|
||||
LPDIRECT3DVERTEXBUFFER8 pVB = DISPLAY->GetVertexBuffer();
|
||||
RAGEVERTEX* v;
|
||||
|
||||
LPDIRECT3DDEVICE8 pd3dDevice = DISPLAY->GetDevice();
|
||||
|
||||
pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
|
||||
pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
|
||||
|
||||
pd3dDevice->SetVertexShader( D3DFVF_RAGEVERTEX );
|
||||
pd3dDevice->SetStreamSource( 0, pVB, sizeof(RAGEVERTEX) );
|
||||
|
||||
|
||||
const float fGrayWidth = m_sprHoldParts.GetUnzoomedWidth();
|
||||
const float fGrayHeight = m_sprHoldParts.GetUnzoomedHeight();
|
||||
const float fColorWidth = m_sprTapParts.GetUnzoomedWidth();
|
||||
const float fColorHeight = m_sprTapParts.GetUnzoomedHeight();
|
||||
|
||||
RageTexture* pGrayTexture = m_sprHoldParts.GetTexture();
|
||||
RageTexture* pColorTexture = m_sprTapParts.GetTexture();
|
||||
|
||||
//
|
||||
// Draw gray parts diffuse pass
|
||||
//
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
|
||||
|
||||
pd3dDevice->SetTexture( 0, pGrayTexture->GetD3DTexture() );
|
||||
|
||||
pVB->Lock( 0, 0, (BYTE**)&v, 0 );
|
||||
|
||||
iNumV = 0;
|
||||
for( int i=0; i<iCount; i++ )
|
||||
{
|
||||
NoteDisplayInstance* pCNI = &cni[i];
|
||||
const float fX = pCNI->fX;
|
||||
const float fY = pCNI->fY;
|
||||
const float fRotation = pCNI->fRotation;
|
||||
D3DXVECTOR3 vecPoints[4]; // top left, bottom left, top right, bottom right
|
||||
|
||||
|
||||
//
|
||||
// Set vertex positions
|
||||
//
|
||||
vecPoints[0] = D3DXVECTOR3( -fGrayWidth/2, -fGrayHeight/2, 0 ); // top left
|
||||
vecPoints[1] = D3DXVECTOR3( -fGrayWidth/2, +fGrayHeight/2, 0 ); // bottom left
|
||||
vecPoints[2] = D3DXVECTOR3( +fGrayWidth/2, -fGrayHeight/2, 0 ); // top right
|
||||
vecPoints[3] = D3DXVECTOR3( +fGrayWidth/2, +fGrayHeight/2, 0 ); // bottom right
|
||||
|
||||
if( fRotation != 0 )
|
||||
{
|
||||
D3DXMATRIX matRotation;
|
||||
D3DXMatrixRotationZ( &matRotation, fRotation );
|
||||
|
||||
for( int j=0; j<4; j++ )
|
||||
D3DXVec3TransformCoord( &vecPoints[j], &vecPoints[j], &matRotation );
|
||||
}
|
||||
for( int j=0; j<4; j++ )
|
||||
{
|
||||
vecPoints[j].x += fX;
|
||||
vecPoints[j].y += fY;
|
||||
}
|
||||
|
||||
// first triangle
|
||||
v[iNumV++].p = vecPoints[0]; // top left
|
||||
v[iNumV++].p = vecPoints[1]; // bottom left
|
||||
v[iNumV++].p = vecPoints[2]; // top right
|
||||
// 2nd triangle
|
||||
v[iNumV++].p = vecPoints[2]; // top right
|
||||
v[iNumV++].p = vecPoints[1]; // bottom left
|
||||
v[iNumV++].p = vecPoints[3]; // bottom right
|
||||
|
||||
//
|
||||
// set texture coordinates
|
||||
//
|
||||
iNumV -= 6;
|
||||
|
||||
FRECT* pTexCoordRect = pGrayTexture->GetTextureCoordRect( pCNI->iGrayPartFrameNo );
|
||||
|
||||
v[iNumV++].t = D3DXVECTOR2( pTexCoordRect->left, pTexCoordRect->top ); // top left
|
||||
v[iNumV++].t = D3DXVECTOR2( pTexCoordRect->left, pTexCoordRect->bottom ); // bottom left
|
||||
v[iNumV++].t = D3DXVECTOR2( pTexCoordRect->right, pTexCoordRect->top ); // top right
|
||||
v[iNumV++].t = v[iNumV-1].t; // top right
|
||||
v[iNumV++].t = v[iNumV-3].t; // bottom left
|
||||
v[iNumV++].t = D3DXVECTOR2( pTexCoordRect->right, pTexCoordRect->bottom ); // bottom right
|
||||
|
||||
//
|
||||
// set vertex colors
|
||||
//
|
||||
iNumV -= 6;
|
||||
|
||||
D3DXCOLOR colorGrayPart(1,1,1,pCNI->fAlpha);
|
||||
|
||||
v[iNumV++].color = colorGrayPart; // top left
|
||||
v[iNumV++].color = colorGrayPart; // bottom left
|
||||
v[iNumV++].color = colorGrayPart; // top right
|
||||
v[iNumV++].color = colorGrayPart; // top right
|
||||
v[iNumV++].color = colorGrayPart; // bottom left
|
||||
v[iNumV++].color = colorGrayPart; // bottom right
|
||||
|
||||
}
|
||||
ASSERT( iNumV == iCount*6 ); // two triangles for each note
|
||||
|
||||
pVB->Unlock();
|
||||
|
||||
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, iNumV/3 );
|
||||
|
||||
|
||||
//
|
||||
// Draw gray parts add pass
|
||||
//
|
||||
if( bDrawAddPass )
|
||||
{
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG2 );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
|
||||
|
||||
pVB->Lock( 0, 0, (BYTE**)&v, 0 );
|
||||
|
||||
|
||||
iNumV = 0;
|
||||
for( int i=0; i<iCount; i++ )
|
||||
{
|
||||
NoteDisplayInstance* pCNI = &cni[i];
|
||||
|
||||
const D3DXCOLOR colorAdd = D3DXCOLOR(1,1,1,pCNI->fAddAlpha);
|
||||
|
||||
//
|
||||
// set vertex colors
|
||||
//
|
||||
v[iNumV++].color = colorAdd; // top left
|
||||
v[iNumV++].color = colorAdd; // bottom left
|
||||
v[iNumV++].color = colorAdd; // top right
|
||||
v[iNumV++].color = colorAdd; // top right
|
||||
v[iNumV++].color = colorAdd; // bottom left
|
||||
v[iNumV++].color = colorAdd; // bottom right
|
||||
|
||||
}
|
||||
ASSERT( iNumV == iCount*6 ); // two triangles for each note
|
||||
|
||||
pVB->Unlock();
|
||||
|
||||
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, iNumV/3 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Draw color parts diffuse pass
|
||||
//
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
|
||||
|
||||
pd3dDevice->SetTexture( 0, pColorTexture->GetD3DTexture() );
|
||||
|
||||
pVB->Lock( 0, 0, (BYTE**)&v, 0 );
|
||||
|
||||
iNumV = 0;
|
||||
for( i=0; i<iCount; i++ )
|
||||
{
|
||||
NoteDisplayInstance* pCNI = &cni[i];
|
||||
const float fX = pCNI->fX;
|
||||
const float fY = pCNI->fY;
|
||||
const float fRotation = pCNI->fRotation;
|
||||
D3DXVECTOR3 vecPoints[4]; // top left, bottom left, top right, bottom right
|
||||
|
||||
//
|
||||
// Set vertex positions
|
||||
//
|
||||
vecPoints[0] = D3DXVECTOR3( -fColorWidth/2, -fColorHeight/2, 0 ); // top left
|
||||
vecPoints[1] = D3DXVECTOR3( -fColorWidth/2, +fColorHeight/2, 0 ); // bottom left
|
||||
vecPoints[2] = D3DXVECTOR3( +fColorWidth/2, -fColorHeight/2, 0 ); // top right
|
||||
vecPoints[3] = D3DXVECTOR3( +fColorWidth/2, +fColorHeight/2, 0 ); // bottom right
|
||||
|
||||
if( fRotation != 0 )
|
||||
{
|
||||
D3DXMATRIX matRotation;
|
||||
D3DXMatrixRotationZ( &matRotation, fRotation );
|
||||
|
||||
for( int j=0; j<4; j++ )
|
||||
D3DXVec3TransformCoord( &vecPoints[j], &vecPoints[j], &matRotation );
|
||||
}
|
||||
for( int j=0; j<4; j++ )
|
||||
{
|
||||
vecPoints[j].x += fX;
|
||||
vecPoints[j].y += fY;
|
||||
}
|
||||
|
||||
// first triangle
|
||||
v[iNumV++].p = vecPoints[0]; // top left
|
||||
v[iNumV++].p = vecPoints[1]; // bottom left
|
||||
v[iNumV++].p = vecPoints[2]; // top right
|
||||
// 2nd triangle
|
||||
v[iNumV++].p = vecPoints[2]; // top right
|
||||
v[iNumV++].p = vecPoints[1]; // bottom left
|
||||
v[iNumV++].p = vecPoints[3]; // bottom right
|
||||
|
||||
//
|
||||
// set texture coordinates
|
||||
//
|
||||
iNumV -= 6;
|
||||
|
||||
FRECT* pTexCoordRect = pColorTexture->GetTextureCoordRect( pCNI->iColorPartFrameNo );
|
||||
|
||||
v[iNumV++].t = D3DXVECTOR2( pTexCoordRect->left, pTexCoordRect->top ); // top left
|
||||
v[iNumV++].t = D3DXVECTOR2( pTexCoordRect->left, pTexCoordRect->bottom ); // bottom left
|
||||
v[iNumV++].t = D3DXVECTOR2( pTexCoordRect->right, pTexCoordRect->top ); // top right
|
||||
v[iNumV++].t = v[iNumV-1].t; // top right
|
||||
v[iNumV++].t = v[iNumV-3].t; // bottom left
|
||||
v[iNumV++].t = D3DXVECTOR2( pTexCoordRect->right, pTexCoordRect->bottom ); // bottom right
|
||||
|
||||
//
|
||||
// set vertex colors
|
||||
//
|
||||
iNumV -= 6;
|
||||
|
||||
D3DXCOLOR colorLeadingEdge = D3DXCOLOR(pCNI->colorLeadingEdge);
|
||||
D3DXCOLOR colorTrailingEdge = D3DXCOLOR(pCNI->colorTrailingEdge);
|
||||
|
||||
colorLeadingEdge.a = pCNI->fAlpha;
|
||||
colorTrailingEdge.a = pCNI->fAlpha;
|
||||
|
||||
v[iNumV++].color = colorLeadingEdge; // top left
|
||||
v[iNumV++].color = colorTrailingEdge; // bottom left
|
||||
v[iNumV++].color = colorLeadingEdge; // top right
|
||||
v[iNumV++].color = v[iNumV-1].color; // top right
|
||||
v[iNumV++].color = v[iNumV-3].color; // bottom left
|
||||
v[iNumV++].color = colorTrailingEdge; // bottom right
|
||||
|
||||
}
|
||||
ASSERT( iNumV == iCount*6 ); // two triangles for each note
|
||||
|
||||
pVB->Unlock();
|
||||
|
||||
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, iNumV/3 );
|
||||
|
||||
|
||||
//
|
||||
// Draw Color parts add pass
|
||||
//
|
||||
if( bDrawAddPass )
|
||||
{
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG2 );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
|
||||
pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
|
||||
|
||||
pVB->Lock( 0, 0, (BYTE**)&v, 0 );
|
||||
|
||||
|
||||
iNumV = 0;
|
||||
for( int i=0; i<iCount; i++ )
|
||||
{
|
||||
NoteDisplayInstance* pCNI = &cni[i];
|
||||
|
||||
const D3DXCOLOR colorAdd = D3DXCOLOR(1,1,1,pCNI->fAddAlpha);
|
||||
|
||||
//
|
||||
// set vertex colors
|
||||
//
|
||||
v[iNumV++].color = colorAdd; // top left
|
||||
v[iNumV++].color = colorAdd; // bottom left
|
||||
v[iNumV++].color = colorAdd; // top right
|
||||
v[iNumV++].color = colorAdd; // top right
|
||||
v[iNumV++].color = colorAdd; // bottom left
|
||||
v[iNumV++].color = colorAdd; // bottom right
|
||||
|
||||
}
|
||||
ASSERT( iNumV == iCount*6 ); // two triangles for each note
|
||||
|
||||
pVB->Unlock();
|
||||
|
||||
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, iNumV/3 );
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float fLife, const float fPercentFadeToFail )
|
||||
{
|
||||
const int iCol = hn.m_iTrack;
|
||||
const float fStartYOffset = ArrowGetYOffset2( m_PlayerNumber, hn.m_fStartBeat );
|
||||
const float fStartYPos = ArrowGetYPos( m_PlayerNumber, fStartYOffset );
|
||||
const float fEndYOffset = ArrowGetYOffset2( m_PlayerNumber, hn.m_fEndBeat );
|
||||
const float fEndYPos = ArrowGetYPos( m_PlayerNumber, fEndYOffset );
|
||||
|
||||
// draw from bottom to top
|
||||
const float fFrameWidth = m_sprHoldParts.GetUnzoomedWidth();
|
||||
const float fFrameHeight = m_sprHoldParts.GetUnzoomedHeight();
|
||||
const float fBodyHeight = fFrameHeight*4;
|
||||
|
||||
const float fYHead = min(fStartYPos, fEndYPos); // stop drawing here
|
||||
const float fYTail = max(fStartYPos, fEndYPos); // the center the tail
|
||||
|
||||
const float fYTailTop = fYTail-fFrameHeight/2;
|
||||
const float fYTailBottom = fYTail+fFrameHeight/2;
|
||||
|
||||
const float fYBodyTop = fYHead; // middle of head
|
||||
const float fYBodyBottom = fYTailTop; // top of tail
|
||||
|
||||
const int fYStep = 8; // draw a segment every 8 pixels // this requires that the texture dimensions be a multiple of 8
|
||||
|
||||
DISPLAY->SetBlendModeNormal();
|
||||
DISPLAY->SetColorTextureMultDiffuse();
|
||||
DISPLAY->SetAlphaTextureMultDiffuse();
|
||||
DISPLAY->SetTexture( m_sprHoldParts.GetTexture() );
|
||||
|
||||
//
|
||||
// Draw the tail
|
||||
//
|
||||
float fY;
|
||||
for( fY=max(fYTailTop,fYHead); fY<fYTailBottom; fY+=fYStep ) // don't draw the part of the tail that is before the middle of the head
|
||||
{
|
||||
const float fYTop = fY;
|
||||
const float fYBottom = fY+fYStep;
|
||||
const float fXTop = ArrowGetXPos2( m_PlayerNumber, iCol, fYTop );
|
||||
const float fXBottom = ArrowGetXPos2( m_PlayerNumber, iCol, fYBottom );
|
||||
const float fXTopLeft = fXTop - fFrameWidth/2;
|
||||
const float fXTopRight = fXTop + fFrameWidth/2;
|
||||
const float fXBottomLeft = fXBottom - fFrameWidth/2;
|
||||
const float fXBottomRight = fXBottom + fFrameWidth/2;
|
||||
const float fTopDistFromTailTop = fYTop - fYTailTop;
|
||||
const float fBottomDistFromTailTop = fYBottom - fYTailTop;
|
||||
const float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fFrameHeight, 0.25f, 0.5f );
|
||||
const float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fFrameHeight, 0.25f, 0.5f );
|
||||
const float fTexCoordLeft = bActive ? 0.25f : 0.00f;
|
||||
const float fTexCoordRight = bActive ? 0.50f : 0.25f;
|
||||
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop );
|
||||
const float fAlphaBottom = ArrowGetAlpha( m_PlayerNumber, fYBottom );
|
||||
const float fAddAlphaTop = GetAddAlpha( fAlphaTop, fPercentFadeToFail );
|
||||
const float fAddAlphaBottom = GetAddAlpha( fAlphaBottom, fPercentFadeToFail );
|
||||
const float fColorScale = SCALE(fLife,0,1,0.5f,1);
|
||||
const D3DXCOLOR colorDiffuseTop = D3DXCOLOR(fColorScale,fColorScale,fColorScale,fAlphaTop);
|
||||
const D3DXCOLOR colorDiffuseBottom = D3DXCOLOR(fColorScale,fColorScale,fColorScale,fAlphaBottom);
|
||||
const D3DXCOLOR colorAddTop = D3DXCOLOR(1,1,1,fAddAlphaTop);
|
||||
const D3DXCOLOR colorAddBottom = D3DXCOLOR(1,1,1,fAddAlphaBottom);
|
||||
|
||||
// the shift by -0.5 is to align texels to pixels
|
||||
|
||||
DISPLAY->AddQuad(
|
||||
D3DXVECTOR3(fXTopLeft-0.5f, fYTop-0.5f, 0), colorDiffuseTop, D3DXVECTOR2(fTexCoordLeft, fTexCoordTop), colorAddTop, // top-left
|
||||
D3DXVECTOR3(fXTopRight-0.5f, fYTop-0.5f, 0), colorDiffuseTop, D3DXVECTOR2(fTexCoordRight, fTexCoordTop), colorAddTop, // top-right
|
||||
D3DXVECTOR3(fXBottomLeft-0.5f, fYBottom-0.5f,0), colorDiffuseBottom, D3DXVECTOR2(fTexCoordLeft, fTexCoordBottom), colorAddBottom, // bottom-left
|
||||
D3DXVECTOR3(fXBottomRight-0.5f,fYBottom-0.5f,0), colorDiffuseBottom, D3DXVECTOR2(fTexCoordRight, fTexCoordBottom), colorAddBottom ); // bottom-right
|
||||
}
|
||||
|
||||
//
|
||||
// Draw the body
|
||||
//
|
||||
for( fY=fYBodyTop; fY<fYTailTop; fY+=fYStep ) // top to bottom
|
||||
{
|
||||
const float fYTop = fY;
|
||||
const float fYBottom = min( fY+fYStep, fYTailTop );
|
||||
const float fXTop = ArrowGetXPos2( m_PlayerNumber, iCol, fYTop );
|
||||
const float fXBottom = ArrowGetXPos2( m_PlayerNumber, iCol, fYBottom );
|
||||
const float fXTopLeft = fXTop - fFrameWidth/2;
|
||||
const float fXTopRight = fXTop + fFrameWidth/2;
|
||||
const float fXBottomLeft = fXBottom - fFrameWidth/2;
|
||||
const float fXBottomRight = fXBottom + fFrameWidth/2;
|
||||
const float fTopDistFromTailTop = fYTailTop - fYTop;
|
||||
const float fBottomDistFromTailTop = fYTailTop - fYBottom;
|
||||
const float fTexCoordTop = SCALE( fTopDistFromTailTop, 0, fBodyHeight, 1, 0 );
|
||||
const float fTexCoordBottom = SCALE( fBottomDistFromTailTop, 0, fBodyHeight, 1, 0 );
|
||||
const float fTexCoordLeft = bActive ? 0.75f : 0.50f;
|
||||
const float fTexCoordRight = bActive ? 1.00f : 0.75f;
|
||||
const float fAlphaTop = ArrowGetAlpha( m_PlayerNumber, fYTop );
|
||||
const float fAlphaBottom = ArrowGetAlpha( m_PlayerNumber, fYBottom );
|
||||
const float fAddAlphaTop = GetAddAlpha( fAlphaTop, fPercentFadeToFail );
|
||||
const float fAddAlphaBottom = GetAddAlpha( fAlphaBottom, fPercentFadeToFail );
|
||||
const float fColorScale = SCALE(fLife,0,1,0.5f,1);
|
||||
const D3DXCOLOR colorDiffuseTop = D3DXCOLOR(fColorScale,fColorScale,fColorScale,fAlphaTop);
|
||||
const D3DXCOLOR colorDiffuseBottom = D3DXCOLOR(fColorScale,fColorScale,fColorScale,fAlphaBottom);
|
||||
const D3DXCOLOR colorAddTop = D3DXCOLOR(1,1,1,fAddAlphaTop);
|
||||
const D3DXCOLOR colorAddBottom = D3DXCOLOR(1,1,1,fAddAlphaBottom);
|
||||
|
||||
DISPLAY->AddQuad(
|
||||
D3DXVECTOR3(fXTopLeft-0.5f, fYTop-0.5f, 0), colorDiffuseTop, D3DXVECTOR2(fTexCoordLeft, fTexCoordTop), colorAddTop, // top-left
|
||||
D3DXVECTOR3(fXTopRight-0.5f, fYTop-0.5f, 0), colorDiffuseTop, D3DXVECTOR2(fTexCoordRight, fTexCoordTop), colorAddTop, // top-right
|
||||
D3DXVECTOR3(fXBottomLeft-0.5f, fYBottom-0.5f,0), colorDiffuseBottom, D3DXVECTOR2(fTexCoordLeft, fTexCoordBottom), colorAddBottom, // bottom-left
|
||||
D3DXVECTOR3(fXBottomRight-0.5f,fYBottom-0.5f,0), colorDiffuseBottom, D3DXVECTOR2(fTexCoordRight, fTexCoordBottom), colorAddBottom ); // bottom-right
|
||||
}
|
||||
|
||||
DISPLAY->FlushQueue();
|
||||
|
||||
|
||||
//
|
||||
// Draw head
|
||||
//
|
||||
{
|
||||
fY = fYHead;
|
||||
const float fX = ArrowGetXPos2( m_PlayerNumber, iCol, fY );
|
||||
const float fAlpha = ArrowGetAlpha( m_PlayerNumber, fY );
|
||||
const float fAddAlpha = GetAddAlpha( fAlpha, fPercentFadeToFail );
|
||||
const float fColorScale = SCALE(fLife,0,1,0.5f,1);
|
||||
const D3DXCOLOR colorDiffuse= D3DXCOLOR(fColorScale,fColorScale,fColorScale,fAlpha);
|
||||
const D3DXCOLOR colorAdd = D3DXCOLOR(1,1,1,fAddAlpha);
|
||||
|
||||
m_sprHoldParts.SetState( bActive?1:0 );
|
||||
m_sprHoldParts.SetXY( fX, fY );
|
||||
m_sprHoldParts.SetDiffuseColor( colorDiffuse );
|
||||
m_sprHoldParts.SetAddColor( colorAdd );
|
||||
m_sprHoldParts.Draw();
|
||||
}
|
||||
}
|
||||
|
||||
void NoteDisplay::DrawTap( const int iCol, const float fBeat, const bool bUseHoldColor, const float fPercentFadeToFail )
|
||||
{
|
||||
const float fYOffset = ArrowGetYOffset2( m_PlayerNumber, fBeat );
|
||||
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
|
||||
const float fRotation = ArrowGetRotation( m_PlayerNumber, iCol, fYOffset );
|
||||
const float fXPos = ArrowGetXPos2( m_PlayerNumber, iCol, fYPos );
|
||||
const float fAlpha = ArrowGetAlpha( m_PlayerNumber, fYPos );
|
||||
const float fAddAlpha = GetAddAlpha( fAlpha, fPercentFadeToFail );
|
||||
const int iGrayPartFrameNo = GetTapGrayFrameNo( fBeat );
|
||||
const int iColorPartFrameNo = GetTapColorFrameNo( fBeat );
|
||||
|
||||
D3DXCOLOR colorGrayPart = D3DXCOLOR(1,1,1,1);
|
||||
D3DXCOLOR colorLeadingEdge;
|
||||
D3DXCOLOR colorTrailingEdge;
|
||||
if( bUseHoldColor )
|
||||
colorLeadingEdge = colorTrailingEdge = D3DXCOLOR(0,1,0,1); // HACK: green.
|
||||
else
|
||||
GetTapEdgeColors( fBeat, colorLeadingEdge, colorTrailingEdge );
|
||||
colorGrayPart.a *= fAlpha;
|
||||
colorLeadingEdge.a *= fAlpha;
|
||||
colorTrailingEdge.a *= fAlpha;
|
||||
|
||||
m_sprTapParts.SetXY( fXPos, fYPos );
|
||||
m_sprTapParts.SetRotation( fRotation );
|
||||
m_sprTapParts.SetAddColor( D3DXCOLOR(1,1,1,fAddAlpha) );
|
||||
|
||||
//
|
||||
// draw gray part
|
||||
//
|
||||
m_sprTapParts.SetState( iGrayPartFrameNo );
|
||||
m_sprTapParts.SetDiffuseColor( colorGrayPart );
|
||||
m_sprTapParts.Draw();
|
||||
|
||||
//
|
||||
// draw color part
|
||||
//
|
||||
m_sprTapParts.SetState( iColorPartFrameNo );
|
||||
m_sprTapParts.SetDiffuseColorTopEdge( colorLeadingEdge );
|
||||
m_sprTapParts.SetDiffuseColorBottomEdge( colorTrailingEdge );
|
||||
m_sprTapParts.Draw();
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: NoteDisplay
|
||||
|
||||
Desc: Draws TapNotes and HoldNotes.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Brian Bugh
|
||||
Ben Nordstrom
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "Sprite.h"
|
||||
#include "NoteTypes.h"
|
||||
|
||||
|
||||
class NoteDisplay
|
||||
{
|
||||
public:
|
||||
NoteDisplay();
|
||||
|
||||
void Load( int iColNum, PlayerNumber pn );
|
||||
|
||||
void DrawTap( const int iCol, const float fBeat, const bool bUseHoldColor, const float fPercentFadeToFail );
|
||||
void DrawHold( const HoldNote& hn, const bool bActive, const float fLife, const float fPercentFadeToFail );
|
||||
|
||||
protected:
|
||||
int GetTapGrayFrameNo( const float fNoteBeat );
|
||||
int GetTapColorFrameNo( const float fNoteBeat );
|
||||
void GetTapEdgeColors( const float fNoteBeat, D3DXCOLOR &colorLeadingOut, D3DXCOLOR &colorTrailingOut );
|
||||
// D3DXCOLOR GetHoldColor( const float fY, const float fYTop, const float fYBottom );
|
||||
float GetAddAlpha( float DiffuseAlpha, const float fPercentFadeToFail );
|
||||
|
||||
PlayerNumber m_PlayerNumber; // to look up PlayerOptions
|
||||
|
||||
Sprite m_sprTapParts; // for now, must be an even number of frames
|
||||
Sprite m_sprHoldParts; // for now, must be 16 frames
|
||||
|
||||
CArray<D3DXCOLOR,D3DXCOLOR> m_colorTapTweens;
|
||||
// CArray<D3DXCOLOR,D3DXCOLOR> m_colorHoldTweens;
|
||||
};
|
||||
+71
-106
@@ -30,7 +30,7 @@ NoteField::NoteField()
|
||||
{
|
||||
m_rectMeasureBar.TurnShadowOff();
|
||||
|
||||
m_textMeasureNumber.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textMeasureNumber.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textMeasureNumber.SetZoom( 1.0f );
|
||||
|
||||
m_rectMarkerBar.TurnShadowOff();
|
||||
@@ -59,11 +59,9 @@ void NoteField::Load( NoteData* pNoteData, PlayerNumber pn, int iPixelsToDrawBeh
|
||||
|
||||
this->CopyAll( pNoteData );
|
||||
|
||||
// init arrow rotations and X positions
|
||||
// init note displays
|
||||
for( int c=0; c<m_iNumTracks; c++ )
|
||||
{
|
||||
m_ColorNote[c].Load( c, pn );
|
||||
}
|
||||
m_NoteDisplay[c].Load( c, pn );
|
||||
|
||||
|
||||
for( i=0; i<MAX_HOLD_NOTES; i++ )
|
||||
@@ -84,6 +82,7 @@ void NoteField::Update( float fDeltaTime )
|
||||
|
||||
|
||||
|
||||
/*
|
||||
void NoteField::CreateTapNoteInstance( ColorNoteInstance &cni, const int iCol, const float fIndex, const bool bUseHoldNoteBeginColor )
|
||||
{
|
||||
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fIndex );
|
||||
@@ -113,41 +112,15 @@ void NoteField::CreateTapNoteInstance( ColorNoteInstance &cni, const int iCol, c
|
||||
|
||||
void NoteField::CreateHoldNoteInstance( ColorNoteInstance &cni, const bool bActive, const float fIndex, const HoldNote &hn, const float fHoldNoteLife )
|
||||
{
|
||||
const int iCol = hn.m_iTrack;
|
||||
|
||||
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fIndex );
|
||||
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
|
||||
const float fRotation = ArrowGetRotation( m_PlayerNumber, iCol, fYOffset );
|
||||
const float fXPos = ArrowGetXPos( m_PlayerNumber, iCol, fYOffset );
|
||||
float fAlpha = ArrowGetAlpha( m_PlayerNumber, fYPos );
|
||||
|
||||
if( m_fPercentFadeToFail != -1 )
|
||||
fAlpha = 1-m_fPercentFadeToFail;
|
||||
|
||||
int iGrayPartFrameNo;
|
||||
int iColorPartFrameNo;
|
||||
if( bActive )
|
||||
{
|
||||
iGrayPartFrameNo = m_ColorNote[iCol].GetGrayPartFrameNoFull();
|
||||
iColorPartFrameNo = m_ColorNote[iCol].GetColorPartFrameNoFull();
|
||||
}
|
||||
else
|
||||
{
|
||||
iGrayPartFrameNo = m_ColorNote[iCol].GetGrayPartFrameNoClear();
|
||||
iColorPartFrameNo = m_ColorNote[iCol].GetColorPartFrameNoClear();
|
||||
}
|
||||
|
||||
const float fPercentIntoHold = (fIndex-hn.m_iStartIndex)/(hn.m_iEndIndex-hn.m_iStartIndex);
|
||||
D3DXCOLOR color = m_ColorNote[iCol].GetHoldColorFromPercentIntoHold( fPercentIntoHold );
|
||||
|
||||
float fAddAlpha = m_ColorNote[iCol].GetAddAlphaFromDiffuseAlpha( fAlpha );
|
||||
|
||||
cni = ColorNoteInstance( fXPos, fYPos, fRotation, fAlpha, color, color, fAddAlpha, iColorPartFrameNo, iGrayPartFrameNo );
|
||||
}
|
||||
*/
|
||||
|
||||
void NoteField::DrawMeasureBar( const int iIndex, const int iMeasureNo )
|
||||
void NoteField::DrawMeasureBar( int iMeasureIndex )
|
||||
{
|
||||
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, (float)iIndex );
|
||||
const int iMeasureNoDisplay = iMeasureIndex+1;
|
||||
const float fBeat = float(iMeasureIndex * BEATS_PER_MEASURE);
|
||||
|
||||
const float fYOffset = ArrowGetYOffset2( m_PlayerNumber, fBeat );
|
||||
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
|
||||
|
||||
m_rectMeasureBar.SetXY( 0, fYPos );
|
||||
@@ -158,14 +131,14 @@ void NoteField::DrawMeasureBar( const int iIndex, const int iMeasureNo )
|
||||
|
||||
m_textMeasureNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
m_textMeasureNumber.SetAddColor( D3DXCOLOR(1,1,1,0) );
|
||||
m_textMeasureNumber.SetText( ssprintf("%d", iMeasureNo) );
|
||||
m_textMeasureNumber.SetText( ssprintf("%d", iMeasureNoDisplay) );
|
||||
m_textMeasureNumber.SetXY( -m_rectMeasureBar.GetZoomedWidth()/2 + 10, fYPos );
|
||||
m_textMeasureNumber.Draw();
|
||||
}
|
||||
|
||||
void NoteField::DrawMarkerBar( const int iIndex )
|
||||
void NoteField::DrawMarkerBar( const float fBeat )
|
||||
{
|
||||
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, (float)iIndex );
|
||||
const float fYOffset = ArrowGetYOffset2( m_PlayerNumber, fBeat );
|
||||
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
|
||||
|
||||
m_rectMarkerBar.SetXY( 0, fYPos );
|
||||
@@ -175,9 +148,9 @@ void NoteField::DrawMarkerBar( const int iIndex )
|
||||
m_rectMarkerBar.Draw();
|
||||
}
|
||||
|
||||
void NoteField::DrawBPMText( const int iIndex, const float fBPM )
|
||||
void NoteField::DrawBPMText( const float fBeat, const float fBPM )
|
||||
{
|
||||
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, (float)iIndex );
|
||||
const float fYOffset = ArrowGetYOffset2( m_PlayerNumber, fBeat );
|
||||
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
|
||||
|
||||
m_textMeasureNumber.SetDiffuseColor( D3DXCOLOR(1,0,0,1) );
|
||||
@@ -187,9 +160,9 @@ void NoteField::DrawBPMText( const int iIndex, const float fBPM )
|
||||
m_textMeasureNumber.Draw();
|
||||
}
|
||||
|
||||
void NoteField::DrawFreezeText( const int iIndex, const float fSecs )
|
||||
void NoteField::DrawFreezeText( const float fBeat, const float fSecs )
|
||||
{
|
||||
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, (float)iIndex );
|
||||
const float fYOffset = ArrowGetYOffset2( m_PlayerNumber, fBeat );
|
||||
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
|
||||
|
||||
m_textMeasureNumber.SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,0,1) );
|
||||
@@ -207,51 +180,44 @@ void NoteField::DrawPrimitives()
|
||||
|
||||
const float fBeatsToDrawBehind = m_iPixelsToDrawBehind * (1/(float)ARROW_SIZE) * (1/GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_fArrowScrollSpeed);
|
||||
const float fBeatsToDrawAhead = m_iPixelsToDrawAhead * (1/(float)ARROW_SIZE) * (1/GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_fArrowScrollSpeed);
|
||||
const int iIndexFirstArrowToDraw = max( 0, BeatToNoteRow( fSongBeat - fBeatsToDrawBehind ) );
|
||||
const int iIndexLastArrowToDraw = BeatToNoteRow( fSongBeat + fBeatsToDrawAhead );
|
||||
const float fFirstBeatToDraw = max( 0, fSongBeat - fBeatsToDrawBehind );
|
||||
const float fLastBeatToDraw = fSongBeat + fBeatsToDrawAhead;
|
||||
const int iFirstIndexToDraw = BeatToNoteRow(fFirstBeatToDraw);
|
||||
const int iLastIndexToDraw = BeatToNoteRow(fLastBeatToDraw);
|
||||
|
||||
//LOG->Trace( "Drawing elements %d through %d", iIndexFirstArrowToDraw, iIndexLastArrowToDraw );
|
||||
|
||||
if( GAMESTATE->m_bEditing )
|
||||
{
|
||||
int i;
|
||||
|
||||
//
|
||||
// Draw measure bars
|
||||
//
|
||||
for( int i=iIndexFirstArrowToDraw; i<=iIndexLastArrowToDraw; i++ )
|
||||
{
|
||||
if( i % ELEMENTS_PER_MEASURE == 0 )
|
||||
DrawMeasureBar( i, i / ELEMENTS_PER_MEASURE + 1 );
|
||||
}
|
||||
for( float b=fFirstBeatToDraw; b<=fLastBeatToDraw; b+=1 )
|
||||
DrawMeasureBar( int(b) );
|
||||
|
||||
//
|
||||
// BPM text
|
||||
//
|
||||
CArray<BPMSegment,BPMSegment&> &aBPMSegments = GAMESTATE->m_pCurSong->m_BPMSegments;
|
||||
for( i=0; i<aBPMSegments.GetSize(); i++ )
|
||||
{
|
||||
DrawBPMText( BeatToNoteRow(aBPMSegments[i].m_fStartBeat), aBPMSegments[i].m_fBPM );
|
||||
}
|
||||
DrawBPMText( aBPMSegments[i].m_fStartBeat, aBPMSegments[i].m_fBPM );
|
||||
|
||||
//
|
||||
// Freeze text
|
||||
//
|
||||
CArray<StopSegment,StopSegment&> &aStopSegments = GAMESTATE->m_pCurSong->m_StopSegments;
|
||||
for( i=0; i<aStopSegments.GetSize(); i++ )
|
||||
{
|
||||
DrawFreezeText( BeatToNoteRow(aStopSegments[i].m_fStartBeat), aStopSegments[i].m_fStopSeconds );
|
||||
}
|
||||
DrawFreezeText( aStopSegments[i].m_fStartBeat, aStopSegments[i].m_fStopSeconds );
|
||||
|
||||
//
|
||||
// Draw marker bars
|
||||
//
|
||||
if( m_fBeginMarker != -1 )
|
||||
{
|
||||
DrawMarkerBar( BeatToNoteRow(m_fBeginMarker) );
|
||||
}
|
||||
DrawMarkerBar( m_fBeginMarker );
|
||||
if( m_fEndMarker != -1 )
|
||||
{
|
||||
DrawMarkerBar( BeatToNoteRow(m_fEndMarker) );
|
||||
}
|
||||
DrawMarkerBar( m_fEndMarker );
|
||||
|
||||
}
|
||||
|
||||
@@ -261,14 +227,23 @@ void NoteField::DrawPrimitives()
|
||||
// to draw the arrows in order of column. This will let us fill up a vertex buffer of arrows
|
||||
// so we can draw them in one swoop without texture or state changes.
|
||||
//
|
||||
// Change: Optimization made this code very unreadable and unmanagable, so we're going to
|
||||
// try a more global, higher-level optimization. Our goal is to make fewer calls to
|
||||
// DrawPrimitive. Instead of filling the vertex buffer all at once (the old optimization)
|
||||
// we'll add something to Display that will automatically group together DrawPrimitive
|
||||
// calls as long as the texture or render states have not changed.
|
||||
//
|
||||
// To mimimize state and texture changes, we're going to draw one column at a time:
|
||||
// HoldNotes, then TapNotes.
|
||||
//
|
||||
|
||||
|
||||
|
||||
for( int c=0; c<m_iNumTracks; c++ ) // for each arrow column
|
||||
{
|
||||
const int MAX_COLOR_NOTE_INSTANCES = 300;
|
||||
ColorNoteInstance instances[MAX_COLOR_NOTE_INSTANCES];
|
||||
int iCount = 0; // number of valid elements in the instances array
|
||||
|
||||
// const int MAX_COLOR_NOTE_INSTANCES = 300;
|
||||
// ColorNoteInstance instances[MAX_COLOR_NOTE_INSTANCES];
|
||||
// int iCount = 0; // number of valid elements in the instances array
|
||||
|
||||
|
||||
|
||||
@@ -279,33 +254,31 @@ void NoteField::DrawPrimitives()
|
||||
{
|
||||
HoldNote &hn = m_HoldNotes[i];
|
||||
HoldNoteScore &hns = m_HoldNoteScores[i];
|
||||
const float fLife = m_fHoldNoteLife[i];
|
||||
const bool bIsHoldingNote = m_bIsHoldingHoldNote[i]; // hack: added -1 because hn.m_iStartIndex changes as note is held
|
||||
|
||||
if( hns == HNS_OK ) // if this HoldNote was completed
|
||||
continue; // don't draw anything
|
||||
|
||||
const float fLife = m_fHoldNoteLife[i];
|
||||
|
||||
if( hn.m_iTrack != c ) // this HoldNote doesn't belong to this column
|
||||
continue;
|
||||
|
||||
// If no part of this HoldNote is on the screen, skip it
|
||||
if( !( iIndexFirstArrowToDraw <= hn.m_iEndIndex && hn.m_iEndIndex <= iIndexLastArrowToDraw ||
|
||||
iIndexFirstArrowToDraw <= hn.m_iStartIndex && hn.m_iStartIndex <= iIndexLastArrowToDraw ||
|
||||
hn.m_iStartIndex < iIndexFirstArrowToDraw && hn.m_iEndIndex > iIndexLastArrowToDraw ) )
|
||||
if( !( fFirstBeatToDraw <= hn.m_fEndBeat && hn.m_fEndBeat <= fLastBeatToDraw ||
|
||||
fFirstBeatToDraw <= hn.m_fStartBeat && hn.m_fStartBeat <= fLastBeatToDraw ||
|
||||
hn.m_fStartBeat < fFirstBeatToDraw && hn.m_fEndBeat > fLastBeatToDraw ) )
|
||||
{
|
||||
continue; // skip
|
||||
}
|
||||
|
||||
|
||||
// If this note was in the past and has life > 0, then it was completed and don't draw it!
|
||||
if( hn.m_iEndIndex < BeatToNoteRow(fSongBeat) && fLife > 0 && m_bIsHoldingHoldNote[i] )
|
||||
continue; // skip
|
||||
m_NoteDisplay[c].DrawHold( hn, bIsHoldingNote, fLife, m_fPercentFadeToFail );
|
||||
|
||||
// // If this note was in the past and has life > 0, then it was completed and don't draw it!
|
||||
// if( hn.m_iEndIndex < BeatToNoteRow(fSongBeat) && fLife > 0 && m_bIsHoldingHoldNote[i] )
|
||||
// continue; // skip
|
||||
|
||||
const int iCol = hn.m_iTrack;
|
||||
const float fHoldNoteLife = m_fHoldNoteLife[i];
|
||||
const bool bActive = m_bIsHoldingHoldNote[i]; // hack: added -1 because hn.m_iStartIndex changes as note is held
|
||||
|
||||
/*
|
||||
// parts of the hold
|
||||
const float fStartDrawingAtBeat = froundf( (float)hn.m_iStartIndex, ROWS_BETWEEN_HOLD_BITS/GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_fArrowScrollSpeed );
|
||||
for( float j=fStartDrawingAtBeat;
|
||||
@@ -321,52 +294,44 @@ void NoteField::DrawPrimitives()
|
||||
|
||||
CreateHoldNoteInstance( instances[iCount++], bActive, (float)j, hn, fHoldNoteLife );
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
const bool bDrawAddPass = GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_AppearanceType != PlayerOptions::APPEARANCE_VISIBLE;
|
||||
if( iCount > 0 )
|
||||
m_ColorNote[c].DrawList( iCount, instances, bDrawAddPass );
|
||||
// const bool bDrawAddPass = GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_AppearanceType != PlayerOptions::APPEARANCE_VISIBLE;
|
||||
// if( iCount > 0 )
|
||||
// m_ColorNote[c].DrawList( iCount, instances, bDrawAddPass );
|
||||
|
||||
|
||||
|
||||
iCount = 0; // reset count
|
||||
// iCount = 0; // reset count
|
||||
|
||||
///////////////////////////////////
|
||||
// Draw all TapNotes in this column
|
||||
///////////////////////////////////
|
||||
for( i=iIndexFirstArrowToDraw; i<=iIndexLastArrowToDraw; i++ ) // for each row
|
||||
for( i=iFirstIndexToDraw; i<=iLastIndexToDraw; i++ ) // for each row
|
||||
{
|
||||
if( m_TapNotes[c][i] == '0' )
|
||||
continue; // no note here
|
||||
if( m_TapNotes[c][i] == '0' ) // no note here
|
||||
continue; // skip
|
||||
|
||||
// See if there is a hold step that begins on this beat.
|
||||
bool bHoldNoteOnThisBeat = false;
|
||||
float fHoldLife = -1;
|
||||
for( int j=0; j<m_iNumHoldNotes; j++ )
|
||||
if( m_TapNotes[c][i] == '2' ) // this is a HoldNote begin marker. Grade it, but don't draw
|
||||
continue; // skip
|
||||
|
||||
// See if there is a hold step that begins on this index.
|
||||
bool bHoldNoteBeginsOnThisBeat = false;
|
||||
for( int c2=0; c2<m_iNumTracks; c2++ )
|
||||
{
|
||||
if( m_HoldNotes[j].m_iStartIndex == i )
|
||||
if( m_TapNotes[c2][i] == '2' )
|
||||
{
|
||||
bHoldNoteOnThisBeat = true;
|
||||
fHoldLife = m_fHoldNoteLife[j];
|
||||
bHoldNoteBeginsOnThisBeat = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( bHoldNoteOnThisBeat )
|
||||
{
|
||||
D3DXCOLOR color(0,1,0,1);
|
||||
color.r *= fHoldLife;
|
||||
color.g *= fHoldLife;
|
||||
color.b *= fHoldLife;
|
||||
CreateTapNoteInstance( instances[iCount++], c, (float)i, true );
|
||||
}
|
||||
else
|
||||
CreateTapNoteInstance( instances[iCount++], c, (float)i );
|
||||
}
|
||||
|
||||
if( iCount > 0 )
|
||||
m_ColorNote[c].DrawList( iCount, instances, bDrawAddPass );
|
||||
|
||||
m_NoteDisplay[c].DrawTap( c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, m_fPercentFadeToFail );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-11
@@ -17,11 +17,11 @@
|
||||
#include "BitmapText.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "StyleDef.h"
|
||||
#include "ColorNote.h"
|
||||
#include "BitmapText.h"
|
||||
#include "Quad.h"
|
||||
#include "ArrowEffects.h"
|
||||
#include "NoteDataWithScoring.h"
|
||||
#include "NoteDisplay.h"
|
||||
|
||||
|
||||
class NoteField : public NoteDataWithScoring, public ActorFrame
|
||||
@@ -31,22 +31,22 @@ public:
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void DrawPrimitives();
|
||||
|
||||
void Load( NoteData* pNoteData, PlayerNumber pn, int iPixelsToDrawBehind, int iPixelsToDrawAhead );
|
||||
void RemoveTapNoteRow( int iIndex );
|
||||
void Load( NoteData* pNoteData, PlayerNumber pn, int iPixelsToDrawBehind, int iPixelsToDrawAhead );
|
||||
void RemoveTapNoteRow( int iIndex );
|
||||
|
||||
bool m_bIsHoldingHoldNote[MAX_HOLD_NOTES]; // hack: Need this to prevent hold note jitter
|
||||
bool m_bIsHoldingHoldNote[MAX_HOLD_NOTES]; // hack: Need this to know when to "light up" the center of hold notes
|
||||
|
||||
float m_fBeginMarker, m_fEndMarker; // only used with MODE_EDIT
|
||||
|
||||
void FadeToFail();
|
||||
|
||||
protected:
|
||||
inline void CreateTapNoteInstance( ColorNoteInstance &cni, const int iCol, const float fIndex, const bool bUseHoldNoteBeginColor = false );
|
||||
inline void CreateHoldNoteInstance( ColorNoteInstance &cni, const bool bActive, const float fIndex, const HoldNote &hn, const float fHoldNoteLife );
|
||||
inline void DrawMeasureBar( const int iIndex, const int iMeasureNo );
|
||||
inline void DrawMarkerBar( const int iIndex );
|
||||
inline void DrawBPMText( const int iIndex, const float fBPM );
|
||||
inline void DrawFreezeText( const int iIndex, const float fBPM );
|
||||
// inline void CreateTapNoteInstance( ColorNoteInstance &cni, const int iCol, const float fIndex, const bool bUseHoldNoteBeginColor = false );
|
||||
// inline void CreateHoldNoteInstance( ColorNoteInstance &cni, const bool bActive, const float fIndex, const HoldNote &hn, const float fHoldNoteLife );
|
||||
inline void DrawMeasureBar( const int iMeasureIndex );
|
||||
inline void DrawMarkerBar( const float fBeat );
|
||||
inline void DrawBPMText( const float fBeat, const float fBPM );
|
||||
inline void DrawFreezeText( const float fBeat, const float fBPM );
|
||||
|
||||
float m_fPercentFadeToFail; // -1 of not fading to fail
|
||||
|
||||
@@ -55,7 +55,7 @@ protected:
|
||||
int m_iPixelsToDrawAhead;
|
||||
|
||||
// color arrows
|
||||
ColorNote m_ColorNote[MAX_NOTE_TRACKS];
|
||||
NoteDisplay m_NoteDisplay[MAX_NOTE_TRACKS];
|
||||
|
||||
// used in MODE_EDIT
|
||||
Quad m_rectMeasureBar;
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: NoteTypes.cpp
|
||||
|
||||
Desc:
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
#include "NoteTypes.h"
|
||||
|
||||
|
||||
D3DXCOLOR NoteTypeToColor( NoteType nt )
|
||||
{
|
||||
switch( nt )
|
||||
{
|
||||
case NOTE_4TH: return D3DXCOLOR(1,0,0,1); // red
|
||||
case NOTE_8TH: return D3DXCOLOR(0,0,1,1); // blue
|
||||
case NOTE_12TH: return D3DXCOLOR(1,0,1,1); // purple
|
||||
case NOTE_16TH: return D3DXCOLOR(1,1,0,1); // yellow
|
||||
default: ASSERT( false ); return D3DXCOLOR(1,1,1,1);
|
||||
}
|
||||
};
|
||||
|
||||
float NoteTypeToBeat( NoteType nt )
|
||||
{
|
||||
switch( nt )
|
||||
{
|
||||
case NOTE_4TH: return 1.0f; // quarter notes
|
||||
case NOTE_8TH: return 1.0f/2; // eighth notes
|
||||
case NOTE_12TH: return 1.0f/3; // triplets
|
||||
case NOTE_16TH: return 1.0f/4; // sixteenth notes
|
||||
default: ASSERT( false ); return 0;
|
||||
}
|
||||
}
|
||||
|
||||
NoteType GetNoteType( int iNoteIndex )
|
||||
{
|
||||
if( iNoteIndex % (ELEMENTS_PER_MEASURE/4) == 0)
|
||||
return NOTE_4TH;
|
||||
else if( iNoteIndex % (ELEMENTS_PER_MEASURE/8) == 0)
|
||||
return NOTE_8TH;
|
||||
else if( iNoteIndex % (ELEMENTS_PER_MEASURE/12) == 0)
|
||||
return NOTE_12TH;
|
||||
else if( iNoteIndex % (ELEMENTS_PER_MEASURE/16) == 0)
|
||||
return NOTE_16TH;
|
||||
// ASSERT(0);
|
||||
return NOTE_INVALID;
|
||||
};
|
||||
|
||||
bool IsNoteOfType( int iNoteIndex, NoteType t )
|
||||
{
|
||||
return GetNoteType(iNoteIndex) == t;
|
||||
}
|
||||
|
||||
D3DXCOLOR GetNoteColorFromIndex( int iIndex )
|
||||
{
|
||||
for( int t=0; t<NUM_NOTE_TYPES; t++ )
|
||||
{
|
||||
if( IsNoteOfType( iIndex, (NoteType)t ) )
|
||||
return NoteTypeToColor( (NoteType)t );
|
||||
}
|
||||
return D3DXCOLOR(0.5f,0.5f,0.5f,1);
|
||||
}
|
||||
|
||||
D3DXCOLOR GetNoteColorFromBeat( float fBeat )
|
||||
{
|
||||
return GetNoteColorFromIndex( BeatToNoteRow(fBeat) );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: NoteTypes.h
|
||||
|
||||
Desc:
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PlayerOptions.h"
|
||||
|
||||
// '1' = tap note
|
||||
// '2' = hold note begin
|
||||
// '3' = hold note end ('1' can also end a HoldNote) ('3' without a matching '2' is ignored
|
||||
// ... for future expansion
|
||||
|
||||
|
||||
typedef unsigned char TapNote;
|
||||
|
||||
enum
|
||||
{
|
||||
TRACK_1 = 0,
|
||||
TRACK_2,
|
||||
TRACK_3,
|
||||
TRACK_4,
|
||||
TRACK_5,
|
||||
TRACK_6,
|
||||
TRACK_7,
|
||||
TRACK_8,
|
||||
TRACK_9,
|
||||
TRACK_10,
|
||||
TRACK_11,
|
||||
TRACK_12,
|
||||
TRACK_13,
|
||||
MAX_NOTE_TRACKS // leave this at the end
|
||||
};
|
||||
|
||||
const int MAX_BEATS = 1500; // BMR's Pulse has about 1300
|
||||
const int BEATS_PER_MEASURE = 4;
|
||||
const int MAX_MEASURES = MAX_BEATS / BEATS_PER_MEASURE;
|
||||
|
||||
const int ELEMENTS_PER_BEAT = 12; // It is important that this number is evenly divisible by 2, 3, and 4.
|
||||
const int ELEMENTS_PER_MEASURE = ELEMENTS_PER_BEAT * BEATS_PER_MEASURE;
|
||||
const int MAX_TAP_NOTE_ROWS = MAX_BEATS*ELEMENTS_PER_BEAT;
|
||||
|
||||
const int MAX_HOLD_NOTES = 400; // BMR's Connected has about 300
|
||||
|
||||
enum NoteType
|
||||
{
|
||||
NOTE_4TH, // quarter notes
|
||||
NOTE_8TH, // eighth notes
|
||||
NOTE_12TH, // triplets
|
||||
NOTE_16TH, // sixteenth notes
|
||||
NUM_NOTE_TYPES,
|
||||
NOTE_INVALID
|
||||
};
|
||||
|
||||
D3DXCOLOR NoteTypeToColor( NoteType nt );
|
||||
float NoteTypeToBeat( NoteType nt );
|
||||
NoteType GetNoteType( int iNoteIndex );
|
||||
bool IsNoteOfType( int iNoteIndex, NoteType t );
|
||||
D3DXCOLOR GetNoteColorFromIndex( int iNoteIndex );
|
||||
D3DXCOLOR GetNoteColorFromBeat( float fBeat );
|
||||
|
||||
|
||||
|
||||
struct HoldNote
|
||||
{
|
||||
int m_iTrack;
|
||||
float m_fStartBeat;
|
||||
float m_fEndBeat;
|
||||
};
|
||||
|
||||
|
||||
inline int BeatToNoteRow( float fBeatNum ) { return int( fBeatNum * ELEMENTS_PER_BEAT + 0.5f); }; // round
|
||||
inline int BeatToNoteRowNotRounded( float fBeatNum ) { return (int)( fBeatNum * ELEMENTS_PER_BEAT ); };
|
||||
inline float NoteRowToBeat( float fNoteIndex ) { return fNoteIndex / (float)ELEMENTS_PER_BEAT; };
|
||||
inline float NoteRowToBeat( int iNoteIndex ) { return NoteRowToBeat( (float)iNoteIndex ); };
|
||||
|
||||
|
||||
|
||||
@@ -333,7 +333,9 @@ void DWIcharToNote( char c, GameController i, DanceNote ¬e1Out, DanceNote &no
|
||||
case 'K': note1Out = DANCE_NOTE_PAD1_UP; note2Out = DANCE_NOTE_PAD1_UPRIGHT; break;
|
||||
case 'L': note1Out = DANCE_NOTE_PAD1_UPRIGHT; note2Out = DANCE_NOTE_PAD1_RIGHT; break;
|
||||
case 'M': note1Out = DANCE_NOTE_PAD1_UPLEFT; note2Out = DANCE_NOTE_PAD1_UPRIGHT; break;
|
||||
default: throw RageException( "Encountered invalid DWI note characer '%c'", c ); break;
|
||||
default:
|
||||
LOG->Warn( "Encountered invalid DWI note characer '%c'", c );
|
||||
note1Out = DANCE_NOTE_NONE; note2Out = DANCE_NOTE_NONE; break;
|
||||
}
|
||||
|
||||
switch( i )
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: OptionsCursor
|
||||
|
||||
Desc: A graphic displayed in the OptionsCursor during Dancing.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "OptionsCursor.h"
|
||||
#include "RageUtil.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "ThemeManager.h"
|
||||
|
||||
|
||||
OptionsCursor::OptionsCursor()
|
||||
{
|
||||
this->AddSubActor( &m_sprMiddle );
|
||||
this->AddSubActor( &m_sprLeft );
|
||||
this->AddSubActor( &m_sprRight );
|
||||
}
|
||||
|
||||
void OptionsCursor::Load( PlayerNumber pn, bool bUnderline )
|
||||
{
|
||||
CString sFileName = bUnderline ? "options underline" : "options cursor";
|
||||
CString sPath = THEME->GetPathTo( "Graphics", sFileName );
|
||||
|
||||
m_sprLeft.Load( sPath );
|
||||
m_sprMiddle.Load( sPath );
|
||||
m_sprRight.Load( sPath );
|
||||
|
||||
m_sprLeft.StopAnimating();
|
||||
m_sprMiddle.StopAnimating();
|
||||
m_sprRight.StopAnimating();
|
||||
|
||||
int iBaseFrameNo;
|
||||
switch( pn )
|
||||
{
|
||||
case PLAYER_1: iBaseFrameNo = 0; break;
|
||||
case PLAYER_2: iBaseFrameNo = 3; break;
|
||||
default: ASSERT(0); break;
|
||||
}
|
||||
m_sprLeft.SetState( iBaseFrameNo+0 );
|
||||
m_sprMiddle.SetState( iBaseFrameNo+1 );
|
||||
m_sprRight.SetState( iBaseFrameNo+2 );
|
||||
}
|
||||
|
||||
void OptionsCursor::SetBarWidth( int iWidth )
|
||||
{
|
||||
TweenBarWidth( iWidth, 0.001f );
|
||||
}
|
||||
|
||||
void OptionsCursor::TweenBarWidth( int iNewWidth )
|
||||
{
|
||||
TweenBarWidth( iNewWidth, 0.2f );
|
||||
}
|
||||
|
||||
void OptionsCursor::TweenBarWidth( int iNewWidth, float fTweenTime )
|
||||
{
|
||||
if( iNewWidth%2 == 1 )
|
||||
iNewWidth++; // round up to nearest even number
|
||||
float fFrameWidth = m_sprLeft.GetUnzoomedWidth();
|
||||
|
||||
m_sprLeft.BeginTweening( fTweenTime );
|
||||
m_sprMiddle.BeginTweening( fTweenTime );
|
||||
m_sprRight.BeginTweening( fTweenTime );
|
||||
|
||||
m_sprMiddle.SetTweenZoomX( iNewWidth/(float)fFrameWidth );
|
||||
|
||||
m_sprLeft.SetTweenX( -iNewWidth/2 - fFrameWidth/2 );
|
||||
m_sprRight.SetTweenX( +iNewWidth/2 + fFrameWidth/2 );
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: OptionsCursor
|
||||
|
||||
Desc: A graphic displayed in the OptionsCursor during Dancing.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "Sprite.h"
|
||||
#include "ActorFrame.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
|
||||
|
||||
class OptionsCursor : public ActorFrame
|
||||
{
|
||||
public:
|
||||
OptionsCursor();
|
||||
|
||||
void Load( PlayerNumber pn, bool bUnderline );
|
||||
void SetBarWidth( int iWidth );
|
||||
void TweenBarWidth( int iNewWidth );
|
||||
|
||||
protected:
|
||||
void TweenBarWidth( int iNewWidth, float fTweenTime );
|
||||
|
||||
Sprite m_sprLeft;
|
||||
Sprite m_sprMiddle;
|
||||
Sprite m_sprRight;
|
||||
};
|
||||
+28
-27
@@ -80,7 +80,7 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi
|
||||
|
||||
m_iNumTapNotes = pNoteData->GetNumTapNotes();
|
||||
m_iTapNotesHit = 0;
|
||||
m_iMeter = GAMESTATE->m_pCurNotes[m_PlayerNumber]->m_iMeter;
|
||||
m_iMeter = GAMESTATE->m_pCurNotes[m_PlayerNumber] ? GAMESTATE->m_pCurNotes[m_PlayerNumber]->m_iMeter : 5;
|
||||
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi
|
||||
if( GAMESTATE->m_PlayerOptions[pn].m_bLittle )
|
||||
this->MakeLittle();
|
||||
|
||||
int iPixelsToDrawBefore = 64;
|
||||
int iPixelsToDrawAfter = 320;
|
||||
int iPixelsToDrawBefore = 96;
|
||||
int iPixelsToDrawAfter = 384;
|
||||
switch( GAMESTATE->m_PlayerOptions[pn].m_EffectType )
|
||||
{
|
||||
case PlayerOptions::EFFECT_MINI: iPixelsToDrawBefore *= 2; iPixelsToDrawAfter *= 2; break;
|
||||
@@ -152,40 +152,40 @@ void Player::Update( float fDeltaTime )
|
||||
HoldNote &hn = m_HoldNotes[i];
|
||||
HoldNoteScore &hns = m_HoldNoteScores[i];
|
||||
float &fLife = m_fHoldNoteLife[i];
|
||||
int iHoldStartIndex = BeatToNoteRow(hn.m_fStartBeat);
|
||||
int iHoldEndIndex = BeatToNoteRow(hn.m_fEndBeat);
|
||||
|
||||
m_NoteField.m_bIsHoldingHoldNote[i] = false; // set host flag so NoteField can do intelligent drawing
|
||||
|
||||
|
||||
if( hns != HNS_NONE ) // if this HoldNote already has a result
|
||||
continue; // we don't need to update the logic for this one
|
||||
|
||||
float fStartBeat = NoteRowToBeat( (float)hn.m_iStartIndex );
|
||||
float fEndBeat = NoteRowToBeat( (float)hn.m_iEndIndex );
|
||||
|
||||
const StyleInput StyleI( m_PlayerNumber, hn.m_iTrack );
|
||||
const GameInput GameI = GAMESTATE->GetCurrentStyleDef()->StyleInputToGameInput( StyleI );
|
||||
|
||||
|
||||
// update the life
|
||||
if( fStartBeat < fSongBeat && fSongBeat < fEndBeat ) // if the song beat is in the range of this hold
|
||||
if( hn.m_fStartBeat < fSongBeat && fSongBeat < hn.m_fEndBeat ) // if the song beat is in the range of this hold
|
||||
{
|
||||
const bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI ) || PREFSMAN->m_bAutoPlay || GAMESTATE->m_bDemonstration;
|
||||
// if they got a bad score or haven't stepped on the corresponding tap yet
|
||||
const bool bSteppedOnTapNote = m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] != TNS_NONE &&
|
||||
m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] != TNS_MISS;
|
||||
const TapNoteScore tns = m_TapNoteScores[hn.m_iTrack][iHoldStartIndex];
|
||||
const bool bSteppedOnTapNote = tns != TNS_NONE && tns != TNS_MISS; // did they step on the start of this hold?
|
||||
|
||||
m_NoteField.m_bIsHoldingHoldNote[i] = bIsHoldingButton && bSteppedOnTapNote;
|
||||
m_NoteField.m_bIsHoldingHoldNote[i] = bIsHoldingButton && bSteppedOnTapNote; // set host flag so NoteField can do intelligent drawing
|
||||
|
||||
if( bIsHoldingButton && bSteppedOnTapNote )
|
||||
if( bSteppedOnTapNote && bIsHoldingButton )
|
||||
{
|
||||
// Increase life
|
||||
fLife += fDeltaTime/HOLD_ARROW_NG_TIME;
|
||||
fLife = min( fLife, 1 ); // clamp
|
||||
|
||||
m_NoteField.m_HoldNotes[i].m_iStartIndex = BeatToNoteRow( fSongBeat ); // move the start of this Hold
|
||||
m_NoteField.m_HoldNotes[i].m_fStartBeat = fSongBeat; // move the start of this Hold
|
||||
|
||||
m_GhostArrowRow.HoldNote( hn.m_iTrack ); // update the "electric ghost" effect
|
||||
}
|
||||
else
|
||||
{
|
||||
if( fSongBeat-fStartBeat > GetMaxBeatDifference() )
|
||||
if( fSongBeat-hn.m_fStartBeat > GetMaxBeatDifference() )
|
||||
{
|
||||
// Decrease life
|
||||
fLife -= fDeltaTime/HOLD_ARROW_NG_TIME;
|
||||
@@ -206,7 +206,7 @@ void Player::Update( float fDeltaTime )
|
||||
}
|
||||
|
||||
// check for OK
|
||||
if( fSongBeat > fEndBeat ) // if this HoldNote is in the past
|
||||
if( fSongBeat > hn.m_fEndBeat ) // if this HoldNote is in the past
|
||||
{
|
||||
// At this point fLife > 0, or else we would have marked it NG above
|
||||
fLife = 1;
|
||||
@@ -379,18 +379,19 @@ void Player::OnRowDestroyed( int col, int iIndexThatWasSteppedOn )
|
||||
score = min( score, m_TapNoteScores[t][iIndexThatWasSteppedOn] );
|
||||
|
||||
// remove this row from the NoteField
|
||||
bool bHoldNoteOnThisBeat = false;
|
||||
for( int j=0; j<m_iNumHoldNotes; j++ )
|
||||
{
|
||||
if( m_HoldNotes[j].m_iStartIndex == iIndexThatWasSteppedOn )
|
||||
{
|
||||
bHoldNoteOnThisBeat = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// bool bHoldNoteOnThisBeat = false;
|
||||
// for( int j=0; j<m_iNumHoldNotes; j++ )
|
||||
// {
|
||||
// if( m_HoldNotes[j].m_iStartIndex == iIndexThatWasSteppedOn )
|
||||
// {
|
||||
// bHoldNoteOnThisBeat = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
if ( score==TNS_PERFECT || score == TNS_GREAT || bHoldNoteOnThisBeat )
|
||||
// if ( score==TNS_PERFECT || score == TNS_GREAT || bHoldNoteOnThisBeat )
|
||||
if ( score==TNS_PERFECT || score == TNS_GREAT )
|
||||
m_NoteField.RemoveTapNoteRow( iIndexThatWasSteppedOn );
|
||||
|
||||
for( int c=0; c<m_iNumTracks; c++ ) // for each column
|
||||
@@ -545,7 +546,7 @@ void Player::HandleNoteScore( TapNoteScore score )
|
||||
int B = m_iMeter * 1000000;
|
||||
float S = (1+N)*N/2.0f;
|
||||
|
||||
printf( "m_iNumTapNotes %d, m_iTapNotesHit %d\n", m_iNumTapNotes, m_iTapNotesHit );
|
||||
// printf( "m_iNumTapNotes %d, m_iTapNotesHit %d\n", m_iNumTapNotes, m_iTapNotesHit );
|
||||
|
||||
float one_step_score = p * (B/S) * n;
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "Sprite.h"
|
||||
#include "BitmapText.h"
|
||||
|
||||
#include "ColorNote.h"
|
||||
#include "GrayArrow.h"
|
||||
#include "GhostArrow.h"
|
||||
#include "GhostArrowBright.h"
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: RageBitmapTexture.h
|
||||
Class: RageBitmapTexture
|
||||
|
||||
Desc: Holder for a static texture with metadata. Can load just about any image format.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -102,6 +103,10 @@ void RageBitmapTexture::Create(
|
||||
iAlphaBits = 0;
|
||||
else if( -1 != m_sFilePath.Find("1 alpha") )
|
||||
iAlphaBits = 1;
|
||||
else if( -1 != m_sFilePath.Find("1alpha") )
|
||||
iAlphaBits = 1;
|
||||
else if( -1 != m_sFilePath.Find("0alpha") )
|
||||
iAlphaBits = 0;
|
||||
if( -1 != m_sFilePath.Find("dither") )
|
||||
bDither = true;
|
||||
|
||||
@@ -143,12 +148,8 @@ void RageBitmapTexture::Create(
|
||||
|
||||
bStretch |= ddii.Width > dwMaxSize || ddii.Height > dwMaxSize;
|
||||
|
||||
/*
|
||||
// HACK: On a Voodoo3 and Win98, D3DXCreateTextureFromFileEx sometimes fails for no good reason.
|
||||
// So, we'll try the call 2x in a row in case the first one fails
|
||||
*/
|
||||
// I'm taking out the Savage hack because it's causing problems. Tough luck for them. I think
|
||||
// the problem can be worked around by setting MaxTextureSize to 512.
|
||||
for( int i=0; i<2; i++ )
|
||||
{
|
||||
if( FAILED( hr = D3DXCreateTextureFromFileEx(
|
||||
@@ -162,7 +163,7 @@ void RageBitmapTexture::Create(
|
||||
D3DPOOL_MANAGED, // which memory pool
|
||||
(bStretch ? D3DX_FILTER_BOX : D3DX_FILTER_NONE) | (bDither ? D3DX_FILTER_DITHER : 0), // filter
|
||||
D3DX_FILTER_BOX | (bDither ? D3DX_FILTER_DITHER : 0), // mip filter
|
||||
0, // no color key
|
||||
D3DCOLOR_ARGB(255,255,0,255), // pink color key
|
||||
&ddii, // struct to fill with source image info
|
||||
NULL, // no palette
|
||||
&m_pd3dTexture ) ) )
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "RageDisplay.h"
|
||||
#include "RageTexture.h"
|
||||
#include <d3dx8.h>
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "RageLog.h"
|
||||
#include "RageTimer.h"
|
||||
#include "RageException.h"
|
||||
#include "RageTexture.h"
|
||||
|
||||
|
||||
RageDisplay* DISPLAY = NULL;
|
||||
@@ -35,6 +36,7 @@ RageDisplay::RageDisplay( HWND hWnd )
|
||||
m_iFramesRenderedSinceLastCheck = 0;
|
||||
m_fFPS = 0;
|
||||
|
||||
m_iNumVerts = 0;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -427,3 +429,126 @@ void RageDisplay::ReleaseVertexBuffer()
|
||||
SAFE_RELEASE( m_pVB );
|
||||
}
|
||||
|
||||
void RageDisplay::AddTriangle(
|
||||
const D3DXVECTOR3& p0, const D3DCOLOR& c0, const D3DXVECTOR2& t0, const D3DCOLOR& a0,
|
||||
const D3DXVECTOR3& p1, const D3DCOLOR& c1, const D3DXVECTOR2& t1, const D3DCOLOR& a1,
|
||||
const D3DXVECTOR3& p2, const D3DCOLOR& c2, const D3DXVECTOR2& t2, const D3DCOLOR& a2 )
|
||||
{
|
||||
ASSERT( m_iNumVerts < MAX_NUM_VERTICIES-3 );
|
||||
m_vertQueue[m_iNumVerts].p = p0;
|
||||
m_vertQueue[m_iNumVerts].color = c0;
|
||||
m_vertQueue[m_iNumVerts].t = t0;
|
||||
m_addColors[m_iNumVerts] = a0;
|
||||
m_iNumVerts++;
|
||||
m_vertQueue[m_iNumVerts].p = p1;
|
||||
m_vertQueue[m_iNumVerts].color = c1;
|
||||
m_vertQueue[m_iNumVerts].t = t1;
|
||||
m_addColors[m_iNumVerts] = a1;
|
||||
m_iNumVerts++;
|
||||
m_vertQueue[m_iNumVerts].p = p2;
|
||||
m_vertQueue[m_iNumVerts].color = c2;
|
||||
m_vertQueue[m_iNumVerts].t = t2;
|
||||
m_addColors[m_iNumVerts] = a2;
|
||||
m_iNumVerts++;
|
||||
|
||||
if( m_iNumVerts > MAX_NUM_VERTICIES-4 )
|
||||
FlushQueue();
|
||||
}
|
||||
|
||||
void RageDisplay::AddQuad(
|
||||
const D3DXVECTOR3 &p0, const D3DCOLOR& c0, const D3DXVECTOR2& t0, const D3DCOLOR& a0, // upper-left
|
||||
const D3DXVECTOR3 &p1, const D3DCOLOR& c1, const D3DXVECTOR2& t1, const D3DCOLOR& a1, // upper-right
|
||||
const D3DXVECTOR3 &p2, const D3DCOLOR& c2, const D3DXVECTOR2& t2, const D3DCOLOR& a2, // lower-left
|
||||
const D3DXVECTOR3 &p3, const D3DCOLOR& c3, const D3DXVECTOR2& t3, const D3DCOLOR& a3 ) // lower-right
|
||||
{
|
||||
// trangles must be in clockwise order
|
||||
AddTriangle(
|
||||
p0, c0, t0, a0, // upper-left
|
||||
p2, c2, t2, a1, // lower-left
|
||||
p3, c3, t3, a2 ); // lower-right
|
||||
|
||||
AddTriangle(
|
||||
p0, c0, t0, a0, // upper-left
|
||||
p3, c3, t3, a1, // lower-right
|
||||
p1, c1, t1, a2 ); // upper-right
|
||||
}
|
||||
|
||||
void RageDisplay::FlushQueue()
|
||||
{
|
||||
if( m_iNumVerts == 0 )
|
||||
return;
|
||||
ASSERT( (m_iNumVerts % 3) == 0 );
|
||||
RAGEVERTEX* v;
|
||||
|
||||
//
|
||||
// draw diffuse pass
|
||||
//
|
||||
m_pVB->Lock( 0, 0, (BYTE**)&v, 0 );
|
||||
memcpy( v, m_vertQueue, sizeof(RAGEVERTEX)*m_iNumVerts );
|
||||
m_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, m_iNumVerts/3 );
|
||||
m_pVB->Unlock();
|
||||
|
||||
//
|
||||
// draw add pass
|
||||
//
|
||||
bool bAnyVertsHaveAdd = false;
|
||||
for( int i=0; i<m_iNumVerts; i++ )
|
||||
if( m_addColors[i]>>24 != 0 ) // if there is any alpha
|
||||
bAnyVertsHaveAdd = true;
|
||||
|
||||
if( bAnyVertsHaveAdd )
|
||||
{
|
||||
SetColorTextureMultDiffuse();
|
||||
SetColorDiffuse();
|
||||
m_pVB->Lock( 0, 0, (BYTE**)&v, 0 );
|
||||
for( int i=0; i<m_iNumVerts; i++ )
|
||||
m_vertQueue[i].color = m_addColors[i];
|
||||
m_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, m_iNumVerts/3 );
|
||||
m_pVB->Unlock();
|
||||
}
|
||||
|
||||
m_iNumVerts = 0;
|
||||
}
|
||||
|
||||
void RageDisplay::SetTexture( RageTexture* pTexture )
|
||||
{
|
||||
m_pd3dDevice->SetTexture( 0, pTexture->GetD3DTexture() );
|
||||
}
|
||||
void RageDisplay::SetColorTextureMultDiffuse()
|
||||
{
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
|
||||
}
|
||||
void RageDisplay::SetColorDiffuse()
|
||||
{
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG2 );
|
||||
}
|
||||
void RageDisplay::SetAlphaTextureMultDiffuse()
|
||||
{
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
|
||||
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
|
||||
}
|
||||
void RageDisplay::SetBlendModeNormal()
|
||||
{
|
||||
m_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
|
||||
m_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
|
||||
}
|
||||
void RageDisplay::SetBlendModeAdd()
|
||||
{
|
||||
m_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE );
|
||||
m_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE );
|
||||
}
|
||||
void RageDisplay::EnableZBuffer()
|
||||
{
|
||||
m_pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
|
||||
m_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
|
||||
}
|
||||
void RageDisplay::DisableZBuffer()
|
||||
{
|
||||
m_pd3dDevice->SetRenderState( D3DRS_ZENABLE, FALSE );
|
||||
m_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE );
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
class RageDisplay;
|
||||
|
||||
|
||||
#include "RageTexture.h"
|
||||
class RageTexture;
|
||||
#include <D3DX8.h>
|
||||
|
||||
// A structure for our custom vertex type. We added texture coordinates
|
||||
@@ -30,7 +30,7 @@ struct RAGEVERTEX
|
||||
|
||||
|
||||
const int MAX_NUM_QUADS = 2048;
|
||||
const int MAX_NUM_INDICIES = MAX_NUM_QUADS*3; // two triangles per quad
|
||||
//const int MAX_NUM_INDICIES = MAX_NUM_QUADS*3; // two triangles per quad
|
||||
const int MAX_NUM_VERTICIES = MAX_NUM_QUADS*4; // 4 verticies per quad
|
||||
|
||||
|
||||
@@ -183,6 +183,35 @@ private:
|
||||
float m_fLastUpdateTime;
|
||||
int m_iFramesRenderedSinceLastCheck;
|
||||
float m_fFPS;
|
||||
|
||||
|
||||
//
|
||||
// Render Queue stuff
|
||||
//
|
||||
protected:
|
||||
RAGEVERTEX m_vertQueue[MAX_NUM_VERTICIES];
|
||||
D3DCOLOR m_addColors[MAX_NUM_VERTICIES];
|
||||
int m_iNumVerts;
|
||||
|
||||
public:
|
||||
void AddTriangle(
|
||||
const D3DXVECTOR3& p0, const D3DCOLOR& c0, const D3DXVECTOR2& t0, const D3DCOLOR& a0,
|
||||
const D3DXVECTOR3& p1, const D3DCOLOR& c1, const D3DXVECTOR2& t1, const D3DCOLOR& a1,
|
||||
const D3DXVECTOR3& p2, const D3DCOLOR& c2, const D3DXVECTOR2& t2, const D3DCOLOR& a2 );
|
||||
void AddQuad(
|
||||
const D3DXVECTOR3 &p0, const D3DCOLOR& c0, const D3DXVECTOR2& t0, const D3DCOLOR& a0, // upper-left
|
||||
const D3DXVECTOR3 &p1, const D3DCOLOR& c1, const D3DXVECTOR2& t1, const D3DCOLOR& a1, // upper-right
|
||||
const D3DXVECTOR3 &p2, const D3DCOLOR& c2, const D3DXVECTOR2& t2, const D3DCOLOR& a2, // lower-left
|
||||
const D3DXVECTOR3 &p3, const D3DCOLOR& c3, const D3DXVECTOR2& t3, const D3DCOLOR& a3 );// lower-right
|
||||
void FlushQueue();
|
||||
void SetTexture( RageTexture* pTexture );
|
||||
void SetColorTextureMultDiffuse();
|
||||
void SetColorDiffuse();
|
||||
void SetAlphaTextureMultDiffuse();
|
||||
void SetBlendModeNormal();
|
||||
void SetBlendModeAdd();
|
||||
void EnableZBuffer();
|
||||
void DisableZBuffer();
|
||||
};
|
||||
|
||||
|
||||
|
||||
+17
-17
@@ -47,7 +47,7 @@ CString DeviceInput::GetDescription()
|
||||
case DEVICE_JOY2:
|
||||
case DEVICE_JOY3:
|
||||
case DEVICE_JOY4:
|
||||
sReturn = ssprintf("Joystick %d: ", device - DEVICE_JOY1 + 1 );
|
||||
sReturn = ssprintf("Joy%d ", device - DEVICE_JOY1 + 1 );
|
||||
|
||||
switch( button )
|
||||
{
|
||||
@@ -84,7 +84,7 @@ CString DeviceInput::GetDescription()
|
||||
break;
|
||||
|
||||
case DEVICE_KEYBOARD: // keyboard
|
||||
sReturn = "Keyboard: ";
|
||||
sReturn = "Key ";
|
||||
|
||||
switch( button )
|
||||
{
|
||||
@@ -101,7 +101,7 @@ CString DeviceInput::GetDescription()
|
||||
case DIK_0: sReturn += "0"; break;
|
||||
case DIK_MINUS: sReturn += "Minus"; break;
|
||||
case DIK_EQUALS: sReturn += "Equals"; break;
|
||||
case DIK_BACK: sReturn += "Backspace"; break;
|
||||
case DIK_BACK: sReturn += "Backsp"; break;
|
||||
case DIK_TAB: sReturn += "Tab"; break;
|
||||
// why? case DIK_BACK: sReturn += "Backspace"; break;
|
||||
case DIK_Q: sReturn += "Q"; break;
|
||||
@@ -127,11 +127,11 @@ CString DeviceInput::GetDescription()
|
||||
case DIK_J: sReturn += "J"; break;
|
||||
case DIK_K: sReturn += "K"; break;
|
||||
case DIK_L: sReturn += "L"; break;
|
||||
case DIK_SEMICOLON: sReturn += "Semicolon"; break;
|
||||
case DIK_APOSTROPHE:sReturn += "Apostroph"; break;
|
||||
case DIK_SEMICOLON: sReturn += "Semicln"; break;
|
||||
case DIK_APOSTROPHE:sReturn += "Apostro"; break;
|
||||
case DIK_GRAVE: sReturn += "Grave"; break;
|
||||
case DIK_LSHIFT: sReturn += "LShift"; break;
|
||||
case DIK_BACKSLASH: sReturn += "Backslash"; break;
|
||||
case DIK_BACKSLASH: sReturn += "Backslsh"; break;
|
||||
case DIK_Z: sReturn += "Z"; break;
|
||||
case DIK_X: sReturn += "X"; break;
|
||||
case DIK_C: sReturn += "C"; break;
|
||||
@@ -142,11 +142,11 @@ CString DeviceInput::GetDescription()
|
||||
case DIK_COMMA: sReturn += "Comma"; break;
|
||||
case DIK_PERIOD: sReturn += "Period"; break;
|
||||
case DIK_SLASH: sReturn += "Slash"; break;
|
||||
case DIK_RSHIFT: sReturn += "R Shift"; break;
|
||||
case DIK_MULTIPLY: sReturn += "Multiply"; break;
|
||||
case DIK_LMENU: sReturn += "Left Menu"; break;
|
||||
case DIK_RSHIFT: sReturn += "RShift"; break;
|
||||
case DIK_MULTIPLY: sReturn += "Mult"; break;
|
||||
case DIK_LMENU: sReturn += "LMenu"; break;
|
||||
case DIK_SPACE: sReturn += "Space"; break;
|
||||
case DIK_CAPITAL: sReturn += "Caps Lock"; break;
|
||||
case DIK_CAPITAL: sReturn += "CapsLk"; break;
|
||||
case DIK_F1: sReturn += "F1"; break;
|
||||
case DIK_F2: sReturn += "F2"; break;
|
||||
case DIK_F3: sReturn += "F3"; break;
|
||||
@@ -172,22 +172,22 @@ CString DeviceInput::GetDescription()
|
||||
case DIK_NUMPAD3: sReturn += "NumPad3"; break;
|
||||
case DIK_NUMPAD0: sReturn += "NumPad0"; break;
|
||||
case DIK_DECIMAL: sReturn += "Decimal"; break;
|
||||
case DIK_RMENU: sReturn += "Right Alt"; break;
|
||||
case DIK_RMENU: sReturn += "RightAlt"; break;
|
||||
case DIK_PAUSE: sReturn += "Pause"; break;
|
||||
case DIK_HOME: sReturn += "Home"; break;
|
||||
case DIK_UP: sReturn += "Up"; break;
|
||||
case DIK_PRIOR: sReturn += "Page Up"; break;
|
||||
case DIK_PRIOR: sReturn += "PageUp"; break;
|
||||
case DIK_LEFT: sReturn += "Left"; break;
|
||||
case DIK_RIGHT: sReturn += "Right"; break;
|
||||
case DIK_END: sReturn += "End"; break;
|
||||
case DIK_DOWN: sReturn += "Down"; break;
|
||||
case DIK_NEXT: sReturn += "Page Down"; break;
|
||||
case DIK_NEXT: sReturn += "PageDn"; break;
|
||||
case DIK_INSERT: sReturn += "Insert"; break;
|
||||
case DIK_DELETE: sReturn += "Delete"; break;
|
||||
case DIK_LWIN: sReturn += "Left Win"; break;
|
||||
case DIK_RWIN: sReturn += "Right Win"; break;
|
||||
case DIK_APPS: sReturn += "App Menu"; break;
|
||||
case DIK_NUMPADENTER: sReturn += "NumPadEnter"; break;
|
||||
case DIK_LWIN: sReturn += "LeftWin"; break;
|
||||
case DIK_RWIN: sReturn += "RightWin"; break;
|
||||
case DIK_APPS: sReturn += "AppMenu"; break;
|
||||
case DIK_NUMPADENTER: sReturn += "PadEnter"; break;
|
||||
|
||||
default: sReturn += "Unknown Key"; break;
|
||||
}
|
||||
|
||||
@@ -262,6 +262,13 @@ RageMovieTexture::RageMovieTexture(
|
||||
Create();
|
||||
|
||||
CreateFrameRects();
|
||||
// flip all frame rects because movies are upside down
|
||||
for( int i=0; i<m_TextureCoordRects.GetSize(); i++ )
|
||||
{
|
||||
float fTemp = m_TextureCoordRects[i].top;
|
||||
m_TextureCoordRects[i].top = m_TextureCoordRects[i].bottom;
|
||||
m_TextureCoordRects[i].bottom = fTemp;
|
||||
}
|
||||
}
|
||||
|
||||
RageMovieTexture::~RageMovieTexture()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: RageMovieTexture
|
||||
@@ -9,12 +10,8 @@
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _RAGEMOVIETEXTURE_H_
|
||||
#define _RAGEMOVIETEXTURE_H_
|
||||
|
||||
|
||||
#include "RageDisplay.h"
|
||||
#include "RageTexture.h"
|
||||
#include <d3dx8.h>
|
||||
//#include <d3d8types.h>
|
||||
#include <atlbase.h>
|
||||
@@ -123,6 +120,3 @@ protected:
|
||||
CTextureRenderer *m_pCTR; // DShow Texture renderer
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -26,7 +26,7 @@ ScoreDisplayNormal::ScoreDisplayNormal()
|
||||
LOG->Trace( "ScoreDisplayNormal::ScoreDisplayNormal()" );
|
||||
|
||||
// init the text
|
||||
Load( THEME->GetPathTo(FONT_SCORE_NUMBERS) );
|
||||
LoadFromFont( THEME->GetPathTo("Fonts","score numbers") );
|
||||
TurnShadowOff();
|
||||
|
||||
m_fScore = 0;
|
||||
@@ -35,7 +35,7 @@ ScoreDisplayNormal::ScoreDisplayNormal()
|
||||
|
||||
CString s;
|
||||
for( int i=0; i<NUM_SCORE_DIGITS; i++ )
|
||||
s += '0';
|
||||
s += ' ';
|
||||
SetText( s );
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ ScoreDisplayOni::ScoreDisplayOni()
|
||||
LOG->Trace( "ScoreDisplayOni::ScoreDisplayOni()" );
|
||||
|
||||
// init the text
|
||||
Load( THEME->GetPathTo(FONT_SCORE_NUMBERS) );
|
||||
LoadFromFont( THEME->GetPathTo("Fonts","score numbers") );
|
||||
TurnShadowOff();
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ void Screen::Input( const DeviceInput& DeviceI, const InputEventType type, const
|
||||
|
||||
void Screen::SendScreenMessage( ScreenMessage SM, float fDelay )
|
||||
{
|
||||
assert( fDelay >= 0.0 );
|
||||
ASSERT( fDelay >= 0.0 );
|
||||
|
||||
QueuedScreenMessage QSM;
|
||||
QSM.SM = SM;
|
||||
|
||||
@@ -44,8 +44,9 @@ OptionLineData g_AppearanceOptionsLines[NUM_APPEARANCE_OPTIONS_LINES] = {
|
||||
|
||||
ScreenAppearanceOptions::ScreenAppearanceOptions() :
|
||||
ScreenOptions(
|
||||
THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_BACKGROUND),
|
||||
THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_TOP_EDGE)
|
||||
THEME->GetPathTo("Graphics","appearance options background"),
|
||||
THEME->GetPathTo("Graphics","appearance options page"),
|
||||
THEME->GetPathTo("Graphics","appearance options top edge")
|
||||
)
|
||||
{
|
||||
LOG->Trace( "ScreenAppearanceOptions::ScreenAppearanceOptions()" );
|
||||
@@ -152,6 +153,9 @@ void ScreenAppearanceOptions::ExportOptions()
|
||||
int iSelectedSkin = m_iSelectedOption[0][AO_SKIN];
|
||||
CString sNewSkin = m_OptionLineData[AO_SKIN].szOptionsText[iSelectedSkin];
|
||||
GAMEMAN->SwitchNoteSkin( sNewSkin );
|
||||
|
||||
PREFSMAN->SaveGamePrefsToDisk();
|
||||
PREFSMAN->SaveGlobalPrefsToDisk();
|
||||
}
|
||||
|
||||
void ScreenAppearanceOptions::GoToPrevState()
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: ScreenCaution.h
|
||||
Class: ScreenCaution
|
||||
|
||||
Desc: Screen that displays while resources are being loaded.
|
||||
Desc: Screen that displays while resources are being loaded.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -13,9 +14,14 @@ Desc: Screen that displays while resources are being loaded.
|
||||
#include "ScreenCaution.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "ScreenSelectStyle.h"
|
||||
#include "ScreenEZ2SelectStyle.h"
|
||||
#include "RageTextureManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "AnnouncerManager.h"
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
#define USE_NORMAL_OR_EZ2_SELECT_STYLE THEME->GetMetricB("Screens","UseNormalOrEZ2SelectStyle")
|
||||
|
||||
|
||||
const ScreenMessage SM_DoneOpening = ScreenMessage(SM_User-7);
|
||||
@@ -25,8 +31,10 @@ const ScreenMessage SM_GoToSelectMusic = ScreenMessage(SM_User-9);
|
||||
|
||||
ScreenCaution::ScreenCaution()
|
||||
{
|
||||
m_sprCaution.Load( THEME->GetPathTo(GRAPHIC_CAUTION) );
|
||||
m_sprCaution.StretchTo( CRect(0,0,640,480) );
|
||||
GAMESTATE->m_bPlayersCanJoin = true;
|
||||
|
||||
m_sprCaution.Load( THEME->GetPathTo("Graphics","caution") );
|
||||
m_sprCaution.StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
|
||||
this->AddSubActor( &m_sprCaution );
|
||||
|
||||
m_Wipe.OpenWipingRight( SM_DoneOpening );
|
||||
@@ -57,13 +65,24 @@ void ScreenCaution::HandleScreenMessage( const ScreenMessage SM )
|
||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_CAUTION) );
|
||||
break;
|
||||
case SM_GoToSelectMusic:
|
||||
SCREENMAN->SetNewScreen( new ScreenSelectStyle );
|
||||
if( USE_NORMAL_OR_EZ2_SELECT_STYLE )
|
||||
SCREENMAN->SetNewScreen( new ScreenEz2SelectStyle );
|
||||
else
|
||||
SCREENMAN->SetNewScreen( new ScreenSelectStyle );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenCaution::MenuStart( const PlayerNumber p )
|
||||
{
|
||||
if( !m_Wipe.IsClosing() )
|
||||
if( p != PLAYER_INVALID && !GAMESTATE->m_bIsJoined[p] )
|
||||
{
|
||||
GAMESTATE->m_bIsJoined[p] = true;
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu start") );
|
||||
SCREENMAN->RefreshCreditsMessages();
|
||||
return; // don't fall though
|
||||
}
|
||||
|
||||
if( !m_Wipe.IsOpening() && !m_Wipe.IsClosing() )
|
||||
m_Wipe.CloseWipingRight( SM_GoToSelectMusic );
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: ScreenCaution.h
|
||||
Class: ScreenCaution
|
||||
|
||||
Desc: Screen that displays while SelectSong is being loaded.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
@@ -96,6 +96,9 @@ ScreenEdit::ScreenEdit()
|
||||
if( m_pNotes == NULL )
|
||||
{
|
||||
m_pNotes = new Notes;
|
||||
m_pNotes->m_DifficultyClass = CLASS_MEDIUM;
|
||||
m_pNotes->m_NotesType = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
|
||||
m_pNotes->m_sDescription = "Untitled";
|
||||
// Dro Kulix: If m_pNotes->m_NotesType is not changed here,
|
||||
// the edit mode is somehow stuck only being able to edit
|
||||
// the first four columns of a (NEW) sequence.
|
||||
@@ -110,7 +113,6 @@ ScreenEdit::ScreenEdit()
|
||||
// GAMEMAN->m_CurStyle is set to the target game style
|
||||
// of the current edit. Naturally, this is where we'll
|
||||
// want to extract the NotesType for a (NEW) sequence.
|
||||
m_pNotes->m_NotesType = GAMESTATE->GetCurrentStyleDef()->m_NotesType;
|
||||
|
||||
m_pSong->m_apNotes.Add( m_pNotes );
|
||||
}
|
||||
@@ -131,13 +133,13 @@ ScreenEdit::ScreenEdit()
|
||||
GAMESTATE->m_PlayerOptions[PLAYER_1].m_fArrowScrollSpeed = 1;
|
||||
GAMESTATE->m_PlayerOptions[PLAYER_1].m_ColorType = PlayerOptions::COLOR_NOTE;
|
||||
|
||||
m_sprBackground.Load( THEME->GetPathTo( GRAPHIC_EDIT_BACKGROUND ) );
|
||||
m_sprBackground.Load( THEME->GetPathTo("Graphics","edit background") );
|
||||
m_sprBackground.StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
|
||||
|
||||
|
||||
m_GranularityIndicator.SetXY( EDIT_X, EDIT_GRAY_Y );
|
||||
m_GranularityIndicator.Load();
|
||||
m_GranularityIndicator.SetZoom( 0.5f );
|
||||
m_SnapDisplay.SetXY( EDIT_X, EDIT_GRAY_Y );
|
||||
m_SnapDisplay.Load();
|
||||
m_SnapDisplay.SetZoom( 0.5f );
|
||||
|
||||
m_GrayArrowRowEdit.SetXY( EDIT_X, EDIT_GRAY_Y );
|
||||
m_GrayArrowRowEdit.Load( PLAYER_1 );
|
||||
@@ -165,7 +167,7 @@ ScreenEdit::ScreenEdit()
|
||||
|
||||
m_Fade.SetClosed();
|
||||
|
||||
m_textInfo.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textInfo.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textInfo.SetXY( INFO_X, INFO_Y );
|
||||
m_textInfo.SetHorizAlign( Actor::align_right );
|
||||
m_textInfo.SetVertAlign( Actor::align_top );
|
||||
@@ -173,7 +175,7 @@ ScreenEdit::ScreenEdit()
|
||||
m_textInfo.SetShadowLength( 2 );
|
||||
//m_textInfo.SetText(); // set this below every frame
|
||||
|
||||
m_textHelp.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textHelp.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textHelp.SetXY( HELP_X, HELP_Y );
|
||||
m_textHelp.SetHorizAlign( Actor::align_left );
|
||||
m_textHelp.SetZoom( 0.5f );
|
||||
@@ -181,14 +183,13 @@ ScreenEdit::ScreenEdit()
|
||||
m_textHelp.SetText( HELP_TEXT );
|
||||
|
||||
|
||||
m_soundChangeLine.Load( THEME->GetPathTo(SOUND_EDIT_CHANGE_LINE), 10 );
|
||||
m_soundChangeSnap.Load( THEME->GetPathTo(SOUND_EDIT_CHANGE_SNAP) );
|
||||
m_soundMarker.Load( THEME->GetPathTo(SOUND_EDIT_CHANGE_SNAP) );
|
||||
m_soundInvalid.Load( THEME->GetPathTo(SOUND_MENU_INVALID) );
|
||||
m_soundChangeLine.Load( THEME->GetPathTo("Sounds","edit change line"), 10 );
|
||||
m_soundChangeSnap.Load( THEME->GetPathTo("Sounds","edit change snap") );
|
||||
m_soundMarker.Load( THEME->GetPathTo("Sounds","edit marker") );
|
||||
m_soundInvalid.Load( THEME->GetPathTo("Sounds","menu invalid") );
|
||||
|
||||
|
||||
m_soundMusic.Load( m_pSong->GetMusicPath(), true ); // enable accurate sync
|
||||
m_soundMusic.SetPlaybackRate( 0.5f );
|
||||
|
||||
|
||||
m_Fade.OpenWipingRight();
|
||||
@@ -235,7 +236,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
}
|
||||
|
||||
m_sprBackground.Update( fDeltaTime );
|
||||
m_GranularityIndicator.Update( fDeltaTime );
|
||||
m_SnapDisplay.Update( fDeltaTime );
|
||||
m_GrayArrowRowEdit.Update( fDeltaTime );
|
||||
m_NoteFieldEdit.Update( fDeltaTime );
|
||||
m_Fade.Update( fDeltaTime );
|
||||
@@ -296,7 +297,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
|
||||
|
||||
CString sNoteType;
|
||||
switch( m_GranularityIndicator.GetSnapMode() )
|
||||
switch( m_SnapDisplay.GetSnapMode() )
|
||||
{
|
||||
case NOTE_4TH: sNoteType = "quarter notes"; break;
|
||||
case NOTE_8TH: sNoteType = "eighth notes"; break;
|
||||
@@ -341,7 +342,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
void ScreenEdit::DrawPrimitives()
|
||||
{
|
||||
m_sprBackground.Draw();
|
||||
m_GranularityIndicator.Draw();
|
||||
m_SnapDisplay.Draw();
|
||||
m_GrayArrowRowEdit.Draw();
|
||||
m_textHelp.Draw();
|
||||
|
||||
@@ -370,6 +371,22 @@ void ScreenEdit::DrawPrimitives()
|
||||
m_Player.Draw();
|
||||
}
|
||||
|
||||
if( m_EditMode == MODE_RECORDING )
|
||||
{
|
||||
/*
|
||||
for( int t=0; t<GAMESTATE->GetCurrentStyleDef()->m_iColsPerPlayer; t++ )
|
||||
{
|
||||
if( m_bLayingAHold[t] )
|
||||
{
|
||||
bool bHoldingButton = false;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
bHoldingButton |= INPUTMAPPER->IsButtonDown( StyleInput(PlayerInput(p), t) );
|
||||
if( bHoldingButton
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Screen::DrawPrimitives();
|
||||
}
|
||||
|
||||
@@ -410,7 +427,8 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
break; // We only care about first presses
|
||||
|
||||
int iCol = DeviceI.button - DIK_1;
|
||||
const int iNoteIndex = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||
const float fSongBeat = GAMESTATE->m_fSongBeat;
|
||||
const int iSongIndex = BeatToNoteRow( fSongBeat );
|
||||
|
||||
if( iCol >= m_NoteFieldEdit.m_iNumTracks ) // this button is not in the range of columns for this StyleDef
|
||||
break;
|
||||
@@ -421,7 +439,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
{
|
||||
HoldNote &hn = m_NoteFieldEdit.m_HoldNotes[i];
|
||||
if( iCol == hn.m_iTrack && // the notes correspond
|
||||
iNoteIndex >= hn.m_iStartIndex && iNoteIndex <= hn.m_iEndIndex ) // the cursor lies within this HoldNote
|
||||
fSongBeat >= hn.m_fStartBeat && fSongBeat <= hn.m_fEndBeat ) // the cursor lies within this HoldNote
|
||||
{
|
||||
m_NoteFieldEdit.RemoveHoldNote( i );
|
||||
bRemovedAHoldNote = true;
|
||||
@@ -432,10 +450,10 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
if( !bRemovedAHoldNote )
|
||||
{
|
||||
// We didn't remove a HoldNote, so the user wants to add or delete a TapNote
|
||||
if( m_NoteFieldEdit.m_TapNotes[iCol][iNoteIndex] == '0' )
|
||||
m_NoteFieldEdit.m_TapNotes[iCol][iNoteIndex] = '1';
|
||||
if( m_NoteFieldEdit.m_TapNotes[iCol][iSongIndex] == '0' )
|
||||
m_NoteFieldEdit.m_TapNotes[iCol][iSongIndex] = '1';
|
||||
else
|
||||
m_NoteFieldEdit.m_TapNotes[iCol][iNoteIndex] = '0';
|
||||
m_NoteFieldEdit.m_TapNotes[iCol][iSongIndex] = '0';
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -460,7 +478,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
|
||||
pNotes->SetNoteData( (NoteData*)&m_NoteFieldEdit );
|
||||
GAMESTATE->m_pCurSong->SaveToSMFile();
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_EDIT_SAVE) );
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","edit save") );
|
||||
}
|
||||
break;
|
||||
case DIK_UP:
|
||||
@@ -473,7 +491,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
{
|
||||
case DIK_UP:
|
||||
case DIK_DOWN:
|
||||
fBeatsToMove = NoteTypeToBeat( m_GranularityIndicator.GetSnapMode() );
|
||||
fBeatsToMove = NoteTypeToBeat( m_SnapDisplay.GetSnapMode() );
|
||||
if( DeviceI.button == DIK_UP )
|
||||
fBeatsToMove *= -1;
|
||||
break;
|
||||
@@ -484,8 +502,8 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
fBeatsToMove *= -1;
|
||||
}
|
||||
|
||||
const int iStartIndex = BeatToNoteRow(GAMESTATE->m_fSongBeat);
|
||||
const int iEndIndex = BeatToNoteRow(GAMESTATE->m_fSongBeat + fBeatsToMove);
|
||||
const float fStartBeat = GAMESTATE->m_fSongBeat;
|
||||
const float fEndBeat = GAMESTATE->m_fSongBeat + fBeatsToMove;
|
||||
|
||||
// check to see if they're holding a button
|
||||
for( int col=0; col<m_NoteFieldEdit.m_iNumTracks && col<=10; col++ )
|
||||
@@ -498,15 +516,15 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
// create a new hold note
|
||||
HoldNote newHN;
|
||||
newHN.m_iTrack = col;
|
||||
newHN.m_iStartIndex = min(iStartIndex, iEndIndex);
|
||||
newHN.m_iEndIndex = max(iStartIndex, iEndIndex);
|
||||
newHN.m_fStartBeat = min(fStartBeat, fEndBeat);
|
||||
newHN.m_fEndBeat = max(fStartBeat, fEndBeat);
|
||||
m_NoteFieldEdit.AddHoldNote( newHN );
|
||||
}
|
||||
}
|
||||
|
||||
GAMESTATE->m_fSongBeat += fBeatsToMove;
|
||||
GAMESTATE->m_fSongBeat = clamp( GAMESTATE->m_fSongBeat, 0, MAX_BEATS-1 );
|
||||
GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_GranularityIndicator.GetSnapMode()) );
|
||||
GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetSnapMode()) );
|
||||
m_soundChangeLine.Play();
|
||||
}
|
||||
break;
|
||||
@@ -519,11 +537,11 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
m_soundChangeLine.Play();
|
||||
break;
|
||||
case DIK_RIGHT:
|
||||
m_GranularityIndicator.PrevSnapMode();
|
||||
m_SnapDisplay.PrevSnapMode();
|
||||
OnSnapModeChange();
|
||||
break;
|
||||
case DIK_LEFT:
|
||||
m_GranularityIndicator.NextSnapMode();
|
||||
m_SnapDisplay.NextSnapMode();
|
||||
OnSnapModeChange();
|
||||
break;
|
||||
case DIK_RETURN:
|
||||
@@ -624,18 +642,20 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
|
||||
m_soundMusic.SetPositionSeconds( fElapsedSeconds );
|
||||
m_soundMusic.Play();
|
||||
m_soundMusic.SetPlaybackRate( GAMESTATE->m_SongOptions.m_fMusicRate );
|
||||
for( int i=0; i<MAX_NOTE_TRACKS; i++ )
|
||||
m_bLayingAHold[i] = false;
|
||||
}
|
||||
break;
|
||||
case DIK_T:
|
||||
if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.0f ) GAMESTATE->m_SongOptions.m_fMusicRate = 0.9f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 0.9f ) GAMESTATE->m_SongOptions.m_fMusicRate = 0.8f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 0.8f ) GAMESTATE->m_SongOptions.m_fMusicRate = 0.7f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 0.7f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.5f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.5f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.4f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.4f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.3f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.3f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.2f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.2f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.1f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.1f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.0f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 0.9f ) GAMESTATE->m_SongOptions.m_fMusicRate = 0.8f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 0.8f ) GAMESTATE->m_SongOptions.m_fMusicRate = 0.7f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 0.7f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.5f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.5f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.4f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.4f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.3f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.3f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.2f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.2f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.1f;
|
||||
else if( GAMESTATE->m_SongOptions.m_fMusicRate == 1.1f ) GAMESTATE->m_SongOptions.m_fMusicRate = 1.0f;
|
||||
break;
|
||||
case DIK_INSERT:
|
||||
case DIK_DELETE:
|
||||
@@ -877,14 +897,11 @@ void ScreenEdit::InputRecord( const DeviceInput& DeviceI, const InputEventType t
|
||||
m_pSong->GetBeatAndBPSFromElapsedTime( fHoldStartSeconds, fStartBeat, fThrowAway, bFreeze );
|
||||
m_pSong->GetBeatAndBPSFromElapsedTime( fHoldEndSeconds, fEndBeat, fThrowAway, bFreeze );
|
||||
|
||||
const int iStartIndex = BeatToNoteRow(fStartBeat) - 1;
|
||||
const int iEndIndex = BeatToNoteRow(fEndBeat);
|
||||
|
||||
// create a new hold note
|
||||
HoldNote newHN;
|
||||
newHN.m_iTrack = iCol;
|
||||
newHN.m_iStartIndex = iStartIndex;
|
||||
newHN.m_iEndIndex = iEndIndex;
|
||||
newHN.m_fStartBeat = fStartBeat;
|
||||
newHN.m_fEndBeat = fEndBeat;
|
||||
|
||||
m_NoteFieldRecord.AddHoldNote( newHN );
|
||||
m_NoteFieldRecord.SnapToNearestNoteType( NOTE_12TH, NOTE_16TH, max(0,GAMESTATE->m_fSongBeat-2), GAMESTATE->m_fSongBeat+2);
|
||||
@@ -906,7 +923,7 @@ void ScreenEdit::InputPlay( const DeviceInput& DeviceI, const InputEventType typ
|
||||
m_EditMode = MODE_EDITING;
|
||||
m_soundMusic.Stop();
|
||||
|
||||
GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_GranularityIndicator.GetSnapMode()) );
|
||||
GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetSnapMode()) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -934,7 +951,7 @@ void ScreenEdit::TransitionToEditFromRecord()
|
||||
|
||||
m_NoteFieldEdit.CopyRange( (NoteData*)&m_NoteFieldRecord, iNoteIndexBegin, iNoteIndexEnd, iNoteIndexBegin );
|
||||
|
||||
GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_GranularityIndicator.GetSnapMode()) );
|
||||
GAMESTATE->m_fSongBeat = froundf( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetSnapMode()) );
|
||||
}
|
||||
|
||||
|
||||
@@ -957,7 +974,7 @@ void ScreenEdit::OnSnapModeChange()
|
||||
{
|
||||
m_soundChangeSnap.Play();
|
||||
|
||||
NoteType nt = m_GranularityIndicator.GetSnapMode();
|
||||
NoteType nt = m_SnapDisplay.GetSnapMode();
|
||||
int iStepIndex = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||
int iElementsPerNoteType = BeatToNoteRow( NoteTypeToBeat(nt) );
|
||||
int iStepIndexHangover = iStepIndex % iElementsPerNoteType;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "RageMusic.h"
|
||||
#include "MotionBlurSprite.h"
|
||||
#include "Background.h"
|
||||
#include "GranularityIndicator.h"
|
||||
#include "SnapDisplay.h"
|
||||
|
||||
|
||||
class ScreenEdit : public Screen
|
||||
@@ -50,7 +50,7 @@ protected:
|
||||
Sprite m_sprBackground;
|
||||
|
||||
NoteField m_NoteFieldEdit;
|
||||
GranularityIndicator m_GranularityIndicator;
|
||||
SnapDisplay m_SnapDisplay;
|
||||
GrayArrowRow m_GrayArrowRowEdit;
|
||||
|
||||
BitmapText m_textInfo; // status information that changes
|
||||
@@ -77,11 +77,12 @@ protected:
|
||||
|
||||
// for MODE_PLAY
|
||||
|
||||
Player m_Player;
|
||||
Player m_Player;
|
||||
|
||||
// for MODE_RECORD and MODE_PLAY
|
||||
|
||||
RageSoundStream m_soundMusic;
|
||||
bool m_bLayingAHold[MAX_NOTE_TRACKS];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: ScreenEditMenu.h
|
||||
Class: ScreenEditMenu
|
||||
|
||||
Desc: The main title screen and menu.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -32,6 +33,9 @@ const float GROUP_Y = CENTER_Y - 160;
|
||||
const float SONG_BANNER_X = CENTER_X;
|
||||
const float SONG_BANNER_Y = CENTER_Y - 80;
|
||||
|
||||
const float SONG_BANNER_WIDTH = 286;
|
||||
const float SONG_BANNER_HEIGHT = 92;
|
||||
|
||||
const float ARROWS_X[2] = { SONG_BANNER_X - 200, SONG_BANNER_X + 200 };
|
||||
const float ARROWS_Y[2] = { SONG_BANNER_Y, SONG_BANNER_Y };
|
||||
|
||||
@@ -63,38 +67,40 @@ ScreenEditMenu::ScreenEditMenu()
|
||||
m_SelectedRow = ROW_GROUP;
|
||||
|
||||
SONGMAN->GetGroupNames( m_sGroups );
|
||||
GAMEMAN->GetNotesTypesForGame( GAMESTATE->m_CurGame, m_NotesTypes );
|
||||
m_iSelectedGroup = 0;
|
||||
m_iSelectedSong = 0;
|
||||
m_CurNotesType = NOTES_TYPE_DANCE_SINGLE;
|
||||
m_iSelectedNotesType = 0;
|
||||
m_iSelectedNotes = 0;
|
||||
|
||||
m_textGroup.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textGroup.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textGroup.SetXY( GROUP_X, GROUP_Y );
|
||||
m_textGroup.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) );
|
||||
this->AddSubActor( &m_textGroup );
|
||||
|
||||
m_Banner.SetXY( SONG_BANNER_X, SONG_BANNER_Y );
|
||||
m_Banner.SetCroppedSize( SONG_BANNER_WIDTH, SONG_BANNER_HEIGHT );
|
||||
this->AddSubActor( &m_Banner );
|
||||
|
||||
m_TextBanner.SetXY( SONG_TEXT_BANNER_X, SONG_TEXT_BANNER_Y );
|
||||
this->AddSubActor( &m_TextBanner );
|
||||
|
||||
m_sprArrowLeft.Load( THEME->GetPathTo(GRAPHIC_ARROWS_LEFT) );
|
||||
m_sprArrowLeft.Load( THEME->GetPathTo("Graphics","edit menu left") );
|
||||
m_sprArrowLeft.SetXY( ARROWS_X[0], ARROWS_Y[0] );
|
||||
m_sprArrowLeft.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
this->AddSubActor( &m_sprArrowLeft );
|
||||
|
||||
m_sprArrowRight.Load( THEME->GetPathTo(GRAPHIC_ARROWS_RIGHT) );
|
||||
m_sprArrowRight.Load( THEME->GetPathTo("Graphics","edit menu right") );
|
||||
m_sprArrowRight.SetXY( ARROWS_X[1], ARROWS_Y[1] );
|
||||
m_sprArrowRight.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
this->AddSubActor( &m_sprArrowRight );
|
||||
|
||||
m_textNotesType.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textNotesType.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textNotesType.SetXY( GAME_STYLE_X, GAME_STYLE_Y );
|
||||
m_textNotesType.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) );
|
||||
this->AddSubActor( &m_textNotesType );
|
||||
|
||||
m_textNotes.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textNotes.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textNotes.SetXY( STEPS_X, STEPS_Y );
|
||||
m_textNotes.SetDiffuseColor( D3DXCOLOR(0.7f,0.7f,0.7f,1) );
|
||||
this->AddSubActor( &m_textNotes );
|
||||
@@ -104,15 +110,15 @@ ScreenEditMenu::ScreenEditMenu()
|
||||
OnGroupChange();
|
||||
|
||||
|
||||
m_textExplanation.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textExplanation.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textExplanation.SetXY( EXPLANATION_X, EXPLANATION_Y );
|
||||
m_textExplanation.SetText( EXPLANATION_TEXT );
|
||||
m_textExplanation.SetZoom( 0.7f );
|
||||
this->AddSubActor( &m_textExplanation );
|
||||
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo(GRAPHIC_EDIT_BACKGROUND),
|
||||
THEME->GetPathTo(GRAPHIC_EDIT_TOP_EDGE),
|
||||
THEME->GetPathTo("Graphics","edit background"),
|
||||
THEME->GetPathTo("Graphics","edit top edge"),
|
||||
ssprintf("%c %c change line %c %c change value START to continue", char(3), char(4), char(1), char(2) ),
|
||||
false, false, 40
|
||||
);
|
||||
@@ -123,10 +129,10 @@ ScreenEditMenu::ScreenEditMenu()
|
||||
this->AddSubActor( &m_Fade);
|
||||
|
||||
|
||||
m_soundChangeMusic.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_CHANGE_MUSIC) );
|
||||
m_soundSelect.Load( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
m_soundChangeMusic.Load( THEME->GetPathTo("Sounds","select music change music") );
|
||||
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
|
||||
|
||||
MUSIC->Load( THEME->GetPathTo(SOUND_MENU_MUSIC) );
|
||||
MUSIC->Load( THEME->GetPathTo("Sounds","edit menu music") );
|
||||
MUSIC->Play( true );
|
||||
|
||||
|
||||
@@ -175,7 +181,7 @@ void ScreenEditMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
NotesType nt = GetSelectedNotesType();
|
||||
Style style = GAMEMAN->GetStyleThatPlaysNotesType( nt );
|
||||
GAMESTATE->m_CurStyle = style;
|
||||
GAMESTATE->m_CurGame = StyleToGame(style);
|
||||
GAMESTATE->m_CurGame = GAMEMAN->GetStyleDefForStyle(style)->m_Game;
|
||||
|
||||
SCREENMAN->SetNewScreen( new ScreenEdit );
|
||||
break;
|
||||
@@ -231,7 +237,7 @@ void ScreenEditMenu::OnSongChange()
|
||||
|
||||
void ScreenEditMenu::OnNotesTypeChange()
|
||||
{
|
||||
m_CurNotesType = (NotesType)clamp( m_CurNotesType, 0, NUM_NOTES_TYPES );
|
||||
m_iSelectedNotesType = clamp( m_iSelectedNotesType, 0, m_NotesTypes.GetSize()-1 );
|
||||
|
||||
m_textNotesType.SetText( NotesTypeToString( GetSelectedNotesType() ) );
|
||||
|
||||
@@ -252,7 +258,7 @@ void ScreenEditMenu::OnStepsChange()
|
||||
if( GetSelectedNotes() == NULL )
|
||||
m_textNotes.SetText( "(NEW)" );
|
||||
else
|
||||
m_textNotes.SetText( GetSelectedNotes()->m_sDescription );
|
||||
m_textNotes.SetText( GetSelectedNotes()->m_sDescription!="" ? GetSelectedNotes()->m_sDescription : "[no name]" );
|
||||
|
||||
}
|
||||
|
||||
@@ -293,9 +299,9 @@ void ScreenEditMenu::MenuLeft( const PlayerNumber p )
|
||||
OnSongChange();
|
||||
break;
|
||||
case ROW_NOTES_TYPE:
|
||||
if( m_CurNotesType == 0 ) // can't go left any further
|
||||
if( m_iSelectedNotesType == 0 ) // can't go left any further
|
||||
return;
|
||||
m_CurNotesType = NotesType( m_CurNotesType-1 );
|
||||
m_iSelectedNotesType--;
|
||||
OnNotesTypeChange();
|
||||
break;
|
||||
case ROW_STEPS:
|
||||
@@ -326,9 +332,9 @@ void ScreenEditMenu::MenuRight( const PlayerNumber p )
|
||||
OnSongChange();
|
||||
break;
|
||||
case ROW_NOTES_TYPE:
|
||||
if( m_CurNotesType == NUM_NOTES_TYPES-1 ) // can't go right any further
|
||||
if( m_iSelectedNotesType == m_NotesTypes.GetSize()-1 ) // can't go right any further
|
||||
return;
|
||||
m_CurNotesType = NotesType( m_CurNotesType+1 );
|
||||
m_iSelectedNotesType++;
|
||||
OnNotesTypeChange();
|
||||
break;
|
||||
case ROW_STEPS:
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: ScreenEditMenu.h
|
||||
Class: ScreenEditMenu
|
||||
|
||||
Desc: The main title screen and menu.
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "Screen.h"
|
||||
#include "Sprite.h"
|
||||
#include "ColorNote.h"
|
||||
#include "BitmapText.h"
|
||||
#include "TransitionFade.h"
|
||||
#include "RandomSample.h"
|
||||
@@ -43,7 +43,7 @@ private:
|
||||
|
||||
CString GetSelectedGroup() { return m_sGroups[m_iSelectedGroup]; };
|
||||
Song* GetSelectedSong() { return m_pSongs[m_iSelectedSong]; };
|
||||
NotesType GetSelectedNotesType() { return m_CurNotesType; };
|
||||
NotesType GetSelectedNotesType() { return m_NotesTypes[m_iSelectedNotesType]; };
|
||||
Notes* GetSelectedNotes() { return m_pNotess[m_iSelectedNotes]; };
|
||||
|
||||
void MenuUp( const PlayerNumber p );
|
||||
@@ -70,7 +70,8 @@ private:
|
||||
Sprite m_sprArrowLeft;
|
||||
Sprite m_sprArrowRight;
|
||||
|
||||
NotesType m_CurNotesType; // index into enum GameMode
|
||||
CArray<NotesType, NotesType> m_NotesTypes;
|
||||
int m_iSelectedNotesType; // index into m_NotesTypes
|
||||
BitmapText m_textNotesType;
|
||||
|
||||
CArray<Notes*, Notes*> m_pNotess;
|
||||
|
||||
@@ -26,35 +26,67 @@
|
||||
#include "ScreenSelectCourse.h"
|
||||
|
||||
|
||||
const float BANNER_X = CENTER_X;
|
||||
const float BANNER_Y = SCREEN_TOP + 100;
|
||||
|
||||
const float STAGE_X = BANNER_X;
|
||||
const float STAGE_Y = BANNER_Y-40;
|
||||
|
||||
const float GRADE_X[NUM_PLAYERS] = { CENTER_X-226, CENTER_X+226 };
|
||||
const float GRADE_Y = BANNER_Y;
|
||||
|
||||
const float JUDGE_LABELS_X = CENTER_X;
|
||||
const float JUDGE_NUMBERS_X[NUM_PLAYERS]= { CENTER_X-88, CENTER_X+88 };
|
||||
const float JUDGE_NUMBERS_X_EZ2[NUM_PLAYERS]= { CENTER_X-88, CENTER_X+68 };
|
||||
const float JUDGE_START_Y = CENTER_Y - 70;
|
||||
const float JUDGE_SPACING = 32;
|
||||
const float JUDGE_EZ2_COOL_Y = CENTER_Y - 80;
|
||||
|
||||
const float SCORE_LABEL_X = CENTER_X;
|
||||
const float SCORE_DISPLAY_X[NUM_PLAYERS]= { CENTER_X-170, CENTER_X+170 };
|
||||
const float SCORE_Y = CENTER_Y + 140;
|
||||
|
||||
const float BONUS_FRAME_X[NUM_PLAYERS] = { CENTER_X-220, CENTER_X+220 };
|
||||
const float BONUS_FRAME_Y = CENTER_Y+10;
|
||||
|
||||
const float NEW_RECORD_X[NUM_PLAYERS] = { SCORE_DISPLAY_X[0], SCORE_DISPLAY_X[1] };
|
||||
const float NEW_RECORD_Y = SCORE_Y - 20;
|
||||
|
||||
const float TRY_EXTRA_STAGE_X = CENTER_X;
|
||||
const float TRY_EXTRA_STAGE_Y = SCREEN_BOTTOM - 60;
|
||||
#define BANNER_X THEME->GetMetricF("Evaluation","BannerX")
|
||||
#define BANNER_Y THEME->GetMetricF("Evaluation","BannerY")
|
||||
#define STAGE_X THEME->GetMetricF("Evaluation","StageX")
|
||||
#define STAGE_Y THEME->GetMetricF("Evaluation","StageY")
|
||||
#define GRADE_P1_X THEME->GetMetricF("Evaluation","GradeP1X")
|
||||
#define GRADE_P2_X THEME->GetMetricF("Evaluation","GradeP2X")
|
||||
#define GRADE_Y THEME->GetMetricF("Evaluation","GradeY")
|
||||
#define JUDGE_LABELS_X THEME->GetMetricF("Evaluation","JudgeLabelsX")
|
||||
#define JUDGE_NUMBERS_P1_X THEME->GetMetricF("Evaluation","JudgeNumbersP1X")
|
||||
#define JUDGE_NUMBERS_P2_X THEME->GetMetricF("Evaluation","JudgeNumbersP2X")
|
||||
#define JUDGE_START_Y THEME->GetMetricF("Evaluation","JudgeStartY")
|
||||
#define JUDGE_SPACING_Y THEME->GetMetricF("Evaluation","JudgeSpacingY")
|
||||
#define SCORE_LABELS_X THEME->GetMetricF("Evaluation","ScoreLabelsX")
|
||||
#define SCORE_NUMBERS_P1_X THEME->GetMetricF("Evaluation","ScoreNumbersP1X")
|
||||
#define SCORE_NUMBERS_P2_X THEME->GetMetricF("Evaluation","ScoreNumbersP2X")
|
||||
#define SCORE_Y THEME->GetMetricF("Evaluation","ScoreY")
|
||||
#define BONUS_P1_X THEME->GetMetricF("Evaluation","BonusP1X")
|
||||
#define BONUS_P2_X THEME->GetMetricF("Evaluation","BonusP2X")
|
||||
#define BONUS_Y THEME->GetMetricF("Evaluation","BonusY")
|
||||
#define NEW_RECORD_P1_X THEME->GetMetricF("Evaluation","NewRecordP1X")
|
||||
#define NEW_RECORD_P2_X THEME->GetMetricF("Evaluation","NewRecordP2X")
|
||||
#define NEW_RECORD_Y THEME->GetMetricF("Evaluation","NewRecordY")
|
||||
#define TRY_EXTRA_STAGE_X THEME->GetMetricF("Evaluation","TryExtraStageX")
|
||||
#define TRY_EXTRA_STAGE_Y THEME->GetMetricF("Evaluation","TryExtraStageY")
|
||||
#define TIMER_SECONDS THEME->GetMetricI("Evaluation","TimerSeconds")
|
||||
|
||||
float GRADE_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return GRADE_P1_X;
|
||||
case PLAYER_2: return GRADE_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float JUDGE_NUMBERS_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return JUDGE_NUMBERS_P1_X;
|
||||
case PLAYER_2: return JUDGE_NUMBERS_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float SCORE_NUMBERS_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return SCORE_NUMBERS_P1_X;
|
||||
case PLAYER_2: return SCORE_NUMBERS_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float BONUS_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return BONUS_P1_X;
|
||||
case PLAYER_2: return BONUS_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float NEW_RECORD_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return NEW_RECORD_P1_X;
|
||||
case PLAYER_2: return NEW_RECORD_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
|
||||
const ScreenMessage SM_GoToSelectMusic = ScreenMessage(SM_User+1);
|
||||
const ScreenMessage SM_GoToSelectCourse = ScreenMessage(SM_User+2);
|
||||
@@ -127,6 +159,8 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
///////////////////////////
|
||||
// Andy:
|
||||
// Fake COOL! / GOOD / OOPS for Ez2dancer using the DDR Rankings.
|
||||
/* Todo: Accomodate this using theme metrics
|
||||
|
||||
if( GAMESTATE->m_CurGame == GAME_EZ2 )
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
@@ -137,12 +171,15 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
iTapNoteScores[p][TNS_BOO] = 0;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
///////////////////////////
|
||||
// Init the song banners depending on m_ResultMode
|
||||
///////////////////////////
|
||||
/* EZ2 should hide these things by placing them off screen with theme metrics
|
||||
if( GAMESTATE->m_CurGame != GAME_EZ2 )
|
||||
{
|
||||
*/
|
||||
switch( m_ResultMode )
|
||||
{
|
||||
case RM_ARCADE_STAGE:
|
||||
@@ -150,7 +187,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_BannerWithFrame[0].SetXY( BANNER_X, BANNER_Y );
|
||||
this->AddSubActor( &m_BannerWithFrame[0] );
|
||||
|
||||
m_textStage.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textStage.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textStage.TurnShadowOff();
|
||||
m_textStage.SetXY( STAGE_X, STAGE_Y );
|
||||
m_textStage.SetZoom( 0.5f );
|
||||
@@ -186,7 +223,9 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
this->AddSubActor( &m_BannerWithFrame[0] );
|
||||
break;
|
||||
}
|
||||
/*
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -194,34 +233,40 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
// Init graphic elements
|
||||
//////////////////////////
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo(GRAPHIC_EVALUATION_BACKGROUND),
|
||||
m_ResultMode==RM_ARCADE_SUMMARY ? THEME->GetPathTo(GRAPHIC_EVALUATION_SUMMARY_TOP_EDGE) : THEME->GetPathTo(GRAPHIC_EVALUATION_TOP_EDGE),
|
||||
THEME->GetPathTo("Graphics","evaluation background"),
|
||||
THEME->GetPathTo("Graphics",m_ResultMode==RM_ARCADE_SUMMARY?"evaluation summary top edge":"evaluation top edge"),
|
||||
"Press START to continue",
|
||||
false, true, 40
|
||||
false, true, TIMER_SECONDS
|
||||
);
|
||||
this->AddSubActor( &m_Menu );
|
||||
|
||||
|
||||
for( l=0; l<NUM_JUDGE_LINES; l++ )
|
||||
{
|
||||
/* EZ2 should hide these things by placing them off screen with theme metrics
|
||||
if (GAMESTATE->m_CurGame != GAME_EZ2)
|
||||
{
|
||||
m_sprJudgeLabels[l].Load( THEME->GetPathTo(GRAPHIC_EVALUATION_JUDGE_LABELS) );
|
||||
*/
|
||||
m_sprJudgeLabels[l].Load( THEME->GetPathTo("Graphics","evaluation judge labels") );
|
||||
m_sprJudgeLabels[l].StopAnimating();
|
||||
m_sprJudgeLabels[l].SetState( l );
|
||||
m_sprJudgeLabels[l].SetXY( JUDGE_LABELS_X, JUDGE_START_Y + l*JUDGE_SPACING );
|
||||
m_sprJudgeLabels[l].SetXY( JUDGE_LABELS_X, JUDGE_START_Y + l*JUDGE_SPACING_Y );
|
||||
m_sprJudgeLabels[l].SetZoom( 1.0f );
|
||||
this->AddSubActor( &m_sprJudgeLabels[l] );
|
||||
/*
|
||||
}
|
||||
*/
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_textJudgeNumbers[l][p].Load( THEME->GetPathTo(FONT_SCORE_NUMBERS) );
|
||||
m_textJudgeNumbers[l][p].LoadFromFont( THEME->GetPathTo("Fonts","score numbers") );
|
||||
m_textJudgeNumbers[l][p].TurnShadowOff();
|
||||
m_textJudgeNumbers[l][p].SetXY( JUDGE_NUMBERS_X[p], JUDGE_START_Y + l*JUDGE_SPACING );
|
||||
m_textJudgeNumbers[l][p].SetXY( JUDGE_NUMBERS_X(p), JUDGE_START_Y + l*JUDGE_SPACING_Y );
|
||||
m_textJudgeNumbers[l][p].SetZoom( 0.7f );
|
||||
m_textJudgeNumbers[l][p].SetDiffuseColor( PlayerToColor(p) );
|
||||
|
||||
/*
|
||||
TODO: This should somehow be accomodated with a switch in the theme metric file.
|
||||
|
||||
// RE-ARRANGE the scoreboard for EZ2Dancer Scoring
|
||||
|
||||
@@ -252,27 +297,29 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_textJudgeNumbers[l][p].SetXY( JUDGE_NUMBERS_X_EZ2[p]+40, JUDGE_EZ2_COOL_Y + 180);
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
this->AddSubActor( &m_textJudgeNumbers[l][p] );
|
||||
}
|
||||
}
|
||||
|
||||
if (GAMESTATE->m_CurGame != GAME_EZ2)
|
||||
/* if (GAMESTATE->m_CurGame != GAME_EZ2)
|
||||
{
|
||||
m_sprScoreLabel.Load( THEME->GetPathTo(GRAPHIC_EVALUATION_SCORE_LABELS) );
|
||||
*/
|
||||
m_sprScoreLabel.Load( THEME->GetPathTo("Graphics","evaluation score labels") );
|
||||
m_sprScoreLabel.SetState( m_ResultMode==RM_ONI ? 1 : 0 );
|
||||
m_sprScoreLabel.StopAnimating();
|
||||
m_sprScoreLabel.SetXY( SCORE_LABEL_X, SCORE_Y );
|
||||
m_sprScoreLabel.SetXY( SCORE_LABELS_X, SCORE_Y );
|
||||
m_sprScoreLabel.SetZoom( 1.0f );
|
||||
this->AddSubActor( &m_sprScoreLabel );
|
||||
}
|
||||
/* }
|
||||
*/
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) || GAMESTATE->m_CurGame == GAME_EZ2 )
|
||||
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) ) // || GAMESTATE->m_CurGame == GAME_EZ2 ) // If EZ2 wants to hide this graphic, place it somewhere off screen using theme metrics
|
||||
continue; // skip
|
||||
|
||||
m_ScoreDisplay[p].SetXY( SCORE_DISPLAY_X[p], SCORE_Y );
|
||||
m_ScoreDisplay[p].SetXY( SCORE_NUMBERS_X(p), SCORE_Y );
|
||||
m_ScoreDisplay[p].SetZoomY( 0.9f );
|
||||
m_ScoreDisplay[p].SetDiffuseColor( PlayerToColor(p) );
|
||||
this->AddSubActor( &m_ScoreDisplay[p] );
|
||||
@@ -346,12 +393,16 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_ScoreDisplay[p].SetScore( fScore[p] );
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: Accomodate this with a theme metric
|
||||
|
||||
// SNEAKY! We take the max combo, and put it into element 5, because Ez2dancer
|
||||
// doesn't care for OK's and plus this text element is already nicely aligned =)
|
||||
if (GAMESTATE->m_CurGame == GAME_EZ2)
|
||||
{
|
||||
m_textJudgeNumbers[5][p].SetText( ssprintf("%4d", iMaxCombo[p]) );
|
||||
}
|
||||
*/
|
||||
|
||||
m_BonusInfoFrame[p].SetBonusInfo( (PlayerNumber)p, fPossibleRadarValues[p], fActualRadarValues[p], iMaxCombo[p] );
|
||||
m_StageBox[p].SetStageInfo( (PlayerNumber)p, GAMESTATE->m_iSongsBeforeFail[p] );
|
||||
@@ -416,21 +467,24 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
if( !GAMESTATE->IsPlayerEnabled( (PlayerNumber)p ) )
|
||||
continue; // skip
|
||||
|
||||
/* Chris: If you don't want EZ2 to have a grade frame, then make a theme that has a 1x1 transparent graphic for the grade frame.
|
||||
|
||||
if ( GAMESTATE->m_CurGame != GAME_EZ2)
|
||||
{
|
||||
m_sprGradeFrame[p].Load( THEME->GetPathTo(GRAPHIC_EVALUATION_GRADE_FRAME) );
|
||||
*/
|
||||
m_sprGradeFrame[p].Load( THEME->GetPathTo("Graphics","evaluation grade frame") );
|
||||
m_sprGradeFrame[p].StopAnimating();
|
||||
m_sprGradeFrame[p].SetState( p );
|
||||
m_sprGradeFrame[p].SetXY( GRADE_X[p], GRADE_Y );
|
||||
m_sprGradeFrame[p].SetXY( GRADE_X(p), GRADE_Y );
|
||||
this->AddSubActor( &m_sprGradeFrame[p] );
|
||||
}
|
||||
|
||||
/* }
|
||||
*/
|
||||
switch( m_ResultMode )
|
||||
{
|
||||
case RM_ONI:
|
||||
{
|
||||
m_textOniPercent[p].Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textOniPercent[p].SetXY( GRADE_X[p], GRADE_Y );
|
||||
m_textOniPercent[p].LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textOniPercent[p].SetXY( GRADE_X(p), GRADE_Y );
|
||||
m_textOniPercent[p].SetShadowLength( 2 );
|
||||
m_textOniPercent[p].SetZoomX( 1.3f );
|
||||
m_textOniPercent[p].SetZoomY( 2.5f );
|
||||
@@ -441,22 +495,27 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_textOniPercent[p].SetText( ssprintf("%.1f%%", fPercentDancePoints*100) );
|
||||
this->AddSubActor( &m_textOniPercent[p] );
|
||||
|
||||
m_StageBox[p].SetXY( BONUS_FRAME_X[p], BONUS_FRAME_Y );
|
||||
m_StageBox[p].SetXY( BONUS_X(p), BONUS_Y );
|
||||
this->AddSubActor( &m_StageBox[p] );
|
||||
}
|
||||
break;
|
||||
case RM_ARCADE_STAGE:
|
||||
case RM_ARCADE_SUMMARY:
|
||||
/*
|
||||
Todo: Accomodate this in theme metrics
|
||||
|
||||
if (GAMESTATE->m_CurGame != GAME_EZ2 )
|
||||
{
|
||||
m_Grades[p].SetXY( GRADE_X[p], GRADE_Y );
|
||||
*/
|
||||
m_Grades[p].SetXY( GRADE_X(p), GRADE_Y );
|
||||
m_Grades[p].SetZ( -2 );
|
||||
m_Grades[p].SetZoom( 1.0f );
|
||||
m_Grades[p].SetEffectGlowing( 1.0f );
|
||||
m_Grades[p].SpinAndSettleOn( grade[p] );
|
||||
|
||||
m_BonusInfoFrame[p].SetXY( BONUS_FRAME_X[p], BONUS_FRAME_Y );
|
||||
m_BonusInfoFrame[p].SetXY( BONUS_X(p), BONUS_Y );
|
||||
this->AddSubActor( &m_BonusInfoFrame[p] );
|
||||
/*
|
||||
}
|
||||
else // Ez2dancer Style Grade Display.
|
||||
{
|
||||
@@ -475,19 +534,22 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_Grades[p].SetTweenZoom( 2 );
|
||||
|
||||
}
|
||||
*/
|
||||
this->AddSubActor( &m_Grades[p] );
|
||||
break;
|
||||
}
|
||||
|
||||
/* Chris: If EZ2 wants to hide these things, place them off screen using theme metrics
|
||||
|
||||
if ( GAMESTATE->m_CurGame == GAME_EZ2)
|
||||
continue;
|
||||
|
||||
*/
|
||||
m_bNewRecord[p] = false;
|
||||
|
||||
if( m_bNewRecord[p] )
|
||||
{
|
||||
m_textNewRecord[p].Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textNewRecord[p].SetXY( NEW_RECORD_X[p], NEW_RECORD_Y );
|
||||
m_textNewRecord[p].LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textNewRecord[p].SetXY( NEW_RECORD_X(p), NEW_RECORD_Y );
|
||||
m_textNewRecord[p].SetShadowLength( 2 );
|
||||
m_textNewRecord[p].SetText( "IT'S A NEW RECORD!" );
|
||||
m_textNewRecord[p].SetZoom( 0.5f );
|
||||
@@ -495,11 +557,11 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
this->AddSubActor( &m_textNewRecord[p] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( m_bTryExtraStage )
|
||||
{
|
||||
m_textTryExtraStage.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textTryExtraStage.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textTryExtraStage.SetXY( TRY_EXTRA_STAGE_X, TRY_EXTRA_STAGE_Y );
|
||||
if( GAMESTATE->IsExtraStage() )
|
||||
m_textTryExtraStage.SetText( "Try Another Extra Stage!" );
|
||||
@@ -509,7 +571,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_textTryExtraStage.SetEffectGlowing( 1.0f );
|
||||
this->AddSubActor( &m_textTryExtraStage );
|
||||
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_EVALUATION_EXTRA_STAGE) );
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","evaluation extra stage") );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -579,14 +641,19 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
|
||||
for( i=0; i<NUM_JUDGE_LINES; i++ )
|
||||
{
|
||||
/* TODO: Accomodate this using theme metrics
|
||||
|
||||
if (GAMESTATE->m_CurGame != GAME_EZ2)
|
||||
{
|
||||
*/
|
||||
fOriginalY = m_sprJudgeLabels[i].GetY();
|
||||
m_sprJudgeLabels[i].SetY( fOriginalY + SCREEN_HEIGHT );
|
||||
m_sprJudgeLabels[i].BeginTweeningQueued( 0.2f + 0.1f*i );
|
||||
m_sprJudgeLabels[i].BeginTweeningQueued( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_sprJudgeLabels[i].SetTweenY( fOriginalY );
|
||||
/*
|
||||
}
|
||||
*/
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
@@ -598,9 +665,11 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
}
|
||||
}
|
||||
|
||||
/* Chris: If EZ2 wants to hide these things, position them off screen using theme metrics
|
||||
|
||||
if (GAMESTATE->m_CurGame != GAME_EZ2)
|
||||
{
|
||||
|
||||
*/
|
||||
fOriginalY = m_sprScoreLabel.GetY();
|
||||
m_sprScoreLabel.SetY( fOriginalY + SCREEN_HEIGHT );
|
||||
m_sprScoreLabel.BeginTweeningQueued( 0.8f + 0.1f*i );
|
||||
@@ -645,7 +714,9 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
|
||||
m_textTryExtraStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_textTryExtraStage.SetTweenZoomY( 0 );
|
||||
/*
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void ScreenEvaluation::TweenOffScreen()
|
||||
@@ -663,11 +734,15 @@ void ScreenEvaluation::TweenOffScreen()
|
||||
|
||||
for( i=0; i<NUM_JUDGE_LINES; i++ )
|
||||
{
|
||||
/* Chris: If EZ2 wants to hide these things, position them off screen using theme metrics
|
||||
if (GAMESTATE->m_CurGame != GAME_EZ2)
|
||||
{
|
||||
*/
|
||||
m_sprJudgeLabels[i].BeginTweeningQueued( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_END );
|
||||
m_sprJudgeLabels[i].SetTweenZoomY( 0 );
|
||||
/*
|
||||
}
|
||||
*/
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
@@ -676,8 +751,10 @@ void ScreenEvaluation::TweenOffScreen()
|
||||
}
|
||||
}
|
||||
|
||||
/* Chris: If EZ2 wants to hide these things, position them off screen using theme metrics
|
||||
if (GAMESTATE->m_CurGame != GAME_EZ2)
|
||||
{
|
||||
*/
|
||||
m_sprScoreLabel.BeginTweeningQueued( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_END );
|
||||
m_sprScoreLabel.SetTweenZoomY( 0 );
|
||||
|
||||
@@ -687,7 +764,9 @@ void ScreenEvaluation::TweenOffScreen()
|
||||
m_ScoreDisplay[p].BeginTweeningQueued( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_END );
|
||||
m_ScoreDisplay[p].SetTweenZoomY( 0 );
|
||||
}
|
||||
/*
|
||||
}
|
||||
*/
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_BonusInfoFrame[p].BeginTweeningQueued( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_END );
|
||||
@@ -788,7 +867,7 @@ void ScreenEvaluation::MenuStart( const PlayerNumber p )
|
||||
m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic );
|
||||
else if( m_ResultMode == RM_ARCADE_STAGE && GAMESTATE->m_iCurrentStageIndex == PREFSMAN->m_iNumArcadeStages-1 )
|
||||
m_Menu.TweenOffScreenToMenu( SM_GoToFinalEvaluation );
|
||||
else if( m_ResultMode == RM_ARCADE_STAGE && GAMESTATE->m_iCurrentStageIndex != PREFSMAN->m_iNumArcadeStages-1 )
|
||||
else if( m_ResultMode == RM_ARCADE_STAGE && GAMESTATE->m_iCurrentStageIndex < PREFSMAN->m_iNumArcadeStages-1 )
|
||||
m_Menu.TweenOffScreenToMenu( SM_GoToSelectMusic );
|
||||
else
|
||||
m_Menu.TweenOffScreenToBlack( SM_GoToMusicScroll, false );
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
/****************************************
|
||||
ScreenEzSelectPlayer,cpp
|
||||
Desc: See Header
|
||||
@@ -7,7 +8,6 @@ Andrew Livy
|
||||
|
||||
/* Includes */
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ScreenEz2SelectPlayer.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "PrefsManager.h"
|
||||
@@ -21,6 +21,7 @@ Andrew Livy
|
||||
#include "GameManager.h"
|
||||
#include "RageLog.h"
|
||||
#include "AnnouncerManager.h"
|
||||
#include "ScreenSelectStyle.h"
|
||||
#include "ScreenEz2SelectStyle.h"
|
||||
#include "GameState.h"
|
||||
#include "RageException.h"
|
||||
@@ -30,6 +31,9 @@ Andrew Livy
|
||||
|
||||
const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User + 1);
|
||||
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 2);
|
||||
|
||||
#define USE_NORMAL_OR_EZ2_SELECT_STYLE THEME->GetMetricB("Screens","UseNormalOrEZ2SelectStyle")
|
||||
|
||||
const float TWEEN_TIME = 0.35f;
|
||||
const D3DXCOLOR OPT_NOT_SELECTED = D3DXCOLOR(0.3f,0.3f,0.3f,1);
|
||||
const D3DXCOLOR OPT_SELECTED = D3DXCOLOR(1.0f,1.0f,1.0f,1);
|
||||
@@ -47,6 +51,8 @@ const float OPT_Y[NUM_EZ2_GRAPHICS] = {
|
||||
CENTER_Y+115,
|
||||
}; // tells us the default Y position
|
||||
|
||||
|
||||
|
||||
float ez2_lasttimercheck[2];
|
||||
int ez2_bounce=0; // used for the bouncing of the '1p' and '2p' images
|
||||
int ez2_direct=0; // direction of the bouncing of the '1p' and '2p' images
|
||||
@@ -63,52 +69,44 @@ ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()
|
||||
ez2_lasttimercheck[1] = 0.0f;
|
||||
m_iSelectedStyle=3; // by bbf: frieza, was this supposed to be 3 ?
|
||||
GAMESTATE->m_CurStyle = STYLE_NONE;
|
||||
GAMESTATE->m_MasterPlayerNumber = PLAYER_INVALID;
|
||||
// GAMESTATE->m_MasterPlayerNumber = PLAYER_INVALID;
|
||||
|
||||
// Load in the sprites we will be working with.
|
||||
for( int i=0; i<NUM_EZ2_GRAPHICS; i++ )
|
||||
{
|
||||
CString sPadGraphicPath;
|
||||
CString sOptFileName;
|
||||
switch( i )
|
||||
{
|
||||
case 0:
|
||||
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_HARD_PICTURE);
|
||||
break;
|
||||
case 1:
|
||||
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_HARD_PICTURE);
|
||||
break;
|
||||
case 2:
|
||||
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_MEDIUM_PICTURE);
|
||||
break;
|
||||
case 3:
|
||||
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_EASY_PICTURE);
|
||||
break;
|
||||
case 0: sOptFileName = "select difficulty hard picture"; break;
|
||||
case 1: sOptFileName = "select difficulty hard picture"; break;
|
||||
case 2: sOptFileName = "select difficulty medium picture"; break;
|
||||
case 3: sOptFileName = "select difficulty easy picture"; break;
|
||||
}
|
||||
m_sprOpt[i].Load( sPadGraphicPath );
|
||||
m_sprOpt[i].Load( THEME->GetPathTo("Graphics",sOptFileName) );
|
||||
m_sprOpt[i].SetXY( OPT_X[i], OPT_Y[i] );
|
||||
m_sprOpt[i].SetZoom( 1 );
|
||||
this->AddSubActor( &m_sprOpt[i] );
|
||||
}
|
||||
|
||||
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_STYLE_BACKGROUND),
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_STYLE_TOP_EDGE),
|
||||
THEME->GetPathTo("Graphics","select style background"),
|
||||
THEME->GetPathTo("Graphics","select style top edge"),
|
||||
ssprintf("Press %c on the pad you wish to play on", char(4) ),
|
||||
false, true, 40
|
||||
);
|
||||
this->AddSubActor( &m_Menu );
|
||||
|
||||
m_soundChange.Load( THEME->GetPathTo(SOUND_SELECT_STYLE_CHANGE) );
|
||||
m_soundSelect.Load( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
m_soundInvalid.Load( THEME->GetPathTo(SOUND_MENU_INVALID) );
|
||||
m_soundChange.Load( THEME->GetPathTo("Sounds","select style change") );
|
||||
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
|
||||
m_soundInvalid.Load( THEME->GetPathTo("Sounds","menu invalid") );
|
||||
|
||||
// SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_STYLE_INTRO) );
|
||||
/* Chris: If EZ2 doesn't use this sound, make a theme that overrides is with a silent sound file */
|
||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_STYLE_INTRO) );
|
||||
|
||||
|
||||
if( !MUSIC->IsPlaying() )
|
||||
{
|
||||
MUSIC->Load( THEME->GetPathTo(SOUND_MENU_MUSIC) );
|
||||
MUSIC->Load( THEME->GetPathTo("Sounds","select player music") );
|
||||
MUSIC->Play( true );
|
||||
}
|
||||
|
||||
@@ -184,17 +182,17 @@ void ScreenEz2SelectPlayer::DrawPrimitives()
|
||||
|
||||
if (m_iSelectedStyle == 0) // only the left pad was selected
|
||||
{
|
||||
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||
// GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||
GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE;
|
||||
}
|
||||
else if (m_iSelectedStyle == 1) // only the right pad was selected
|
||||
{
|
||||
GAMESTATE->m_MasterPlayerNumber = PLAYER_2;
|
||||
// GAMESTATE->m_MasterPlayerNumber = PLAYER_2;
|
||||
GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE;
|
||||
}
|
||||
else // they both selected
|
||||
{
|
||||
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||
// GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||
GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE_VERSUS;
|
||||
}
|
||||
|
||||
@@ -242,7 +240,10 @@ void ScreenEz2SelectPlayer::HandleScreenMessage( const ScreenMessage SM )
|
||||
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
|
||||
break;
|
||||
case SM_GoToNextState:
|
||||
SCREENMAN->SetNewScreen( new ScreenEz2SelectStyle );
|
||||
if( USE_NORMAL_OR_EZ2_SELECT_STYLE )
|
||||
SCREENMAN->SetNewScreen( new ScreenEz2SelectStyle );
|
||||
else
|
||||
SCREENMAN->SetNewScreen( new ScreenSelectStyle );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -293,7 +294,7 @@ void ScreenEz2SelectPlayer::MenuStart( PlayerNumber p )
|
||||
// if( GAMESTATE->m_MasterPlayerNumber != PLAYER_2 && GAMESTATE->m_MasterPlayerNumber != PLAYER_1 )
|
||||
if (m_iSelectedStyle == 3)
|
||||
{
|
||||
GAMESTATE->m_MasterPlayerNumber = p;
|
||||
// GAMESTATE->m_MasterPlayerNumber = p;
|
||||
|
||||
if (p == PLAYER_1)
|
||||
{
|
||||
|
||||
@@ -112,6 +112,10 @@ const float OPT_YP[NUM_EZ2P_GRAPHICS] = {
|
||||
CENTER_Y+115,
|
||||
}; // tells us the default Y position
|
||||
|
||||
|
||||
#define SKIP_SELECT_DIFFICULTY THEME->GetMetricB("Screens","SkipSelectDifficulty")
|
||||
|
||||
|
||||
float ez2p_lasttimercheck[2];
|
||||
int ez2p_bounce=0; // used for the bouncing of the '1p' and '2p' images
|
||||
int ez2p_direct=0; // direction of the bouncing of the '1p' and '2p' images
|
||||
@@ -127,18 +131,11 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle()
|
||||
|
||||
m_iSelectedStyle=0;
|
||||
ez2p_lasttimercheck[0] = TIMER->GetTimeSinceStart();
|
||||
// Load in the sprites we will be working with.
|
||||
|
||||
// Load in the sprites we will be working with.
|
||||
for( int i=0; i<NUM_EZ2STYLE_GRAPHICS; i++ )
|
||||
{
|
||||
ThemeElement te;
|
||||
switch( i )
|
||||
{ //HACK! Would LIKE to have own filename :)
|
||||
case 0: te = GRAPHIC_SELECT_STYLE_PREVIEW_1; break;
|
||||
case 1: te = GRAPHIC_SELECT_STYLE_PREVIEW_2; break;
|
||||
case 2: te = GRAPHIC_SELECT_STYLE_PREVIEW_3; break;
|
||||
case 3: te = GRAPHIC_SELECT_STYLE_PREVIEW_0; break;
|
||||
}
|
||||
m_sprBackground[i].Load( THEME->GetPathTo(te) );
|
||||
m_sprBackground[i].Load( THEME->GetPathTo("Graphics",ssprintf("select style preview game %d style %d",GAMESTATE->m_CurGame,i)) );
|
||||
m_sprBackground[i].SetXY( CENTER_X, CENTER_Y );
|
||||
m_sprBackground[i].SetZoom( 1 );
|
||||
this->AddSubActor( &m_sprBackground[i] );
|
||||
@@ -146,15 +143,7 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle()
|
||||
|
||||
for( i=0; i<NUM_EZ2STYLE_GRAPHICS; i++ )
|
||||
{
|
||||
ThemeElement te;
|
||||
switch( i )
|
||||
{
|
||||
case 0: te = GRAPHIC_SELECT_STYLE_INFO_3; break;
|
||||
case 1: te = GRAPHIC_SELECT_STYLE_INFO_0; break;
|
||||
case 2: te = GRAPHIC_SELECT_STYLE_INFO_1; break;
|
||||
case 3: te = GRAPHIC_SELECT_STYLE_INFO_2; break;
|
||||
}
|
||||
m_sprOpt[i].Load( THEME->GetPathTo(te) );
|
||||
m_sprOpt[i].Load( THEME->GetPathTo("Graphics",ssprintf("select style info game %d style %d",GAMESTATE->m_CurGame,i)) );
|
||||
m_sprOpt[i].SetXY( OPT_X[i], OPT_Y[i] );
|
||||
m_sprOpt[i].SetZoom( 1 );
|
||||
this->AddSubActor( &m_sprOpt[i] );
|
||||
@@ -162,50 +151,47 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle()
|
||||
|
||||
for( i=0; i<NUM_EZ2P_GRAPHICS; i++ )
|
||||
{
|
||||
CString sPadGraphicPath;
|
||||
CString sPlyFileName;
|
||||
switch( i )
|
||||
{
|
||||
case 0:
|
||||
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_HARD_PICTURE);
|
||||
break;
|
||||
case 1:
|
||||
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_HARD_PICTURE);
|
||||
break;
|
||||
case 2:
|
||||
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_MEDIUM_PICTURE);
|
||||
break;
|
||||
case 3:
|
||||
sPadGraphicPath = THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_EASY_PICTURE);
|
||||
break;
|
||||
case 0: sPlyFileName = "select difficulty hard picture"; break;
|
||||
case 1: sPlyFileName = "select difficulty hard picture"; break;
|
||||
case 2: sPlyFileName = "select difficulty medium picture"; break;
|
||||
case 3: sPlyFileName = "select difficulty easy picture"; break;
|
||||
}
|
||||
m_sprPly[i].Load( sPadGraphicPath );
|
||||
m_sprPly[i].Load( THEME->GetPathTo("Graphics",sPlyFileName) );
|
||||
m_sprPly[i].SetXY( OPT_XP[i], OPT_YP[i] );
|
||||
m_sprPly[i].SetZoom( 1 );
|
||||
this->AddSubActor( &m_sprPly[i] );
|
||||
}
|
||||
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_STYLE_BACKGROUND),
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_STYLE_TOP_EDGE),
|
||||
THEME->GetPathTo("Graphics","select style background"),
|
||||
THEME->GetPathTo("Graphics","select style top edge"),
|
||||
ssprintf("Use %c %c to select, then press START", char(1), char(2) ),
|
||||
false, true, 40
|
||||
);
|
||||
this->AddSubActor( &m_Menu );
|
||||
|
||||
m_soundChange.Load( THEME->GetPathTo(SOUND_SELECT_STYLE_CHANGE) );
|
||||
m_soundSelect.Load( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
m_soundInvalid.Load( THEME->GetPathTo(SOUND_MENU_INVALID) );
|
||||
m_soundChange.Load( THEME->GetPathTo("Sounds","select style change") );
|
||||
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
|
||||
m_soundInvalid.Load( THEME->GetPathTo("Sounds","menu invalid") );
|
||||
|
||||
// SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_STYLE_INTRO) );
|
||||
/* Chris: if EZ2 shouldn't play a sound here, then make a slient sound file. */
|
||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_STYLE_INTRO) );
|
||||
|
||||
|
||||
if( !MUSIC->IsPlaying() )
|
||||
{
|
||||
MUSIC->Load( THEME->GetPathTo(SOUND_MUSIC_SCROLL_MUSIC) );
|
||||
MUSIC->Load( THEME->GetPathTo("Sounds","select style music") );
|
||||
MUSIC->Play( true );
|
||||
}
|
||||
|
||||
if ( GAMESTATE->m_MasterPlayerNumber == PLAYER_1 && GAMESTATE->m_CurStyle == STYLE_EZ2_SINGLE) //if p1 already selected hide graphic.
|
||||
/*
|
||||
TODO: Get all the EZ2 specific stuff out of here
|
||||
*/
|
||||
|
||||
if ( GAMESTATE->m_bIsJoined[PLAYER_1] && GAMESTATE->m_CurStyle == STYLE_EZ2_SINGLE) //if p1 already selected hide graphic.
|
||||
{
|
||||
m_iSelectedPlayer = 0;
|
||||
m_sprPly[1].BeginTweening( 0 );
|
||||
@@ -213,7 +199,7 @@ ScreenEz2SelectStyle::ScreenEz2SelectStyle()
|
||||
m_sprPly[2].BeginTweening( 0 );
|
||||
m_sprPly[2].SetTweenZoomY( 0 );
|
||||
}
|
||||
else if ( GAMESTATE->m_MasterPlayerNumber == PLAYER_2 && GAMESTATE->m_CurStyle == STYLE_EZ2_SINGLE) //if p2 already selected hide graphic.
|
||||
else if ( GAMESTATE->m_bIsJoined[PLAYER_2] && GAMESTATE->m_CurStyle == STYLE_EZ2_SINGLE) //if p2 already selected hide graphic.
|
||||
{
|
||||
m_iSelectedPlayer = 1;
|
||||
m_sprPly[3].BeginTweening( 0 );
|
||||
@@ -343,7 +329,7 @@ void ScreenEz2SelectStyle::HandleScreenMessage( const ScreenMessage SM )
|
||||
else // club
|
||||
{
|
||||
GAMESTATE->m_CurStyle = STYLE_EZ2_DOUBLE;
|
||||
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||
// GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,7 +343,10 @@ void ScreenEz2SelectStyle::HandleScreenMessage( const ScreenMessage SM )
|
||||
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
|
||||
break;
|
||||
case SM_GoToNextState:
|
||||
SCREENMAN->SetNewScreen( new ScreenSelectGroup );
|
||||
if( SKIP_SELECT_DIFFICULTY )
|
||||
SCREENMAN->SetNewScreen( new ScreenSelectGroup );
|
||||
else
|
||||
SCREENMAN->SetNewScreen( new ScreenSelectDifficulty );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -736,7 +725,7 @@ void ScreenEz2SelectStyle::MenuStart( PlayerNumber p )
|
||||
{
|
||||
GAMESTATE->m_CurStyle = STYLE_EZ2_DOUBLE;
|
||||
GAMESTATE->m_CurStyle = STYLE_EZ2_DOUBLE;
|
||||
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||
// GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||
//m_soundInvalid.PlayRandom();
|
||||
//return;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ ScreenGameOver::ScreenGameOver()
|
||||
{
|
||||
m_bClosing = false;
|
||||
|
||||
m_sprGameOver.Load( THEME->GetPathTo(GRAPHIC_GAME_OVER) );
|
||||
m_sprGameOver.Load( THEME->GetPathTo("Graphics","game over") );
|
||||
m_sprGameOver.SetXY( CENTER_X, CENTER_Y );
|
||||
this->AddSubActor( &m_sprGameOver );
|
||||
|
||||
|
||||
+225
-111
@@ -36,38 +36,141 @@
|
||||
// Defines
|
||||
//
|
||||
|
||||
const float LIFE_LOCAL_X[NUM_PLAYERS] = { -180, +180 };
|
||||
const float LIFE_LOCAL_Y[NUM_PLAYERS] = { -8, -8 };
|
||||
#define TOP_FRAME_X THEME->GetMetricF("Gameplay","TopFrameX")
|
||||
#define TOP_FRAME_Y THEME->GetMetricF("Gameplay","TopFrameY")
|
||||
#define TOP_FRAME_EXTRA_Y THEME->GetMetricF("Gameplay","TopFrameExtraY")
|
||||
#define BOTTOM_FRAME_X THEME->GetMetricF("Gameplay","BottomFrameX")
|
||||
#define BOTTOM_FRAME_Y THEME->GetMetricF("Gameplay","BottomFrameY")
|
||||
#define BOTTOM_FRAME_EXTRA_Y THEME->GetMetricF("Gameplay","BottomFrameExtraY")
|
||||
#define MIDDLE_FRAME_X THEME->GetMetricF("Gameplay","MiddleFrameX")
|
||||
#define MIDDLE_FRAME_Y THEME->GetMetricF("Gameplay","MiddleFrameY")
|
||||
#define LIFE_P1_X THEME->GetMetricF("Gameplay","LifeP1X")
|
||||
#define LIFE_P1_Y THEME->GetMetricF("Gameplay","LifeP1Y")
|
||||
#define LIFE_P1_EXTRA_Y THEME->GetMetricF("Gameplay","LifeP1ExtraY")
|
||||
#define LIFE_P2_X THEME->GetMetricF("Gameplay","LifeP2X")
|
||||
#define LIFE_P2_Y THEME->GetMetricF("Gameplay","LifeP2Y")
|
||||
#define LIFE_P2_EXTRA_Y THEME->GetMetricF("Gameplay","LifeP2ExtraY")
|
||||
#define STAGE_X THEME->GetMetricF("Gameplay","StageX")
|
||||
#define STAGE_Y THEME->GetMetricF("Gameplay","StageY")
|
||||
#define STAGE_EXTRA_Y THEME->GetMetricF("Gameplay","StageExtraY")
|
||||
#define SONG_NUMBER_P1_X THEME->GetMetricF("Gameplay","SongNumberP1X")
|
||||
#define SONG_NUMBER_P1_Y THEME->GetMetricF("Gameplay","SongNumberP1Y")
|
||||
#define SONG_NUMBER_P1_EXTRA_Y THEME->GetMetricF("Gameplay","SongNumberP1ExtraY")
|
||||
#define SONG_NUMBER_P2_X THEME->GetMetricF("Gameplay","SongNumberP2X")
|
||||
#define SONG_NUMBER_P2_Y THEME->GetMetricF("Gameplay","SongNumberP2Y")
|
||||
#define SONG_NUMBER_P2_EXTRA_Y THEME->GetMetricF("Gameplay","SongNumberP2ExtraY")
|
||||
#define SCORE_P1_X THEME->GetMetricF("Gameplay","ScoreP1X")
|
||||
#define SCORE_P1_Y THEME->GetMetricF("Gameplay","ScoreP1Y")
|
||||
#define SCORE_P1_EXTRA_Y THEME->GetMetricF("Gameplay","ScoreP1ExtraY")
|
||||
#define SCORE_P2_X THEME->GetMetricF("Gameplay","ScoreP2X")
|
||||
#define SCORE_P2_Y THEME->GetMetricF("Gameplay","ScoreP2Y")
|
||||
#define SCORE_P2_EXTRA_Y THEME->GetMetricF("Gameplay","ScoreP2ExtraY")
|
||||
#define PLAYER_OPTIONS_P1_X THEME->GetMetricF("Gameplay","PlayerOptionsP1X")
|
||||
#define PLAYER_OPTIONS_P1_Y THEME->GetMetricF("Gameplay","PlayerOptionsP1Y")
|
||||
#define PLAYER_OPTIONS_P1_EXTRA_Y THEME->GetMetricF("Gameplay","PlayerOptionsP1ExtraY")
|
||||
#define PLAYER_OPTIONS_P2_X THEME->GetMetricF("Gameplay","PlayerOptionsP2X")
|
||||
#define PLAYER_OPTIONS_P2_Y THEME->GetMetricF("Gameplay","PlayerOptionsP2Y")
|
||||
#define PLAYER_OPTIONS_P2_EXTRA_Y THEME->GetMetricF("Gameplay","PlayerOptionsP2ExtraY")
|
||||
#define SONG_OPTIONS_X THEME->GetMetricF("Gameplay","SongOptionsX")
|
||||
#define SONG_OPTIONS_Y THEME->GetMetricF("Gameplay","SongOptionsY")
|
||||
#define SONG_OPTIONS_EXTRA_Y THEME->GetMetricF("Gameplay","SongOptionsExtraY")
|
||||
#define DIFFICULTY_P1_X THEME->GetMetricF("Gameplay","DifficultyP1X")
|
||||
#define DIFFICULTY_P1_Y THEME->GetMetricF("Gameplay","DifficultyP1Y")
|
||||
#define DIFFICULTY_P1_REVERSE_Y THEME->GetMetricF("Gameplay","DifficultyP1ReverseY")
|
||||
#define DIFFICULTY_P1_EXTRA_Y THEME->GetMetricF("Gameplay","DifficultyP1ExtraY")
|
||||
#define DIFFICULTY_P1_EXTRA_REVERSE_Y THEME->GetMetricF("Gameplay","DifficultyP1ExtraReverseY")
|
||||
#define DIFFICULTY_P2_X THEME->GetMetricF("Gameplay","DifficultyP2X")
|
||||
#define DIFFICULTY_P2_Y THEME->GetMetricF("Gameplay","DifficultyP2Y")
|
||||
#define DIFFICULTY_P2_REVERSE_Y THEME->GetMetricF("Gameplay","DifficultyP2ReverseY")
|
||||
#define DIFFICULTY_P2_EXTRA_Y THEME->GetMetricF("Gameplay","DifficultyP2ExtraY")
|
||||
#define DIFFICULTY_P2_EXTRA_REVERSE_Y THEME->GetMetricF("Gameplay","DifficultyP2ExtraReverseY")
|
||||
#define DEBUG_X THEME->GetMetricF("Gameplay","DebugX")
|
||||
#define DEBUG_Y THEME->GetMetricF("Gameplay","DebugY")
|
||||
#define SURVIVE_TIME_X THEME->GetMetricF("Gameplay","SurviveTimeX")
|
||||
#define SURVIVE_TIME_Y THEME->GetMetricF("Gameplay","SurviveTimeY")
|
||||
#define SECONDS_BETWEEN_COMMENTS THEME->GetMetricF("Gameplay","SecondsBetweenComments")
|
||||
#define DEMONSTRATION_SECONDS THEME->GetMetricF("Gameplay","DemonstrationSeconds")
|
||||
|
||||
const float STAGE_NUMBER_LOCAL_X = 0;
|
||||
const float STAGE_NUMBER_LOCAL_Y = +20;
|
||||
const float STAGE_NUMBER_LOCALEZ2_Y = -30;
|
||||
|
||||
const float SONG_NUMBER_LOCAL_X[NUM_PLAYERS] = { STAGE_NUMBER_LOCAL_X-20, STAGE_NUMBER_LOCAL_X+20 };
|
||||
const float SONG_NUMBER_LOCAL_Y[NUM_PLAYERS] = { STAGE_NUMBER_LOCAL_Y, STAGE_NUMBER_LOCAL_Y };
|
||||
|
||||
|
||||
const float SCORE_LOCAL_X[NUM_PLAYERS] = { -214, +214 };
|
||||
const float SCORE_LOCAL_Y[NUM_PLAYERS] = { -6, -6 };
|
||||
|
||||
const float SCORE_LOCALEZ2_X[NUM_PLAYERS] = { -240, +240 };
|
||||
const float SCORE_LOCALEZ2_Y[NUM_PLAYERS] = { -32, -32 };
|
||||
|
||||
const float PLAYER_OPTIONS_LOCAL_X[NUM_PLAYERS] = { -0, +0 };
|
||||
const float PLAYER_OPTIONS_LOCAL_Y[NUM_PLAYERS] = { -12, +2 };
|
||||
|
||||
const float DIFFICULTY_X[NUM_PLAYERS] = { SCREEN_LEFT+60, SCREEN_RIGHT-60 };
|
||||
const float DIFFICULTY_Y[NUM_PLAYERS] = { SCREEN_BOTTOM-70, SCREEN_BOTTOM-70 };
|
||||
|
||||
const float DEBUG_X = CENTER_X;
|
||||
const float DEBUG_Y = CENTER_Y-70;
|
||||
|
||||
const float SURVIVE_TIME_X = CENTER_X;
|
||||
const float SURVIVE_TIME_Y = CENTER_Y+100;
|
||||
|
||||
const float TIME_BETWEEN_DANCING_COMMENTS = 13;
|
||||
|
||||
const float DEMONSTRATION_TIME = 30;
|
||||
float LIFE_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return LIFE_P1_X;
|
||||
case PLAYER_2: return LIFE_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float LIFE_Y( int p, bool bExtra ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return bExtra ? LIFE_P1_EXTRA_Y : LIFE_P1_Y;
|
||||
case PLAYER_2: return bExtra ? LIFE_P2_EXTRA_Y : LIFE_P2_Y;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float SONG_NUMBER_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return SONG_NUMBER_P1_X;
|
||||
case PLAYER_2: return SONG_NUMBER_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float SONG_NUMBER_Y( int p, bool bExtra ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return bExtra ? SONG_NUMBER_P1_EXTRA_Y : SONG_NUMBER_P1_Y;
|
||||
case PLAYER_2: return bExtra ? SONG_NUMBER_P2_EXTRA_Y : SONG_NUMBER_P2_Y;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float SCORE_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return SCORE_P1_X;
|
||||
case PLAYER_2: return SCORE_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float SCORE_Y( int p, bool bExtra ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return bExtra ? SCORE_P1_EXTRA_Y : SCORE_P1_Y;
|
||||
case PLAYER_2: return bExtra ? SCORE_P2_EXTRA_Y : SCORE_P2_Y;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float DIFFICULTY_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return DIFFICULTY_P1_X;
|
||||
case PLAYER_2: return DIFFICULTY_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float DIFFICULTY_Y( int p, bool bReverse, bool bExtra ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1:
|
||||
if( bExtra && bReverse ) return DIFFICULTY_P1_EXTRA_REVERSE_Y;
|
||||
if( !bExtra && bReverse ) return DIFFICULTY_P1_REVERSE_Y;
|
||||
if( bExtra && !bReverse ) return DIFFICULTY_P1_EXTRA_Y;
|
||||
if( !bExtra && !bReverse ) return DIFFICULTY_P1_Y;
|
||||
else ASSERT(0);
|
||||
case PLAYER_2:
|
||||
if( bExtra && bReverse ) return DIFFICULTY_P2_EXTRA_REVERSE_Y;
|
||||
if( !bExtra && bReverse ) return DIFFICULTY_P2_REVERSE_Y;
|
||||
if( bExtra && !bReverse ) return DIFFICULTY_P2_EXTRA_Y;
|
||||
if( !bExtra && !bReverse ) return DIFFICULTY_P2_Y;
|
||||
else ASSERT(0);
|
||||
}
|
||||
ASSERT(0); return 0;
|
||||
}
|
||||
float PLAYER_OPTIONS_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return PLAYER_OPTIONS_P1_X;
|
||||
case PLAYER_2: return PLAYER_OPTIONS_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float PLAYER_OPTIONS_Y( int p, bool bExtra ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return bExtra ? PLAYER_OPTIONS_P1_EXTRA_Y : PLAYER_OPTIONS_P1_Y;
|
||||
case PLAYER_2: return bExtra ? PLAYER_OPTIONS_P2_EXTRA_Y : PLAYER_OPTIONS_P2_Y;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// received while STATE_DANCING
|
||||
@@ -99,6 +202,12 @@ ScreenGameplay::ScreenGameplay()
|
||||
|
||||
GAMESTATE->ResetStageStatistics(); // clear values
|
||||
|
||||
const bool bExtra = GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2();
|
||||
const bool bReverse[NUM_PLAYERS] = {
|
||||
GAMESTATE->m_PlayerOptions[0].m_bReverseScroll,
|
||||
GAMESTATE->m_PlayerOptions[1].m_bReverseScroll
|
||||
};
|
||||
|
||||
// Update possible dance points
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
@@ -142,7 +251,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
|
||||
|
||||
m_DancingState = STATE_INTRO;
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
|
||||
|
||||
m_Background.SetDiffuseColor( D3DXCOLOR(0.4f,0.4f,0.4f,1) );
|
||||
@@ -158,7 +267,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_Player[p].SetX( fPlayerX );
|
||||
this->AddSubActor( &m_Player[p] );
|
||||
|
||||
m_sprOniGameOver[p].Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_ONI_GAMEOVER) );
|
||||
m_sprOniGameOver[p].Load( THEME->GetPathTo("Graphics","gameplay oni gameover") );
|
||||
m_sprOniGameOver[p].SetX( fPlayerX );
|
||||
m_sprOniGameOver[p].SetY( SCREEN_TOP - m_sprOniGameOver[p].GetZoomedHeight()/2 );
|
||||
m_sprOniGameOver[p].SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // 0 alpha so we don't waste time drawing while not visible
|
||||
@@ -170,10 +279,9 @@ ScreenGameplay::ScreenGameplay()
|
||||
this->AddSubActor( &m_OniFade );
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
// Add all Actors to m_frameTop
|
||||
//////////////////////////////////
|
||||
this->AddSubActor( &m_frameTop );
|
||||
m_sprMiddleFrame.Load( THEME->GetPathTo("Graphics","Gameplay Middle Frame") );
|
||||
m_sprMiddleFrame.SetXY( MIDDLE_FRAME_X, MIDDLE_FRAME_Y );
|
||||
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
@@ -190,8 +298,11 @@ ScreenGameplay::ScreenGameplay()
|
||||
}
|
||||
|
||||
m_pLifeMeter[p]->Load( (PlayerNumber)p );
|
||||
m_pLifeMeter[p]->SetXY( LIFE_LOCAL_X[p], LIFE_LOCAL_Y[p] );
|
||||
m_frameTop.AddSubActor( m_pLifeMeter[p] );
|
||||
m_pLifeMeter[p]->SetXY( LIFE_X(p), LIFE_Y(p,bExtra) );
|
||||
this->AddSubActor( m_pLifeMeter[p] );
|
||||
|
||||
/*
|
||||
Chris: EZ2 should change positions via Theme metrics
|
||||
|
||||
if( GAMESTATE->m_CurGame == GAME_EZ2 )
|
||||
{
|
||||
@@ -201,51 +312,41 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_pScoreDisplay[p]->SetDiffuseColor( PlayerToColor(p) );
|
||||
m_frameTop.AddSubActor( m_pScoreDisplay[p] );
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
// TopFrame goes above LifeMeter
|
||||
m_sprTopFrame.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_TOP_FRAME) );
|
||||
m_frameTop.AddSubActor( &m_sprTopFrame );
|
||||
m_sprTopFrame.Load( THEME->GetPathTo("Graphics",bExtra?"gameplay extra top frame":"gameplay top frame") );
|
||||
m_sprTopFrame.SetXY( TOP_FRAME_X, bExtra ? TOP_FRAME_EXTRA_Y : TOP_FRAME_Y );
|
||||
this->AddSubActor( &m_sprTopFrame );
|
||||
|
||||
m_frameTop.SetXY( CENTER_X, SCREEN_TOP + m_sprTopFrame.GetZoomedHeight()/2 );
|
||||
|
||||
m_textStageNumber.Load( THEME->GetPathTo(FONT_HEADER2) );
|
||||
m_textStageNumber.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
m_textStageNumber.TurnShadowOff();
|
||||
m_textStageNumber.SetXY( STAGE_NUMBER_LOCAL_X, STAGE_NUMBER_LOCAL_Y );
|
||||
m_textStageNumber.SetXY( STAGE_X, bExtra ? STAGE_EXTRA_Y : STAGE_Y );
|
||||
m_textStageNumber.SetText( GAMESTATE->GetStageText() );
|
||||
m_textStageNumber.SetDiffuseColor( GAMESTATE->GetStageColor() );
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_textCourseSongNumber[p].Load( THEME->GetPathTo(FONT_HEADER2) );
|
||||
m_textCourseSongNumber[p].LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
m_textCourseSongNumber[p].TurnShadowOff();
|
||||
m_textCourseSongNumber[p].SetXY( SONG_NUMBER_LOCAL_X[p], SONG_NUMBER_LOCAL_Y[p] );
|
||||
m_textCourseSongNumber[p].SetXY( SONG_NUMBER_X(p), SONG_NUMBER_Y(p,bExtra) );
|
||||
m_textCourseSongNumber[p].SetText( "" );
|
||||
m_textCourseSongNumber[p].SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,1,1) ); // light blue
|
||||
}
|
||||
|
||||
if( GAMESTATE->m_CurGame == GAME_EZ2 )
|
||||
{
|
||||
m_textStageNumber.SetXY( STAGE_NUMBER_LOCAL_X, STAGE_NUMBER_LOCALEZ2_Y );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_textStageNumber.SetXY( STAGE_NUMBER_LOCAL_X, STAGE_NUMBER_LOCAL_Y );
|
||||
}
|
||||
m_textStageNumber.SetText( GAMESTATE->GetStageText() );
|
||||
m_textStageNumber.SetDiffuseColor( GAMESTATE->GetStageColor() );
|
||||
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ARCADE:
|
||||
m_frameTop.AddSubActor( &m_textStageNumber );
|
||||
this->AddSubActor( &m_textStageNumber );
|
||||
break;
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
m_frameTop.AddSubActor( &m_textCourseSongNumber[p] );
|
||||
this->AddSubActor( &m_textCourseSongNumber[p] );
|
||||
break;
|
||||
default:
|
||||
ASSERT(0); // invalid GameMode
|
||||
@@ -255,12 +356,13 @@ ScreenGameplay::ScreenGameplay()
|
||||
//////////////////////////////////
|
||||
// Add all Actors to m_frameBottom
|
||||
//////////////////////////////////
|
||||
this->AddSubActor( &m_frameBottom );
|
||||
m_sprBottomFrame.Load( THEME->GetPathTo("Graphics",bExtra?"gameplay extra bottom frame":"gameplay bottom frame") );
|
||||
m_sprBottomFrame.SetXY( BOTTOM_FRAME_X, bExtra ? BOTTOM_FRAME_EXTRA_Y : BOTTOM_FRAME_Y );
|
||||
this->AddSubActor( &m_sprBottomFrame );
|
||||
|
||||
m_sprBottomFrame.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_BOTTOM_FRAME) );
|
||||
m_frameBottom.AddSubActor( &m_sprBottomFrame );
|
||||
|
||||
m_frameBottom.SetXY( CENTER_X, SCREEN_BOTTOM - m_sprBottomFrame.GetZoomedHeight()/2 );
|
||||
/*
|
||||
Chris: Change this position using theme metrics
|
||||
|
||||
if( GAMESTATE->m_CurGame != GAME_EZ2 )
|
||||
{
|
||||
@@ -268,13 +370,16 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_frameBottom.AddSubActor( &m_sprBottomFrame );
|
||||
m_frameBottom.SetXY( CENTER_X, SCREEN_BOTTOM - m_sprBottomFrame.GetZoomedHeight()/2 );
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
/* Chris: I don't understand why EZ2 wouldn't want this.
|
||||
|
||||
if( GAMESTATE->m_CurGame != GAME_EZ2 )
|
||||
{
|
||||
*/
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ARCADE:
|
||||
@@ -289,36 +394,47 @@ ScreenGameplay::ScreenGameplay()
|
||||
}
|
||||
|
||||
m_pScoreDisplay[p]->Init( (PlayerNumber)p );
|
||||
m_pScoreDisplay[p]->SetXY( SCORE_LOCAL_X[p], SCORE_LOCAL_Y[p] );
|
||||
m_pScoreDisplay[p]->SetXY( SCORE_X(p), SCORE_Y(p,bExtra) );
|
||||
m_pScoreDisplay[p]->SetZoom( 0.8f );
|
||||
m_pScoreDisplay[p]->SetDiffuseColor( PlayerToColor(p) );
|
||||
m_frameBottom.AddSubActor( m_pScoreDisplay[p] );
|
||||
this->AddSubActor( m_pScoreDisplay[p] );
|
||||
/*
|
||||
}
|
||||
*/
|
||||
|
||||
m_textPlayerOptions[p].Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textPlayerOptions[p].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
|
||||
if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
||||
continue;
|
||||
|
||||
/* Chris: EZ2 should control this with theme metrics
|
||||
|
||||
if( GAMESTATE->m_CurGame != GAME_EZ2 )
|
||||
{
|
||||
m_pScoreDisplay[p]->SetXY( SCORE_LOCAL_X[p], SCORE_LOCAL_Y[p] );
|
||||
{
|
||||
*/
|
||||
m_pScoreDisplay[p]->SetXY( SCORE_X(p), SCORE_Y(p,bExtra) );
|
||||
m_pScoreDisplay[p]->SetZoom( 0.8f );
|
||||
m_pScoreDisplay[p]->SetDiffuseColor( PlayerToColor(p) );
|
||||
m_frameBottom.AddSubActor( m_pScoreDisplay[p] );
|
||||
this->AddSubActor( m_pScoreDisplay[p] );
|
||||
// }
|
||||
|
||||
// m_textPlayerOptions[p].Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
|
||||
m_textPlayerOptions[p].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textPlayerOptions[p].TurnShadowOff();
|
||||
m_textPlayerOptions[p].SetXY( PLAYER_OPTIONS_LOCAL_X[p], PLAYER_OPTIONS_LOCAL_Y[p] );
|
||||
m_textPlayerOptions[p].SetXY( PLAYER_OPTIONS_X(p), PLAYER_OPTIONS_Y(p,bExtra) );
|
||||
m_textPlayerOptions[p].SetZoom( 0.5f );
|
||||
m_textPlayerOptions[p].SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
m_textPlayerOptions[p].SetText( GAMESTATE->m_PlayerOptions[p].GetString() );
|
||||
m_frameBottom.AddSubActor( &m_textPlayerOptions[p] );
|
||||
}
|
||||
this->AddSubActor( &m_textPlayerOptions[p] );
|
||||
//}
|
||||
}
|
||||
|
||||
m_textSongOptions.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textSongOptions.TurnShadowOff();
|
||||
m_textSongOptions.SetXY( SONG_OPTIONS_X, bExtra?SONG_OPTIONS_EXTRA_Y:SONG_OPTIONS_Y );
|
||||
m_textSongOptions.SetZoom( 0.5f );
|
||||
m_textSongOptions.SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetString() );
|
||||
this->AddSubActor( &m_textSongOptions );
|
||||
|
||||
|
||||
// Get the current StyleDef definition (used below)
|
||||
@@ -353,18 +469,12 @@ ScreenGameplay::ScreenGameplay()
|
||||
}
|
||||
*/
|
||||
// HOW I THINK IT SHOULD BE FIXED:
|
||||
if( GAMESTATE->m_CurGame != GAME_EZ2 )
|
||||
{
|
||||
float fDifficultyY = DIFFICULTY_Y[p];
|
||||
if( GAMESTATE->m_PlayerOptions[p].m_bReverseScroll )
|
||||
fDifficultyY = SCREEN_HEIGHT - DIFFICULTY_Y[p] -10; // HACK: move difficulty banner up 10 if reverse
|
||||
m_DifficultyBanner[p].SetXY( DIFFICULTY_X[p], fDifficultyY );
|
||||
this->AddSubActor( &m_DifficultyBanner[p] );
|
||||
}
|
||||
m_DifficultyBanner[p].SetXY( DIFFICULTY_X(p), DIFFICULTY_Y(p,bReverse[p],bExtra) );
|
||||
this->AddSubActor( &m_DifficultyBanner[p] );
|
||||
}
|
||||
|
||||
|
||||
m_textDebug.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textDebug.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textDebug.SetXY( DEBUG_X, DEBUG_Y );
|
||||
m_textDebug.SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
this->AddSubActor( &m_textDebug );
|
||||
@@ -374,22 +484,22 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_StarWipe.SetClosed();
|
||||
this->AddSubActor( &m_StarWipe );
|
||||
|
||||
m_sprReady.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_READY) );
|
||||
m_sprReady.Load( THEME->GetPathTo("Graphics","gameplay ready") );
|
||||
m_sprReady.SetXY( CENTER_X, CENTER_Y );
|
||||
m_sprReady.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
this->AddSubActor( &m_sprReady );
|
||||
|
||||
m_sprHereWeGo.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_HERE_WE_GO) );
|
||||
m_sprHereWeGo.Load( THEME->GetPathTo("Graphics","gameplay here we go") );
|
||||
m_sprHereWeGo.SetXY( CENTER_X, CENTER_Y );
|
||||
m_sprHereWeGo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
this->AddSubActor( &m_sprHereWeGo );
|
||||
|
||||
m_sprCleared.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_CLEARED) );
|
||||
m_sprCleared.Load( THEME->GetPathTo("Graphics","gameplay cleared") );
|
||||
m_sprCleared.SetXY( CENTER_X, CENTER_Y );
|
||||
m_sprCleared.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
this->AddSubActor( &m_sprCleared );
|
||||
|
||||
m_sprFailed.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_FAILED) );
|
||||
m_sprFailed.Load( THEME->GetPathTo("Graphics","gameplay failed") );
|
||||
m_sprFailed.SetXY( CENTER_X, CENTER_Y );
|
||||
m_sprFailed.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
this->AddSubActor( &m_sprFailed );
|
||||
@@ -400,7 +510,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_quadDemonstrationBox.StretchTo( CRect(SCREEN_LEFT, int(CENTER_Y-60), SCREEN_RIGHT, int(CENTER_Y+60)) );
|
||||
this->AddSubActor( &m_quadDemonstrationBox );
|
||||
|
||||
m_sprDemonstration.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_DEMONSTRATION) );
|
||||
m_sprDemonstration.Load( THEME->GetPathTo("Graphics","gameplay demonstration") );
|
||||
m_sprDemonstration.SetXY( CENTER_X, CENTER_Y );
|
||||
m_sprDemonstration.SetEffectBlinking();
|
||||
this->AddSubActor( &m_sprDemonstration );
|
||||
@@ -412,7 +522,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
this->AddSubActor( &m_Fade );
|
||||
|
||||
|
||||
m_textSurviveTime.Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textSurviveTime.LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textSurviveTime.TurnShadowOff();
|
||||
m_textSurviveTime.SetXY( SURVIVE_TIME_X, SURVIVE_TIME_Y );
|
||||
m_textSurviveTime.SetText( "" );
|
||||
@@ -423,8 +533,8 @@ ScreenGameplay::ScreenGameplay()
|
||||
|
||||
if( !GAMESTATE->m_bDemonstration ) // don't load sounds if just playing demonstration
|
||||
{
|
||||
m_soundFail.Load( THEME->GetPathTo(SOUND_GAMEPLAY_FAILED) );
|
||||
m_soundOniDie.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ONI_DIE) );
|
||||
m_soundFail.Load( THEME->GetPathTo("Sounds","gameplay failed") );
|
||||
m_soundOniDie.Load( THEME->GetPathTo("Sounds","gameplay oni die") );
|
||||
m_announcerReady.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_READY) );
|
||||
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
||||
m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_EXTRA) );
|
||||
@@ -449,7 +559,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_announcerComboStopped.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMBO_STOPPED) );
|
||||
}
|
||||
|
||||
m_soundAssistTick.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ASSIST_TICK) );
|
||||
m_soundAssistTick.Load( THEME->GetPathTo("Sounds","gameplay assist tick") );
|
||||
|
||||
|
||||
LoadNextSong( true );
|
||||
@@ -460,7 +570,7 @@ ScreenGameplay::ScreenGameplay()
|
||||
m_StarWipe.SetOpened();
|
||||
m_DancingState = STATE_DANCING;
|
||||
m_soundMusic.Play();
|
||||
this->SendScreenMessage( SM_BeginFadingToTitleMenu, DEMONSTRATION_TIME );
|
||||
this->SendScreenMessage( SM_BeginFadingToTitleMenu, DEMONSTRATION_SECONDS );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -724,7 +834,7 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
m_fTimeLeftBeforeDancingComment -= fDeltaTime;
|
||||
if( m_fTimeLeftBeforeDancingComment <= 0 )
|
||||
{
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS; // reset for the next comment
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS; // reset for the next comment
|
||||
|
||||
|
||||
|
||||
@@ -815,11 +925,13 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
|
||||
|
||||
if( GAMESTATE->m_bDemonstration )
|
||||
{
|
||||
if( MenuI.button == MENU_BUTTON_START )
|
||||
if( MenuI.button == MENU_BUTTON_START && !m_Fade.IsClosing() )
|
||||
{
|
||||
m_soundMusic.Stop();
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_INSERT_COIN) );
|
||||
m_Fade.CloseWipingRight( SM_GoToTitleMenu );
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","insert coin") );
|
||||
::Sleep( 1000 ); // do a little pause, like the arcade does
|
||||
this->SendScreenMessage( SM_GoToTitleMenu, 0 );
|
||||
// m_Fade.CloseWipingRight( SM_GoToTitleMenu );
|
||||
}
|
||||
return; // don't fall through below
|
||||
}
|
||||
@@ -903,7 +1015,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
|
||||
(DeviceI.device!=DEVICE_KEYBOARD && type==IET_FAST_REPEAT) )
|
||||
{
|
||||
m_DancingState = STATE_OUTRO;
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_MENU_BACK) );
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu back") );
|
||||
m_soundMusic.Stop();
|
||||
this->ClearMessageQueue();
|
||||
m_Fade.CloseWipingLeft( SM_SaveChangedBeforeGoingBack );
|
||||
@@ -1095,7 +1207,8 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_StarWipe.CloseWipingRight( SM_ShowCleared );
|
||||
m_StarWipe.CloseWipingRight( SM_None );
|
||||
this->SendScreenMessage( SM_ShowCleared, 1 );
|
||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_CLEARED) );
|
||||
}
|
||||
}
|
||||
@@ -1114,77 +1227,77 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer100Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_200Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer200Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_300Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer300Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_400Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer400Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_500Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer500Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_600Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer600Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_700Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer700Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_800Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer800Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_900Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer900Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_1000Combo:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcer1000Combo.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
case SM_ComboStopped:
|
||||
if( m_fTimeLeftBeforeDancingComment < 12 )
|
||||
{
|
||||
m_announcerComboStopped.PlayRandom();
|
||||
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
|
||||
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1235,6 +1348,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
case SM_BeginFailed:
|
||||
m_DancingState = STATE_OUTRO;
|
||||
m_soundMusic.Pause();
|
||||
m_StarWipe.SetTransitionTime( 1.5f );
|
||||
m_StarWipe.CloseWipingRight( SM_None );
|
||||
int p;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
|
||||
@@ -81,16 +81,17 @@ private:
|
||||
|
||||
TransitionOniFade m_OniFade; // shows between songs in a course
|
||||
|
||||
ActorFrame m_frameTop;
|
||||
Sprite m_sprTopFrame;
|
||||
LifeMeter* m_pLifeMeter[NUM_PLAYERS];
|
||||
BitmapText m_textStageNumber;
|
||||
BitmapText m_textCourseSongNumber[NUM_PLAYERS];
|
||||
|
||||
ActorFrame m_frameBottom;
|
||||
Sprite m_sprMiddleFrame;
|
||||
|
||||
Sprite m_sprBottomFrame;
|
||||
ScoreDisplay* m_pScoreDisplay[NUM_PLAYERS];
|
||||
BitmapText m_textPlayerOptions[NUM_PLAYERS];
|
||||
BitmapText m_textSongOptions;
|
||||
|
||||
BitmapText m_textDebug;
|
||||
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScreenGraphicOptions
|
||||
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "ScreenGraphicOptions.h"
|
||||
#include <assert.h>
|
||||
#include "RageTextureManager.h"
|
||||
#include "RageUtil.h"
|
||||
#include "RageMusic.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "ScreenOptions.h"
|
||||
#include "ScreenTitleMenu.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "StepMania.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
|
||||
|
||||
enum {
|
||||
GO_WINDOWED = 0,
|
||||
GO_DISPLAY_RESOLUTION,
|
||||
GO_TEXTURE_RESOLUTION,
|
||||
GO_REFRESH_RATE,
|
||||
GO_SHOWFPS,
|
||||
GO_BGMODE,
|
||||
GO_BGBRIGHTNESS,
|
||||
NUM_GRAPHIC_OPTIONS_LINES
|
||||
};
|
||||
OptionLineData g_GraphicOptionsLines[NUM_GRAPHIC_OPTIONS_LINES] = {
|
||||
{ "Display", 2, {"FULLSCREEN", "WINDOWED"} },
|
||||
{ "Display Res", 7, {"320","400","512","640","800","1024","1280"} },
|
||||
{ "Texture Res", 3, {"256","512","1024"} },
|
||||
{ "Refresh Rate", 10, {"DEFAULT","60","70","72","75","80","85","90","100","120"} },
|
||||
{ "Show FPS", 2, {"OFF","ON"} },
|
||||
{ "BG Mode", 4, {"OFF","ANIMATIONS","VISUALIZATIONS","RANDOM MOVIES"} },
|
||||
{ "BG Brightness", 5, {"20%","40%","60%","80%","100%"} },
|
||||
};
|
||||
|
||||
ScreenGraphicOptions::ScreenGraphicOptions() :
|
||||
ScreenOptions(
|
||||
THEME->GetPathTo("Graphics","graphic options background"),
|
||||
THEME->GetPathTo("Graphics","graphic options page"),
|
||||
THEME->GetPathTo("Graphics","graphic options top edge")
|
||||
)
|
||||
{
|
||||
LOG->Trace( "ScreenGraphicOptions::ScreenGraphicOptions()" );
|
||||
|
||||
Init(
|
||||
INPUTMODE_BOTH,
|
||||
g_GraphicOptionsLines,
|
||||
NUM_GRAPHIC_OPTIONS_LINES
|
||||
);
|
||||
m_Menu.StopTimer();
|
||||
}
|
||||
|
||||
void ScreenGraphicOptions::ImportOptions()
|
||||
{
|
||||
m_iSelectedOption[0][GO_WINDOWED] = PREFSMAN->m_bWindowed ? 1:0;
|
||||
|
||||
switch( PREFSMAN->m_iDisplayResolution )
|
||||
{
|
||||
case 320: m_iSelectedOption[0][GO_DISPLAY_RESOLUTION] = 0; break;
|
||||
case 400: m_iSelectedOption[0][GO_DISPLAY_RESOLUTION] = 1; break;
|
||||
case 512: m_iSelectedOption[0][GO_DISPLAY_RESOLUTION] = 2; break;
|
||||
case 640: m_iSelectedOption[0][GO_DISPLAY_RESOLUTION] = 3; break;
|
||||
case 800: m_iSelectedOption[0][GO_DISPLAY_RESOLUTION] = 4; break;
|
||||
case 1024: m_iSelectedOption[0][GO_DISPLAY_RESOLUTION] = 5; break;
|
||||
case 1280: m_iSelectedOption[0][GO_DISPLAY_RESOLUTION] = 6; break;
|
||||
default: m_iSelectedOption[0][GO_DISPLAY_RESOLUTION] = 3; break;
|
||||
}
|
||||
|
||||
switch( PREFSMAN->m_iTextureResolution )
|
||||
{
|
||||
case 256: m_iSelectedOption[0][GO_TEXTURE_RESOLUTION] = 0; break;
|
||||
case 512: m_iSelectedOption[0][GO_TEXTURE_RESOLUTION] = 1; break;
|
||||
case 1024: m_iSelectedOption[0][GO_TEXTURE_RESOLUTION] = 2; break;
|
||||
default: m_iSelectedOption[0][GO_TEXTURE_RESOLUTION] = 1; break;
|
||||
}
|
||||
|
||||
switch( PREFSMAN->m_iRefreshRate )
|
||||
{
|
||||
case 0: m_iSelectedOption[0][GO_REFRESH_RATE] = 0; break;
|
||||
case 60: m_iSelectedOption[0][GO_REFRESH_RATE] = 1; break;
|
||||
case 70: m_iSelectedOption[0][GO_REFRESH_RATE] = 2; break;
|
||||
case 72: m_iSelectedOption[0][GO_REFRESH_RATE] = 3; break;
|
||||
case 75: m_iSelectedOption[0][GO_REFRESH_RATE] = 4; break;
|
||||
case 80: m_iSelectedOption[0][GO_REFRESH_RATE] = 5; break;
|
||||
case 85: m_iSelectedOption[0][GO_REFRESH_RATE] = 6; break;
|
||||
case 90: m_iSelectedOption[0][GO_REFRESH_RATE] = 7; break;
|
||||
case 100: m_iSelectedOption[0][GO_REFRESH_RATE] = 8; break;
|
||||
case 120: m_iSelectedOption[0][GO_REFRESH_RATE] = 9; break;
|
||||
default: m_iSelectedOption[0][GO_REFRESH_RATE] = 0; break;
|
||||
}
|
||||
|
||||
m_iSelectedOption[0][GO_SHOWFPS] = PREFSMAN->m_bShowFPS ? 1:0;
|
||||
m_iSelectedOption[0][GO_BGMODE] = PREFSMAN->m_BackgroundMode;
|
||||
|
||||
if( PREFSMAN->m_fBGBrightness == 0.2f ) m_iSelectedOption[0][GO_BGBRIGHTNESS] = 0;
|
||||
else if( PREFSMAN->m_fBGBrightness == 0.4f ) m_iSelectedOption[0][GO_BGBRIGHTNESS] = 1;
|
||||
else if( PREFSMAN->m_fBGBrightness == 0.6f ) m_iSelectedOption[0][GO_BGBRIGHTNESS] = 2;
|
||||
else if( PREFSMAN->m_fBGBrightness == 0.8f ) m_iSelectedOption[0][GO_BGBRIGHTNESS] = 3;
|
||||
else if( PREFSMAN->m_fBGBrightness == 1.0f ) m_iSelectedOption[0][GO_BGBRIGHTNESS] = 4;
|
||||
else m_iSelectedOption[0][GO_BGBRIGHTNESS] = 2;
|
||||
}
|
||||
|
||||
void ScreenGraphicOptions::ExportOptions()
|
||||
{
|
||||
PREFSMAN->m_bWindowed = m_iSelectedOption[0][GO_WINDOWED] == 1;
|
||||
|
||||
switch( m_iSelectedOption[0][GO_DISPLAY_RESOLUTION] )
|
||||
{
|
||||
case 0: PREFSMAN->m_iDisplayResolution = 320; break;
|
||||
case 1: PREFSMAN->m_iDisplayResolution = 400; break;
|
||||
case 2: PREFSMAN->m_iDisplayResolution = 512; break;
|
||||
case 3: PREFSMAN->m_iDisplayResolution = 640; break;
|
||||
case 4: PREFSMAN->m_iDisplayResolution = 800; break;
|
||||
case 5: PREFSMAN->m_iDisplayResolution = 1024; break;
|
||||
case 6: PREFSMAN->m_iDisplayResolution = 1280; break;
|
||||
default: ASSERT(0); PREFSMAN->m_iDisplayResolution = 640; break;
|
||||
}
|
||||
|
||||
switch( m_iSelectedOption[0][GO_TEXTURE_RESOLUTION] )
|
||||
{
|
||||
case 0: PREFSMAN->m_iTextureResolution = 256; break;
|
||||
case 1: PREFSMAN->m_iTextureResolution = 512; break;
|
||||
case 2: PREFSMAN->m_iTextureResolution = 1024; break;
|
||||
default: ASSERT(0); PREFSMAN->m_iTextureResolution = 512; break;
|
||||
}
|
||||
|
||||
switch( m_iSelectedOption[0][GO_REFRESH_RATE] )
|
||||
{
|
||||
case 0: PREFSMAN->m_iRefreshRate = 0; break;
|
||||
case 1: PREFSMAN->m_iRefreshRate = 60; break;
|
||||
case 2: PREFSMAN->m_iRefreshRate = 70; break;
|
||||
case 3: PREFSMAN->m_iRefreshRate = 72; break;
|
||||
case 4: PREFSMAN->m_iRefreshRate = 75; break;
|
||||
case 5: PREFSMAN->m_iRefreshRate = 80; break;
|
||||
case 6: PREFSMAN->m_iRefreshRate = 85; break;
|
||||
case 7: PREFSMAN->m_iRefreshRate = 90; break;
|
||||
case 8: PREFSMAN->m_iRefreshRate = 100; break;
|
||||
case 9: PREFSMAN->m_iRefreshRate = 120; break;
|
||||
default: ASSERT(0); PREFSMAN->m_iRefreshRate = 0; break;
|
||||
}
|
||||
|
||||
PREFSMAN->m_bShowFPS = m_iSelectedOption[0][GO_SHOWFPS] == 1;
|
||||
PREFSMAN->m_BackgroundMode = PrefsManager::BackgroundMode( m_iSelectedOption[0][GO_BGMODE] );
|
||||
|
||||
switch( m_iSelectedOption[0][GO_BGBRIGHTNESS] )
|
||||
{
|
||||
case 0: PREFSMAN->m_fBGBrightness = 0.2f; break;
|
||||
case 1: PREFSMAN->m_fBGBrightness = 0.4f; break;
|
||||
case 2: PREFSMAN->m_fBGBrightness = 0.6f; break;
|
||||
case 3: PREFSMAN->m_fBGBrightness = 0.8f; break;
|
||||
case 4: PREFSMAN->m_fBGBrightness = 1.0f; break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenGraphicOptions::GoToPrevState()
|
||||
{
|
||||
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
|
||||
PREFSMAN->SaveGlobalPrefsToDisk();
|
||||
ApplyGraphicOptions();
|
||||
}
|
||||
|
||||
void ScreenGraphicOptions::GoToNextState()
|
||||
{
|
||||
GoToPrevState();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScreenGraphicOptions
|
||||
|
||||
Desc: Change video-related options.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "Screen.h"
|
||||
#include "ScreenOptions.h"
|
||||
#include "Sprite.h"
|
||||
#include "BitmapText.h"
|
||||
#include "RandomSample.h"
|
||||
#include "TransitionFade.h"
|
||||
#include "Quad.h"
|
||||
|
||||
|
||||
class ScreenGraphicOptions : public ScreenOptions
|
||||
{
|
||||
public:
|
||||
ScreenGraphicOptions();
|
||||
|
||||
private:
|
||||
void ImportOptions();
|
||||
void ExportOptions();
|
||||
|
||||
void GoToNextState();
|
||||
void GoToPrevState();
|
||||
};
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: ScreenManager.h
|
||||
Class: ScreenManager
|
||||
|
||||
Desc: Manages the game windows.
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -14,21 +15,54 @@
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "RageLog.h"
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our program
|
||||
|
||||
|
||||
#define FPS_X THEME->GetMetricF("Other","FPSX")
|
||||
#define FPS_Y THEME->GetMetricF("Other","FPSY")
|
||||
#define CREDITS_P1_X THEME->GetMetricF("Other","CreditsP1X")
|
||||
#define CREDITS_P1_Y THEME->GetMetricF("Other","CreditsP1Y")
|
||||
#define CREDITS_P2_X THEME->GetMetricF("Other","CreditsP2X")
|
||||
#define CREDITS_P2_Y THEME->GetMetricF("Other","CreditsP2Y")
|
||||
|
||||
float CREDITS_X( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return CREDITS_P1_X;
|
||||
case PLAYER_2: return CREDITS_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float CREDITS_Y( int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return CREDITS_P1_Y;
|
||||
case PLAYER_2: return CREDITS_P2_Y;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ScreenManager::ScreenManager()
|
||||
{
|
||||
m_textFPS.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textFPS.SetXY( SCREEN_WIDTH-35, 15 );
|
||||
m_textFPS.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textFPS.SetXY( FPS_X, FPS_Y );
|
||||
m_textFPS.SetZ( -2 );
|
||||
m_textFPS.SetZoom( 0.5f );
|
||||
m_textFPS.SetShadowLength( 2 );
|
||||
|
||||
m_textSystemMessage.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_textCreditInfo[p].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textCreditInfo[p].SetXY( CREDITS_X(p), CREDITS_Y(p) );
|
||||
m_textCreditInfo[p].SetZoom( 0.5f );
|
||||
m_textCreditInfo[p].SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
m_textCreditInfo[p].SetShadowLength( 2 );
|
||||
}
|
||||
|
||||
m_textSystemMessage.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textSystemMessage.SetHorizAlign( Actor::align_left );
|
||||
m_textSystemMessage.SetVertAlign( Actor::align_bottom );
|
||||
m_textSystemMessage.SetXY( 5.0f, 10.0f );
|
||||
@@ -55,6 +89,8 @@ void ScreenManager::Update( float fDeltaTime )
|
||||
{
|
||||
m_textSystemMessage.Update( fDeltaTime );
|
||||
m_textFPS.Update( fDeltaTime );
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
m_textCreditInfo[p].Update( fDeltaTime );
|
||||
|
||||
// delete all ScreensToDelete
|
||||
for( int i=0; i<m_ScreensToDelete.GetSize(); i++ ) {
|
||||
@@ -99,6 +135,9 @@ void ScreenManager::Draw()
|
||||
m_textFPS.SetText( ssprintf("%3.0f FPS", DISPLAY->GetFPS()) );
|
||||
m_textFPS.Draw();
|
||||
}
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
m_textCreditInfo[p].Draw();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +154,7 @@ void ScreenManager::Input( const DeviceInput& DeviceI, const InputEventType type
|
||||
void ScreenManager::SetNewScreen( Screen *pNewScreen )
|
||||
{
|
||||
// move CurrentScreen to ScreenToDelete
|
||||
RefreshCreditsMessages();
|
||||
m_ScreensToDelete.Copy( m_ScreenStack );
|
||||
|
||||
m_ScreenStack.RemoveAll();
|
||||
@@ -161,4 +201,20 @@ void ScreenManager::SystemMessage( CString sMessage )
|
||||
LOG->Trace( "WARNING: Didn't find an empty system messages slot." );
|
||||
}
|
||||
|
||||
/*
|
||||
void ScreenManager::OverrideCreditsMessage( PlayerNumber p, CString sNewString )
|
||||
{
|
||||
m_textCreditInfo[p].SetText( sNewString );
|
||||
}
|
||||
*/
|
||||
|
||||
void ScreenManager::RefreshCreditsMessages()
|
||||
{
|
||||
// update joined
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( GAMESTATE->m_bIsJoined[p] ) m_textCreditInfo[p].SetText( "" );
|
||||
else if( GAMESTATE->m_bPlayersCanJoin ) m_textCreditInfo[p].SetText( "PRESS START" );
|
||||
else m_textCreditInfo[p].SetText( "CREDIT(s) 0 / 0" );
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScreenManager
|
||||
|
||||
Desc: Manages the game windows.
|
||||
Desc: Manager/container for Screens.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
@@ -40,6 +40,8 @@ public:
|
||||
|
||||
void SendMessageToTopScreen( ScreenMessage SM, float fDelay );
|
||||
|
||||
// void OverrideCreditsMessage( PlayerNumber p, CString sNewString );
|
||||
void RefreshCreditsMessages();
|
||||
|
||||
private:
|
||||
CArray<Screen*, Screen*&> m_ScreenStack;
|
||||
@@ -47,6 +49,7 @@ private:
|
||||
|
||||
BitmapText m_textFPS;
|
||||
BitmapText m_textSystemMessage;
|
||||
BitmapText m_textCreditInfo[NUM_PLAYERS];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ const CString CREDIT_LINES[] =
|
||||
"PROGRAMMING:",
|
||||
"Chris Danford",
|
||||
"Lord Frieza (Andrew Livy)",
|
||||
"Dro Kulix (Peter S. May)",
|
||||
"Bruno Figueiredo",
|
||||
"Dro Kulix (Peter S. May)",
|
||||
"Mantis (Ben Nordstrom)",
|
||||
"Parasyte (Chris Gomez)",
|
||||
"dirkthedaring (Michael Patterson)",
|
||||
@@ -99,14 +99,16 @@ const CString CREDIT_LINES[] =
|
||||
"Mark 'Foobly' Verrey",
|
||||
"Mandarin Blue",
|
||||
"Anne Kiel",
|
||||
"BeMaNiFiNiNaTiC (Jeremy)",
|
||||
"BeMaNiFiNiNaTiC (Jeremy Hine)",
|
||||
"Garett Sakamoto",
|
||||
"SailorBob",
|
||||
"AngelTK {Kenny Lai}",
|
||||
"Gotetsu",
|
||||
"Illusionz - Issaquah, WA",
|
||||
"Quarters - Kirkland, WA",
|
||||
"Segapark - Bournemouth, UK",
|
||||
"Pier Amusements - Bournemouth, UK",
|
||||
"Westcliff Amusements - Bournemouth, UK",
|
||||
"SailorBob",
|
||||
"Naoki",
|
||||
"Konami Computer Entertainment Japan",
|
||||
"",
|
||||
@@ -128,7 +130,7 @@ ScreenMusicScroll::ScreenMusicScroll()
|
||||
|
||||
int i;
|
||||
|
||||
m_sprBackground.Load( THEME->GetPathTo(GRAPHIC_MUSIC_SCROLL_BACKGROUND) );
|
||||
m_sprBackground.Load( THEME->GetPathTo("Graphics","music scroll background") );
|
||||
m_sprBackground.StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
|
||||
this->AddSubActor( &m_sprBackground );
|
||||
|
||||
@@ -142,7 +144,7 @@ ScreenMusicScroll::ScreenMusicScroll()
|
||||
for( i=0; i<min(arraySongs.GetSize(), MAX_TOTAL_LINES); i++ )
|
||||
{
|
||||
Song* pSong = arraySongs[i];
|
||||
m_textLines[m_iNumLines].Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textLines[m_iNumLines].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textLines[m_iNumLines].SetText( pSong->GetFullTitle() );
|
||||
m_textLines[m_iNumLines].SetDiffuseColor( SONGMAN->GetGroupColor(pSong->m_sGroupName) );
|
||||
|
||||
@@ -151,7 +153,7 @@ ScreenMusicScroll::ScreenMusicScroll()
|
||||
|
||||
for( i=0; i<min(NUM_CREDIT_LINES, MAX_CREDIT_LINES); i++ )
|
||||
{
|
||||
m_textLines[m_iNumLines].Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textLines[m_iNumLines].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textLines[m_iNumLines].SetText( CREDIT_LINES[i] );
|
||||
// this->AddSubActor( &m_textLines[m_iNumLines] );
|
||||
|
||||
@@ -171,24 +173,12 @@ ScreenMusicScroll::ScreenMusicScroll()
|
||||
|
||||
this->AddSubActor( &m_Fade );
|
||||
|
||||
if ( GAMESTATE->m_CurGame != GAME_EZ2 )
|
||||
{
|
||||
m_soundMusic.Load( THEME->GetPathTo(SOUND_MUSIC_SCROLL_MUSIC) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_soundMusic.Load( THEME->GetPathTo(SOUND_MENU_PROMPT) ); // yes, yes, hack hack hack. What can I do huh? re-write thememanager? hahaha.
|
||||
}
|
||||
m_soundMusic.Load( THEME->GetPathTo("Sounds","music scroll music") );
|
||||
m_soundMusic.Play( true );
|
||||
|
||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_MUSIC_SCROLL) );
|
||||
|
||||
m_Fade.OpenWipingRight();
|
||||
if ( GAMESTATE->m_CurGame != GAME_EZ2 )
|
||||
{
|
||||
m_soundMusic.Play( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_soundMusic.Play( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+126
-161
@@ -21,6 +21,7 @@
|
||||
#include "PrefsManager.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "RageLog.h"
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
|
||||
@@ -39,13 +40,13 @@ const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User-5);
|
||||
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User-6);
|
||||
|
||||
|
||||
ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sTopEdgePath )
|
||||
ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sPagePath, CString sTopEdgePath )
|
||||
{
|
||||
LOG->Trace( "ScreenOptions::ScreenOptions()" );
|
||||
|
||||
m_SoundChangeCol.Load( THEME->GetPathTo(SOUND_OPTION_CHANGE_COL) );
|
||||
m_SoundChangeRow.Load( THEME->GetPathTo(SOUND_OPTION_CHANGE_ROW) );
|
||||
m_SoundNext.Load( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
m_SoundChangeCol.Load( THEME->GetPathTo("Sounds","option change col") );
|
||||
m_SoundChangeRow.Load( THEME->GetPathTo("Sounds","option change row") );
|
||||
m_SoundNext.Load( THEME->GetPathTo("Sounds","menu start") );
|
||||
|
||||
m_Menu.Load(
|
||||
sBackgroundPath,
|
||||
@@ -54,40 +55,30 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sTopEdgePath )
|
||||
false, true, 40
|
||||
);
|
||||
this->AddSubActor( &m_Menu );
|
||||
m_Menu.TweenOnScreenFromBlack( SM_None );
|
||||
|
||||
// init row numbers and element colors
|
||||
// add everything to m_framePage so we can animate everything at once
|
||||
this->AddSubActor( &m_framePage );
|
||||
|
||||
m_sprPage.Load( sPagePath );
|
||||
m_sprPage.SetXY( CENTER_X, CENTER_Y );
|
||||
m_framePage.AddSubActor( &m_sprPage );
|
||||
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_iCurrentRow[p] = 0;
|
||||
m_SelectionHighlight[p].SetDiffuseColor( PlayerToColor((PlayerNumber)p) );
|
||||
|
||||
this->AddSubActor( &m_SelectionHighlight[p] );
|
||||
|
||||
for( int l=0; l<MAX_OPTION_LINES; l++ )
|
||||
{
|
||||
m_iSelectedOption[p][l] = 0;
|
||||
|
||||
m_OptionUnderline[p][l].SetDiffuseColor( PlayerToColor(p) );
|
||||
this->AddSubActor( &m_OptionUnderline[p][l] );
|
||||
}
|
||||
}
|
||||
|
||||
// add sub actors
|
||||
for( int i=0; i<MAX_OPTION_LINES; i++ ) // foreach line
|
||||
{
|
||||
this->AddSubActor( &m_textOptionLineTitles[i] );
|
||||
|
||||
for( int j=0; j<MAX_OPTIONS_PER_LINE; j++ )
|
||||
{
|
||||
m_textOptions[i][j].SetZ( -1 );
|
||||
this->AddSubActor( &m_textOptions[i][j] ); // this array has to be big enough to hold all of the options
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_Menu.TweenOnScreenFromBlack( SM_None );
|
||||
m_Wipe.OpenWipingRight(SM_None);
|
||||
this->AddSubActor( &m_Wipe );
|
||||
|
||||
m_framePage.SetX( SCREEN_LEFT-SCREEN_WIDTH );
|
||||
m_framePage.BeginTweening( 0.3f, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_framePage.SetTweenX( 0 );
|
||||
}
|
||||
|
||||
void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNumOptionLines )
|
||||
@@ -101,6 +92,43 @@ void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNu
|
||||
|
||||
|
||||
this->ImportOptions();
|
||||
if( m_InputMode == INPUTMODE_BOTH )
|
||||
{
|
||||
for( int l=0; l<MAX_OPTION_LINES; l++ )
|
||||
m_iSelectedOption[PLAYER_2][l] = m_iSelectedOption[PLAYER_1][l];
|
||||
}
|
||||
|
||||
// init highlights and underlines
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
continue; // skip
|
||||
|
||||
for( int l=0; l<m_iNumOptionLines; l++ )
|
||||
{
|
||||
m_Underline[p][l].Load( (PlayerNumber)p, true );
|
||||
m_framePage.AddSubActor( &m_Underline[p][l] );
|
||||
}
|
||||
|
||||
m_Highlight[p].Load( (PlayerNumber)p, false );
|
||||
m_framePage.AddSubActor( &m_Highlight[p] );
|
||||
|
||||
}
|
||||
|
||||
// init text
|
||||
for( int i=0; i<m_iNumOptionLines; i++ ) // foreach line
|
||||
{
|
||||
m_framePage.AddSubActor( &m_textOptionLineTitles[i] );
|
||||
|
||||
for( int j=0; j<m_OptionLineData[i].iNumOptions; j++ )
|
||||
{
|
||||
m_textOptions[i][j].SetZ( -1 );
|
||||
m_framePage.AddSubActor( &m_textOptions[i][j] ); // this array has to be big enough to hold all of the options
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
InitOptionsText();
|
||||
PositionUnderlines();
|
||||
PositionHighlights();
|
||||
@@ -113,22 +141,14 @@ ScreenOptions::~ScreenOptions()
|
||||
}
|
||||
|
||||
|
||||
const int UNDERLINE_THICKNESS = 3;
|
||||
const int HIGHLIGHT_HEIGHT = 26;
|
||||
|
||||
|
||||
void ScreenOptions::GetWidthXY( PlayerNumber p, int iRow, float &fWidthOut, float &fXOut, float &fYOut )
|
||||
void ScreenOptions::GetWidthXY( PlayerNumber p, int iRow, int &iWidthOut, int &iXOut, int &iYOut )
|
||||
{
|
||||
int iOptionInRow = m_iSelectedOption[p][iRow];
|
||||
BitmapText &option = m_textOptions[iRow][iOptionInRow];
|
||||
|
||||
fWidthOut = option.GetWidestLineWidthInSourcePixels() * option.GetZoomX() + UNDERLINE_THICKNESS*2;
|
||||
fXOut = option.GetX();
|
||||
fYOut = option.GetY();
|
||||
|
||||
// offset so the underlines for each player don't overlap
|
||||
fXOut += p - (NUM_PLAYERS-1)/2.0f * UNDERLINE_THICKNESS * 2;
|
||||
fYOut += p - (NUM_PLAYERS-1)/2.0f * UNDERLINE_THICKNESS * 2;
|
||||
iWidthOut = roundf( option.GetWidestLineWidthInSourcePixels() * option.GetZoomX() );
|
||||
iXOut = roundf( option.GetX() );
|
||||
iYOut = roundf( option.GetY() );
|
||||
}
|
||||
|
||||
void ScreenOptions::InitOptionsText()
|
||||
@@ -144,12 +164,12 @@ void ScreenOptions::InitOptionsText()
|
||||
|
||||
BitmapText &title = m_textOptionLineTitles[i];
|
||||
|
||||
title.Load( THEME->GetPathTo(FONT_HEADER2) );
|
||||
title.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
title.SetText( optline.szTitle );
|
||||
title.SetXY( LABELS_X, fY );
|
||||
title.SetZoom( 0.7f );
|
||||
title.SetVertAlign( Actor::align_middle );
|
||||
this->AddSubActor( &title );
|
||||
m_framePage.AddSubActor( &title );
|
||||
|
||||
// init all text in this line and count the width of the line
|
||||
float fX = ITEMS_START_X; // indent 70 pixels
|
||||
@@ -157,12 +177,12 @@ void ScreenOptions::InitOptionsText()
|
||||
{
|
||||
BitmapText &option = m_textOptions[i][j];
|
||||
|
||||
option.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
option.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
option.SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||
option.SetText( optline.szOptionsText[j] );
|
||||
option.SetZoom( 0.5f );
|
||||
option.SetShadowLength( 2 );
|
||||
this->AddSubActor( &option );
|
||||
m_framePage.AddSubActor( &option );
|
||||
|
||||
// set the XY position of each item in the line
|
||||
float fItemWidth = option.GetWidestLineWidthInSourcePixels() * option.GetZoomX();
|
||||
@@ -171,19 +191,6 @@ void ScreenOptions::InitOptionsText()
|
||||
fX += fItemWidth/2 + ITEM_GAP_X;
|
||||
}
|
||||
}
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach player
|
||||
{
|
||||
if( p > PLAYER_1 && m_InputMode != INPUTMODE_2PLAYERS )
|
||||
continue; // skip
|
||||
|
||||
Quad &highlight = m_SelectionHighlight[p];
|
||||
|
||||
for( int i=0; i<m_iNumOptionLines; i++ ) // foreach options line
|
||||
{
|
||||
Quad &underline = m_OptionUnderline[p][i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenOptions::PositionUnderlines()
|
||||
@@ -191,21 +198,15 @@ void ScreenOptions::PositionUnderlines()
|
||||
// Set the position of the underscores showing the current choice for each option line.
|
||||
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach player
|
||||
{
|
||||
if( p > PLAYER_1 && m_InputMode != INPUTMODE_2PLAYERS )
|
||||
continue; // skip
|
||||
|
||||
for( int i=0; i<m_iNumOptionLines; i++ ) // foreach options line
|
||||
{
|
||||
Quad &underline = m_OptionUnderline[p][i];
|
||||
// Quad &underline = m_OptionUnderline[p][i];
|
||||
OptionsCursor &underline = m_Underline[p][i];
|
||||
|
||||
float fWidth, fX, fY;
|
||||
GetWidthXY( (PlayerNumber)p, i, fWidth, fX, fY );
|
||||
fY += HIGHLIGHT_HEIGHT/2;
|
||||
float fHeight = UNDERLINE_THICKNESS;
|
||||
|
||||
underline.SetZoomX( fWidth );
|
||||
underline.SetZoomY( fHeight );
|
||||
underline.SetXY( fX, fY );
|
||||
int iWidth, iX, iY;
|
||||
GetWidthXY( (PlayerNumber)p, i, iWidth, iX, iY );
|
||||
underline.SetBarWidth( iWidth );
|
||||
underline.SetXY( (float)iX, (float)iY );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,20 +218,14 @@ void ScreenOptions::PositionHighlights()
|
||||
// Set the position of the underscores showing the current choice for each option line.
|
||||
for( int p=0; p<NUM_PLAYERS; p++ ) // foreach player
|
||||
{
|
||||
if( p > PLAYER_1 && m_InputMode != INPUTMODE_2PLAYERS )
|
||||
continue; // skip
|
||||
|
||||
int i=m_iCurrentRow[p];
|
||||
|
||||
Quad &highlight = m_SelectionHighlight[p];
|
||||
OptionsCursor &highlight = m_Highlight[p];
|
||||
|
||||
float fWidth, fX, fY;
|
||||
GetWidthXY( (PlayerNumber)p, i, fWidth, fX, fY );
|
||||
float fHeight = HIGHLIGHT_HEIGHT;
|
||||
|
||||
highlight.SetZoomX( fWidth );
|
||||
highlight.SetZoomY( fHeight );
|
||||
highlight.SetXY( fX, fY );
|
||||
int iWidth, iX, iY;
|
||||
GetWidthXY( (PlayerNumber)p, i, iWidth, iX, iY );
|
||||
highlight.SetBarWidth( iWidth );
|
||||
highlight.SetXY( (float)iX, (float)iY );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,16 +234,13 @@ void ScreenOptions::TweenHighlight( PlayerNumber player_no )
|
||||
// Set the position of the highlight showing the current option the user is changing.
|
||||
int iCurRow = m_iCurrentRow[player_no];
|
||||
|
||||
Quad &highlight = m_SelectionHighlight[player_no];
|
||||
|
||||
float fWidth, fX, fY;
|
||||
GetWidthXY( player_no, iCurRow, fWidth, fX, fY );
|
||||
float fHeight = HIGHLIGHT_HEIGHT;
|
||||
OptionsCursor &highlight = m_Highlight[player_no];
|
||||
|
||||
int iWidth, iX, iY;
|
||||
GetWidthXY( player_no, iCurRow, iWidth, iX, iY );
|
||||
highlight.BeginTweening( 0.2f );
|
||||
highlight.SetTweenZoomX( fWidth );
|
||||
highlight.SetTweenZoomY( fHeight );
|
||||
highlight.SetTweenXY( fX, fY );
|
||||
highlight.TweenBarWidth( iWidth );
|
||||
highlight.SetTweenXY( (float)iX, (float)iY );
|
||||
}
|
||||
|
||||
void ScreenOptions::Update( float fDeltaTime )
|
||||
@@ -317,109 +309,82 @@ void ScreenOptions::MenuStart( const PlayerNumber p )
|
||||
|
||||
m_SoundNext.PlayRandom();
|
||||
m_Wipe.CloseWipingRight( SM_GoToNextState );
|
||||
|
||||
m_framePage.BeginTweening( 0.3f, Actor::TWEEN_BIAS_END );
|
||||
m_framePage.SetTweenX( SCREEN_RIGHT );
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuLeft( const PlayerNumber p )
|
||||
void ScreenOptions::MenuLeft( const PlayerNumber pn )
|
||||
{
|
||||
PlayerNumber pn = p;
|
||||
|
||||
switch( m_InputMode )
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
case INPUTMODE_P1_ONLY:
|
||||
if( pn != PLAYER_1 )
|
||||
if( m_InputMode == INPUTMODE_PLAYERS && p != pn )
|
||||
continue; // skip
|
||||
|
||||
int iCurRow = m_iCurrentRow[p];
|
||||
if( m_iSelectedOption[p][iCurRow] == 0 ) // can't go left any more
|
||||
return;
|
||||
case INPUTMODE_BOTH:
|
||||
pn = PLAYER_1;
|
||||
break;
|
||||
case INPUTMODE_2PLAYERS:
|
||||
break; // fall through
|
||||
|
||||
m_iSelectedOption[p][iCurRow]--;
|
||||
|
||||
TweenHighlight( (PlayerNumber)p );
|
||||
}
|
||||
|
||||
int iCurRow = m_iCurrentRow[pn];
|
||||
if( m_iSelectedOption[pn][iCurRow] == 0 ) // can't go left any more
|
||||
return;
|
||||
|
||||
m_SoundChangeCol.PlayRandom();
|
||||
m_iSelectedOption[pn][iCurRow]--;
|
||||
|
||||
TweenHighlight( pn );
|
||||
OnChange();
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuRight( const PlayerNumber p )
|
||||
void ScreenOptions::MenuRight( const PlayerNumber pn )
|
||||
{
|
||||
PlayerNumber pn = p;
|
||||
|
||||
switch( m_InputMode )
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
case INPUTMODE_P1_ONLY:
|
||||
if( pn != PLAYER_1 )
|
||||
if( m_InputMode == INPUTMODE_PLAYERS && p != pn )
|
||||
continue; // skip
|
||||
|
||||
int iCurRow = m_iCurrentRow[p];
|
||||
if( m_iSelectedOption[p][iCurRow] == m_OptionLineData[iCurRow].iNumOptions-1 ) // can't go right any more
|
||||
return;
|
||||
case INPUTMODE_BOTH:
|
||||
pn = PLAYER_1;
|
||||
break;
|
||||
case INPUTMODE_2PLAYERS:
|
||||
break; // fall through
|
||||
|
||||
m_iSelectedOption[p][iCurRow]++;
|
||||
|
||||
TweenHighlight( (PlayerNumber)p );
|
||||
}
|
||||
|
||||
int iCurRow = m_iCurrentRow[pn];
|
||||
if( m_iSelectedOption[pn][iCurRow] == m_OptionLineData[iCurRow].iNumOptions-1 ) // can't go right any more
|
||||
return;
|
||||
|
||||
m_SoundChangeCol.PlayRandom();
|
||||
m_iSelectedOption[pn][iCurRow]++;
|
||||
|
||||
TweenHighlight( pn );
|
||||
OnChange();
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuUp( const PlayerNumber p )
|
||||
void ScreenOptions::MenuUp( const PlayerNumber pn )
|
||||
{
|
||||
PlayerNumber pn = p;
|
||||
|
||||
switch( m_InputMode )
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
case INPUTMODE_P1_ONLY:
|
||||
return;
|
||||
case INPUTMODE_BOTH:
|
||||
pn = PLAYER_1;
|
||||
break;
|
||||
case INPUTMODE_2PLAYERS:
|
||||
break; // fall through
|
||||
}
|
||||
if( m_InputMode == INPUTMODE_PLAYERS && p != pn )
|
||||
continue; // skip
|
||||
|
||||
if( m_iCurrentRow[p] == 0 )
|
||||
m_iCurrentRow[p] = m_iNumOptionLines-1; // wrap around
|
||||
else
|
||||
m_iCurrentRow[p]--;
|
||||
|
||||
TweenHighlight( (PlayerNumber)p );
|
||||
}
|
||||
m_SoundChangeRow.PlayRandom();
|
||||
if( m_iCurrentRow[pn] == 0 )
|
||||
m_iCurrentRow[pn] = m_iNumOptionLines-1; // wrap around
|
||||
else
|
||||
m_iCurrentRow[pn]--;
|
||||
|
||||
TweenHighlight( pn );
|
||||
OnChange();
|
||||
}
|
||||
|
||||
void ScreenOptions::MenuDown( const PlayerNumber p )
|
||||
void ScreenOptions::MenuDown( const PlayerNumber pn )
|
||||
{
|
||||
PlayerNumber pn = p;
|
||||
|
||||
switch( m_InputMode )
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
case INPUTMODE_P1_ONLY:
|
||||
return;
|
||||
case INPUTMODE_BOTH:
|
||||
pn = PLAYER_1;
|
||||
break;
|
||||
case INPUTMODE_2PLAYERS:
|
||||
break; // fall through
|
||||
if( m_InputMode == INPUTMODE_PLAYERS && p != pn )
|
||||
continue; // skip
|
||||
|
||||
if( m_iCurrentRow[p] == m_iNumOptionLines-1 )
|
||||
m_iCurrentRow[p] = 0; // wrap around
|
||||
else
|
||||
m_iCurrentRow[p]++;
|
||||
|
||||
TweenHighlight( (PlayerNumber)p );
|
||||
}
|
||||
|
||||
m_SoundChangeRow.PlayRandom();
|
||||
if( m_iCurrentRow[pn] == m_iNumOptionLines-1 )
|
||||
m_iCurrentRow[pn] = 0; // wrap around
|
||||
else
|
||||
m_iCurrentRow[pn]++;
|
||||
|
||||
TweenHighlight( pn );
|
||||
OnChange();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "TransitionInvisible.h"
|
||||
#include "Quad.h"
|
||||
#include "MenuElements.h"
|
||||
#include "OptionsCursor.h"
|
||||
|
||||
|
||||
const int MAX_OPTION_LINES = 20;
|
||||
@@ -31,13 +32,17 @@ struct OptionLineData {
|
||||
char szOptionsText[MAX_OPTIONS_PER_LINE][60];
|
||||
};
|
||||
|
||||
enum InputMode { INPUTMODE_P1_ONLY, INPUTMODE_2PLAYERS, INPUTMODE_BOTH }; // both means both players control the same cursor
|
||||
enum InputMode
|
||||
{
|
||||
INPUTMODE_PLAYERS, // each player controls their own cursor
|
||||
INPUTMODE_BOTH // both players control the same cursor
|
||||
};
|
||||
|
||||
|
||||
class ScreenOptions : public Screen
|
||||
{
|
||||
public:
|
||||
ScreenOptions( CString sBackgroundPath, CString sTopEdgePath );
|
||||
ScreenOptions( CString sBackgroundPath, CString sPagePath, CString sTopEdgePath );
|
||||
void Init( InputMode im, OptionLineData optionLineData[], int iNumOptionLines );
|
||||
virtual ~ScreenOptions();
|
||||
virtual void Update( float fDeltaTime );
|
||||
@@ -49,7 +54,7 @@ protected:
|
||||
virtual void ImportOptions() = 0;
|
||||
virtual void ExportOptions() = 0;
|
||||
void InitOptionsText();
|
||||
void GetWidthXY( PlayerNumber p, int iRow, float &fWidthOut, float &fXOut, float &fYOut );
|
||||
void GetWidthXY( PlayerNumber p, int iRow, int &iWidthOut, int &iXOut, int &iYOut );
|
||||
void PositionUnderlines();
|
||||
void PositionHighlights();
|
||||
void TweenHighlight( PlayerNumber player_no );
|
||||
@@ -66,25 +71,30 @@ protected:
|
||||
void MenuUp( const PlayerNumber p );
|
||||
void MenuDown( const PlayerNumber p );
|
||||
|
||||
InputMode m_InputMode;
|
||||
InputMode m_InputMode;
|
||||
|
||||
OptionLineData* m_OptionLineData;
|
||||
int m_iNumOptionLines;
|
||||
int m_iNumOptionLines;
|
||||
|
||||
MenuElements m_Menu;
|
||||
MenuElements m_Menu;
|
||||
|
||||
BitmapText m_textOptionLineTitles[MAX_OPTION_LINES];
|
||||
BitmapText m_textOptions[MAX_OPTION_LINES][MAX_OPTIONS_PER_LINE]; // this array has to be big enough to hold all of the options
|
||||
ActorFrame m_framePage;
|
||||
Sprite m_sprPage;
|
||||
BitmapText m_textOptionLineTitles[MAX_OPTION_LINES];
|
||||
BitmapText m_textOptions[MAX_OPTION_LINES][MAX_OPTIONS_PER_LINE]; // this array has to be big enough to hold all of the options
|
||||
|
||||
int m_iSelectedOption[NUM_PLAYERS][MAX_OPTION_LINES];
|
||||
int m_iCurrentRow[NUM_PLAYERS];
|
||||
|
||||
Quad m_OptionUnderline[NUM_PLAYERS][MAX_OPTION_LINES];
|
||||
Quad m_SelectionHighlight[NUM_PLAYERS];
|
||||
// Quad m_OptionUnderline[NUM_PLAYERS][MAX_OPTION_LINES];
|
||||
// Quad m_SelectionHighlight[NUM_PLAYERS];
|
||||
|
||||
RandomSample m_SoundChangeCol;
|
||||
RandomSample m_SoundChangeRow;
|
||||
RandomSample m_SoundNext;
|
||||
OptionsCursor m_Underline[NUM_PLAYERS][MAX_OPTION_LINES];
|
||||
OptionsCursor m_Highlight[NUM_PLAYERS];
|
||||
|
||||
RandomSample m_SoundChangeCol;
|
||||
RandomSample m_SoundChangeRow;
|
||||
RandomSample m_SoundNext;
|
||||
|
||||
TransitionInvisible m_Wipe;
|
||||
};
|
||||
|
||||
@@ -53,14 +53,15 @@ OptionLineData g_PlayerOptionsLines[NUM_PLAYER_OPTIONS_LINES] = {
|
||||
|
||||
ScreenPlayerOptions::ScreenPlayerOptions() :
|
||||
ScreenOptions(
|
||||
THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_BACKGROUND),
|
||||
THEME->GetPathTo(GRAPHIC_PLAYER_OPTIONS_TOP_EDGE)
|
||||
THEME->GetPathTo("Graphics","player options background"),
|
||||
THEME->GetPathTo("Graphics","player options page"),
|
||||
THEME->GetPathTo("Graphics","player options top edge")
|
||||
)
|
||||
{
|
||||
LOG->Trace( "ScreenPlayerOptions::ScreenPlayerOptions()" );
|
||||
|
||||
Init(
|
||||
INPUTMODE_2PLAYERS,
|
||||
INPUTMODE_PLAYERS,
|
||||
g_PlayerOptionsLines,
|
||||
NUM_PLAYER_OPTIONS_LINES
|
||||
);
|
||||
|
||||
@@ -41,7 +41,7 @@ ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, Prompt
|
||||
m_Fade.CloseWipingRight();
|
||||
this->AddSubActor( &m_Fade );
|
||||
|
||||
m_textQuestion.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_textQuestion.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textQuestion.SetText( sText );
|
||||
m_textQuestion.SetXY( QUESTION_X, QUESTION_Y );
|
||||
this->AddSubActor( &m_textQuestion );
|
||||
@@ -49,8 +49,8 @@ ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, Prompt
|
||||
m_rectAnswerBox.SetDiffuseColor( D3DXCOLOR(0.5f,0.5f,1.0f,0.7f) );
|
||||
this->AddSubActor( &m_rectAnswerBox );
|
||||
|
||||
m_textAnswer[0].Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textAnswer[1].Load( THEME->GetPathTo(FONT_HEADER1) );
|
||||
m_textAnswer[0].LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textAnswer[1].LoadFromFont( THEME->GetPathTo("Fonts","header1") );
|
||||
m_textAnswer[0].SetY( PROMPT_Y );
|
||||
m_textAnswer[1].SetY( PROMPT_Y );
|
||||
this->AddSubActor( &m_textAnswer[0] );
|
||||
@@ -77,6 +77,8 @@ ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, Prompt
|
||||
m_rectAnswerBox.SetZoomY( 30 );
|
||||
|
||||
m_textAnswer[m_bAnswer].SetEffectGlowing();
|
||||
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu prompt") );
|
||||
}
|
||||
|
||||
void ScreenPrompt::Update( float fDeltaTime )
|
||||
@@ -134,7 +136,7 @@ void ScreenPrompt::MenuRight( const PlayerNumber p )
|
||||
m_rectAnswerBox.SetTweenXY( m_textAnswer[m_bAnswer].GetX(), m_textAnswer[m_bAnswer].GetY() );
|
||||
m_rectAnswerBox.SetTweenZoomX( m_textAnswer[m_bAnswer].GetWidestLineWidthInSourcePixels()+10.0f );
|
||||
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_EDIT_CHANGE_LINE) );
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","edit change line") );
|
||||
}
|
||||
|
||||
void ScreenPrompt::MenuStart( const PlayerNumber p )
|
||||
@@ -154,7 +156,7 @@ void ScreenPrompt::MenuStart( const PlayerNumber p )
|
||||
m_textAnswer[1].BeginTweening( 0.2f );
|
||||
m_textAnswer[1].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu start") );
|
||||
|
||||
if( m_bAnswer )
|
||||
m_pOnYes();
|
||||
|
||||
@@ -22,26 +22,18 @@
|
||||
|
||||
ScreenSandbox::ScreenSandbox()
|
||||
{
|
||||
// m_text.Load( THEME->GetPathTo(FONT_NORMAL) );
|
||||
m_text.SetXY( CENTER_X, CENTER_Y );
|
||||
CStringArray as;
|
||||
as.Add( "Testing... Attention please." );
|
||||
m_text.SetTips( as );
|
||||
m_text.SetXY( CENTER_X, CENTER_Y );
|
||||
this->AddSubActor( &m_text );
|
||||
m_spr.Load( THEME->GetPathTo("Graphics","title menu logo game 0") );
|
||||
m_spr.SetXY( CENTER_X, CENTER_Y );
|
||||
this->AddSubActor( &m_spr );
|
||||
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_STYLE_BACKGROUND),
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_STYLE_TOP_EDGE),
|
||||
ssprintf("Use %c %c to select, then press START", char(1), char(2) ),
|
||||
false, true, 40
|
||||
);
|
||||
this->AddSubActor( &m_Menu );
|
||||
m_Menu.TweenOnScreenFromBlack( SM_None );
|
||||
|
||||
m_sound.Load( THEME->GetPathTo(SOUND_MENU_MUSIC) );
|
||||
m_sound.SetPositionSeconds( -10 );
|
||||
m_sound.Play();
|
||||
// m_Menu.Load(
|
||||
// THEME->GetPathTo(GRAPHIC_SELECT_STYLE_BACKGROUND),
|
||||
// THEME->GetPathTo(GRAPHIC_SELECT_STYLE_TOP_EDGE),
|
||||
// ssprintf("Use %c %c to select, then press START", char(1), char(2) ),
|
||||
// false, true, 40
|
||||
// );
|
||||
// this->AddSubActor( &m_Menu );
|
||||
// m_Menu.TweenOnScreenFromBlack( SM_None );
|
||||
|
||||
//this->AddSubActor( &m_spr );
|
||||
}
|
||||
@@ -50,14 +42,11 @@ ScreenSandbox::ScreenSandbox()
|
||||
void ScreenSandbox::Update( float fDeltaTime )
|
||||
{
|
||||
Screen::Update( fDeltaTime );
|
||||
m_sound.Update( fDeltaTime );
|
||||
}
|
||||
|
||||
void ScreenSandbox::DrawPrimitives()
|
||||
{
|
||||
m_Menu.DrawBottomLayer();
|
||||
Screen::DrawPrimitives();
|
||||
m_Menu.DrawTopLayer();
|
||||
}
|
||||
|
||||
void ScreenSandbox::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
||||
|
||||
@@ -30,8 +30,6 @@ public:
|
||||
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
TipDisplay m_text;
|
||||
MenuElements m_Menu;
|
||||
RageSoundStream m_sound;
|
||||
Sprite m_spr;
|
||||
};
|
||||
|
||||
|
||||
@@ -55,18 +55,18 @@ ScreenSelectCourse::ScreenSelectCourse()
|
||||
{
|
||||
LOG->Trace( "ScreenSelectCourse::ScreenSelectCourse()" );
|
||||
|
||||
if( !MUSIC->IsPlaying() )
|
||||
if( !MUSIC->IsPlaying() || MUSIC->GetLoadedFilePath() != THEME->GetPathTo("Sounds","select course music") )
|
||||
{
|
||||
MUSIC->Load( THEME->GetPathTo(SOUND_MENU_MUSIC) );
|
||||
MUSIC->Play(true);
|
||||
MUSIC->Load( THEME->GetPathTo("Sounds","select course music") );
|
||||
MUSIC->Play( true );
|
||||
}
|
||||
|
||||
m_bMadeChoice = false;
|
||||
m_bGoToOptions = false;
|
||||
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_COURSE_BACKGROUND),
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_COURSE_TOP_EDGE),
|
||||
THEME->GetPathTo("Graphics","select course background"),
|
||||
THEME->GetPathTo("Graphics","select course top edge"),
|
||||
ssprintf("%c or %c change course then press START", char(1), char(2)),
|
||||
false, true, 60
|
||||
);
|
||||
@@ -81,7 +81,7 @@ ScreenSelectCourse::ScreenSelectCourse()
|
||||
m_MusicWheel.SetXY( WHEEL_X, WHEEL_Y );
|
||||
this->AddSubActor( &m_MusicWheel );
|
||||
|
||||
m_textHoldForOptions.Load( THEME->GetPathTo(FONT_STAGE) );
|
||||
m_textHoldForOptions.LoadFromFont( THEME->GetPathTo("Fonts","Stage") );
|
||||
m_textHoldForOptions.SetXY( CENTER_X, CENTER_Y );
|
||||
m_textHoldForOptions.SetText( "press START again for options" );
|
||||
m_textHoldForOptions.SetZoom( 1 );
|
||||
@@ -90,8 +90,8 @@ ScreenSelectCourse::ScreenSelectCourse()
|
||||
this->AddSubActor( &m_textHoldForOptions );
|
||||
|
||||
|
||||
m_soundSelect.Load( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
m_soundChangeNotes.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_CHANGE_NOTES) );
|
||||
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
|
||||
m_soundChangeNotes.Load( THEME->GetPathTo("Sounds","select music change notes") );
|
||||
|
||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_COURSE_INTRO) );
|
||||
|
||||
@@ -154,7 +154,7 @@ void ScreenSelectCourse::Input( const DeviceInput& DeviceI, const InputEventType
|
||||
{
|
||||
m_bGoToOptions = true;
|
||||
m_textHoldForOptions.SetText( "Entering Options..." );
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu start") );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "ScreenSelectDifficulty.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "PrefsManager.h"
|
||||
@@ -24,54 +23,103 @@
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
const float MORE_ARROWS_X[NUM_PAGES] = { SCREEN_RIGHT-60, SCREEN_WIDTH + SCREEN_LEFT+60};
|
||||
const float MORE_ARROWS_Y[NUM_PAGES] = { CENTER_Y-150, CENTER_Y-150 };
|
||||
const float EXPLANATION_X[NUM_PAGES] = { CENTER_X - 150, SCREEN_WIDTH + CENTER_X + 150 };
|
||||
const float EXPLANATION_Y[NUM_PAGES] = { CENTER_Y - 170, CENTER_Y - 170 };
|
||||
const float EXPLANATION_OFF_SCREEN_X[NUM_PAGES] = { EXPLANATION_X[0]-400, EXPLANATION_X[1]+400 };
|
||||
const float EXPLANATION_OFF_SCREEN_Y[NUM_PAGES] = { EXPLANATION_Y[0], EXPLANATION_Y[1] };
|
||||
|
||||
const float DIFFICULTY_ITEM_X[NUM_DIFFICULTY_ITEMS] = {
|
||||
CENTER_X-200, // easy
|
||||
CENTER_X, // medium
|
||||
CENTER_X+200, // hard
|
||||
SCREEN_WIDTH+CENTER_X-100, // Oni, page 2
|
||||
SCREEN_WIDTH+CENTER_X+100, // Endless, page 2
|
||||
};
|
||||
// these sprites are bottom aligned!
|
||||
const float DIFFICULTY_ITEM_Y[NUM_DIFFICULTY_ITEMS] = {
|
||||
CENTER_Y-40,
|
||||
CENTER_Y-60,
|
||||
CENTER_Y-40,
|
||||
CENTER_Y-60,
|
||||
CENTER_Y-60,
|
||||
};
|
||||
|
||||
const float DIFFICULTY_ARROW_Y[NUM_DIFFICULTY_ITEMS] = {
|
||||
DIFFICULTY_ITEM_Y[0]+205,
|
||||
DIFFICULTY_ITEM_Y[1]+205,
|
||||
DIFFICULTY_ITEM_Y[2]+205,
|
||||
DIFFICULTY_ITEM_Y[3]+205,
|
||||
DIFFICULTY_ITEM_Y[4]+205,
|
||||
};
|
||||
const float DIFFICULTY_ARROW_X[NUM_DIFFICULTY_ITEMS][NUM_PLAYERS] = {
|
||||
{ DIFFICULTY_ITEM_X[0]-40, DIFFICULTY_ITEM_X[0]+40 },
|
||||
{ DIFFICULTY_ITEM_X[1]-40, DIFFICULTY_ITEM_X[1]+40 },
|
||||
{ DIFFICULTY_ITEM_X[2]-40, DIFFICULTY_ITEM_X[2]+40 },
|
||||
{ DIFFICULTY_ITEM_X[3]-40, DIFFICULTY_ITEM_X[3]+40 },
|
||||
{ DIFFICULTY_ITEM_X[4]-40, DIFFICULTY_ITEM_X[4]+40 },
|
||||
};
|
||||
|
||||
|
||||
const float ARROW_SHADOW_OFFSET = 10;
|
||||
|
||||
const float LOCK_INPUT_TIME = 0.30f; // lock input while waiting for tweening to complete
|
||||
|
||||
|
||||
const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User + 1);
|
||||
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 2);
|
||||
const ScreenMessage SM_StartTweeningOffScreen = ScreenMessage(SM_User + 3);
|
||||
const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 4);
|
||||
#define MORE_PAGE1_X THEME->GetMetricF("SelectDifficulty","MorePage1X")
|
||||
#define MORE_PAGE1_Y THEME->GetMetricF("SelectDifficulty","MorePage1Y")
|
||||
#define MORE_PAGE2_X THEME->GetMetricF("SelectDifficulty","MorePage2X")
|
||||
#define MORE_PAGE2_Y THEME->GetMetricF("SelectDifficulty","MorePage2Y")
|
||||
#define EXPLANATION_PAGE1_X THEME->GetMetricF("SelectDifficulty","ExplanationPage1X")
|
||||
#define EXPLANATION_PAGE1_Y THEME->GetMetricF("SelectDifficulty","ExplanationPage1Y")
|
||||
#define EXPLANATION_PAGE2_X THEME->GetMetricF("SelectDifficulty","ExplanationPage2X")
|
||||
#define EXPLANATION_PAGE2_Y THEME->GetMetricF("SelectDifficulty","ExplanationPage2Y")
|
||||
#define EASY_X THEME->GetMetricF("SelectDifficulty","EasyX")
|
||||
#define EASY_Y THEME->GetMetricF("SelectDifficulty","EasyY")
|
||||
#define MEDIUM_X THEME->GetMetricF("SelectDifficulty","MediumX")
|
||||
#define MEDIUM_Y THEME->GetMetricF("SelectDifficulty","MediumY")
|
||||
#define HARD_X THEME->GetMetricF("SelectDifficulty","HardX")
|
||||
#define HARD_Y THEME->GetMetricF("SelectDifficulty","HardY")
|
||||
#define ONI_X THEME->GetMetricF("SelectDifficulty","OniX")
|
||||
#define ONI_Y THEME->GetMetricF("SelectDifficulty","OniY")
|
||||
#define ENDLESS_X THEME->GetMetricF("SelectDifficulty","EndlessX")
|
||||
#define ENDLESS_Y THEME->GetMetricF("SelectDifficulty","EndlessY")
|
||||
#define ARROW_OFFSET_P1_X THEME->GetMetricF("SelectDifficulty","ArrowOffsetP1X")
|
||||
#define ARROW_OFFSET_P1_Y THEME->GetMetricF("SelectDifficulty","ArrowOffsetP1Y")
|
||||
#define ARROW_OFFSET_P2_X THEME->GetMetricF("SelectDifficulty","ArrowOffsetP2X")
|
||||
#define ARROW_OFFSET_P2_Y THEME->GetMetricF("SelectDifficulty","ArrowOffsetP2Y")
|
||||
#define ARROW_SHADOW_LENGTH_X THEME->GetMetricF("SelectDifficulty","ArrowShadowLengthX")
|
||||
#define ARROW_SHADOW_LENGTH_Y THEME->GetMetricF("SelectDifficulty","ArrowShadowLengthY")
|
||||
|
||||
|
||||
float MORE_X( int iIndex ) {
|
||||
switch( iIndex ) {
|
||||
case 0: return MORE_PAGE1_X;
|
||||
case 1: return MORE_PAGE2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float MORE_Y( int iIndex ) {
|
||||
switch( iIndex ) {
|
||||
case 0: return MORE_PAGE1_Y;
|
||||
case 1: return MORE_PAGE2_Y;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float EXPLANATION_X( int iIndex ) {
|
||||
switch( iIndex ) {
|
||||
case 0: return EXPLANATION_PAGE1_X;
|
||||
case 1: return EXPLANATION_PAGE2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float EXPLANATION_Y( int iIndex ) {
|
||||
switch( iIndex ) {
|
||||
case 0: return EXPLANATION_PAGE1_Y;
|
||||
case 1: return EXPLANATION_PAGE2_Y;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float ITEM_X( int iItemIndex ) {
|
||||
switch( iItemIndex ) {
|
||||
case 0: return EASY_X;
|
||||
case 1: return MEDIUM_X;
|
||||
case 2: return HARD_X;
|
||||
case 3: return ONI_X;
|
||||
case 4: return ENDLESS_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float ITEM_Y( int iItemIndex ) {
|
||||
switch( iItemIndex ) {
|
||||
case 0: return EASY_Y;
|
||||
case 1: return MEDIUM_Y;
|
||||
case 2: return HARD_Y;
|
||||
case 3: return ONI_Y;
|
||||
case 4: return ENDLESS_Y;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float ARROW_X( int iItemIndex, int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return ITEM_X(iItemIndex) + ARROW_OFFSET_P1_X;
|
||||
case PLAYER_2: return ITEM_X(iItemIndex) + ARROW_OFFSET_P2_X;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
float ARROW_Y( int iItemIndex, int p ) {
|
||||
switch( p ) {
|
||||
case PLAYER_1: return ITEM_Y(iItemIndex) + ARROW_OFFSET_P1_Y;
|
||||
case PLAYER_2: return ITEM_Y(iItemIndex) + ARROW_OFFSET_P2_Y;
|
||||
default: ASSERT(0); return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User + 1);
|
||||
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 2);
|
||||
const ScreenMessage SM_StartTweeningOffScreen = ScreenMessage(SM_User + 3);
|
||||
const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 4);
|
||||
|
||||
|
||||
ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
@@ -80,13 +128,14 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
|
||||
// Reset the current PlayMode
|
||||
GAMESTATE->m_PlayMode = PLAY_MODE_INVALID;
|
||||
GAMESTATE->m_bPlayersCanJoin = false;
|
||||
|
||||
|
||||
int p;
|
||||
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_BACKGROUND) ,
|
||||
THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_TOP_EDGE),
|
||||
THEME->GetPathTo("Graphics","select difficulty background"),
|
||||
THEME->GetPathTo("Graphics","select difficulty top edge"),
|
||||
ssprintf("Use %c %c to select, then press START", char(1), char(2)),
|
||||
false, true, 40
|
||||
);
|
||||
@@ -95,24 +144,24 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
|
||||
for( int d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
|
||||
{
|
||||
ThemeElement te_header;
|
||||
ThemeElement te_picture;
|
||||
CString sHeaderFile;
|
||||
CString sPictureFile;
|
||||
switch( d )
|
||||
{
|
||||
case 0: te_header = GRAPHIC_SELECT_DIFFICULTY_EASY_HEADER; te_picture = GRAPHIC_SELECT_DIFFICULTY_EASY_PICTURE; break;
|
||||
case 1: te_header = GRAPHIC_SELECT_DIFFICULTY_MEDIUM_HEADER; te_picture = GRAPHIC_SELECT_DIFFICULTY_MEDIUM_PICTURE; break;
|
||||
case 2: te_header = GRAPHIC_SELECT_DIFFICULTY_HARD_HEADER; te_picture = GRAPHIC_SELECT_DIFFICULTY_HARD_PICTURE; break;
|
||||
case 3: te_header = GRAPHIC_SELECT_DIFFICULTY_ONI_HEADER; te_picture = GRAPHIC_SELECT_DIFFICULTY_ONI_PICTURE; break;
|
||||
case 4: te_header = GRAPHIC_SELECT_DIFFICULTY_ENDLESS_HEADER; te_picture = GRAPHIC_SELECT_DIFFICULTY_ENDLESS_PICTURE; break;
|
||||
case 0: sHeaderFile = "select difficulty easy header"; sPictureFile = "select difficulty easy picture"; break;
|
||||
case 1: sHeaderFile = "select difficulty medium header"; sPictureFile = "select difficulty medium picture"; break;
|
||||
case 2: sHeaderFile = "select difficulty hard header"; sPictureFile = "select difficulty hard picture"; break;
|
||||
case 3: sHeaderFile = "select difficulty oni header"; sPictureFile = "select difficulty oni picture"; break;
|
||||
case 4: sHeaderFile = "select difficulty endless header"; sPictureFile = "select difficulty endless picture"; break;
|
||||
}
|
||||
m_sprPicture[d].Load( THEME->GetPathTo(te_picture) );
|
||||
m_sprPicture[d].SetXY( DIFFICULTY_ITEM_X[d], DIFFICULTY_ITEM_Y[d] );
|
||||
m_sprPicture[d].Load( THEME->GetPathTo("Graphics",sPictureFile) );
|
||||
m_sprPicture[d].SetXY( ITEM_X(d), ITEM_Y(d) );
|
||||
m_sprPicture[d].SetVertAlign( align_bottom );
|
||||
m_sprPicture[d].TurnShadowOff();
|
||||
m_framePages.AddSubActor( &m_sprPicture[d] );
|
||||
|
||||
m_sprHeader[d].Load( THEME->GetPathTo(te_header) );
|
||||
m_sprHeader[d].SetXY( DIFFICULTY_ITEM_X[d], DIFFICULTY_ITEM_Y[d] );
|
||||
m_sprHeader[d].Load( THEME->GetPathTo("Graphics",sHeaderFile) );
|
||||
m_sprHeader[d].SetXY( ITEM_X(d), ITEM_Y(d) );
|
||||
m_sprHeader[d].SetVertAlign( align_top );
|
||||
m_sprHeader[d].TurnShadowOff();
|
||||
m_framePages.AddSubActor( &m_sprHeader[d] );
|
||||
@@ -120,12 +169,12 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
|
||||
for( p=0; p<NUM_PAGES; p++ )
|
||||
{
|
||||
m_sprMoreArrows[p].Load( THEME->GetPathTo( p==0 ? GRAPHIC_ARROWS_RIGHT : GRAPHIC_ARROWS_LEFT ) );
|
||||
m_sprMoreArrows[p].SetXY( MORE_ARROWS_X[p], MORE_ARROWS_Y[p] );
|
||||
m_sprMoreArrows[p].Load( THEME->GetPathTo("Graphics", p==0 ? "select difficulty more page1" : "select difficulty more page2" ) );
|
||||
m_sprMoreArrows[p].SetXY( MORE_X(p), MORE_Y(p) );
|
||||
m_framePages.AddSubActor( &m_sprMoreArrows[p] );
|
||||
|
||||
m_sprExplanation[p].Load( THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_EXPLANATION) );
|
||||
m_sprExplanation[p].SetXY( EXPLANATION_X[p], EXPLANATION_Y[p] );
|
||||
m_sprExplanation[p].Load( THEME->GetPathTo("Graphics", "select difficulty explanation") );
|
||||
m_sprExplanation[p].SetXY( EXPLANATION_X(p), EXPLANATION_Y(p) );
|
||||
m_sprExplanation[p].StopAnimating();
|
||||
m_sprExplanation[p].SetState( p );
|
||||
m_framePages.AddSubActor( &m_sprExplanation[p] );
|
||||
@@ -140,14 +189,14 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
|
||||
continue;
|
||||
|
||||
m_sprArrowShadow[p].Load( THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_ARROWS) );
|
||||
m_sprArrowShadow[p].Load( THEME->GetPathTo("Graphics", "select difficulty arrows") );
|
||||
m_sprArrowShadow[p].StopAnimating();
|
||||
m_sprArrowShadow[p].SetState( p );
|
||||
m_sprArrowShadow[p].TurnShadowOff();
|
||||
m_sprArrowShadow[p].SetDiffuseColor( D3DXCOLOR(0,0,0,0.6f) );
|
||||
m_framePages.AddSubActor( &m_sprArrowShadow[p] );
|
||||
|
||||
m_sprArrow[p].Load( THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_ARROWS) );
|
||||
m_sprArrow[p].Load( THEME->GetPathTo("Graphics", "select difficulty arrows") );
|
||||
m_sprArrow[p].StopAnimating();
|
||||
m_sprArrow[p].SetState( p );
|
||||
m_sprArrow[p].TurnShadowOff();
|
||||
@@ -155,29 +204,28 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
m_sprArrow[p].SetEffectGlowing();
|
||||
m_framePages.AddSubActor( &m_sprArrow[p] );
|
||||
|
||||
m_sprOK[p].Load( THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_OK) );
|
||||
m_sprOK[p].Load( THEME->GetPathTo("Graphics", "select difficulty ok") );
|
||||
m_framePages.AddSubActor( &m_sprOK[p] );
|
||||
}
|
||||
|
||||
this->AddSubActor( &m_framePages );
|
||||
|
||||
m_soundChange.Load( THEME->GetPathTo(SOUND_SELECT_DIFFICULTY_CHANGE) );
|
||||
m_soundSelect.Load( THEME->GetPathTo(SOUND_MENU_START) );
|
||||
m_soundChange.Load( THEME->GetPathTo("Sounds", "select difficulty change") );
|
||||
m_soundSelect.Load( THEME->GetPathTo("Sounds", "menu start") );
|
||||
|
||||
m_bPlayedChallengeSound = false;
|
||||
|
||||
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_INTRO) );
|
||||
|
||||
|
||||
if( !MUSIC->IsPlaying() )
|
||||
{
|
||||
MUSIC->Load( THEME->GetPathTo(SOUND_MENU_MUSIC) );
|
||||
MUSIC->Play( true );
|
||||
}
|
||||
|
||||
m_Menu.TweenOnScreenFromMenu( SM_None );
|
||||
TweenOnScreen();
|
||||
|
||||
if( !MUSIC->IsPlaying() || MUSIC->GetLoadedFilePath() != THEME->GetPathTo("Sounds","select difficulty music") )
|
||||
{
|
||||
MUSIC->Load( THEME->GetPathTo("Sounds","select difficulty music") );
|
||||
MUSIC->Play( true );
|
||||
}
|
||||
|
||||
m_fLockInputTime = LOCK_INPUT_TIME;
|
||||
}
|
||||
|
||||
@@ -352,12 +400,12 @@ void ScreenSelectDifficulty::ChangeTo( const PlayerNumber pn, int iSelectionWas,
|
||||
if( bSelectedSomethingOnPage2 || bChangedPagesFrom2To1 || p==pn )
|
||||
{
|
||||
m_sprArrow[p].BeginTweening( 0.2f, bChangedPages ? TWEEN_LINEAR : TWEEN_BIAS_BEGIN );
|
||||
m_sprArrow[p].SetTweenX( DIFFICULTY_ARROW_X[m_iSelection[p]][p] - ARROW_SHADOW_OFFSET );
|
||||
m_sprArrow[p].SetTweenY( DIFFICULTY_ARROW_Y[m_iSelection[p]] - ARROW_SHADOW_OFFSET );
|
||||
m_sprArrow[p].SetTweenX( ARROW_X(m_iSelection[p],(PlayerNumber)p) - ARROW_SHADOW_LENGTH_X );
|
||||
m_sprArrow[p].SetTweenY( ARROW_Y(m_iSelection[p],(PlayerNumber)p) - ARROW_SHADOW_LENGTH_Y );
|
||||
|
||||
m_sprArrowShadow[p].BeginTweening( 0.2f, bChangedPages ? TWEEN_LINEAR : TWEEN_BIAS_BEGIN );
|
||||
m_sprArrowShadow[p].SetTweenX( DIFFICULTY_ARROW_X[m_iSelection[p]][p] );
|
||||
m_sprArrowShadow[p].SetTweenY( DIFFICULTY_ARROW_Y[m_iSelection[p]] );
|
||||
m_sprArrowShadow[p].SetTweenX( ARROW_X(m_iSelection[p],(PlayerNumber)p) );
|
||||
m_sprArrowShadow[p].SetTweenY( ARROW_Y(m_iSelection[p],(PlayerNumber)p) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,11 +444,11 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
|
||||
|
||||
m_sprArrow[pn].BeginTweeningQueued( 0.2f );
|
||||
m_sprArrow[pn].BeginTweeningQueued( 0.2f );
|
||||
m_sprArrow[pn].SetTweenX( DIFFICULTY_ARROW_X[iSelection][pn] );
|
||||
m_sprArrow[pn].SetTweenY( DIFFICULTY_ARROW_Y[iSelection] );
|
||||
m_sprArrow[pn].SetTweenX( ARROW_X(iSelection, pn) );
|
||||
m_sprArrow[pn].SetTweenY( ARROW_Y(iSelection, pn) );
|
||||
|
||||
m_sprOK[pn].SetX( DIFFICULTY_ARROW_X[iSelection][pn] );
|
||||
m_sprOK[pn].SetY( DIFFICULTY_ARROW_Y[iSelection] );
|
||||
m_sprOK[pn].SetX( ARROW_X(iSelection, pn) );
|
||||
m_sprOK[pn].SetY( ARROW_Y(iSelection, pn) );
|
||||
m_sprOK[pn].SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
m_sprOK[pn].SetZoom( 2 );
|
||||
|
||||
@@ -433,9 +481,9 @@ void ScreenSelectDifficulty::TweenOffScreen()
|
||||
|
||||
for( p=0; p<NUM_PAGES; p++ )
|
||||
{
|
||||
m_sprExplanation[p].SetXY( EXPLANATION_X[p], EXPLANATION_Y[p] );
|
||||
m_sprExplanation[p].SetXY( EXPLANATION_X(p), EXPLANATION_Y(p) );
|
||||
m_sprExplanation[p].BeginTweening( 0.5, Actor::TWEEN_BOUNCE_BEGIN );
|
||||
m_sprExplanation[p].SetTweenXY( EXPLANATION_OFF_SCREEN_X[p], EXPLANATION_OFF_SCREEN_Y[p] );
|
||||
m_sprExplanation[p].SetTweenXY( EXPLANATION_X(p)+700, EXPLANATION_Y(p) );
|
||||
|
||||
m_sprMoreArrows[p].BeginTweening( 0.5 );
|
||||
m_sprMoreArrows[p].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
@@ -476,10 +524,10 @@ void ScreenSelectDifficulty::TweenOffScreen()
|
||||
|
||||
// fly off
|
||||
m_sprHeader[d].BeginTweeningQueued( 0.4f, TWEEN_BIAS_END );
|
||||
m_sprHeader[d].SetTweenXY( DIFFICULTY_ITEM_X[d]-700, DIFFICULTY_ITEM_Y[d] );
|
||||
m_sprHeader[d].SetTweenXY( ITEM_X(d)-700, ITEM_Y(d) );
|
||||
|
||||
m_sprPicture[d].BeginTweeningQueued( 0.4f, TWEEN_BIAS_END );
|
||||
m_sprPicture[d].SetTweenXY( DIFFICULTY_ITEM_X[d]-700, DIFFICULTY_ITEM_Y[d] );
|
||||
m_sprPicture[d].SetTweenXY( ITEM_X(d)-700, ITEM_Y(d) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,9 +537,9 @@ void ScreenSelectDifficulty::TweenOnScreen()
|
||||
|
||||
for( p=0; p<NUM_PAGES; p++ )
|
||||
{
|
||||
m_sprExplanation[p].SetXY( EXPLANATION_OFF_SCREEN_X[p], EXPLANATION_OFF_SCREEN_Y[p] );
|
||||
m_sprExplanation[p].SetXY( EXPLANATION_X(p)+700, EXPLANATION_Y(p) );
|
||||
m_sprExplanation[p].BeginTweening( 0.3f, Actor::TWEEN_BOUNCE_END );
|
||||
m_sprExplanation[p].SetTweenXY( EXPLANATION_X[p], EXPLANATION_Y[p] );
|
||||
m_sprExplanation[p].SetTweenXY( EXPLANATION_X(p), EXPLANATION_Y(p) );
|
||||
|
||||
m_sprMoreArrows[p].SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
m_sprMoreArrows[p].BeginTweening( 0.5 );
|
||||
@@ -505,8 +553,7 @@ void ScreenSelectDifficulty::TweenOnScreen()
|
||||
|
||||
int iSelection = m_iSelection[p];
|
||||
|
||||
m_sprArrow[p].SetX( DIFFICULTY_ARROW_X[iSelection][p] );
|
||||
m_sprArrow[p].SetY( DIFFICULTY_ARROW_Y[iSelection] );
|
||||
m_sprArrow[p].SetXY( ARROW_X(iSelection,(PlayerNumber)p), ARROW_Y(iSelection,(PlayerNumber)p) );
|
||||
m_sprArrow[p].SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||
m_sprArrow[p].SetRotation( D3DX_PI );
|
||||
m_sprArrow[p].SetZoom( 2 );
|
||||
@@ -515,8 +562,7 @@ void ScreenSelectDifficulty::TweenOnScreen()
|
||||
m_sprArrow[p].SetTweenRotationZ( 0 );
|
||||
m_sprArrow[p].SetTweenZoom( 1 );
|
||||
|
||||
m_sprArrowShadow[p].SetX( DIFFICULTY_ARROW_X[iSelection][p] );
|
||||
m_sprArrowShadow[p].SetY( DIFFICULTY_ARROW_Y[iSelection] );
|
||||
m_sprArrowShadow[p].SetXY( ARROW_X(iSelection,(PlayerNumber)p), ARROW_Y(iSelection,(PlayerNumber)p) );
|
||||
D3DXCOLOR colorOriginal = m_sprArrowShadow[p].GetDiffuseColor();
|
||||
m_sprArrowShadow[p].SetDiffuseColor( D3DXCOLOR(0,0,0,0) );
|
||||
m_sprArrowShadow[p].BeginTweening( 0.3f );
|
||||
@@ -531,9 +577,9 @@ void ScreenSelectDifficulty::TweenOnScreen()
|
||||
continue; // don't tween
|
||||
|
||||
// set off screen
|
||||
m_sprHeader[d].SetXY( DIFFICULTY_ITEM_X[d]-700, DIFFICULTY_ITEM_Y[d] );
|
||||
m_sprHeader[d].SetXY( ITEM_X(d)-700, ITEM_Y(d) );
|
||||
|
||||
m_sprPicture[d].SetXY( DIFFICULTY_ITEM_X[d]-700, DIFFICULTY_ITEM_Y[d] );
|
||||
m_sprPicture[d].SetXY( ITEM_X(d)-700, ITEM_Y(d) );
|
||||
m_sprPicture[d].SetZoomY( 0 );
|
||||
|
||||
// pause
|
||||
@@ -543,10 +589,10 @@ void ScreenSelectDifficulty::TweenOnScreen()
|
||||
|
||||
// fly on
|
||||
m_sprHeader[d].BeginTweeningQueued( 0.5f, TWEEN_BIAS_BEGIN );
|
||||
m_sprHeader[d].SetTweenXY( DIFFICULTY_ITEM_X[d], DIFFICULTY_ITEM_Y[d] );
|
||||
m_sprHeader[d].SetTweenXY( ITEM_X(d), ITEM_Y(d) );
|
||||
|
||||
m_sprPicture[d].BeginTweeningQueued( 0.5f, TWEEN_BIAS_BEGIN );
|
||||
m_sprPicture[d].SetTweenXY( DIFFICULTY_ITEM_X[d], DIFFICULTY_ITEM_Y[d] );
|
||||
m_sprPicture[d].SetTweenXY( ITEM_X(d), ITEM_Y(d) );
|
||||
|
||||
// roll down
|
||||
m_sprHeader[d].BeginTweeningQueued( 0.3f, TWEEN_BOUNCE_END );
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user