code cleanup

This commit is contained in:
Chris Danford
2002-02-24 01:43:11 +00:00
parent f2a7f50634
commit 54f442350a
36 changed files with 1019 additions and 1568 deletions
+8 -8
View File
@@ -46,9 +46,9 @@ void Actor::Draw() // set the world matrix and calculate actor properties, the
case glowing:
break;
case wagging:
rotation.z = m_fWagRadians * (float)sin(
rotation.z = m_fWagRadians * sinf(
(m_fWagTimer / m_fWagPeriod) // percent through wag
* 2.0 * D3DX_PI );
* 2.0f * D3DX_PI );
break;
case spinning:
// nothing special needed
@@ -61,13 +61,13 @@ void Actor::Draw() // set the world matrix and calculate actor properties, the
break;
case bouncing:
float fPercentThroughBounce = m_fTimeIntoBounce / m_fBouncePeriod;
float fPercentOffset = sin( fPercentThroughBounce*D3DX_PI );
float fPercentOffset = sinf( fPercentThroughBounce*D3DX_PI );
pos += m_vectBounce * fPercentOffset;
break;
}
SCREEN->Translate( pos.x-0.5f, pos.y-0.5f, pos.z ); // offset so that pixels are aligned to texels
SCREEN->Translate( pos.x, pos.y, pos.z ); // offset so that pixels are aligned to texels
SCREEN->Scale( scale.x, scale.y, 1 );
// super slow!
@@ -255,8 +255,8 @@ void Actor::SetTweenAddColor( D3DXCOLOR c ) { GetLatestTween().m_end_colorAdd
void Actor::ScaleTo( LPRECT pRect, StretchType st )
{
// width and height of rectangle
float rect_width = RECTWIDTH(*pRect);
float rect_height = RECTHEIGHT(*pRect);
float rect_width = (float)RECTWIDTH(*pRect);
float rect_height = (float)RECTHEIGHT(*pRect);
if( rect_width < 0 ) SetRotationY( D3DX_PI );
if( rect_height < 0 ) SetRotationX( D3DX_PI );
@@ -266,8 +266,8 @@ void Actor::ScaleTo( LPRECT pRect, StretchType st )
float rect_cy = pRect->top + rect_height/2;
// zoom fActor needed to scale the Actor to fill the rectangle
float fNewZoomX = (float)fabs(rect_width / m_size.x);
float fNewZoomY = (float)fabs(rect_height / m_size.y);
float fNewZoomX = fabsf(rect_width / m_size.x);
float fNewZoomY = fabsf(rect_height / m_size.y);
float fNewZoom;
switch( st )
+1 -1
View File
@@ -24,7 +24,7 @@ class BPMDisplay : public ActorFrame
{
public:
BPMDisplay();
void Update( float fDeltaTime );
virtual void Update( float fDeltaTime );
void SetBPMRange( float fLowBPM, float fHighBPM );
protected:
+1 -1
View File
@@ -29,7 +29,7 @@ Background::Background()
m_sprDanger.SetXY( CENTER_X, CENTER_Y );
m_sprDangerBackground.Load( THEME->GetPathTo(GRAPHIC_DANGER_BACKGROUND) );
m_sprDangerBackground.StretchTo( CRect(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) );
m_sprDangerBackground.StretchTo( CRect((int)SCREEN_LEFT, (int)SCREEN_TOP, (int)SCREEN_RIGHT, (int)SCREEN_BOTTOM) );
}
bool Background::LoadFromSong( Song* pSong, bool bDisableVisualizations )
+6 -6
View File
@@ -96,7 +96,7 @@ bool BitmapText::Load( CString sFontFilePath )
if( sCharacters != "" ) // the creator supplied characters
{
// sanity check
if( sCharacters.GetLength() != Sprite::GetNumStates() )
if( sCharacters.GetLength() != (int)Sprite::GetNumStates() )
RageError( ssprintf("The characters in '%s' does not match the number of frames in the texture.", m_sFontFilePath) );
// set the char to frameno map
@@ -123,20 +123,20 @@ bool BitmapText::Load( CString sFontFilePath )
CStringArray arrayCharWidths;
split( sWidthsValue, ",", arrayCharWidths );
if( arrayCharWidths.GetSize() != Sprite::GetNumStates() )
if( arrayCharWidths.GetSize() != (int)Sprite::GetNumStates() )
RageError( ssprintf("The number of widths specified in '%s' (%d) do not match the number of frames in the texture (%u).", m_sFontFilePath, arrayCharWidths.GetSize(), Sprite::GetNumStates()) );
for( int i=0; i<arrayCharWidths.GetSize(); i++ )
{
m_fFrameNoToWidth[i] = atof( arrayCharWidths[i] );
m_fFrameNoToWidth[i] = (float)atof( arrayCharWidths[i] );
}
}
else // no creator supplied withds. Assume each character is the width of the frame
{
for( int i=0; i<Sprite::GetNumStates(); i++ )
for( int i=0; i<(int)Sprite::GetNumStates(); i++ )
{
m_fFrameNoToWidth[i] = m_pTexture->GetSourceFrameWidth();
m_fFrameNoToWidth[i] = (float)m_pTexture->GetSourceFrameWidth();
}
}
@@ -144,7 +144,7 @@ bool BitmapText::Load( CString sFontFilePath )
if( bFirstTimeBeingLoaded )
{
// tweak the textures frame rectangles so we don't draw extra to the left and right of the character
for( int i=0; i<Sprite::GetNumStates(); i++ )
for( int i=0; i<(int)Sprite::GetNumStates(); i++ )
{
FRECT* pFrect = m_pTexture->GetTextureCoordRect( i );
+85
View File
@@ -0,0 +1,85 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
File: Combo.h
Desc: A graphic displayed in the Combo during Dancing.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#include "Combo.h"
#include "ThemeManager.h"
const float COMBO_TWEEN_TIME = 0.5f;
Combo::Combo()
{
m_iCurCombo = 0;
m_iMaxCombo = 0;
m_sprCombo.Load( THEME->GetPathTo(GRAPHIC_COMBO) );
m_sprCombo.StopAnimating();
m_sprCombo.SetX( 40 );
m_sprCombo.SetZoom( 1.0f );
m_textComboNumber.Load( THEME->GetPathTo(FONT_COMBO_NUMBERS) );
m_textComboNumber.SetX( -40 );
m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
this->AddActor( &m_textComboNumber );
this->AddActor( &m_sprCombo );
}
void Combo::ContinueCombo()
{
m_iCurCombo++;
// new max combo
if( m_iCurCombo > m_iMaxCombo )
m_iMaxCombo = m_iCurCombo;
if( m_iCurCombo <= 4 )
{
m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
}
else
{
m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible
m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // visible
m_textComboNumber.SetText( ssprintf("%d", m_iCurCombo) );
float fNewZoom = 0.5f + m_iCurCombo/800.0f;
m_textComboNumber.SetZoom( fNewZoom );
m_textComboNumber.SetX( -40 - (fNewZoom-1)*30 );
//m_textComboNumber.BeginTweening( COMBO_TWEEN_TIME );
//m_textComboNumber.SetTweenZoom( 1 );
}
}
void Combo::EndCombo()
{
m_iCurCombo = 0;
m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
}
int Combo::GetCurrentCombo()
{
return m_iCurCombo;
}
int Combo::GetMaxCombo()
{
return m_iMaxCombo;
}
+42
View File
@@ -0,0 +1,42 @@
/*
-----------------------------------------------------------------------------
File: Combo.h
Desc: A graphic displayed in the Combo during Dancing.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#ifndef _Combo_H_
#define _Combo_H_
#include "ActorFrame.h"
#include "Sprite.h"
#include "ScoreDisplayRolling.h"
class Combo : public ActorFrame
{
public:
Combo();
void ContinueCombo();
void EndCombo();
int GetCurrentCombo();
int GetMaxCombo();
protected:
int m_iCurCombo;
int m_iMaxCombo;
bool m_bComboVisible;
Sprite m_sprCombo;
BitmapText m_textComboNumber;
};
#endif
+11 -7
View File
@@ -17,25 +17,29 @@ const float GRAY_ARROW_TWEEN_TIME = 0.5f;
GhostArrow::GhostArrow()
{
Load( THEME->GetPathTo(GRAPHIC_GHOST_ARROW) );
SetState( 1 );
SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
TurnShadowOff();
}
void GhostArrow::Update( float fDeltaTime )
{
Sprite::Update( fDeltaTime );
}
void GhostArrow::SetBeat( const float fSongBeat )
{
//SetState( fmod(fSongBeat,1)<0.25 ? 1 : 0 );
}
void GhostArrow::Step( StepScore score )
void GhostArrow::Step( TapStepScore score )
{
switch( score )
{
case perfect: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,0.7f) ); break; // yellow
case great: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,0.7f) ); break; // green
case good: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,0.7f) ); break;
case boo: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,0.7f) ); break;
case miss: ASSERT( false ); break;
case TSS_PERFECT: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,0.6f) ); break; // yellow
case TSS_GREAT: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,0.6f) ); break; // green
case TSS_GOOD: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,0.6f) ); break;
case TSS_BOO: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,0.6f) ); break;
case TSS_MISS: ASSERT( false ); break;
}
SetZoom( 1.0f );
BeginTweening( 0.3f );
+3 -1
View File
@@ -24,8 +24,10 @@ class GhostArrow : public Sprite
public:
GhostArrow();
virtual void Update( float fDeltaTime );
void SetBeat( const float fSongBeat );
void Step( StepScore score );
void Step( TapStepScore score );
float m_fVisibilityCountdown;
};
+8 -8
View File
@@ -17,7 +17,7 @@ const float GRAY_ARROW_TWEEN_TIME = 0.5f;
GhostArrowBright::GhostArrowBright()
{
Load( THEME->GetPathTo(GRAPHIC_GHOST_ARROW) );
Load( THEME->GetPathTo(GRAPHIC_BRIGHT_GHOST_ARROW) );
SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
TurnShadowOff();
}
@@ -27,19 +27,19 @@ void GhostArrowBright::SetBeat( const float fSongBeat )
//SetState( fmod(fSongBeat,1)<0.25 ? 1 : 0 );
}
void GhostArrowBright::Step( StepScore score )
void GhostArrowBright::Step( TapStepScore score )
{
switch( score )
{
case perfect: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,0.9f) ); break; // yellow
case great: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,0.9f) ); break; // green
case good: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,0.9f) ); break;
case boo: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,0.9f) ); break;
case miss: ASSERT( false ); break;
case TSS_PERFECT: SetDiffuseColor( D3DXCOLOR(1.0f,1.0f,0.3f,1.0f) ); break; // yellow
case TSS_GREAT: SetDiffuseColor( D3DXCOLOR(0.0f,1.0f,0.4f,1.0f) ); break; // green
case TSS_GOOD: SetDiffuseColor( D3DXCOLOR(0.3f,0.8f,1.0f,1.0f) ); break;
case TSS_BOO: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,1.0f) ); break;
case TSS_MISS: ASSERT( false ); break;
}
SetState( 0 );
SetZoom( 1.2f );
BeginTweening( 0.3f );
BeginTweening( 0.35f );
SetTweenZoom( 2.5f );
D3DXCOLOR colorTween = GetDiffuseColor();
colorTween.a = 0;
+1 -1
View File
@@ -25,7 +25,7 @@ public:
GhostArrowBright();
void SetBeat( const float fSongBeat );
void Step( StepScore score );
void Step( TapStepScore score );
float m_fVisibilityCountdown;
};
+1 -1
View File
@@ -25,7 +25,7 @@ void GrayArrow::SetBeat( const float fSongBeat )
SetState( fmod(fSongBeat,1)<0.25 ? 1 : 0 );
}
void GrayArrow::Step( StepScore score )
void GrayArrow::Step()
{
SetZoom( 0.50 );
BeginTweening( GRAY_ARROW_POP_UP_TIME );
+1 -1
View File
@@ -22,7 +22,7 @@ public:
GrayArrow();
virtual void SetBeat( const float fSongBeat );
void Step( StepScore score );
void Step();
};
#endif
+1 -1
View File
@@ -42,7 +42,7 @@ void HoldGhostArrow::Update( float fDeltaTime )
m_fHeatLevel = 0;
}
int iStateNum = min( m_fHeatLevel * GetNumStates(), GetNumStates()-1 );
int iStateNum = (int)min( m_fHeatLevel * GetNumStates(), GetNumStates()-1 );
SetState( iStateNum );
if( m_fHeatLevel == 1 )
+1 -1
View File
@@ -24,7 +24,7 @@ class HoldGhostArrow : public Sprite
public:
HoldGhostArrow();
void Update( float fDeltaTime );
virtual void Update( float fDeltaTime );
void SetBeat( const float fSongBeat );
void Step();
+75
View File
@@ -0,0 +1,75 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
File: HoldJudgement.h
Desc: A graphic displayed in the HoldJudgement during Dancing.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#include "HoldJudgement.h"
#include "RageUtil.h"
#include "ScreenDimensions.h"
#include "ThemeManager.h"
const float JUDGEMENT_DISPLAY_TIME = 0.6f;
HoldJudgement::HoldJudgement()
{
m_fDisplayCountdown = 0;
m_sprJudgement.Load( THEME->GetPathTo(GRAPHIC_JUDGEMENT) );
m_sprJudgement.StopAnimating();
this->AddActor( &m_sprJudgement );
}
void HoldJudgement::Update( float fDeltaTime )
{
ActorFrame::Update( fDeltaTime );
m_fDisplayCountdown -= fDeltaTime;
if( m_fDisplayCountdown < 0 )
m_fDisplayCountdown = 0;
}
void HoldJudgement::RenderPrimitives()
{
if( m_fDisplayCountdown > 0 )
{
ActorFrame::RenderPrimitives();
}
}
void HoldJudgement::SetHoldJudgement( HoldStepResult result )
{
//RageLog( "Judgement::SetJudgement()" );
switch( result )
{
case HSR_NONE: m_sprJudgement.SetState( 0 ); break;
case HSR_OK: m_sprJudgement.SetState( 7 ); break;
case HSR_NG: m_sprJudgement.SetState( 8 ); break;
default: ASSERT( false );
}
m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME;
if( result == HSR_NG )
{
// falling down
m_sprJudgement.SetY( -10 );
m_sprJudgement.SetZoom( 1.0f );
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME );
m_sprJudgement.SetTweenY( 10 );
}
else if( result == HSR_OK )
{
// zooming out
m_sprJudgement.SetZoom( 1.5f );
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME/3.0f );
m_sprJudgement.SetTweenZoom( 1.0f );
}
}
+36
View File
@@ -0,0 +1,36 @@
/*
-----------------------------------------------------------------------------
File: HoldJudgement.h
Desc: A graphic displayed in the HoldJudgement during Dancing.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#ifndef _HoldJudgement_H_
#define _HoldJudgement_H_
#include "Sprite.h"
#include "ActorFrame.h"
#include "Song.h"
#include "BitmapText.h"
#include "ThemeManager.h"
class HoldJudgement : public ActorFrame
{
public:
HoldJudgement();
void SetHoldJudgement( HoldStepResult result );
virtual void Update( float fDeltaTime );
virtual void RenderPrimitives();
protected:
Sprite m_sprJudgement;
float m_fDisplayCountdown;
};
#endif
+78
View File
@@ -0,0 +1,78 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
File: Judgement.h
Desc: A graphic displayed in the Judgement during Dancing.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#include "Judgement.h"
#include "RageUtil.h"
#include "ScreenDimensions.h"
#include "ThemeManager.h"
const float JUDGEMENT_DISPLAY_TIME = 0.6f;
Judgement::Judgement()
{
m_fDisplayCountdown = 0;
m_sprJudgement.Load( THEME->GetPathTo(GRAPHIC_JUDGEMENT) );
m_sprJudgement.StopAnimating();
this->AddActor( &m_sprJudgement );
}
void Judgement::Update( float fDeltaTime )
{
ActorFrame::Update( fDeltaTime );
m_fDisplayCountdown -= fDeltaTime;
if( m_fDisplayCountdown < 0 )
m_fDisplayCountdown = 0;
}
void Judgement::RenderPrimitives()
{
if( m_fDisplayCountdown > 0 )
{
ActorFrame::RenderPrimitives();
}
}
void Judgement::SetJudgement( TapStepScore score )
{
//RageLog( "Judgement::SetJudgement()" );
switch( score )
{
case TSS_PERFECT: m_sprJudgement.SetState( 0 ); break;
case TSS_GREAT: m_sprJudgement.SetState( 1 ); break;
case TSS_GOOD: m_sprJudgement.SetState( 2 ); break;
case TSS_BOO: m_sprJudgement.SetState( 3 ); break;
case TSS_MISS: m_sprJudgement.SetState( 4 ); break;
default: ASSERT( false );
}
m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME;
if( score == TSS_MISS )
{
// falling down
m_sprJudgement.SetY( -30 );
m_sprJudgement.SetZoom( 1.0f );
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME );
m_sprJudgement.SetTweenY( 30 );
}
else
{
// zooming out
m_sprJudgement.SetZoom( 1.35f );
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME/5.0f );
m_sprJudgement.SetTweenZoom( 1.0f );
}
}
+36
View File
@@ -0,0 +1,36 @@
/*
-----------------------------------------------------------------------------
File: Judgement.h
Desc: A graphic displayed in the Judgement during Dancing.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#ifndef _Judgement_H_
#define _Judgement_H_
#include "Sprite.h"
#include "ActorFrame.h"
#include "Song.h"
#include "BitmapText.h"
#include "ThemeManager.h"
class Judgement : public ActorFrame
{
public:
Judgement();
void SetJudgement( TapStepScore score );
virtual void Update( float fDeltaTime );
virtual void RenderPrimitives();
protected:
Sprite m_sprJudgement;
float m_fDisplayCountdown;
};
#endif
+1 -7
View File
@@ -42,14 +42,8 @@ void MusicSortDisplay::Set( SongSortOrder so )
case SORT_BPM:
SetState( 2 );
break;
case SORT_ARTIST:
SetState( 3 );
break;
case SORT_MOST_PLAYED:
SetState( 4 );
break;
case NUM_SORT_ORDERS:
SetState( 5 );
SetState( 3 );
break;
default:
ASSERT( false ); // unimplemented MusicSortOrder
+47 -17
View File
@@ -256,6 +256,14 @@ MusicWheel::MusicWheel()
BuildWheelItemDatas( m_WheelItemDatas[so], SongSortOrder(so) );
if( GAMEINFO->m_pCurSong == NULL // if there is no currently selected song
&& GAMEINFO->m_pSongs[0] ) // and there is at least one song
{
GAMEINFO->m_pCurSong = GAMEINFO->m_pSongs[0]; // select the first song
}
// find the previously selected song (if any)
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
{
@@ -267,6 +275,7 @@ MusicWheel::MusicWheel()
}
}
// rebuild the WheelItems that appear on screen
RebuildWheelItemDisplays();
@@ -310,9 +319,9 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
case SORT_BPM:
SortSongPointerArrayByBPM( arraySongs );
break;
case SORT_ARTIST:
SortSongPointerArrayByArtist( arraySongs );
break;
// case SORT_ARTIST:
// SortSongPointerArrayByArtist( arraySongs );
// break;
case SORT_MOST_PLAYED:
SortSongPointerArrayByMostPlayed( arraySongs );
break;
@@ -330,7 +339,6 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
// ...and load new ones
switch( so )
{
case SORT_GROUP:
case SORT_MOST_PLAYED:
case SORT_BPM:
// make WheelItems without sections
@@ -346,8 +354,9 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
}
}
break;
case SORT_GROUP:
case SORT_TITLE:
case SORT_ARTIST:
// case SORT_ARTIST:
{
// make WheelItemDatas with sections
@@ -425,7 +434,7 @@ float MusicWheel::GetBannerY( float fPosOffsetsFromMiddle )
float MusicWheel::GetBannerBrightness( float fPosOffsetsFromMiddle )
{
return 1 - fabs(fPosOffsetsFromMiddle)*0.11f;
return 1 - fabsf(fPosOffsetsFromMiddle)*0.11f;
}
float MusicWheel::GetBannerAlpha( float fPosOffsetsFromMiddle )
@@ -452,25 +461,25 @@ float MusicWheel::GetBannerAlpha( float fPosOffsetsFromMiddle )
float MusicWheel::GetBannerX( float fPosOffsetsFromMiddle )
{
float fX = (1-cos((fPosOffsetsFromMiddle)/3))*95.0f;
float fX = (1-cosf((fPosOffsetsFromMiddle)/3))*95.0f;
if( m_WheelState == STATE_FLYING_OFF_BEFORE_NEXT_SORT
|| m_WheelState == STATE_TWEENING_OFF_SCREEN )
{
float fDistFromCenter = fabs( fPosOffsetsFromMiddle );
float fDistFromCenter = fabsf( fPosOffsetsFromMiddle );
float fPercentOffScreen = 1- (m_fTimeLeftInState / FADE_TIME);
float fXLogicalOffset = max( 0, fPercentOffScreen - 1 + (fDistFromCenter+3)/6 );
fXLogicalOffset = pow( fXLogicalOffset, 1.7 ); // accelerate
fXLogicalOffset = powf( fXLogicalOffset, 1.7f ); // accelerate
float fXPixelOffset = fXLogicalOffset * 600;
fX += fXPixelOffset;
}
else if( m_WheelState == STATE_FLYING_ON_AFTER_NEXT_SORT
|| m_WheelState == STATE_TWEENING_ON_SCREEN )
{
float fDistFromCenter = fabs( fPosOffsetsFromMiddle );
float fDistFromCenter = fabsf( fPosOffsetsFromMiddle );
float fPercentOffScreen = m_fTimeLeftInState / FADE_TIME;
float fXLogicalOffset = max( 0, fPercentOffScreen - 1 + (fDistFromCenter+3)/6 );
fXLogicalOffset = pow( fXLogicalOffset, 1.7 ); // accelerate
fXLogicalOffset = powf( fXLogicalOffset, 1.7f ); // accelerate
float fXPixelOffset = fXLogicalOffset * 600;
fX += fXPixelOffset;
}
@@ -585,6 +594,7 @@ void MusicWheel::Update( float fDeltaTime )
m_fTimeLeftInState = FADE_TIME;
Song* pPrevSelectedSong = GetCurWheelItemDatas()[m_iSelection].m_pSong;
CString sPrevSelectedSection = GetCurWheelItemDatas()[m_iSelection].m_sSectionName;
// change the sort order
m_SortOrder = SongSortOrder(m_SortOrder+1);
@@ -598,11 +608,31 @@ void MusicWheel::Update( float fDeltaTime )
m_MusicSortDisplay.SetTweenXY( SORT_ICON_ON_SCREEN_X, SORT_ICON_ON_SCREEN_Y );
// find the previously selected song, and select it
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
m_iSelection = 0;
if( pPrevSelectedSong != NULL ) // the previous selected item was a song
{
if( GetCurWheelItemDatas()[i].m_pSong == pPrevSelectedSong )
m_iSelection = i;
// find the previously selected song, and select it
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
{
if( GetCurWheelItemDatas()[i].m_pSong == pPrevSelectedSong )
{
m_iSelection = i;
break;
}
}
}
else // the previously selected item was a section
{
// find the previously selected song, and select it
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
{
if( GetCurWheelItemDatas()[i].m_sSectionName == sPrevSelectedSection )
{
m_iSelection = i;
break;
}
}
}
RebuildWheelItemDisplays();
@@ -630,12 +660,12 @@ void MusicWheel::Update( float fDeltaTime )
// "rotate" wheel toward selected song
if( fabs(m_fPositionOffsetFromSelection) < 0.02f )
if( fabsf(m_fPositionOffsetFromSelection) < 0.02f )
m_fPositionOffsetFromSelection = 0;
else
{
m_fPositionOffsetFromSelection -= fDeltaTime * m_fPositionOffsetFromSelection*4; // linear
float fSign = m_fPositionOffsetFromSelection / fabs(m_fPositionOffsetFromSelection);
float fSign = m_fPositionOffsetFromSelection / fabsf(m_fPositionOffsetFromSelection);
m_fPositionOffsetFromSelection -= fDeltaTime * fSign; // constant
}
}
+7 -11
View File
@@ -163,18 +163,14 @@ protected:
{
case SORT_GROUP:
sTemp = pSong->GetGroupName();
sTemp.MakeUpper();
sTemp = (sTemp.GetLength() > 0) ? sTemp : "";
if( IsAnInt(sTemp) )
sTemp = "NUM";
return sTemp;
case SORT_ARTIST:
sTemp = pSong->GetArtist();
sTemp.MakeUpper();
sTemp = (sTemp.GetLength() > 0) ? sTemp.Left(1) : "";
if( IsAnInt(sTemp) )
sTemp = "NUM";
return sTemp;
// case SORT_ARTIST:
// sTemp = pSong->GetArtist();
// sTemp.MakeUpper();
// sTemp = (sTemp.GetLength() > 0) ? sTemp.Left(1) : "";
// if( IsAnInt(sTemp) )
// sTemp = "NUM";
// return sTemp;
case SORT_TITLE:
sTemp = pSong->GetTitle();
sTemp.MakeUpper();
+239 -1261
View File
File diff suppressed because it is too large Load Diff
+35 -106
View File
@@ -25,134 +25,63 @@
#include "Player.h"
#include "ActorFrame.h"
#include "SoundSet.h"
#include "ScoreDisplayRolling.h"
#include "ScoreDisplayRollingWithFrame.h"
#include "LifeMeterPills.h"
#include "Judgement.h"
#include "HoldJudgement.h"
#include "Combo.h"
#include "ColorArrowField.h"
#include "GrayArrows.h"
#include "GhostArrows.h"
const int MAX_NUM_COLUMNS = 8;
class Player : public ActorFrame
{
public:
Player();
void SetPlayerOptions( PlayerOptions po, PlayerNumber pn );
virtual void Update( float fDeltaTime, float fSongBeat, float fMaxBeatDifference );
virtual void RenderPrimitives();
void SetSteps( Steps* pNewSteps, bool bLoadOnlyLeftSide = false, bool bLoadOnlyRightSide = false );
void SetX( float fX );
void Load( const Style& style, PlayerNumber player_no, const Steps& steps, const PlayerOptions& po );
void CrossedIndex( int iIndex );
void HandlePlayerStep( float fSongBeat, TapStep step, float fMaxBeatDiff );
int UpdateStepsMissedOlderThan( float fMissIfOlderThanThisBeat );
ScoreSummary GetScoreSummary();
int UpdateStepsMissedOlderThan( float fMissIfOlderThanThisBeat );
void HandlePlayerStep( float fSongBeat, Step player_step, float fMaxBeatDiff );
float GetLifePercentage() { return m_LifeMeter.GetLifePercentage(); };
bool IsThereANoteAtIndex( int iIndex );
protected:
void CheckForCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDiff );
void OnCompleteStep( float fSongBeat, Step player_step, float fMaxBeatDiff, int iStepIndex );
void CheckForCompleteStep( float fSongBeat, TapStep step, float fMaxBeatDiff );
void OnCompleteStep( float fSongBeat, TapStep step, float fMaxBeatDiff, int iStepIndex );
PlayerOptions m_PlayerOptions;
float m_fSongBeat;
Style m_Style;
PlayerNumber m_PlayerNumber;
PlayerOptions m_PlayerOptions;
int m_iCurCombo;
int m_iMaxCombo;
float m_fSongBeat;
TapStep m_TapStepsOriginal[MAX_TAP_STEP_ELEMENTS]; // the original steps that were loaded into player
TapStep m_TapStepsRemaining[MAX_TAP_STEP_ELEMENTS]; // mask off the bits as the player steps
TapStepScore m_TapStepScores[MAX_TAP_STEP_ELEMENTS];
HoldStep m_HoldSteps[MAX_HOLD_STEP_ELEMENTS];
HoldStepScore m_HoldStepScores[MAX_HOLD_STEP_ELEMENTS];
int m_iNumHoldSteps;
// index is quarter beat number (e.g. beat 30 is index 30*4)
Step m_OriginalStep[MAX_STEP_ELEMENTS];
Step m_LeftToStepOn[MAX_STEP_ELEMENTS];
StepScore m_StepScore[MAX_STEP_ELEMENTS];
CArray<HoldStep, HoldStep&> m_HoldSteps;
//StepTiming m_StepTiming[MAX_STEP_ELEMENTS];
CArray<HoldStepScore, HoldStepScore> m_HoldStepScores;
// common to color and gray arrows
float m_fArrowsCenterX;
GrayArrows m_GrayArrows;
ColorArrowField m_ColorArrowField;
GhostArrows m_GhostArrows;
int m_iNumColumns; // will vary depending on the number panels (4,6,8,etc)
CMap<Step, Step, int, int> m_StepToColumnNumber;
CMap<int, int, Step, Step> m_ColumnNumberToStep;
CMap<int, int, float, float&> m_ColumnToRotation;
float GetArrowColumnX( int iColNum );
// color arrows
void SetColorArrowsX( int iX );
void UpdateColorArrows( float fDeltaTime );
float GetColorArrowYPos( float fStepIndex, float fSongBeat );
float GetColorArrowYOffset( float fStepIndex, float fSongBeat );
float GetColorArrowAlphaFromYOffset( float fYOffset );
void DrawColorArrows();
int m_iColorArrowFrameOffset[MAX_STEP_ELEMENTS];
ColorArrow m_ColorArrow[MAX_NUM_COLUMNS];
// gray arrows
void SetGrayArrowsX( int iX );
void UpdateGrayArrows( float fDeltaTime );
float GetGrayArrowYPos();
void DrawGrayArrows();
void GrayArrowStep( int iCol, StepScore score );
GrayArrow m_GrayArrow[MAX_NUM_COLUMNS];
// ghost arrows
void SetGhostArrowsX( int iX );
void UpdateGhostArrows( float fDeltaTime );
void DrawGhostArrows();
void GhostArrowStep( int iCol, StepScore score );
GhostArrow m_GhostArrow[MAX_NUM_COLUMNS];
GhostArrowBright m_GhostArrowBright[MAX_NUM_COLUMNS];
HoldGhostArrow m_HoldGhostArrow[MAX_NUM_COLUMNS];
// holder for judgement and combo displays
ActorFrame m_frameJudgementAndCombo;
// judgement
void SetJudgementX( int iX );
void UpdateJudgement( float fDeltaTime );
void DrawJudgement();
void SetJudgement( StepScore score );
float m_fJudgementDisplayCountdown;
Sprite m_sprJudgement;
void SetHoldJudgement( int iCol, HoldStepScore::HoldScore score );
float m_fHoldJudgementDisplayCountdown[MAX_NUM_COLUMNS];
Sprite m_sprHoldJudgement[MAX_NUM_COLUMNS];
// combo
void SetComboX( int iX );
void UpdateCombo( float fDeltaTime );
void DrawCombo();
void ContinueCombo();
void EndCombo();
bool m_bComboVisible;
Sprite m_sprCombo;
BitmapText m_textComboNumber;
// life meter
void SetLifeMeterX( int iX );
void UpdateLifeMeter( float fDeltaTime );
void DrawLifeMeter();
void ChangeLife( StepScore score );
public:
float GetLifePercentage() { return m_fLifePercentage; };
private:
float m_fLifePercentage;
Sprite m_sprLifeMeterFrame;
Sprite m_sprLifeMeterPills;
// score
void SetScoreX( int iX );
void UpdateScore( float fDeltaTime );
void DrawScore();
void ChangeScore( StepScore stepscore, int iCurCombo );
float m_fScore;
Sprite m_sprScoreFrame;
ScoreDisplayRolling m_ScoreDisplay;
// assist
SoundSet m_soundAssistTick;
Judgement m_Judgement;
HoldJudgement m_HoldJudgement[MAX_NUM_COLUMNS];
Combo m_Combo;
LifeMeterPills m_LifeMeter;
ScoreDisplayRollingWithFrame m_Score;
SoundSet m_soundAssistTick;
};
+50 -1
View File
@@ -35,6 +35,8 @@ ScoreDisplayRolling::ScoreDisplayRolling()
void ScoreDisplayRolling::SetScore( float fNewScore )
{
m_fScore = fNewScore;
// super inefficient (but isn't called very often)
CString sFormatString = ssprintf( "%%%d.0f", NUM_SCORE_DIGITS );
CString sScore = ssprintf( sFormatString, fNewScore );
@@ -47,6 +49,12 @@ void ScoreDisplayRolling::SetScore( float fNewScore )
}
float ScoreDisplayRolling::GetScore()
{
return m_fScore;
}
void ScoreDisplayRolling::Update( float fDeltaTime )
{
BitmapText::Update( fDeltaTime );
@@ -81,4 +89,45 @@ void ScoreDisplayRolling::Draw()
SetText( ssprintf(sFormat, iCurScore) );
BitmapText::Draw();
}
}
void ScoreDisplayRolling::AddToScore( TapStepScore stepscore, int iCurCombo )
{
// The scoring system for DDR versions 1 and 2 (including the Plus remixes) is as follows:
// For every step:
//
// Multiplier (M) = (# of steps in your current combo / 4) rounded down
// "Good" step = M * 100 (and this ends your combo)
// "Great" step = M * M * 100
// "Perfect" step = M * M * 300
//
// e.g. When you get a 259 combo, the 260th step will earn you:
//
// M = (260 / 4) rounded down
// = 65
// step = M x M X 100
// = 65 x 65 x 100
// = 422,500
// Perfect step = Great step score x 3
// = 422,500 x 3
// = 1,267,500
float M = iCurCombo/4.0f;
float fScoreToAdd = 0;
switch( stepscore )
{
case TSS_MISS: break;
case TSS_BOO: break;
case TSS_GOOD: fScoreToAdd = M * 100 + 100; break;
case TSS_GREAT: fScoreToAdd = M * M * 100 + 300; break;
case TSS_PERFECT: fScoreToAdd = M * M * 300 + 500; break;
}
m_fScore += fScoreToAdd;
ASSERT( m_fScore >= 0 );
this->SetScore( m_fScore );
}
+5
View File
@@ -26,12 +26,17 @@ class ScoreDisplayRolling : public BitmapText
{
public:
ScoreDisplayRolling();
void SetScore( float fNewScore );
float GetScore();
void AddToScore( TapStepScore stepscore, int iCurCombo );
virtual void Update( float fDeltaTime );
virtual void Draw();
protected:
float m_fScore;
int m_iCurrentScoreDigits[NUM_SCORE_DIGITS];
int m_iDestinationScoreDigits[NUM_SCORE_DIGITS];
};
+16 -21
View File
@@ -345,7 +345,7 @@ bool Song::LoadSongInfoFromBMSDir( CString sDir )
{
case 01: // background music track
float fBeatOffset;
fBeatOffset = StepIndexToBeat(iStepIndex);
fBeatOffset = StepIndexToBeat( (float)iStepIndex );
float fBPS;
fBPS = m_BPMSegments[0].m_fBPM/60.0f;
m_fOffsetInSeconds = fBeatOffset / fBPS;
@@ -353,7 +353,7 @@ bool Song::LoadSongInfoFromBMSDir( CString sDir )
break;
case 03: // bpm
BPMSegment new_seg;
new_seg.m_fStartBeat = StepIndexToBeat( iStepIndex );
new_seg.m_fStartBeat = StepIndexToBeat( (float)iStepIndex );
new_seg.m_fBPM = (float)arrayNotes[j];
m_BPMSegments.Add( new_seg ); // add to back for now (we'll sort later)
@@ -856,13 +856,12 @@ int CompareSongPointersByArtist(const void *arg1, const void *arg2)
CString sArtist1 = pSong1->GetArtist();
CString sArtist2 = pSong2->GetArtist();
CString sFilePath1 = pSong1->GetSongFilePath(); // this is unique among songs
CString sFilePath2 = pSong2->GetSongFilePath();
CString sCompareString1 = sArtist1 + sFilePath1;
CString sCompareString2 = sArtist2 + sFilePath2;
return CompareCStrings( (void*)&sCompareString1, (void*)&sCompareString2 );
if( sArtist1 < sArtist2 )
return -1;
else if( sArtist1 == sArtist2 )
return CompareSongPointersByTitle( arg1, arg2 );
else
return 1;
}
void SortSongPointerArrayByArtist( CArray<Song*, Song*> &arraySongPointers )
@@ -878,13 +877,12 @@ int CompareSongPointersByGroup(const void *arg1, const void *arg2)
CString sGroup1 = pSong1->GetGroupName();
CString sGroup2 = pSong2->GetGroupName();
CString sFilePath1 = pSong1->GetSongFilePath(); // this is unique among songs
CString sFilePath2 = pSong2->GetSongFilePath();
CString sCompareString1 = sGroup1 + sFilePath1;
CString sCompareString2 = sGroup2 + sFilePath2;
return CompareCStrings( (void*)&sCompareString1, (void*)&sCompareString2 );
if( sGroup1 < sGroup2 )
return -1;
else if( sGroup1 == sGroup2 )
return CompareSongPointersByTitle( arg1, arg2 );
else
return 1;
}
void SortSongPointerArrayByGroup( CArray<Song*, Song*> &arraySongPointers )
@@ -900,13 +898,10 @@ int CompareSongPointersByMostPlayed(const void *arg1, const void *arg2)
int iNumTimesPlayed1 = pSong1->GetNumTimesPlayed();
int iNumTimesPlayed2 = pSong2->GetNumTimesPlayed();
CString sFilePath1 = pSong1->GetSongFilePath(); // this is unique among songs
CString sFilePath2 = pSong2->GetSongFilePath();
if( iNumTimesPlayed1 > iNumTimesPlayed2 )
if( iNumTimesPlayed1 < iNumTimesPlayed2 )
return -1;
else if( iNumTimesPlayed1 == iNumTimesPlayed2 )
return CompareCStrings( (void*)&sFilePath1, (void*)&sFilePath2 );
return CompareSongPointersByTitle( arg1, arg2 );
else
return 1;
}
+1
View File
@@ -199,6 +199,7 @@ void Sprite::Update( float fDeltaTime )
void Sprite::RenderPrimitives()
{
SCREEN->Translate( -0.5f, -0.5f, 0 ); // offset so that pixels are aligned to texels
if( m_pTexture == NULL )
return;
+1 -1
View File
@@ -32,7 +32,7 @@
#include "ScreenDimensions.h"
#include <DXUtil.h>
#include "DXUtil.h"
//-----------------------------------------------------------------------------
// Links
+170 -98
View File
@@ -420,6 +420,14 @@ SOURCE=.\Steps.h
# End Source File
# Begin Source File
SOURCE=.\Style.cpp
# End Source File
# Begin Source File
SOURCE=.\Style.h
# End Source File
# Begin Source File
SOURCE=.\ThemeManager.cpp
# End Source File
# Begin Source File
@@ -448,14 +456,6 @@ SOURCE=.\dxutil.cpp
# End Source File
# Begin Source File
SOURCE=.\getdxver.cpp
# End Source File
# Begin Source File
SOURCE=.\getdxver.h
# End Source File
# Begin Source File
SOURCE=.\resource.h
# End Source File
# Begin Source File
@@ -576,14 +576,34 @@ SOURCE=.\ActorFrame.h
# End Source File
# Begin Source File
SOURCE=.\Background.cpp
SOURCE=.\BitmapText.cpp
# End Source File
# Begin Source File
SOURCE=.\Background.h
SOURCE=.\BitmapText.h
# End Source File
# Begin Source File
SOURCE=.\Rectangle.cpp
# End Source File
# Begin Source File
SOURCE=.\Rectangle.h
# End Source File
# Begin Source File
SOURCE=.\Sprite.cpp
# End Source File
# Begin Source File
SOURCE=.\Sprite.h
# End Source File
# End Group
# Begin Group "Actors used in Menus"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\Banner.cpp
# End Source File
# Begin Source File
@@ -592,14 +612,6 @@ SOURCE=.\Banner.h
# End Source File
# Begin Source File
SOURCE=.\BitmapText.cpp
# End Source File
# Begin Source File
SOURCE=.\BitmapText.h
# End Source File
# Begin Source File
SOURCE=.\BPMDisplay.cpp
# End Source File
# Begin Source File
@@ -608,14 +620,6 @@ SOURCE=.\BPMDisplay.h
# End Source File
# Begin Source File
SOURCE=.\ColorArrow.cpp
# End Source File
# Begin Source File
SOURCE=.\ColorArrow.h
# End Source File
# Begin Source File
SOURCE=.\DifficultyIcon.cpp
# End Source File
# Begin Source File
@@ -624,14 +628,6 @@ SOURCE=.\DifficultyIcon.h
# End Source File
# Begin Source File
SOURCE=.\FocusingSprite.cpp
# End Source File
# Begin Source File
SOURCE=.\FocusingSprite.h
# End Source File
# Begin Source File
SOURCE=.\FootMeter.cpp
# End Source File
# Begin Source File
@@ -640,22 +636,6 @@ SOURCE=.\FootMeter.h
# End Source File
# Begin Source File
SOURCE=.\GhostArrow.cpp
# End Source File
# Begin Source File
SOURCE=.\GhostArrow.h
# End Source File
# Begin Source File
SOURCE=.\GhostArrowBright.cpp
# End Source File
# Begin Source File
SOURCE=.\GhostArrowBright.h
# End Source File
# Begin Source File
SOURCE=.\GradeDisplay.cpp
# End Source File
# Begin Source File
@@ -664,30 +644,6 @@ SOURCE=.\GradeDisplay.h
# End Source File
# Begin Source File
SOURCE=.\GrayArrow.cpp
# End Source File
# Begin Source File
SOURCE=.\GrayArrow.h
# End Source File
# Begin Source File
SOURCE=.\HoldGhostArrow.cpp
# End Source File
# Begin Source File
SOURCE=.\HoldGhostArrow.h
# End Source File
# Begin Source File
SOURCE=.\MotionBlurSprite.cpp
# End Source File
# Begin Source File
SOURCE=.\MotionBlurSprite.h
# End Source File
# Begin Source File
SOURCE=.\MusicSortDisplay.cpp
# End Source File
# Begin Source File
@@ -712,30 +668,6 @@ SOURCE=.\MusicWheel.h
# End Source File
# Begin Source File
SOURCE=.\Rectangle.cpp
# End Source File
# Begin Source File
SOURCE=.\Rectangle.h
# End Source File
# Begin Source File
SOURCE=.\ScoreDisplayRolling.cpp
# End Source File
# Begin Source File
SOURCE=.\ScoreDisplayRolling.h
# End Source File
# Begin Source File
SOURCE=.\Sprite.cpp
# End Source File
# Begin Source File
SOURCE=.\Sprite.h
# End Source File
# Begin Source File
SOURCE=.\StepsSelector.cpp
# End Source File
# Begin Source File
@@ -759,6 +691,146 @@ SOURCE=.\TipDisplay.cpp
SOURCE=.\TipDisplay.h
# End Source File
# End Group
# Begin Group "Actors used in Dancing"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\Background.cpp
# End Source File
# Begin Source File
SOURCE=.\Background.h
# End Source File
# Begin Source File
SOURCE=.\ColorArrow.cpp
# End Source File
# Begin Source File
SOURCE=.\ColorArrow.h
# End Source File
# Begin Source File
SOURCE=.\ColorArrowField.cpp
# End Source File
# Begin Source File
SOURCE=.\ColorArrowField.h
# End Source File
# Begin Source File
SOURCE=.\Combo.cpp
# End Source File
# Begin Source File
SOURCE=.\Combo.h
# End Source File
# Begin Source File
SOURCE=.\FocusingSprite.cpp
# End Source File
# Begin Source File
SOURCE=.\FocusingSprite.h
# End Source File
# Begin Source File
SOURCE=.\GhostArrow.cpp
# End Source File
# Begin Source File
SOURCE=.\GhostArrow.h
# End Source File
# Begin Source File
SOURCE=.\GhostArrowBright.cpp
# End Source File
# Begin Source File
SOURCE=.\GhostArrowBright.h
# End Source File
# Begin Source File
SOURCE=.\GhostArrows.cpp
# End Source File
# Begin Source File
SOURCE=.\GhostArrows.h
# End Source File
# Begin Source File
SOURCE=.\GrayArrow.cpp
# End Source File
# Begin Source File
SOURCE=.\GrayArrow.h
# End Source File
# Begin Source File
SOURCE=.\GrayArrows.cpp
# End Source File
# Begin Source File
SOURCE=.\GrayArrows.h
# End Source File
# Begin Source File
SOURCE=.\HoldGhostArrow.cpp
# End Source File
# Begin Source File
SOURCE=.\HoldGhostArrow.h
# End Source File
# Begin Source File
SOURCE=.\HoldJudgement.cpp
# End Source File
# Begin Source File
SOURCE=.\HoldJudgement.h
# End Source File
# Begin Source File
SOURCE=.\Judgement.cpp
# End Source File
# Begin Source File
SOURCE=.\Judgement.h
# End Source File
# Begin Source File
SOURCE=.\LifeMeterPills.cpp
# End Source File
# Begin Source File
SOURCE=.\LifeMeterPills.h
# End Source File
# Begin Source File
SOURCE=.\MotionBlurSprite.cpp
# End Source File
# Begin Source File
SOURCE=.\MotionBlurSprite.h
# End Source File
# Begin Source File
SOURCE=.\ScoreDisplayRolling.cpp
# End Source File
# Begin Source File
SOURCE=.\ScoreDisplayRolling.h
# End Source File
# Begin Source File
SOURCE=.\ScoreDisplayRollingWithFrame.cpp
# End Source File
# Begin Source File
SOURCE=.\ScoreDisplayRollingWithFrame.h
# End Source File
# End Group
# Begin Source File
SOURCE=.\error.bmp
+43
View File
@@ -0,0 +1,43 @@
/*
-----------------------------------------------------------------------------
File: Style.h
Desc: A data structure that holds the definition of a GameMode.
Copyright (c) 2001 Chris Danford. All rights reserved.
-----------------------------------------------------------------------------
*/
#ifndef _Style_H_
#define _Style_H_
#include "Steps.h"
const int MAX_NUM_COLUMNS = 8;
struct Style
{
int m_iNumPlayers;
int m_iNumColumns; // will vary depending on the number panels (4,6,8,etc)
TapStep m_ColumnToTapStep[MAX_NUM_COLUMNS];
float m_ColumnToRotation[MAX_NUM_COLUMNS];
int TapStepToColumnNumber( TapStep tap_step )
{
for( int i=0; i<m_iNumColumns; i++ )
{
if( m_ColumnToTapStep[i] == tap_step )
return i;
}
ASSERT( false );
return -1;
};
};
Style GetStyle( GameMode mode );
#endif
+2 -1
View File
@@ -38,6 +38,7 @@ CString ThemeManager::ElementToAssetPath( ThemeElement te )
case GRAPHIC_COLOR_ARROW_GRAY_PART: sAssetPath = "Graphics\\Color Arrow gray part 2x2"; break;
case GRAPHIC_COLOR_ARROW_COLOR_PART:sAssetPath = "Graphics\\Color Arrow color part"; break;
case GRAPHIC_GHOST_ARROW: sAssetPath = "Graphics\\ghost arrow"; break;
case GRAPHIC_BRIGHT_GHOST_ARROW: sAssetPath = "Graphics\\bright ghost arrow"; break;
case GRAPHIC_HOLD_GHOST_ARROW: sAssetPath = "Graphics\\hold ghost arrow"; break;
case GRAPHIC_GRAY_ARROW: sAssetPath = "Graphics\\gray arrow"; break;
case GRAPHIC_JUDGEMENT: sAssetPath = "Graphics\\judgement 1x9"; break;
@@ -65,7 +66,7 @@ CString ThemeManager::ElementToAssetPath( ThemeElement te )
case GRAPHIC_MUSIC_SELECTION_HIGHLIGHT: sAssetPath = "Graphics\\music selection highlight"; break;
case GRAPHIC_STEPS_DESCRIPTION: sAssetPath = "Graphics\\steps description 1x8"; break;
case GRAPHIC_SECTION_BACKGROUND: sAssetPath = "Graphics\\section background"; break;
case GRAPHIC_MUSIC_SORT_ICONS: sAssetPath = "Graphics\\music sort icons 1x5"; break;
case GRAPHIC_MUSIC_SORT_ICONS: sAssetPath = "Graphics\\music sort icons 1x4"; break;
case GRAPHIC_MUSIC_STATUS_ICONS: sAssetPath = "Graphics\\music status icons 1x4"; break;
case GRAPHIC_DANGER_TEXT: sAssetPath = "Graphics\\danger text"; break;
case GRAPHIC_DANGER_BACKGROUND: sAssetPath = "Graphics\\danger background"; break;
+1
View File
@@ -32,6 +32,7 @@ enum ThemeElement {
GRAPHIC_COLOR_ARROW_GRAY_PART,
GRAPHIC_COLOR_ARROW_COLOR_PART,
GRAPHIC_GHOST_ARROW,
GRAPHIC_BRIGHT_GHOST_ARROW,
GRAPHIC_HOLD_GHOST_ARROW,
GRAPHIC_GRAY_ARROW,
GRAPHIC_JUDGEMENT,
+1 -1
View File
@@ -25,7 +25,7 @@ public:
TipDisplay();
void SetTips( CStringArray &arrayTips );
void Update( float fDeltaTime );
virtual void Update( float fDeltaTime );
protected:
BitmapText m_textTip;
+2 -2
View File
@@ -54,12 +54,12 @@ void TransitionFadeWipe::RenderPrimitives()
m_rectBlack.SetDiffuseColor( D3DXCOLOR(0,0,0,1) );
m_rectBlack.StretchTo( CRect(fDarkOutsideX, 0, fDarkEdgeX, SCREEN_HEIGHT) );
m_rectBlack.StretchTo( CRect((int)fDarkOutsideX, 0, (int)fDarkEdgeX, (int)SCREEN_HEIGHT) );
m_rectBlack.Draw();
m_rectGradient.SetDiffuseColorLeftEdge( D3DXCOLOR(0,0,0,1) );
m_rectGradient.SetDiffuseColorRightEdge( D3DXCOLOR(0,0,0,0) );
m_rectGradient.StretchTo( CRect(fDarkEdgeX, 0, fLightEdgeX, SCREEN_HEIGHT) );
m_rectGradient.StretchTo( CRect((int)fDarkEdgeX, 0, (int)fLightEdgeX, (int)SCREEN_HEIGHT) );
m_rectGradient.Draw();
+3 -3
View File
@@ -79,7 +79,7 @@ void TransitionStarWipe::RenderPrimitives()
m_sprStar.SetRotation( bIsAnEvenRow ? D3DX_PI : 0.0f ); // flip the sprite
m_sprStar.SetXY( bIsAnEvenRow?x-1:x, bIsAnEvenRow?y-1:y ); // fudge. The rotation makes it off center
m_sprStar.SetXY( bIsAnEvenRow?x-1.0f:x+0.0f, bIsAnEvenRow?y-1.0f:y+0.0f ); // fudge. The rotation makes it off center
m_sprStar.Draw();
int x_rect_leading_edge = x + ( bIsAnEvenRow ? - m_iStarWidth/2 : m_iStarWidth/2 );
@@ -120,6 +120,6 @@ void TransitionStarWipe::CloseWipingLeft( WindowMessage send_when_done )
void TransitionStarWipe::LoadNewStarSprite( CString sFileName )
{
m_sprStar.Load( sFileName );
m_iStarWidth = m_sprStar.GetZoomedWidth();
m_iStarHeight = m_sprStar.GetZoomedHeight();
m_iStarWidth = (int)m_sprStar.GetZoomedWidth();
m_iStarHeight = (int)m_sprStar.GetZoomedHeight();
}
-1
View File
@@ -13,7 +13,6 @@
#include "Steps.h"
class Steps; // why is this needed?
#include "GameInfo.h" // for definition of GameMode
enum GameMode; // why is this needed?