weekend checkin

This commit is contained in:
Chris Danford
2002-06-14 22:25:22 +00:00
parent bfc327df13
commit 0bc6e1ec7e
94 changed files with 2375 additions and 1241 deletions
+4
View File
@@ -11,6 +11,10 @@
#include "ActorFrame.h"
void ActorFrame::AddActor( Actor* pActor)
{
m_SubActors.Add( pActor );
}
void ActorFrame::DrawPrimitives()
{
+2 -9
View File
@@ -1,3 +1,4 @@
#pragma once
/*
-----------------------------------------------------------------------------
File: ActorFrame.h
@@ -8,10 +9,6 @@
-----------------------------------------------------------------------------
*/
#ifndef _ActorFrame_H_
#define _ActorFrame_H_
#include "RageUtil.h"
#include <d3dx8math.h>
@@ -26,7 +23,7 @@ protected:
public:
void AddActor( Actor* pActor) { m_SubActors.Add(pActor); };
void AddActor( Actor* pActor);
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
@@ -34,7 +31,3 @@ public:
virtual void SetDiffuseColor( D3DXCOLOR c );
};
#endif
+6 -3
View File
@@ -12,7 +12,7 @@
#include "AnnouncerManager.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
AnnouncerManager* ANNOUNCER = NULL; // global object accessable from anywhere in the program
@@ -49,7 +49,7 @@ void AnnouncerManager::SwitchAnnouncer( CString sAnnouncerName )
m_sCurAnnouncerName = sAnnouncerName;
CString sAnnouncerDir = GetAnnouncerDirFromName( m_sCurAnnouncerName );
if( !DoesFileExist( sAnnouncerDir ) )
FatalError( "Error loading the announcer in diretory '%s'.", m_sCurAnnouncerName );
throw RageException( "Error loading the announcer in diretory '%s'.", m_sCurAnnouncerName );
}
void AnnouncerManager::AssertAnnouncerIsComplete( CString sAnnouncerName )
@@ -58,7 +58,7 @@ void AnnouncerManager::AssertAnnouncerIsComplete( CString sAnnouncerName )
{
CString sPath = GetPathTo( (AnnouncerElement)i, sAnnouncerName );
if( !DoesFileExist(sPath) )
FatalError( "The Announcer element '%s' is missing.", sPath );
throw RageException( "The Announcer element '%s' is missing.", sPath );
}
}
@@ -119,9 +119,12 @@ CString AnnouncerManager::GetPathTo( AnnouncerElement ae, CString sAnnouncerName
case ANNOUNCER_RESULT_C: sAssetDir = "result c"; break;
case ANNOUNCER_RESULT_D: sAssetDir = "result d"; break;
case ANNOUNCER_RESULT_E: sAssetDir = "result e"; break;
case ANNOUNCER_SELECT_COURSE_INTRO: sAssetDir = "select course intro"; break;
case ANNOUNCER_SELECT_DIFFICULTY_COMMENT_EASY: sAssetDir = "select difficulty comment easy"; break;
case ANNOUNCER_SELECT_DIFFICULTY_COMMENT_HARD: sAssetDir = "select difficulty comment hard"; break;
case ANNOUNCER_SELECT_DIFFICULTY_COMMENT_MEDIUM:sAssetDir = "select difficulty comment medium"; break;
case ANNOUNCER_SELECT_DIFFICULTY_COMMENT_ONI: sAssetDir = "select difficulty comment oni"; break;
case ANNOUNCER_SELECT_DIFFICULTY_CHALLENGE: sAssetDir = "select difficulty challenge"; break;
case ANNOUNCER_SELECT_DIFFICULTY_INTRO: sAssetDir = "select difficulty intro"; break;
case ANNOUNCER_SELECT_GROUP_COMMENT_ALL_MUSIC: sAssetDir = "select group comment all music"; break;
case ANNOUNCER_SELECT_GROUP_COMMENT_GENERAL: sAssetDir = "select group comment general"; break;
+3
View File
@@ -56,9 +56,12 @@ enum AnnouncerElement {
ANNOUNCER_RESULT_C,
ANNOUNCER_RESULT_D,
ANNOUNCER_RESULT_E,
ANNOUNCER_SELECT_COURSE_INTRO,
ANNOUNCER_SELECT_DIFFICULTY_COMMENT_EASY,
ANNOUNCER_SELECT_DIFFICULTY_COMMENT_HARD,
ANNOUNCER_SELECT_DIFFICULTY_COMMENT_MEDIUM,
ANNOUNCER_SELECT_DIFFICULTY_COMMENT_ONI,
ANNOUNCER_SELECT_DIFFICULTY_CHALLENGE,
ANNOUNCER_SELECT_DIFFICULTY_INTRO,
ANNOUNCER_SELECT_GROUP_COMMENT_ALL_MUSIC,
ANNOUNCER_SELECT_GROUP_COMMENT_GENERAL,
+1 -1
View File
@@ -40,7 +40,7 @@ float ArrowGetXPos( const PlayerOptions& po, int iColNum, float fYOffset, float
switch( po.m_EffectType )
{
case PlayerOptions::EFFECT_DRUNK:
fPixelOffsetFromCenter += cosf( (GetTickCount()%1000000)/250.0f + iColNum*0.4f + fYOffset/SCREEN_HEIGHT*4) * ARROW_SIZE/3;
fPixelOffsetFromCenter += cosf( TIMER->GetTimeSinceStart()/4 + iColNum*0.4f + fYOffset/SCREEN_HEIGHT*4) * ARROW_SIZE/3;
break;
}
return fPixelOffsetFromCenter;
+1 -1
View File
@@ -95,7 +95,7 @@ void Background::DrawPrimitives()
{
ActorFrame::DrawPrimitives();
if( m_bShowDanger && (GetTickCount() % 1000) > 500 )
if( m_bShowDanger && (TIMER->GetTimeSinceStart() - (int)TIMER->GetTimeSinceStart()) > 0.5f )
{
m_sprDangerBackground.Draw();
m_sprDanger.Draw();
+13
View File
@@ -72,6 +72,19 @@ bool Banner::LoadFromGroup( CString sGroupName )
return true;
}
bool Banner::LoadFromCourse( Course* pCourse ) // NULL means no course
{
m_bScrolling = false;
Sprite::TurnShadowOff();
if( pCourse == NULL ) Banner::Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BANNER) );
else if( pCourse->m_sBannerPath != "" ) Banner::Load( pCourse->m_sBannerPath );
else Banner::Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BANNER) );
return true;
}
bool Banner::LoadRoulette()
{
Banner::Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_ROULETTE_BANNER), false, 0, 0, false, false );
+3
View File
@@ -17,6 +17,8 @@
const float BANNER_WIDTH = 286;
const float BANNER_HEIGHT = 92;
class Course;
class Banner : public CroppedSprite
{
@@ -36,6 +38,7 @@ public:
bool LoadFromSong( Song* pSong ); // NULL means no song
bool LoadFromGroup( CString sGroupName );
bool LoadFromCourse( Course* pCourse );
bool LoadRoulette();
inline void SetScrolling( bool bScroll ) { m_bScrolling = bScroll; };
+5
View File
@@ -31,3 +31,8 @@ void BannerWithFrame::LoadFromSong( Song* pSong )
{
m_Banner.LoadFromSong( pSong );
}
void BannerWithFrame::LoadFromGroup( CString sGroupName )
{
m_Banner.LoadFromGroup( sGroupName );
}
+1
View File
@@ -21,6 +21,7 @@ public:
BannerWithFrame();
void LoadFromSong( Song* pSong );
void LoadFromGroup( CString sGroupName );
protected:
+3 -3
View File
@@ -14,7 +14,7 @@
#include "IniFile.h"
#include "FontManager.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
D3DXCOLOR RAINBOW_COLORS[] = {
@@ -176,7 +176,7 @@ void BitmapText::DrawPrimitives()
const char c = szLine[j];
const int iFrameNo = m_pFont->m_iCharToFrameNo[c];
if( iFrameNo == -1 ) // this font doesn't impelemnt this character
FatalError( "The font '%s' does not implement the character '%c'", m_sFontFilePath, c );
throw RageException( "The font '%s' does not implement the character '%c'", m_sFontFilePath, c );
const int iCharWidth = m_pFont->m_iFrameNoToWidth[iFrameNo];
// HACK:
@@ -298,7 +298,7 @@ void BitmapText::DrawPrimitives()
if( m_bRainbow )
{
int color_index = (GetTickCount() / 200) % NUM_RAINBOW_COLORS;
int color_index = int(TIMER->GetTimeSinceStart() / 0.200) % NUM_RAINBOW_COLORS;
for( int i=0; i<iNumV; i+=6 )
{
const D3DXCOLOR color = RAINBOW_COLORS[color_index];
+3 -4
View File
@@ -27,7 +27,7 @@ Combo::Combo()
m_textComboNumber.Load( THEME->GetPathTo(FONT_COMBO_NUMBERS) );
m_textComboNumber.TurnShadowOn();
m_textComboNumber.SetHorizAlign( Actor::align_right );
m_textComboNumber.SetX( -10 );
m_textComboNumber.SetX( -0 );
m_textComboNumber.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
m_sprCombo.SetDiffuseColor( D3DXCOLOR(1,1,1,0) ); // invisible
@@ -38,9 +38,9 @@ Combo::Combo()
}
void Combo::ContinueCombo()
void Combo::ContinueCombo( const int iNumNotesHit )
{
m_iCurCombo++;
m_iCurCombo += iNumNotesHit;
// new max combo
if( m_iCurCombo > m_iMaxCombo )
@@ -59,7 +59,6 @@ void Combo::ContinueCombo()
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 );
//this->SetZoom( 1.2f );
//this->BeginTweening( 0.3f );
+1 -1
View File
@@ -24,7 +24,7 @@ class Combo : public ActorFrame
public:
Combo();
void ContinueCombo();
void ContinueCombo( const int iNumNotesHit );
void EndCombo();
int GetCurrentCombo();
+15
View File
@@ -0,0 +1,15 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: Course
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Course.h"
#include "ThemeManager.h"
+49
View File
@@ -0,0 +1,49 @@
#pragma once
/*
-----------------------------------------------------------------------------
Course: Course
Desc: A queue of songs and notes.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "GameConstantsAndTypes.h"
class Song;
struct Notes;
const int MAX_COURSE_STAGES = 100;
class Course
{
public:
Course()
{
m_NotesType = NOTES_TYPE_INVALID;
m_iStages = 0;
for( int i=0; i<MAX_COURSE_STAGES; i++ )
{
m_apSongs[i] = NULL;
m_apNotes[i] = NULL;
}
}
CString m_sName;
CString m_sBannerPath;
CString m_sCDTitlePath;
NotesType m_NotesType;
int m_iStages;
Song* m_apSongs[MAX_COURSE_STAGES];
Notes* m_apNotes[MAX_COURSE_STAGES];
void AddStage( Song* pSong, Notes* pNotes )
{
ASSERT( m_iStages <= MAX_COURSE_STAGES );
m_apSongs[m_iStages] = pSong;
m_apNotes[m_iStages] = pNotes;
m_iStages++;
}
};
+71
View File
@@ -0,0 +1,71 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: CourseContentsFrame
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "CourseContentsFrame.h"
#include "RageUtil.h"
#include "GameConstantsAndTypes.h"
#include "ThemeManager.h"
#include "RageLog.h"
#include "PrefsManager.h"
#include "Course.h"
const float NAME_X = -100;
const float METER_X = +50;
const float GAP_Y = 34;
const float START_Y = 0 - MAX_COURSE_CONTENTS/2*GAP_Y;
CourseContentsFrame::CourseContentsFrame()
{
for( int i=0; i<MAX_COURSE_CONTENTS; i++ )
{
m_textContents[i].Load( THEME->GetPathTo(FONT_TEXT_BANNER) );
m_textContents[i].SetHorizAlign( Actor::align_left );
m_textContents[i].SetXY( NAME_X, START_Y + GAP_Y*i );
m_textContents[i].SetText( "" );
m_textContents[i].SetZoom( 0.7f );
this->AddActor( &m_textContents[i] );
m_Meters[i].SetXY( METER_X, START_Y + GAP_Y*i + 10 );
this->AddActor( &m_Meters[i] );
}
}
void CourseContentsFrame::Update( float fDeltaTime )
{
ActorFrame::Update( fDeltaTime );
}
void CourseContentsFrame::SetFromCourse( Course* pCourse )
{
ASSERT( pCourse != NULL );
int i;
// turn all lines "off"
for( i=0; i<MAX_COURSE_CONTENTS; i++ )
{
m_textContents[i].SetText( "" );
m_Meters[i].SetFromNotes( NULL );
}
for( i=0; i<pCourse->m_iStages-1; i++ )
{
m_textContents[i].SetText( pCourse->m_apSongs[i]->GetMainTitle() );
m_textContents[i].SetDiffuseColor( DifficultyClassToColor(pCourse->m_apNotes[i]->m_DifficultyClass) );
m_Meters[i].SetFromNotes( pCourse->m_apNotes[i] );
}
if( pCourse->m_iStages >= MAX_COURSE_CONTENTS )
m_textContents[MAX_COURSE_CONTENTS-1].SetText( ssprintf("%d more...", pCourse->m_iStages-(MAX_COURSE_CONTENTS-1)) );
}
+33
View File
@@ -0,0 +1,33 @@
#pragma once
/*
-----------------------------------------------------------------------------
Class: CourseContentsFrame
Desc: Holds course name and banner.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "FootMeter.h"
#include "BitmapText.h"
#include "ActorFrame.h"
class Course;
const int MAX_COURSE_CONTENTS = 8;
class CourseContentsFrame : public ActorFrame
{
public:
CourseContentsFrame();
void Update( float fDeltaTime );
void SetFromCourse( Course* pCourse );
protected:
BitmapText m_textContents[MAX_COURSE_CONTENTS];
FootMeter m_Meters[MAX_COURSE_CONTENTS];
};
+5 -8
View File
@@ -1,18 +1,16 @@
#pragma once
/*
-----------------------------------------------------------------------------
File: DifficultyIcon.h
Class: DifficultyIcon
Desc: A graphic displayed in the DifficultyIcon during Dancing.
Desc: A graphic displayed in Select Music above the Groove Radar.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#ifndef _DifficultyIcon_H_
#define _DifficultyIcon_H_
#include "Sprite.h"
#include "Song.h"
#include "BitmapText.h"
@@ -24,7 +22,7 @@ class DifficultyIcon : public Sprite
public:
DifficultyIcon()
{
Load( THEME->GetPathTo(GRAPHIC_DIFFICULTY_ICONS) );
Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_DIFFICULTY_BANNER_ICONS) );
StopAnimating();
SetFromNotes( NULL );
@@ -61,4 +59,3 @@ private:
};
};
#endif
+7 -7
View File
@@ -16,7 +16,7 @@
#include "RageTextureManager.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
Font::Font( const CString &sFontFilePath )
@@ -49,7 +49,7 @@ Font::Font( const CString &sFontFilePath )
IniFile ini;
ini.SetPath( m_sFontFilePath );
if( !ini.ReadFile() )
FatalError( "Error opening Font file '%s'.", m_sFontFilePath );
throw RageException( "Error opening Font file '%s'.", m_sFontFilePath );
//
@@ -58,7 +58,7 @@ Font::Font( const CString &sFontFilePath )
CString sTextureFile;
ini.GetValue( "Font", "Texture", sTextureFile );
if( sTextureFile == "" )
FatalError( "Error reading value 'Texture' from %s.", m_sFontFilePath );
throw RageException( "Error reading value 'Texture' from %s.", m_sFontFilePath );
m_sTexturePath = sFontDir + sTextureFile; // save the path of the new texture
m_sTexturePath.MakeLower();
@@ -76,7 +76,7 @@ Font::Font( const CString &sFontFilePath )
{
// sanity check
if( sCharacters.GetLength() != m_pTexture->GetNumFrames() )
FatalError( "The characters in '%s' does not match the number of frames in the texture."
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() );
@@ -106,7 +106,7 @@ Font::Font( const CString &sFontFilePath )
}
break;
default:
FatalError( "No characters were specified in '%s' and the font is not a standard ASCII set.", m_sFontFilePath );
throw RageException( "No characters were specified in '%s' and the font is not a standard ASCII set.", m_sFontFilePath );
}
}
@@ -126,7 +126,7 @@ Font::Font( const CString &sFontFilePath )
split( sWidthsValue, ",", asCharWidths );
if( asCharWidths.GetSize() != m_pTexture->GetNumFrames() )
FatalError( "The number of widths specified in '%s' (%d) do not match the number of frames in the texture (%d).",
throw RageException( "The number of widths specified in '%s' (%d) do not match the number of frames in the texture (%d).",
m_sFontFilePath, asCharWidths.GetSize(), m_pTexture->GetNumFrames() );
for( int i=0; i<asCharWidths.GetSize(); i++ )
@@ -158,7 +158,7 @@ int Font::GetLineWidthInSourcePixels( LPCTSTR szLine, int iLength )
const char c = szLine[i];
const int iFrameNo = m_iCharToFrameNo[c];
if( iFrameNo == -1 ) // this font doesn't impelemnt this character
FatalError( "The font '%s' does not implement the character '%c'", m_sFontFilePath, c );
throw RageException( "The font '%s' does not implement the character '%c'", m_sFontFilePath, c );
iLineWidth += m_iFrameNoToWidth[iFrameNo];
}
+2 -2
View File
@@ -17,7 +17,7 @@
#include "Font.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
FontManager* FONT = NULL;
@@ -127,7 +127,7 @@ void FontManager::UnloadFont( CString sFontFilePath )
}
else // lookup failed
{
FatalError( ssprintf("Tried to Unload a font that wasn't loaded. '%s'", sFontFilePath) );
throw RageException( ssprintf("Tried to Unload a font that wasn't loaded. '%s'", sFontFilePath) );
}
}
+1
View File
@@ -42,6 +42,7 @@ void FootMeter::SetFromNotes( Notes* pNotes )
}
else
{
this->SetEffectNone();
SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
SetNumFeet( 0, "" );
}
+3 -21
View File
@@ -153,7 +153,8 @@ enum NotesType
NOTES_TYPE_DANCE_SOLO,
NOTES_TYPE_PUMP_SINGLE,
NOTES_TYPE_PUMP_DOUBLE,
NUM_NOTES_TYPES // leave this at the end
NUM_NOTES_TYPES, // leave this at the end
NOTES_TYPE_INVALID,
};
inline int NotesTypeToNumColumns( NotesType nt )
@@ -202,8 +203,7 @@ inline CString NotesTypeToString( NotesType nt )
enum PlayMode
{
PLAY_MODE_ARCADE,
PLAY_MODE_NONSTOP,
PLAY_MODE_ENDLESS,
PLAY_MODE_ONI,
NUM_PLAY_MODES
};
@@ -253,7 +253,6 @@ enum Style
STYLE_DANCE_DOUBLE,
STYLE_DANCE_COUPLE,
STYLE_DANCE_SOLO,
STYLE_DANCE_SOLO_VERSUS,
STYLE_PUMP_SINGLE,
STYLE_PUMP_VERSUS,
STYLE_PUMP_DOUBLE,
@@ -270,7 +269,6 @@ inline Game StyleToGame( Style s )
case STYLE_DANCE_DOUBLE:
case STYLE_DANCE_COUPLE:
case STYLE_DANCE_SOLO:
case STYLE_DANCE_SOLO_VERSUS:
return GAME_DANCE;
case STYLE_PUMP_SINGLE:
case STYLE_PUMP_VERSUS:
@@ -374,19 +372,3 @@ struct SongOptions
};
struct ScoreSummary
{
int perfect, great, good, boo, miss, ok, ng, max_combo;
float score;
float fRadarActual[NUM_RADAR_VALUES];
float fRadarPossible[NUM_RADAR_VALUES];
ScoreSummary()
{
perfect=great=good=boo=miss=ok=ng=max_combo=0;
score=0;
for( int r=0; r<NUM_RADAR_VALUES; r++ )
fRadarActual[r] = fRadarPossible[r] = 0;
}
};
+5 -5
View File
@@ -13,7 +13,7 @@
#include "GameDef.h"
#include "RageLog.h"
#include "RageUtil.h"
#include "ErrorCatcher/ErrorCatcher.h"
#include "IniFile.h"
#include "StyleDef.h"
@@ -32,7 +32,7 @@ CString GameDef::ElementToGraphicSuffix( const GameButtonGraphic gbg )
case GRAPHIC_TAP_EXPLOSION_DIM: sAssetPath = "tap explosion dim"; break;
default:
FatalError( ssprintf("Unhandled StyleElement %d", gbg) );
throw RageException( ssprintf("Unhandled StyleElement %d", gbg) );
}
return sAssetPath;
@@ -54,7 +54,7 @@ CString GameDef::GetPathToGraphic( const CString sSkinName, const int iInstrumen
if( arrayPossibleFileNames.GetSize() > 0 )
return sSkinDir + arrayPossibleFileNames[0];
FatalError( "The game button graphic '%s%s %s' is missing.", sSkinDir, sButtonName, sGraphicSuffix );
throw RageException( "The game button graphic '%s%s %s' is missing.", sSkinDir, sButtonName, sGraphicSuffix );
return "";
}
@@ -94,7 +94,7 @@ void GameDef::GetSkinNames( CStringArray &AddTo )
AddTo.RemoveAt( i );
if( AddTo.GetSize() == 0 )
FatalError( "The folder '%s' must contain at least one skin.", sBaseSkinFolder );
throw RageException( "The folder '%s' must contain at least one skin.", sBaseSkinFolder );
}
bool GameDef::HasASkinNamed( CString sSkin )
@@ -124,7 +124,7 @@ void GameDef::AssertSkinsAreComplete()
GameButtonGraphic gbg = (GameButtonGraphic)i;
CString sPathToGraphic = GetPathToGraphic( sSkin, INSTRUMENT_1, gbg );
if( !DoesFileExist(sPathToGraphic) )
FatalError( "Game button graphic at %s is missing.", sPathToGraphic );
throw RageException( "Game button graphic at %s is missing.", sPathToGraphic );
}
}
}
+7 -4
View File
@@ -11,7 +11,7 @@
*/
#include "GameManager.h"
#include "ErrorCatcher/ErrorCatcher.h"
GameManager* GAMEMAN = NULL; // global and accessable from anywhere in our program
@@ -226,7 +226,7 @@ StyleDef g_StyleDefs[NUM_STYLES] =
0,1,2,3,4,5
},
},
{ // STYLE_DANCE_SOLO_VERSUS
/* { // STYLE_DANCE_SOLO_VERSUS
"dance-solo-versus", // m_szName
NOTES_TYPE_DANCE_SOLO, // m_NotesType
StyleDef::ONE_PLAYER_USES_ONE_SIDE, // m_StyleType
@@ -254,8 +254,8 @@ StyleDef g_StyleDefs[NUM_STYLES] =
0,5,1,4,2,3 // outside in
},
},
{ // PUMP_STYLE_SINGLE
"single", // m_szName
*/ { // PUMP_STYLE_SINGLE
"pump-single", // m_szName
NOTES_TYPE_PUMP_SINGLE, // m_NotesType
StyleDef::ONE_PLAYER_USES_ONE_SIDE, // m_StyleType
{ 160, 480 }, // m_iCenterX
@@ -383,6 +383,9 @@ void GameManager::GetSkinNames( CStringArray &AddTo )
bool GameManager::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_sMasterPlayerNumber ) ||
( GetCurrentStyleDef()->m_StyleType == StyleDef::TWO_PLAYERS_USE_TWO_SIDES );
};
+3 -3
View File
@@ -41,9 +41,9 @@ void GhostArrow::Step( TapNoteScore score )
case TNS_BOO: SetDiffuseColor( D3DXCOLOR(0.8f,0.0f,0.6f,0.6f) ); break;
case TNS_MISS: ASSERT( false ); break;
}
SetZoom( 1.1f );
BeginTweening( 0.30f );
SetTweenZoom( 1.7f );
SetZoom( 1.0f );
BeginTweening( 0.25f );
SetTweenZoom( 1.5f );
D3DXCOLOR colorTween = GetDiffuseColor();
colorTween.a = 0;
SetTweenDiffuseColor( colorTween );
+3 -3
View File
@@ -38,9 +38,9 @@ void GhostArrowBright::Step( TapNoteScore score )
case TNS_MISS: ASSERT( false ); break;
}
SetState( 0 );
SetZoom( 1.3f );
BeginTweening( 0.35f );
SetTweenZoom( 2.5f );
SetZoom( 1.0f );
BeginTweening( 0.25f );
SetTweenZoom( 1.5f );
D3DXCOLOR colorTween = GetDiffuseColor();
colorTween.a = 0;
SetTweenDiffuseColor( colorTween );
+24 -16
View File
@@ -29,6 +29,7 @@ GradeDisplay::GradeDisplay()
StopAnimating();
m_fTimeLeftInScroll = 0;
m_bDoScrolling = false;
SetGrade( GRADE_NO_DATA );
}
@@ -37,31 +38,34 @@ void GradeDisplay::Update( float fDeltaTime )
{
Sprite::Update( fDeltaTime );
m_fTimeLeftInScroll -= fDeltaTime;
m_fTimeLeftInScroll = max( 0, m_fTimeLeftInScroll );
if( m_bDoScrolling )
{
m_fTimeLeftInScroll -= fDeltaTime;
m_fTimeLeftInScroll = max( 0, m_fTimeLeftInScroll );
float fPercentIntoScrolling = 1 - (m_fTimeLeftInScroll/SCROLL_TIME);
if( fPercentIntoScrolling < 0.75 )
fPercentIntoScrolling = (fPercentIntoScrolling/0.75f) * (1 + 1.0f/NUM_GRADE_FRAMES);
else if( fPercentIntoScrolling < 0.9 )
fPercentIntoScrolling = 1 + 1.0f/NUM_GRADE_FRAMES;
else
fPercentIntoScrolling = (1 + 1.0f/NUM_GRADE_FRAMES) - ((fPercentIntoScrolling-0.9f)/0.1f) * 1.0f/NUM_GRADE_FRAMES;
float fPercentIntoScrolling = 1 - (m_fTimeLeftInScroll/SCROLL_TIME);
if( fPercentIntoScrolling < 0.75 )
fPercentIntoScrolling = (fPercentIntoScrolling/0.75f) * (1 + 1.0f/NUM_GRADE_FRAMES);
else if( fPercentIntoScrolling < 0.9 )
fPercentIntoScrolling = 1 + 1.0f/NUM_GRADE_FRAMES;
else
fPercentIntoScrolling = (1 + 1.0f/NUM_GRADE_FRAMES) - ((fPercentIntoScrolling-0.9f)/0.1f) * 1.0f/NUM_GRADE_FRAMES;
FRECT frectCurrentTextureCoords;
frectCurrentTextureCoords.left = m_frectStartTexCoords.left*(1-fPercentIntoScrolling) + m_frectDestTexCoords.left*fPercentIntoScrolling;
frectCurrentTextureCoords.top = m_frectStartTexCoords.top*(1-fPercentIntoScrolling) + m_frectDestTexCoords.top*fPercentIntoScrolling;
frectCurrentTextureCoords.right = m_frectStartTexCoords.right*(1-fPercentIntoScrolling) + m_frectDestTexCoords.right*fPercentIntoScrolling;
frectCurrentTextureCoords.bottom = m_frectStartTexCoords.bottom*(1-fPercentIntoScrolling) + m_frectDestTexCoords.bottom*fPercentIntoScrolling;
FRECT frectCurrentTextureCoords;
frectCurrentTextureCoords.left = m_frectStartTexCoords.left*(1-fPercentIntoScrolling) + m_frectDestTexCoords.left*fPercentIntoScrolling;
frectCurrentTextureCoords.top = m_frectStartTexCoords.top*(1-fPercentIntoScrolling) + m_frectDestTexCoords.top*fPercentIntoScrolling;
frectCurrentTextureCoords.right = m_frectStartTexCoords.right*(1-fPercentIntoScrolling) + m_frectDestTexCoords.right*fPercentIntoScrolling;
frectCurrentTextureCoords.bottom = m_frectStartTexCoords.bottom*(1-fPercentIntoScrolling) + m_frectDestTexCoords.bottom*fPercentIntoScrolling;
this->SetCustomTextureRect( frectCurrentTextureCoords );
this->SetCustomTextureRect( frectCurrentTextureCoords );
}
}
void GradeDisplay::DrawPrimitives()
{
if( m_Grade == GRADE_NO_DATA )
return;
Sprite::DrawPrimitives();
}
@@ -69,6 +73,7 @@ void GradeDisplay::SetGrade( Grade g )
{
m_Grade = g;
m_bDoScrolling = false;
StopUsingCustomCoords();
switch( g )
@@ -90,6 +95,9 @@ void GradeDisplay::SpinAndSettleOn( Grade g )
ASSERT( g != GRADE_NO_DATA );
m_Grade = g;
m_bDoScrolling = true;
SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
int iFrameNo;
+1
View File
@@ -32,6 +32,7 @@ protected:
Grade m_Grade;
// for scrolling
bool m_bDoScrolling;
FRECT m_frectStartTexCoords;
FRECT m_frectDestTexCoords;
float m_fTimeLeftInScroll;
+1 -1
View File
@@ -47,7 +47,7 @@ void HoldGhostArrow::Update( float fDeltaTime )
if( m_fHeatLevel == 1 )
{
bool bZooomALittle = (GetTickCount() % 50) > 25;
bool bZooomALittle = fmodf( TIMER->GetTimeSinceStart(), 1/20.0f ) > 1/40.0f;
SetZoom( bZooomALittle ? 1.04f : 1.0f );
}
else
+7 -7
View File
@@ -44,21 +44,21 @@ void HoldJudgement::DrawPrimitives()
}
}
void HoldJudgement::SetHoldJudgement( HoldNoteResult result )
void HoldJudgement::SetHoldJudgement( HoldNoteScore hns )
{
//LOG->WriteLine( "Judgement::SetJudgement()" );
switch( result )
switch( hns )
{
case HNR_NONE: m_sprJudgement.SetState( 0 ); break;
case HNR_OK: m_sprJudgement.SetState( 7 ); break;
case HNR_NG: m_sprJudgement.SetState( 8 ); break;
case HNS_NONE: m_sprJudgement.SetState( 0 ); break;
case HNS_OK: m_sprJudgement.SetState( 7 ); break;
case HNS_NG: m_sprJudgement.SetState( 8 ); break;
default: ASSERT( false );
}
m_fDisplayCountdown = JUDGEMENT_DISPLAY_TIME;
if( result == HNR_NG )
if( hns == HNS_NG )
{
// falling down
m_sprJudgement.SetY( -10 );
@@ -66,7 +66,7 @@ void HoldJudgement::SetHoldJudgement( HoldNoteResult result )
m_sprJudgement.BeginTweening( JUDGEMENT_DISPLAY_TIME );
m_sprJudgement.SetTweenY( 10 );
}
else if( result == HNR_OK )
else // hns == HNS_OK
{
// zooming out
m_sprJudgement.SetZoom( 1.5f );
+1 -1
View File
@@ -24,7 +24,7 @@ class HoldJudgement : public ActorFrame
{
public:
HoldJudgement();
void SetHoldJudgement( HoldNoteResult result );
void SetHoldJudgement( HoldNoteScore hns );
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
+1 -1
View File
@@ -14,7 +14,7 @@
#include "InputFilter.h"
#include "RageLog.h"
#include "RageInput.h"
#include "ErrorCatcher/ErrorCatcher.h"
InputFilter* INPUTFILTER = NULL; // global and accessable from anywhere in our program
+7 -1
View File
@@ -41,7 +41,7 @@ void InputMapper::ReadMappingsFromDisk()
ini.SetPath( m_sCurrentGame + ".ini" );
if( !ini.ReadFile() ) {
return; // load nothing
//FatalError( "could not read config file" );
//throw RageException( "could not read config file" );
}
CMapStringToString* pKey = ini.GetKeyPointer("Input");
@@ -235,6 +235,12 @@ DeviceInput InputMapper::MenuToDevice( MenuInput MenuI )
void InputMapper::GameToStyle( GameInput GameI, StyleInput &StyleI )
{
if( GAMEMAN->m_CurStyle == STYLE_NONE )
{
StyleI.MakeBlank();
return;
}
StyleDef* pStyleDef = GAMEMAN->GetCurrentStyleDef();
StyleI = pStyleDef->GameInputToStyleInput( GameI );
}
+1 -1
View File
@@ -5,7 +5,7 @@
Desc: Holds user-chosen preferences and saves it between sessions. This class
also has temporary holders for information that passed between windows - e.g.
ScoreSummary.
GameplayStatistics.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
+15 -16
View File
@@ -21,35 +21,34 @@ public:
InputQueue()
{
for( int p=0; p<NUM_PLAYERS; p++ )
m_aMenuButtonQueue[p].SetSize( MAX_INPUT_QUEUE_LENGTH );
m_aQueue[p].SetSize( MAX_INPUT_QUEUE_LENGTH );
}
void HandleInput( const PlayerNumber p, const MenuButton b )
{
if( m_aMenuButtonQueue[p].GetSize() >= MAX_INPUT_QUEUE_LENGTH ) // full
m_aMenuButtonQueue[p].RemoveAt( 0, m_aMenuButtonQueue[p].GetSize()-MAX_INPUT_QUEUE_LENGTH+1 );
m_aMenuButtonQueue[p].Add( MenuButtonAndTickCount(b,GetTickCount()) );
if( m_aQueue[p].GetSize() >= MAX_INPUT_QUEUE_LENGTH ) // full
m_aQueue[p].RemoveAt( 0, m_aQueue[p].GetSize()-MAX_INPUT_QUEUE_LENGTH+1 );
m_aQueue[p].Add( MenuButtonAndTime(b,TIMER->GetTimeSinceStart()) );
};
bool MatchesPattern( const PlayerNumber p, const MenuButton* button_sequence, const int iNumButtons, float fMaxSecondsBack = -1 )
{
if( fMaxSecondsBack == -1 )
fMaxSecondsBack = 0.4f + iNumButtons*0.15f;
DWORD dwMaxTicksBack = roundf(fMaxSecondsBack*1000);
DWORD dwOldestTickAllowed = GetTickCount() - dwMaxTicksBack;
float fOldestTimeAllowed = TIMER->GetTimeSinceStart() - fMaxSecondsBack;
int sequence_index = iNumButtons-1; // count down
for( int queue_index=m_aMenuButtonQueue[p].GetSize()-1; queue_index>=0; queue_index-- ) // iterate newest to oldest
for( int queue_index=m_aQueue[p].GetSize()-1; queue_index>=0; queue_index-- ) // iterate newest to oldest
{
MenuButtonAndTickCount BandT = m_aMenuButtonQueue[p][queue_index];
MenuButtonAndTime BandT = m_aQueue[p][queue_index];
if( BandT.button != button_sequence[sequence_index] ||
BandT.dwTickCount < dwOldestTickAllowed )
BandT.fTime < fOldestTimeAllowed )
{
return false;
}
if( sequence_index == 0 ) // we matched the whole pattern
{
m_aMenuButtonQueue[p].RemoveAll(); // empty the queue so we don't match on it again
m_aQueue[p].RemoveAll(); // empty the queue so we don't match on it again
return true;
}
sequence_index--;
@@ -58,14 +57,14 @@ public:
}
protected:
struct MenuButtonAndTickCount
struct MenuButtonAndTime
{
MenuButtonAndTickCount() {}
MenuButtonAndTickCount( MenuButton b, DWORD t ) { button = b; dwTickCount = t; };
MenuButton button;
DWORD dwTickCount;
MenuButtonAndTime() {}
MenuButtonAndTime( MenuButton b, float t ) { button = b; fTime = t; };
MenuButton button;
float fTime;
};
CArray<MenuButtonAndTickCount,MenuButtonAndTickCount> m_aMenuButtonQueue[NUM_PLAYERS];
CArray<MenuButtonAndTime,MenuButtonAndTime> m_aQueue[NUM_PLAYERS];
};
+1 -1
View File
@@ -116,7 +116,7 @@ void LifeMeterBar::DrawPrimitives()
int iNumV = 0;
float fPercentIntoSection = (GetTickCount()/300.0f)*SECTION_WIDTH;
float fPercentIntoSection = (TIMER->GetTimeSinceStart()/0.3f)*SECTION_WIDTH;
fPercentIntoSection -= (int)fPercentIntoSection;
fPercentIntoSection = 1-fPercentIntoSection;
fPercentIntoSection -= (int)fPercentIntoSection;
+1 -1
View File
@@ -16,7 +16,7 @@
#include "ThemeManager.h"
#include "ScreenManager.h"
const float TIMER_SECONDS = 40;
const float TIMER_SECONDS = 99;
MenuTimer::MenuTimer()
{
+1 -1
View File
@@ -80,7 +80,7 @@ public:
case TYPE_CROWN2:
case TYPE_CROWN3:
// blink
if( (GetTickCount() % 1000) > 500 ) // show the new icon
if( (TIMER->GetTimeSinceStart() - (int)TIMER->GetTimeSinceStart()) > 0.5f ) // show the new icon
return;
break;
case TYPE_NONE:
+245 -165
View File
@@ -66,11 +66,12 @@ WheelItemData::WheelItemData()
m_MusicStatusDisplayType = TYPE_NONE;
}
void WheelItemData::Load( WheelItemType wit, Song* pSong, const CString &sSectionName, const D3DXCOLOR color )
void WheelItemData::Load( WheelItemType wit, Song* pSong, const CString &sSectionName, Course* pCourse, const D3DXCOLOR color )
{
m_WheelItemType = wit;
m_pSong = pSong;
m_sSectionName = sSectionName;
m_pCourse = pCourse;
m_color = color;
}
@@ -110,6 +111,15 @@ WheelItemDisplay::WheelItemDisplay()
m_GradeDisplay[p].SetZoom( 1.0f );
m_GradeDisplay[p].SetXY( 90.0f + p*30.0f, 0 );
}
m_textCourse.Load( THEME->GetPathTo(FONT_TEXT_BANNER) );
m_textCourse.TurnShadowOff();
m_textCourse.SetText( "ROULETTE" );
m_textCourse.TurnRainbowOn();
m_textCourse.SetZoom( 1.3f );
m_textCourse.SetHorizAlign( align_left );
m_textCourse.SetXY( -120, 0 );
}
@@ -119,11 +129,11 @@ void WheelItemDisplay::LoadFromWheelItemData( WheelItemData* pWID )
// copy all data items
m_WheelItemType = pWID->m_WheelItemType;
m_sSectionName = pWID->m_sSectionName;
m_pSong = pWID->m_pSong;
m_color = pWID->m_color;
m_MusicStatusDisplayType = pWID->m_MusicStatusDisplayType;
this->m_WheelItemType = pWID->m_WheelItemType;
this->m_sSectionName = pWID->m_sSectionName;
this->m_pCourse = pWID->m_pCourse;
this->m_pSong = pWID->m_pSong;
this->m_color = pWID->m_color;
// init type specific stuff
@@ -132,16 +142,16 @@ void WheelItemDisplay::LoadFromWheelItemData( WheelItemData* pWID )
case TYPE_SECTION:
{
CString sDisplayName = SONGMAN->ShortenGroupName(m_sSectionName);
m_textSectionName.SetZoom( 1 );
m_textSectionName.SetText( sDisplayName );
m_textSectionName.SetDiffuseColor( m_color );
m_textSectionName.TurnRainbowOff();
CString sDisplayName = SONGMAN->ShortenGroupName(m_sSectionName);
m_textSectionName.SetZoom( 1 );
m_textSectionName.SetText( sDisplayName );
m_textSectionName.SetDiffuseColor( m_color );
m_textSectionName.TurnRainbowOff();
float fSourcePixelWidth = (float)m_textSectionName.GetWidestLineWidthInSourcePixels();
float fMaxTextWidth = 200;
if( fSourcePixelWidth > fMaxTextWidth )
m_textSectionName.SetZoomX( fMaxTextWidth / fSourcePixelWidth );
float fSourcePixelWidth = (float)m_textSectionName.GetWidestLineWidthInSourcePixels();
float fMaxTextWidth = 200;
if( fSourcePixelWidth > fMaxTextWidth )
m_textSectionName.SetZoomX( fMaxTextWidth / fSourcePixelWidth );
}
break;
case TYPE_SONG:
@@ -160,6 +170,19 @@ void WheelItemDisplay::LoadFromWheelItemData( WheelItemData* pWID )
{
}
break;
case TYPE_COURSE:
{
m_textCourse.SetZoom( 1 );
m_textCourse.SetText( m_pCourse->m_sName );
m_textCourse.SetDiffuseColor( m_color );
m_textCourse.TurnRainbowOff();
float fSourcePixelWidth = (float)m_textCourse.GetWidestLineWidthInSourcePixels();
float fMaxTextWidth = 200;
if( fSourcePixelWidth > fMaxTextWidth )
m_textCourse.SetZoomX( fMaxTextWidth / fSourcePixelWidth );
}
break;
default:
ASSERT( false ); // invalid type
}
@@ -181,7 +204,7 @@ void WheelItemDisplay::RefreshGrades()
const DifficultyClass dc = PREFSMAN->m_PreferredDifficultyClass[p];
const Grade grade = m_pSong->GetGradeForDifficultyClass( GAMEMAN->GetCurrentStyleDef()->m_NotesType, dc );
m_GradeDisplay[p].SetGrade( grade );
//m_GradeDisplay[p].SetDiffuseColor( PlayerToColor((PlayerNumber)p) );
m_GradeDisplay[p].SetDiffuseColor( PlayerToColor((PlayerNumber)p) );
}
else // this is a section display
{
@@ -207,12 +230,20 @@ void WheelItemDisplay::Update( float fDeltaTime )
m_textRoulette.Update( fDeltaTime );
break;
case TYPE_SONG:
m_sprSongBar.Update( fDeltaTime );
m_MusicStatusDisplay.Update( fDeltaTime );
m_TextBanner.Update( fDeltaTime );
for( int p=0; p<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Update( fDeltaTime );
{
m_sprSongBar.Update( fDeltaTime );
m_MusicStatusDisplay.Update( fDeltaTime );
m_TextBanner.Update( fDeltaTime );
for( int p=0; p<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Update( fDeltaTime );
}
break;
case TYPE_COURSE:
m_sprSongBar.Update( fDeltaTime );
m_textCourse.Update( fDeltaTime );
break;
default:
ASSERT(0);
}
}
@@ -229,12 +260,20 @@ void WheelItemDisplay::DrawPrimitives()
m_textRoulette.Draw();
break;
case TYPE_SONG:
m_sprSongBar.Draw();
m_MusicStatusDisplay.Draw();
m_TextBanner.Draw();
for( int p=0; p<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Draw();
{
m_sprSongBar.Draw();
m_MusicStatusDisplay.Draw();
m_TextBanner.Draw();
for( int p=0; p<NUM_PLAYERS; p++ )
m_GradeDisplay[p].Draw();
}
break;
case TYPE_COURSE:
m_sprSongBar.Draw();
m_textCourse.Draw();
break;
default:
ASSERT(0);
}
}
@@ -289,6 +328,7 @@ MusicWheel::MusicWheel()
m_soundChangeMusic.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_CHANGE_MUSIC), 10 );
m_soundChangeSort.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_CHANGE_SORT) );
m_soundExpand.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_SECTION_EXPAND) );
m_soundExpand.Load( THEME->GetPathTo(SOUND_MENU_START) );
// init m_mapGroupNameToBannerColor
@@ -358,103 +398,127 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
{
int i;
///////////////////////////////////
// Make an array of Song*, then sort them
///////////////////////////////////
CArray<Song*, Song*> arraySongs;
// copy only song that have at least one Notes for the current GameMode
for( i=0; i<SONGMAN->m_pSongs.GetSize(); i++ )
switch( PREFSMAN->m_PlayMode )
{
Song* pSong = SONGMAN->m_pSongs[i];
case PLAY_MODE_ARCADE:
{
///////////////////////////////////
// Make an array of Song*, then sort them
///////////////////////////////////
CArray<Song*, Song*> arraySongs;
// copy only song that have at least one Notes for the current GameMode
for( i=0; i<SONGMAN->m_pSongs.GetSize(); i++ )
{
Song* pSong = SONGMAN->m_pSongs[i];
CArray<Notes*, Notes*> arraySteps;
pSong->GetNotesThatMatch( GAMEMAN->GetCurrentStyleDef()->m_NotesType, arraySteps );
CArray<Notes*, Notes*> arraySteps;
pSong->GetNotesThatMatch( GAMEMAN->GetCurrentStyleDef()->m_NotesType, arraySteps );
if( arraySteps.GetSize() > 0 )
arraySongs.Add( pSong );
}
if( arraySteps.GetSize() > 0 )
arraySongs.Add( pSong );
}
// sort the SONGMAN
switch( so )
{
case SORT_GROUP:
SortSongPointerArrayByGroup( arraySongs );
// sort the SONGMAN
switch( so )
{
case SORT_GROUP:
SortSongPointerArrayByGroup( arraySongs );
break;
case SORT_TITLE:
SortSongPointerArrayByTitle( arraySongs );
break;
case SORT_BPM:
SortSongPointerArrayByBPM( arraySongs );
break;
// case SORT_ARTIST:
// SortSongPointerArrayByArtist( arraySongs );
// break;
case SORT_MOST_PLAYED:
SortSongPointerArrayByMostPlayed( arraySongs );
break;
default:
ASSERT( false ); // unhandled SORT_ORDER
}
///////////////////////////////////
// Build an array of WheelItemDatas from the sorted list of Song*
///////////////////////////////////
arrayWheelItemDatas.RemoveAll(); // clear out the previous wheel items...
// ...and load new ones
bool bUseSections;
switch( so )
{
case SORT_MOST_PLAYED: bUseSections = false; break;
case SORT_BPM: bUseSections = false; break;
case SORT_GROUP: bUseSections = SONGMAN->m_sPreferredGroup != "ALL MUSIC"; break;
case SORT_TITLE: bUseSections = true; break;
default: ASSERT( false );
}
if( bUseSections )
{
// make WheelItemDatas with sections
arrayWheelItemDatas.SetSize( arraySongs.GetSize()*2 ); // make sure we have enough room for all music and section items
CString sLastSection = "";
D3DXCOLOR colorSection;
int iCurWheelItem = 0;
for( int i=0; i< arraySongs.GetSize(); i++ )
{
Song* pSong = arraySongs[i];
CString sThisSection = GetSectionNameFromSongAndSort( pSong, so );
int iSectionColorIndex = 0;
if( sThisSection != sLastSection ) // new section, make a section item
{
WheelItemData &WID = arrayWheelItemDatas[iCurWheelItem++];
colorSection = (so==SORT_TITLE) ? SONGMAN->GetGroupColor(pSong->GetGroupName()) : SECTION_COLORS[iSectionColorIndex];
iSectionColorIndex = (iSectionColorIndex+1) % NUM_SECTION_COLORS;
WID.Load( TYPE_SECTION, NULL, sThisSection, NULL, colorSection );
sLastSection = sThisSection;
}
WheelItemData &WID = arrayWheelItemDatas[iCurWheelItem++];
WID.Load( TYPE_SONG, pSong, sThisSection, NULL, SONGMAN->GetGroupColor(pSong->GetGroupName()) );
}
arrayWheelItemDatas.SetSize( iCurWheelItem ); // make sure we have enough room for all music and section items
}
else
{
arrayWheelItemDatas.SetSize( arraySongs.GetSize() );
{
for( int i=0; i<arraySongs.GetSize(); i++ )
{
Song* pSong = arraySongs[i];
WheelItemData &WID = arrayWheelItemDatas[i];
WID.Load( TYPE_SONG, pSong, "", NULL, SONGMAN->GetGroupColor(pSong->GetGroupName()) );
}
}
}
}
break;
case SORT_TITLE:
SortSongPointerArrayByTitle( arraySongs );
break;
case SORT_BPM:
SortSongPointerArrayByBPM( arraySongs );
break;
// case SORT_ARTIST:
// SortSongPointerArrayByArtist( arraySongs );
// break;
case SORT_MOST_PLAYED:
SortSongPointerArrayByMostPlayed( arraySongs );
case PLAY_MODE_ONI:
{
arrayWheelItemDatas.SetSize( 0, 20 ); // clear out the previous wheel items...
for( int c=0; c<SONGMAN->m_aCourses.GetSize(); c++ ) // foreach course
{
Course* pCourse = &SONGMAN->m_aCourses[c];
if( GAMEMAN->GetCurrentStyleDef()->m_NotesType == pCourse->m_NotesType )
{
arrayWheelItemDatas.Add( WheelItemData() );
WheelItemData &WID = arrayWheelItemDatas[arrayWheelItemDatas.GetSize()-1];
WID.Load( TYPE_COURSE, NULL, "", pCourse, D3DXCOLOR(1,1,1,1) );
}
}
}
break;
default:
ASSERT( false ); // unhandled SORT_ORDER
}
///////////////////////////////////
// Build an array of WheelItemDatas from the sorted list of Song*
///////////////////////////////////
arrayWheelItemDatas.RemoveAll(); // clear out the previous wheel items...
// ...and load new ones
bool bUseSections;
switch( so )
{
case SORT_MOST_PLAYED: bUseSections = false; break;
case SORT_BPM: bUseSections = false; break;
case SORT_GROUP: bUseSections = SONGMAN->m_sPreferredGroup != "ALL MUSIC"; break;
case SORT_TITLE: bUseSections = true; break;
default: ASSERT( false );
}
if( bUseSections )
{
// make WheelItemDatas with sections
arrayWheelItemDatas.SetSize( arraySongs.GetSize()*2 ); // make sure we have enough room for all music and section items
CString sLastSection = "";
D3DXCOLOR colorSection;
int iCurWheelItem = 0;
for( int i=0; i< arraySongs.GetSize(); i++ )
{
Song* pSong = arraySongs[i];
CString sThisSection = GetSectionNameFromSongAndSort( pSong, so );
int iSectionColorIndex = 0;
if( sThisSection != sLastSection ) // new section, make a section item
{
WheelItemData &WID = arrayWheelItemDatas[iCurWheelItem++];
colorSection = (so==SORT_TITLE) ? SONGMAN->GetGroupColor(pSong->GetGroupName()) : SECTION_COLORS[iSectionColorIndex];
iSectionColorIndex = (iSectionColorIndex+1) % NUM_SECTION_COLORS;
WID.Load( TYPE_SECTION, NULL, sThisSection, colorSection );
sLastSection = sThisSection;
}
WheelItemData &WID = arrayWheelItemDatas[iCurWheelItem++];
WID.Load( TYPE_SONG, pSong, sThisSection, SONGMAN->GetGroupColor(pSong->GetGroupName()) );
}
arrayWheelItemDatas.SetSize( iCurWheelItem ); // make sure we have enough room for all music and section items
}
else
{
arrayWheelItemDatas.SetSize( arraySongs.GetSize() );
{
for( int i=0; i<arraySongs.GetSize(); i++ )
{
Song* pSong = arraySongs[i];
WheelItemData &WID = arrayWheelItemDatas[i];
WID.Load( TYPE_SONG, pSong, "", SONGMAN->GetGroupColor(pSong->GetGroupName()) );
}
}
ASSERT(0); // invalid PlayMode
}
// init crowns
@@ -481,12 +545,12 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
if( arrayWheelItemDatas.GetSize() == 0 )
{
arrayWheelItemDatas.SetSize( 1 );
arrayWheelItemDatas[0].Load( TYPE_SECTION, NULL, "NO SONGS", D3DXCOLOR(1,0,0,1) );
arrayWheelItemDatas[0].Load( TYPE_SECTION, NULL, "NO SONGS", NULL, D3DXCOLOR(1,0,0,1) );
}
else
else if( PREFSMAN->m_PlayMode == PLAY_MODE_ARCADE )
{
arrayWheelItemDatas.SetSize( arrayWheelItemDatas.GetSize()+1 );
arrayWheelItemDatas[arrayWheelItemDatas.GetSize()-1].Load( TYPE_ROULETTE, NULL, "", D3DXCOLOR(1,0,0,1) );
arrayWheelItemDatas[arrayWheelItemDatas.GetSize()-1].Load( TYPE_ROULETTE, NULL, "", NULL, D3DXCOLOR(1,0,0,1) );
}
}
@@ -587,7 +651,7 @@ void MusicWheel::NotesChanged( PlayerNumber pn ) // update grade graphics and to
Notes* m_pNotes = SONGMAN->GetCurrentNotes( pn );
if( m_pNotes )
m_HighScore[pn].SetScore( (float)m_pNotes->m_iTopScore );
m_HighScore[pn].SetScore( m_pNotes->m_iTopScore );
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ )
{
@@ -643,6 +707,13 @@ void MusicWheel::Update( float fDeltaTime )
float fScrollPercentage = (m_iSelection-m_fPositionOffsetFromSelection) / (float)GetCurWheelItemDatas().GetSize();
m_ScrollBar.SetPercentage( fScrollPercentage );
if( m_WheelState == STATE_ROULETTE_SPINNING )
{
float fOldMod = fmodf( TIMER->GetTimeSinceStart()-fDeltaTime, SWITCH_MUSIC_TIME );
float fNewMod = fmodf( TIMER->GetTimeSinceStart(), SWITCH_MUSIC_TIME );
if( fNewMod < fOldMod ) // wrapped
NextMusic();
}
// update wheel state
m_fTimeLeftInState -= fDeltaTime;
@@ -656,55 +727,54 @@ void MusicWheel::Update( float fDeltaTime )
break;
case STATE_FLYING_OFF_BEFORE_NEXT_SORT:
{
m_WheelState = STATE_FLYING_ON_AFTER_NEXT_SORT;
m_fTimeLeftInState = FADE_TIME;
m_WheelState = STATE_FLYING_ON_AFTER_NEXT_SORT;
m_fTimeLeftInState = FADE_TIME;
Song* pPrevSelectedSong = GetCurWheelItemDatas()[m_iSelection].m_pSong;
CString sPrevSelectedSection = GetCurWheelItemDatas()[m_iSelection].m_sSectionName;
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 );
//RebuildWheelItems();
// 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 );
//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_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;
m_iSelection = 0;
if( pPrevSelectedSong != NULL ) // the previous selected item was a song
{
// find the previously selected song, and select it
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
if( pPrevSelectedSong != NULL ) // the previous selected item was a song
{
if( GetCurWheelItemDatas()[i].m_pSong == pPrevSelectedSong )
// find the previously selected song, and select it
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
{
m_iSelection = i;
break;
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++ )
else // the previously selected item was a section
{
if( GetCurWheelItemDatas()[i].m_sSectionName == sPrevSelectedSection )
// find the previously selected song, and select it
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
{
m_iSelection = i;
break;
if( GetCurWheelItemDatas()[i].m_sSectionName == sPrevSelectedSection )
{
m_iSelection = i;
break;
}
}
}
}
RebuildWheelItemDisplays();
TweenOnScreen();
RebuildWheelItemDisplays();
TweenOnScreen();
}
break;
case STATE_FLYING_ON_AFTER_NEXT_SORT:
@@ -723,6 +793,10 @@ void MusicWheel::Update( float fDeltaTime )
case STATE_IDLE:
m_fTimeLeftInState = 0;
break;
case STATE_ROULETTE_SLOWING_DOWN:
m_WheelState = STATE_IDLE;
m_fTimeLeftInState = 0;
break;
}
}
@@ -745,6 +819,8 @@ void MusicWheel::PrevMusic()
{
case STATE_IDLE:
case STATE_SWITCHING_MUSIC:
case STATE_ROULETTE_SPINNING:
case STATE_ROULETTE_SLOWING_DOWN:
break; // fall through
default:
return; // don't fall through
@@ -759,7 +835,7 @@ void MusicWheel::PrevMusic()
if( m_iSelection < 0 )
m_iSelection = GetCurWheelItemDatas().GetSize()-1;
}
while( GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_SONG
while( (GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_SONG || GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_COURSE)
&& GetCurWheelItemDatas()[m_iSelection].m_sSectionName != ""
&& GetCurWheelItemDatas()[m_iSelection].m_sSectionName != m_sExpandedSectionName );
@@ -778,6 +854,8 @@ void MusicWheel::NextMusic()
{
case STATE_IDLE:
case STATE_SWITCHING_MUSIC:
case STATE_ROULETTE_SPINNING:
case STATE_ROULETTE_SLOWING_DOWN:
break; // fall through
default:
return; // don't continue
@@ -792,7 +870,7 @@ void MusicWheel::NextMusic()
if( m_iSelection > GetCurWheelItemDatas().GetSize()-1 )
m_iSelection = 0;
}
while( GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_SONG
while( (GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_SONG || GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_COURSE)
&& GetCurWheelItemDatas()[m_iSelection].m_sSectionName != ""
&& GetCurWheelItemDatas()[m_iSelection].m_sSectionName != m_sExpandedSectionName );
@@ -834,8 +912,15 @@ void MusicWheel::NextSort()
m_fTimeLeftInState = FADE_TIME;
}
bool MusicWheel::Select()
bool MusicWheel::Select() // return true of a playable item was chosen
{
if( m_WheelState == STATE_ROULETTE_SPINNING )
{
m_WheelState = STATE_ROULETTE_SLOWING_DOWN;
m_fTimeLeftInState = 20;
return false;
}
switch( GetCurWheelItemDatas()[m_iSelection].m_WheelItemType )
{
case TYPE_SECTION:
@@ -868,6 +953,8 @@ bool MusicWheel::Select()
}
return false;
case TYPE_ROULETTE:
m_soundExpand.Play();
m_WheelState = STATE_ROULETTE_SPINNING;
return false;
case TYPE_SONG:
@@ -888,14 +975,6 @@ void MusicWheel::TweenOnScreen()
m_MusicSortDisplay.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
for( int p=0; p<NUM_PLAYERS; p++ )
{
float fOriginalX = m_HighScore[p].GetX();
m_HighScore[p].SetX( fOriginalX+320 );
m_HighScore[p].BeginTweening( 0.2f, Actor::TWEEN_BIAS_END );
m_HighScore[p].SetTweenX( fOriginalX );
}
float fX, fY;
@@ -907,6 +986,7 @@ void MusicWheel::TweenOnScreen()
m_frameOverlay.SetTweenX( fX );
fX = m_ScrollBar.GetX();
fY = m_ScrollBar.GetY();
m_ScrollBar.SetXY( fX+30, fY );
@@ -943,8 +1023,8 @@ void MusicWheel::TweenOffScreen()
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_HighScore[p].BeginTweening( 0.2f, Actor::TWEEN_BIAS_END );
// m_HighScore[p].SetTweenX( m_HighScore[p].GetX()+320 );
}
+16 -6
View File
@@ -22,9 +22,10 @@
#include "GameConstantsAndTypes.h"
#include "MusicSortDisplay.h"
#include "MusicStatusDisplay.h"
#include "Screen.h" // for ScreenMessage
#include "Screen.h" // for ScreenMessage
#include "ScoreDisplayRolling.h"
#include "ScrollBar.h"
#include "Course.h"
const int NUM_WHEEL_ITEMS_TO_DRAW = 13;
@@ -34,7 +35,7 @@ const ScreenMessage SM_SongChanged = ScreenMessage(SM_User+47); // this should
const ScreenMessage SM_PlaySongSample = ScreenMessage(SM_User+48);
enum WheelItemType { TYPE_SECTION, TYPE_SONG, TYPE_ROULETTE };
enum WheelItemType { TYPE_SECTION, TYPE_SONG, TYPE_ROULETTE, TYPE_COURSE };
struct WheelItemData
@@ -42,18 +43,19 @@ struct WheelItemData
public:
WheelItemData();
void Load( WheelItemType wit, Song* pSong, const CString &sSectionName, const D3DXCOLOR color );
void Load( WheelItemType wit, Song* pSong, const CString &sSectionName, Course* pCourse, const D3DXCOLOR color );
WheelItemType m_WheelItemType;
CString m_sSectionName;
Course* m_pCourse;
Song* m_pSong;
D3DXCOLOR m_color; // either text color or section background color
MusicStatusDisplayType m_MusicStatusDisplayType;
};
class WheelItemDisplay : public Actor,
public WheelItemData
class WheelItemDisplay : public WheelItemData,
public Actor
{
public:
WheelItemDisplay();
@@ -78,6 +80,9 @@ public:
MusicStatusDisplay m_MusicStatusDisplay;
TextBanner m_TextBanner;
GradeDisplay m_GradeDisplay[NUM_PLAYERS];
// for TYPE_COURSE
BitmapText m_textCourse;
};
@@ -109,6 +114,7 @@ public:
bool Select(); // return true if the selected item is a music, otherwise false
WheelItemType GetSelectedType() { return GetCurWheelItemDatas()[m_iSelection].m_WheelItemType; };
Song* GetSelectedSong() { return GetCurWheelItemDatas()[m_iSelection].m_pSong; };
Course* GetSelectedCourse() { return GetCurWheelItemDatas()[m_iSelection].m_pCourse; };
CString GetSelectedSection(){ return GetCurWheelItemDatas()[m_iSelection].m_sSectionName; };
@@ -147,7 +153,10 @@ protected:
STATE_FLYING_ON_AFTER_NEXT_SORT,
STATE_TWEENING_ON_SCREEN,
STATE_TWEENING_OFF_SCREEN,
STATE_WAITING_OFF_SCREEN
STATE_WAITING_OFF_SCREEN,
STATE_ROULETTE_SPINNING,
STATE_ROULETTE_SLOWING_DOWN,
STATE_LOCKED,
};
WheelState m_WheelState;
float m_fTimeLeftInState;
@@ -158,6 +167,7 @@ protected:
RageSoundSample m_soundChangeMusic;
RageSoundSample m_soundChangeSort;
RageSoundSample m_soundExpand;
RageSoundSample m_soundStart;
+28 -3
View File
@@ -17,7 +17,7 @@
#include "ArrowEffects.h"
#include "PrefsManager.h"
#include "GameConstantsAndTypes.h"
#include "ErrorCatcher/ErrorCatcher.h"
NoteData::NoteData()
@@ -149,11 +149,14 @@ void NoteData::AddHoldNote( HoldNote add )
}
// delete TapNotes under this HoldNote
for( i=add.m_iStartIndex; i<=add.m_iEndIndex; i++ )
for( i=add.m_iStartIndex+1; i<=add.m_iEndIndex; 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_HoldNotes[m_iNumHoldNotes++] = add;
}
@@ -161,6 +164,11 @@ void NoteData::RemoveHoldNote( int index )
{
ASSERT( index > 0 && index < m_iNumHoldNotes );
// delete a tap note at the start of this hold
HoldNote &hn = m_HoldNotes[index];
m_TapNotes[hn.m_iTrack][hn.m_iStartIndex] = '0';
// remove from list
for( int j=index; j<m_iNumHoldNotes-1; j++ )
{
m_HoldNotes[j] = m_HoldNotes[j+1];
@@ -260,6 +268,23 @@ int NoteData::GetNumHoldNotes( const float fStartBeat, const float fEndBeat )
return iNumSteps;
}
int NoteData::GetPossibleDancePoints()
{
//Each song has a certain number of "Dance Points" assigned to it. For regular arrows, this is 2 per arrow. For freeze arrows, it is 6 per arrow. When you add this all up, you get the maximum number of possible "Dance Points".
//
//Your "Dance Points" are calculated as follows:
//
//A "Perfect" is worth 2 points
//A "Great" is worth 1 points
//A "Good" is worth 0 points
//A "Boo" will subtract 4 points
//A "Miss" will subtract 8 points
//An "OK" (Successful Freeze step) will add 6 points
//A "NG" (Unsuccessful Freeze step) is worth 0 points
return GetNumTapNotes()*TapNoteScoreToDancePoints(TNS_PERFECT) +
GetNumHoldNotes()*HoldNoteScoreToDancePoints(HNS_OK);
}
void NoteData::CropToLeftSide()
{
@@ -666,7 +691,7 @@ void NoteData::SetFromMeasureStrings( CStringArray &arrayMeasureStrings )
if( m_iNumTracks == 0 )
m_iNumTracks = sNoteLine.GetLength();
if( m_iNumTracks != sNoteLine.GetLength() )
FatalError( "Line doesn't have right number of notes." );
throw RageException( "Line doesn't have right number of notes." );
for( int c=0; c<sNoteLine.GetLength(); c++ )
{
+45 -27
View File
@@ -17,19 +17,32 @@
// '1' = tap note
// '2' = hold note begin
// '3' = hold note end ('1' can also end a HoldNote)
// '3' = hold note end ('1' can also end a HoldNote) ('3' without a matching '2' is ignored
// ... for future expansion
enum TapNoteScore {
TNS_NONE,
TNS_PERFECT,
TNS_GREAT,
TNS_GOOD,
TNS_MISS,
TNS_BOO,
TNS_MISS
TNS_GOOD,
TNS_GREAT,
TNS_PERFECT,
};
inline int TapNoteScoreToDancePoints( TapNoteScore tns )
{
switch( tns )
{
case TNS_PERFECT: return +2;
case TNS_GREAT: return +1;
case TNS_GOOD: return +0;
case TNS_BOO: return -4;
case TNS_MISS: return +8;
default: return 0;
}
}
//enum TapNoteTiming {
// TNT_NONE,
// TNT_EARLY,
@@ -44,32 +57,23 @@ struct HoldNote
int m_iEndIndex;
};
enum HoldNoteResult
enum HoldNoteScore
{
HNR_NONE, // this HoldNote has not been scored yet
HNR_OK, // the HoldNote has passed and was successfully held all the way through
HNR_NG // the HoldNote has passed and they missed it
HNS_NONE, // this HoldNote has not been scored yet
HNS_OK, // the HoldNote has passed and was successfully held all the way through
HNS_NG // the HoldNote has passed and they missed it
};
struct HoldNoteScore
inline int HoldNoteScoreToDancePoints( HoldNoteScore hns )
{
TapNoteScore m_TapNoteScore; // The scoring of the tap Note that begins the hold.
// This is judeged separately from the actual hold.
HoldNoteResult m_Result;
float m_fLife; // 1.0 means this HoldNote has full life.
// 0.0 means this HoldNote is dead
// When this value hits 0.0 for the first time,
// m_HoldScore becomes HSS_NG.
// If the life is > 0.0 when the HoldNote ends, then
// m_HoldScore becomes HSS_OK.
HoldNoteScore()
{
m_TapNoteScore = TNS_NONE;
m_Result = HNR_NONE;
m_fLife = 1.0f;
};
};
switch( hns )
{
case HNS_OK: return +6;
case HNS_NG: return +0;
default: ASSERT(0); return 0;
}
}
inline int BeatToNoteRow( float fBeatNum ) { return int( fBeatNum * ELEMENTS_PER_BEAT + 0.5f); }; // round
@@ -126,7 +130,21 @@ public:
int GetNumDoubles( const float fStartBeat = 0, const float fEndBeat = MAX_BEATS );
int GetNumHoldNotes( const float fStartBeat = 0, const float fEndBeat = MAX_BEATS );
int GetPossibleDancePoints();
// radar values - return between 0.0 and 1.2
float GetRadarValue( RadarCatrgory rv, float fSongSeconds )
{
switch( rv )
{
case RADAR_STREAM: return GetStreamRadarValue( fSongSeconds ); break;
case RADAR_VOLTAGE: return GetVoltageRadarValue( fSongSeconds ); break;
case RADAR_AIR: return GetAirRadarValue( fSongSeconds ); break;
case RADAR_CHAOS: return GetChaosRadarValue( fSongSeconds ); break;
case RADAR_FREEZE: return GetFreezeRadarValue( fSongSeconds ); break;
default: ASSERT(0); return 0;
}
};
float GetStreamRadarValue( float fSongSeconds );
float GetVoltageRadarValue( float fSongSeconds );
float GetAirRadarValue( float fSongSeconds );
+62 -57
View File
@@ -18,8 +18,9 @@
#include "PrefsManager.h"
#include "GameManager.h"
const float BEATS_BETWEEN_HOLD_BITS = 0.2f;
const float INDICIES_BETWEEN_HOLD_BITS = BEATS_BETWEEN_HOLD_BITS * ELEMENTS_PER_BEAT;
const float HOLD_NOTE_BITS_PER_BEAT = 6;
const float HOLD_NOTE_BITS_PER_ROW = HOLD_NOTE_BITS_PER_BEAT / ELEMENTS_PER_BEAT;
const float ROWS_BETWEEN_HOLD_BITS = 1 / HOLD_NOTE_BITS_PER_ROW;
NoteField::NoteField()
{
@@ -205,18 +206,72 @@ void NoteField::DrawPrimitives()
{
const int MAX_COLOR_NOTE_INSTANCES = 300;
ColorNoteInstance instances[MAX_COLOR_NOTE_INSTANCES];
int iCount = 0; // number of valid elements in instances
int iCount = 0; // number of valid elements in the instances array
//
/////////////////////////////////
// Draw all HoldNotes in this column (so that they appear under the tap notes)
/////////////////////////////////
for( int i=0; i<m_iNumHoldNotes; i++ )
{
HoldNote &hn = m_HoldNotes[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 ) )
{
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(m_fSongBeat) && m_HoldNoteLife[i] > 0 )
continue; // skip
const int iCol = hn.m_iTrack;
const float fHoldNoteLife = m_HoldNoteLife[i];
const bool bActive = NoteRowToBeat(hn.m_iStartIndex) > m_fSongBeat && m_fSongBeat < NoteRowToBeat(hn.m_iEndIndex);
// parts of the hold
const float fStartDrawingAtBeat = froundf( (float)hn.m_iStartIndex, ROWS_BETWEEN_HOLD_BITS );
for( float j=fStartDrawingAtBeat;
j<=hn.m_iEndIndex;
j+=ROWS_BETWEEN_HOLD_BITS/m_PlayerOptions.m_fArrowScrollSpeed ) // for each bit of the hold
{
// check if this arrow is off the the screen
if( j < iIndexFirstArrowToDraw || iIndexLastArrowToDraw < j)
continue; // skip this arrow
CreateHoldNoteInstance( instances[iCount++], bActive, (float)j, hn, fHoldNoteLife );
}
}
const bool bDrawAddPass = m_PlayerOptions.m_AppearanceType != PlayerOptions::APPEARANCE_VISIBLE;
if( iCount > 0 )
m_ColorNote[c].DrawList( iCount, instances, bDrawAddPass );
iCount = 0; // reset count
///////////////////////////////////
// Draw all TapNotes in this column
//
for( int i=iIndexFirstArrowToDraw; i<=iIndexLastArrowToDraw; i++ ) // for each row
///////////////////////////////////
for( i=iIndexFirstArrowToDraw; i<=iIndexLastArrowToDraw; i++ ) // for each row
{
if( m_TapNotes[c][i] == '0' )
continue; // no note here
// See if there is a hold step that begins on this beat. Not pretty...
// See if there is a hold step that begins on this beat.
bool bHoldNoteOnThisBeat = false;
for( int j=0; j<m_iNumHoldNotes; j++ )
{
@@ -233,56 +288,6 @@ void NoteField::DrawPrimitives()
CreateTapNoteInstance( instances[iCount++], c, (float)i );
}
//
// Draw all HoldNotes in this column
//
for( i=0; i<m_iNumHoldNotes; i++ )
{
HoldNote &hn = m_HoldNotes[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 ) )
{
continue;
}
const int iCol = hn.m_iTrack;
const float fHoldNoteLife = m_HoldNoteLife[i];
const bool bActive = NoteRowToBeat(hn.m_iStartIndex) > m_fSongBeat && m_fSongBeat < NoteRowToBeat(hn.m_iEndIndex);
// draw the gray parts
for( float j=(float)hn.m_iStartIndex;
j<=hn.m_iEndIndex;
j+=INDICIES_BETWEEN_HOLD_BITS/m_PlayerOptions.m_fArrowScrollSpeed ) // for each arrow in the run
{
// check if this arrow is off the the screen
if( j < iIndexFirstArrowToDraw || iIndexLastArrowToDraw < j)
continue; // skip this arrow
if( fHoldNoteLife > 0 && m_Mode == MODE_DANCING && NoteRowToBeat(j) < m_fSongBeat )
continue; // don't draw
CreateHoldNoteInstance( instances[iCount++], bActive, j, hn, fHoldNoteLife );
}
// draw the first arrow on top of the others
j = (float)hn.m_iStartIndex;
if( fHoldNoteLife > 0 && m_Mode == MODE_DANCING && NoteRowToBeat(j) < m_fSongBeat )
; // don't draw
else
CreateHoldNoteInstance( instances[iCount++], bActive, j, hn, fHoldNoteLife );
}
const bool bDrawAddPass = m_PlayerOptions.m_AppearanceType != PlayerOptions::APPEARANCE_VISIBLE;
if( iCount > 0 )
m_ColorNote[c].DrawList( iCount, instances, bDrawAddPass );
}
+2 -2
View File
@@ -65,7 +65,7 @@ protected:
ColorNote m_ColorNote[MAX_NOTE_TRACKS];
// used in MODE_EDIT
Quad m_rectMeasureBar;
Quad m_rectMeasureBar;
BitmapText m_textMeasureNumber;
Quad m_rectMarkerBar;
Quad m_rectMarkerBar;
};
+6 -5
View File
@@ -17,7 +17,7 @@
#include "math.h" // for fabs()
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
#include "GameInput.h"
@@ -54,6 +54,7 @@ Notes::Notes()
Notes::~Notes()
{
DeleteNoteData();
}
void Notes::WriteToCacheFile( FILE* file )
@@ -156,7 +157,7 @@ bool Notes::LoadFromBMSFile( const CString &sPath )
CStdioFile file;
if( !file.Open( sPath, CFile::modeRead|CFile::shareDenyNone ) )
{
FatalError( ssprintf("Failed to open %s.", sPath) );
throw RageException( ssprintf("Failed to open %s.", sPath) );
return false;
}
@@ -434,7 +435,7 @@ void DWIcharToNote( char c, InstrumentNumber i, DanceNote &note1Out, DanceNote &
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: FatalError( "Encountered invalid DWI note characer '%c'", c ); break;
default: throw RageException( "Encountered invalid DWI note characer '%c'", c ); break;
}
switch( i )
@@ -634,7 +635,7 @@ bool Notes::LoadFromNotesFile( const CString &sPath )
CStdioFile file;
if( !file.Open( sPath, CFile::modeRead|CFile::shareDenyNone ) )
FatalError( "Error opening DWI file '%s'.", sPath );
throw RageException( "Error opening DWI file '%s'.", sPath );
// read the whole file into a sFileText
CString sFileText;
@@ -709,7 +710,7 @@ void Notes::SaveToSMDir( CString sSongDir )
CStdioFile file;
if( !file.Open( sNewNotesFilePath, CFile::modeWrite | CFile::modeCreate ) )
FatalError( "Error opening Notes file '%s' for writing.", sNewNotesFilePath );
throw RageException( "Error opening Notes file '%s' for writing.", sNewNotesFilePath );
file.WriteString( ssprintf("#TYPE:%s;\n", NotesTypeToString(m_NotesType)) );
file.WriteString( ssprintf("#DESCRIPTION:%s;\n", m_sDescription) );
+75 -113
View File
@@ -18,6 +18,7 @@
#include "ArrowEffects.h"
#include "GameManager.h"
#include "InputMapper.h"
#include "SongManager.h"
// these two items are in the
@@ -47,7 +48,13 @@ Player::Player()
}
m_TapNoteScores[i] = TNS_NONE;
}
m_iNumHoldNotes = 0;
for( i=0; i<MAX_HOLD_NOTE_ELEMENTS; i++ )
{
m_HoldNoteScores[i] = HNS_NONE;
m_fHoldNoteLife[i] = 1.0f;
}
m_pLifeMeter = NULL;
m_pScore = NULL;
@@ -75,6 +82,8 @@ void Player::Load( PlayerNumber player_no, StyleDef* pStyleDef, NoteData* pNoteD
m_pLifeMeter = pLM;
m_pScore = pScore;
if( m_pScore )
m_pScore->Init( player_no, m_PlayerOptions, pNoteData->GetNumTapNotes(), SONGMAN->GetCurrentNotes(player_no)->m_iMeter );
if( !po.m_bHoldNotes )
this->RemoveHoldNotes();
@@ -125,8 +134,9 @@ void Player::Update( float fDeltaTime, float fSongBeat, float fMaxBeatDifference
{
HoldNote &hn = m_HoldNotes[i];
HoldNoteScore &hns = m_HoldNoteScores[i];
float &fLife = m_fHoldNoteLife[i];
if( hns.m_Result != HNR_NONE ) // if this HoldNote already has a result
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 );
@@ -136,40 +146,52 @@ void Player::Update( float fDeltaTime, float fSongBeat, float fMaxBeatDifference
const StyleInput StyleI( m_PlayerNumber, hn.m_iTrack );
const GameInput GameI = GAMEMAN->GetCurrentStyleDef()->StyleInputToGameInput( StyleI );
// update the life
if( fStartBeat < m_fSongBeat && m_fSongBeat < fEndBeat ) // if the song beat is in the range of this hold
{
const bool bIsHoldingButton = INPUTMAPPER->IsButtonDown( GameI );
// if they got a bad score or haven't stepped on the corresponding tap yet
const bool bSteppedOnTapNote = m_TapNoteScores[hn.m_iStartIndex] >= TNS_GREAT;
if( bIsHoldingButton )
if( bIsHoldingButton && bSteppedOnTapNote )
{
hns.m_fLife += fDeltaTime/HOLD_ARROW_NG_TIME;
hns.m_fLife = min( hns.m_fLife, 1 ); // clamp
// Increase life
fLife += fDeltaTime/HOLD_ARROW_NG_TIME;
fLife = min( fLife, 1 ); // clamp
m_NoteField.m_HoldNotes[i].m_iStartIndex = BeatToNoteRow( m_fSongBeat ); // move the start of this Hold
m_GhostArrowRow.HoldNote( iCol ); // update the "electric ghost" effect
}
else // !bIsHoldingButton
{
hns.m_fLife -= fDeltaTime/HOLD_ARROW_NG_TIME;
hns.m_fLife = max( hns.m_fLife, 0 ); // clamp
if( m_fSongBeat-fStartBeat > fMaxBeatDifference )
{
// Decrease life
fLife -= fDeltaTime/HOLD_ARROW_NG_TIME;
fLife = max( fLife, 0 ); // clamp
}
}
m_NoteField.SetHoldNoteLife( i, hns.m_fLife ); // update the NoteField display
m_NoteField.SetHoldNoteLife( i, fLife ); // update the NoteField display
}
// check for NG
if( hns.m_fLife == 0 ) // the player has not pressed the button for a long time!
if( fLife == 0 ) // the player has not pressed the button for a long time!
{
hns.m_Result = HNR_NG;
m_HoldJudgement[iCol].SetHoldJudgement( HNR_NG );
hns = HNS_NG;
m_HoldJudgement[iCol].SetHoldJudgement( HNS_NG );
}
// check for OK
if( m_fSongBeat > fEndBeat ) // if this HoldNote is in the past
{
// this implies that hns.m_fLife > 0, or else we would have marked it NG above
hns.m_fLife = 1;
hns.m_Result = HNR_OK;
m_HoldJudgement[iCol].SetHoldJudgement( HNR_OK );
m_NoteField.SetHoldNoteLife( i, hns.m_fLife ); // update the NoteField display
// At this point fLife > 0, or else we would have marked it NG above
fLife = 1;
hns = HNS_OK;
m_HoldJudgement[iCol].SetHoldJudgement( HNS_OK );
m_NoteField.SetHoldNoteLife( i, fLife ); // update the NoteField display
}
}
@@ -267,77 +289,6 @@ void Player::HandlePlayerStep( float fSongBeat, int col, float fMaxBeatDiff )
m_GrayArrowRow.Step( col );
CheckForCompleteRow( fSongBeat, col, fMaxBeatDiff );
//
// check if we stepped on the TapNote part of a HoldNote
//
for( int i=0; i<m_iNumHoldNotes; i++ ) // for each HoldNote
{
HoldNote& hn = m_HoldNotes[i];
HoldNoteScore& hns = m_HoldNoteScores[i];
if( hns.m_Result != HNR_NONE ) // if this note already has a score
continue; // we don't need to update its logic
if( hns.m_TapNoteScore != TNS_NONE ) // the TapNote already has a score
continue; // no need to continue;
if( col == m_HoldNotes[i].m_iTrack ) // the player's step is the same as this HoldNote
{
float fBeatDifference = fabsf( NoteRowToBeat(hn.m_iStartIndex) - fSongBeat );
if( fBeatDifference <= fMaxBeatDiff )
{
float fBeatsUntilStep = NoteRowToBeat( (float)hn.m_iStartIndex ) - fSongBeat;
float fPercentFromPerfect = fabsf( fBeatsUntilStep / fMaxBeatDiff );
//LOG->WriteLine( "fBeatsUntilStep: %f, fPercentFromPerfect: %f",
// fBeatsUntilStep, fPercentFromPerfect );
// compute what the score should be for the note we stepped on
TapNoteScore &score = hns.m_TapNoteScore;
if( fPercentFromPerfect < 0.25f ) score = TNS_PERFECT;
else if( fPercentFromPerfect < 0.50f ) score = TNS_GREAT;
else if( fPercentFromPerfect < 0.75f ) score = TNS_GOOD;
else score = TNS_BOO;
// update the judgement, score, and life
m_Judgement.SetJudgement( score );
m_pScore->AddToScore( score, m_Combo.GetCurrentCombo() );
m_pLifeMeter->ChangeLife( score );
// show the gray arrow ghost
m_GhostArrowRow.TapNote( col, score, m_Combo.GetCurrentCombo() > 100 );
// update the combo display
switch( score )
{
case TNS_PERFECT:
case TNS_GREAT:
m_Combo.ContinueCombo();
break;
case TNS_GOOD:
case TNS_BOO:
m_Combo.EndCombo();
break;
}
// zoom the judgement and combo like a heart beat
float fStartZoom;
switch( score )
{
case TNS_PERFECT: fStartZoom = 1.5f; break;
case TNS_GREAT: fStartZoom = 1.3f; break;
case TNS_GOOD: fStartZoom = 1.2f; break;
case TNS_BOO: fStartZoom = 1.0f; break;
}
m_frameJudgeAndCombo.SetZoom( fStartZoom );
m_frameJudgeAndCombo.BeginTweening( 0.2f );
m_frameJudgeAndCombo.SetTweenZoom( 1 );
}
}
}
}
@@ -436,12 +387,19 @@ void Player::OnRowDestroyed( float fSongBeat, int col, float fMaxBeatDiff, int i
m_GhostArrowRow.TapNote( c, score, m_Combo.GetCurrentCombo()>100 ); // show the ghost arrow for this column
}
int iNumNotesDestroyed = 0;
for( c=0; c<m_iNumTracks; c++ ) // for each column
{
if( m_TapNotesOriginal[c][iIndexThatWasSteppedOn] != '0' ) // if there is an original note note in this column
iNumNotesDestroyed++;
}
// update the combo display
switch( score )
{
case TNS_PERFECT:
case TNS_GREAT:
m_Combo.ContinueCombo();
m_Combo.ContinueCombo( iNumNotesDestroyed );
break;
case TNS_GOOD:
case TNS_BOO:
@@ -464,47 +422,51 @@ void Player::OnRowDestroyed( float fSongBeat, int col, float fMaxBeatDiff, int i
}
ScoreSummary Player::GetScoreSummary()
void Player::GetGameplayStatistics( GameplayStatistics& GSout )
{
ScoreSummary scoreSummary;
GSout.pSong = SONGMAN->GetCurrentSong();
Notes* pNotes = SONGMAN->GetCurrentNotes(m_PlayerNumber);
GSout.dc = pNotes->m_DifficultyClass;
GSout.meter = pNotes->m_iMeter;
GSout.iPossibleDancePoints = ((NoteData*)this)->GetPossibleDancePoints();
GSout.iActualDancePoints = 0;
for( int i=0; i<MAX_TAP_NOTE_ROWS; i++ )
{
switch( m_TapNoteScores[i] )
{
case TNS_PERFECT: scoreSummary.perfect++; break;
case TNS_GREAT: scoreSummary.great++; break;
case TNS_GOOD: scoreSummary.good++; break;
case TNS_BOO: scoreSummary.boo++; break;
case TNS_MISS: scoreSummary.miss++; break;
case TNS_NONE: break;
case TNS_PERFECT: GSout.perfect++; break;
case TNS_GREAT: GSout.great++; break;
case TNS_GOOD: GSout.good++; break;
case TNS_BOO: GSout.boo++; break;
case TNS_MISS: GSout.miss++; break;
case TNS_NONE: break;
default: ASSERT( false );
}
GSout.iActualDancePoints += TapNoteScoreToDancePoints( m_TapNoteScores[i] );
}
for( i=0; i<m_iNumHoldNotes; i++ )
{
switch( m_HoldNoteScores[i].m_TapNoteScore )
switch( m_HoldNoteScores[i] )
{
case TNS_PERFECT: scoreSummary.perfect++; break;
case TNS_GREAT: scoreSummary.great++; break;
case TNS_GOOD: scoreSummary.good++; break;
case TNS_BOO: scoreSummary.boo++; break;
case TNS_MISS: scoreSummary.miss++; break;
case TNS_NONE: break;
default: ASSERT( false );
}
switch( m_HoldNoteScores[i].m_Result )
{
case HNR_NG: scoreSummary.ng++; break;
case HNR_OK: scoreSummary.ok++; break;
case HNR_NONE: break;
case HNS_NG: GSout.ng++; break;
case HNS_OK: GSout.ok++; break;
case HNS_NONE: break;
default: ASSERT( false );
}
GSout.iActualDancePoints += HoldNoteScoreToDancePoints( m_HoldNoteScores[i] );
}
GSout.max_combo = m_Combo.GetMaxCombo();
GSout.score = m_pScore ? m_pScore->GetScore() : 0;
GSout.failed = this->m_pLifeMeter->HasFailed();
for( int r=0; r<NUM_RADAR_VALUES; r++ )
{
GSout.fRadarPossible[r] = this->GetRadarValue( (RadarCatrgory)r, SONGMAN->GetCurrentSong()->GetMusicLengthSeconds() );
GSout.fRadarActual[r] = randomf(0, GSout.fRadarPossible[r]);
}
scoreSummary.max_combo = m_Combo.GetMaxCombo();
scoreSummary.score = m_pScore ? m_pScore->GetScore() : 0;
return scoreSummary;
}
+9 -3
View File
@@ -11,7 +11,7 @@
-----------------------------------------------------------------------------
*/
#include "PrefsManager.h" // for ScoreSummary
#include "PrefsManager.h" // for GameplayStatistics
#include "Notes.h"
#include "Sprite.h"
#include "BitmapText.h"
@@ -33,7 +33,7 @@
#include "GhostArrowRow.h"
struct GameplayStatistics;
class Player : public NoteData, public ActorFrame
{
@@ -48,7 +48,7 @@ public:
void HandlePlayerStep( float fSongBeat, int col, float fMaxBeatDiff );
int UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
ScoreSummary GetScoreSummary();
void GetGameplayStatistics( GameplayStatistics& GSout );
bool IsThereANoteAtIndex( int iIndex );
@@ -63,6 +63,12 @@ protected:
// maintain this extra data in addition to the NoteData
TapNote m_TapNotesOriginal[MAX_NOTE_TRACKS][MAX_TAP_NOTE_ROWS]; // the original Notes that were loaded into player
TapNoteScore m_TapNoteScores[MAX_TAP_NOTE_ROWS];
float m_fHoldNoteLife[MAX_TAP_NOTE_ROWS]; // 1.0 means this HoldNote has full life.
// 0.0 means this HoldNote is dead
// When this value hits 0.0 for the first time,
// m_HoldScore becomes HSS_NG.
// If the life is > 0.0 when the HoldNote ends, then
// m_HoldScore becomes HSS_OK.
HoldNoteScore m_HoldNoteScores[MAX_HOLD_NOTE_ELEMENTS];
+1 -4
View File
@@ -5,7 +5,7 @@
Desc: Holds user-chosen preferences and saves it between sessions. This class
also has temporary holders for information that passed between windows - e.g.
ScoreSummary.
GameplayStatistics.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
@@ -16,7 +16,6 @@
const int NUM_PAD_TO_DEVICE_SLOTS = 3; // three device inputs may map to one pad input
const int MAX_NUM_STAGES = 10;
class PrefsManager
{
@@ -54,8 +53,6 @@ public:
PlayerOptions m_PlayerOptions[NUM_PLAYERS];
SongOptions m_SongOptions;
ScoreSummary m_ScoreSummary[NUM_PLAYERS][MAX_NUM_STAGES]; // for passing from Dancing to Results
};
+5 -5
View File
@@ -24,7 +24,7 @@
#include "DXUtil.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
//-----------------------------------------------------------------------------
@@ -122,7 +122,7 @@ void RageBitmapTexture::Create(
fmtTexture = D3DFMT_A8R8G8B8;
break;
default:
FatalError( "Invalid color depth: %d bits", dwTextureColorDepth );
throw RageException( "Invalid color depth: %d bits", dwTextureColorDepth );
}
@@ -134,7 +134,7 @@ void RageBitmapTexture::Create(
m_sFilePath,
&ddii ) ) )
{
FatalErrorHr( hr, "D3DXGetImageInfoFromFile() failed for file '%s'.", m_sFilePath );
throw RageException( hr, "D3DXGetImageInfoFromFile() failed for file '%s'.", m_sFilePath );
}
// find out what the min texture size is
@@ -166,7 +166,7 @@ void RageBitmapTexture::Create(
NULL, // no palette
&m_pd3dTexture ) ) )
{
FatalErrorHr( hr, "D3DXCreateTextureFromFileEx() failed for file '%s'.", m_sFilePath );
throw RageException( hr, "D3DXCreateTextureFromFileEx() failed for file '%s'.", m_sFilePath );
}
/////////////////////
@@ -177,7 +177,7 @@ void RageBitmapTexture::Create(
D3DSURFACE_DESC ddsd;
if ( FAILED( hr = m_pd3dTexture->GetLevelDesc( 0, &ddsd ) ) )
FatalErrorHr( hr, "Could not get level Description of D3DX texture!" );
throw RageException( hr, "Could not get level Description of D3DX texture!" );
// save information about the texture
m_iTextureWidth = ddsd.Width;
+18 -36
View File
@@ -14,7 +14,7 @@
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
RageDisplay* DISPLAY = NULL;
@@ -28,9 +28,8 @@ RageDisplay::RageDisplay( HWND hWnd )
m_pd3d = NULL;
m_pd3dDevice = NULL;
m_pVB = NULL;
m_pIB = NULL;
m_dwLastUpdateTicks = GetTickCount();
m_fLastUpdateTime = TIMER->GetTimeSinceStart();
m_iFramesRenderedSinceLastCheck = 0;
m_fFPS = 0;
@@ -43,16 +42,16 @@ RageDisplay::RageDisplay( HWND hWnd )
catch (...)
{
// Edwin Evans: Catch any exception. It won't be caught by main exception handler.
FatalError( "Unknown exception in Direct3DCreate8." );
throw RageException( "Unknown exception in Direct3DCreate8." );
}
if( NULL == m_pd3d )
FatalError( "Direct3DCreate8 failed." );
throw RageException( "Direct3DCreate8 failed." );
HRESULT hr;
if( FAILED( hr = m_pd3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &m_DeviceCaps) ) )
{
FatalError(
throw RageException(
"There was an error while initializing your video card.\n\n"
"Your system is reporting that Direct3D8 hardware acceleration\n"
"is not available. In most cases, you can download an updated\n"
@@ -92,7 +91,6 @@ RageDisplay::RageDisplay( HWND hWnd )
RageDisplay::~RageDisplay()
{
ReleaseVertexBuffer();
ReleaseIndexBuffer();
// Release our D3D Device
SAFE_RELEASE( m_pd3dDevice );
m_pd3d->Release();
@@ -141,7 +139,7 @@ bool RageDisplay::SwitchDisplayMode(
arrayBackBufferFormats.Add( D3DFMT_A8R8G8B8 );
break;
default:
FatalError( ssprintf("Invalid BPP '%u' specified", dwBPP) );
throw RageException( ssprintf("Invalid BPP '%u' specified", dwBPP) );
return false;
}
}
@@ -238,11 +236,13 @@ bool RageDisplay::SwitchDisplayMode(
LOG->WriteLineHr( hr, "failed to create device: %d, %u, %u, %u.", bWindowed, dwWidth, dwHeight, dwBPP );
return false;
}
LOG->WriteLine(
"Video card info:\n"
" - available texture mem is %u\n",
m_pd3dDevice->GetAvailableTextureMem()
);
if( m_pVB == NULL )
CreateVertexBuffer();
if( m_pIB == NULL )
CreateIndexBuffer();
}
else
{
@@ -336,9 +336,9 @@ HRESULT RageDisplay::BeginFrame()
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR );
// tile, don't crop texture coords
// m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, D3DTADDRESS_BORDER );
// m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSV, D3DTADDRESS_BORDER );
// Don't tile texture coords. This creates ugly wrapping artifacts on textures that have to be rescaled.
//m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, D3DTADDRESS_BORDER );
//m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSV, D3DTADDRESS_BORDER );
@@ -354,12 +354,12 @@ HRESULT RageDisplay::EndFrame()
// update stats
m_iFramesRenderedSinceLastCheck++;
DWORD dwThisTicks = GetTickCount();
if( dwThisTicks - m_dwLastUpdateTicks > 1000 ) // update stats every 1 sec.
float fTimeNow = TIMER->GetTimeSinceStart();
if( fTimeNow - m_fLastUpdateTime > 1.0f ) // update stats every 1 sec.
{
m_fFPS = (float)m_iFramesRenderedSinceLastCheck;
m_iFramesRenderedSinceLastCheck = 0;
m_dwLastUpdateTicks = dwThisTicks;
m_fLastUpdateTime = fTimeNow;
LOG->WriteLine( "FPS: %.0f", m_fFPS );
}
@@ -401,7 +401,7 @@ void RageDisplay::CreateVertexBuffer()
MAX_NUM_VERTICIES * sizeof(RAGEVERTEX),
D3DUSAGE_WRITEONLY, D3DFVF_RAGEVERTEX,
D3DPOOL_MANAGED, &m_pVB ) ) )
FatalErrorHr( hr, "Vertex Buffer Could Not Be Created" );
throw RageException( hr, "Vertex Buffer Could Not Be Created" );
}
@@ -410,21 +410,3 @@ void RageDisplay::ReleaseVertexBuffer()
SAFE_RELEASE( m_pVB );
}
void RageDisplay::CreateIndexBuffer()
{
HRESULT hr;
if( FAILED( hr = GetDevice()->CreateIndexBuffer(
MAX_NUM_INDICIES,
D3DUSAGE_WRITEONLY,
D3DFMT_INDEX16,
D3DPOOL_MANAGED,
&m_pIB ) ) )
FatalErrorHr( hr, "Index Buffer Could Not Be Created" );
}
void RageDisplay::ReleaseIndexBuffer()
{
SAFE_RELEASE( m_pIB );
}
+1 -6
View File
@@ -79,7 +79,6 @@ public:
LPDIRECT3DVERTEXBUFFER8 GetVertexBuffer() { return m_pVB; };
LPDIRECT3DINDEXBUFFER8 GetIndexBuffer() { return m_pIB; };
inline void ResetMatrixStack()
{
@@ -177,15 +176,11 @@ private:
void CreateVertexBuffer();
void ReleaseVertexBuffer();
LPDIRECT3DINDEXBUFFER8 m_pIB;
void CreateIndexBuffer();
void ReleaseIndexBuffer();
// OpenGL-like matrix stack
CArray<D3DXMATRIX, D3DXMATRIX&> m_MatrixStack;
// for performance stats
DWORD m_dwLastUpdateTicks;
float m_fLastUpdateTime;
int m_iFramesRenderedSinceLastCheck;
float m_fFPS;
};
+39
View File
@@ -0,0 +1,39 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: RageLog
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "RageException.h"
#include "RageUtil.h"
#include "dxerr8.h"
#pragma comment(lib, "DxErr8.lib")
RageException::RageException( LPCTSTR fmt, ...)
{
va_list va;
va_start(va, fmt);
m_sError = vssprintf( fmt, va );
#ifdef _DEBUG
DebugBreak();
#endif
}
RageException::RageException( HRESULT hr, LPCTSTR fmt, ...)
{
va_list va;
va_start(va, fmt);
m_sError = vssprintf( fmt, va );
m_sError += ssprintf( "(%s)", DXGetErrorString8(hr) );
#ifdef _DEBUG
DebugBreak();
#endif
}
+25
View File
@@ -0,0 +1,25 @@
#pragma once
/*
-----------------------------------------------------------------------------
Class: RageError
Desc: Class for thowing fatal error exceptions
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
class RageException
{
public:
RageException( LPCTSTR fmt, ...);
RageException( HRESULT hr, LPCTSTR fmt, ...);
CString GetError() { return m_sError; };
protected:
CString m_sError;
};
+16 -16
View File
@@ -25,7 +25,7 @@
#include <dinput.h>
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
RageInput* INPUTMAN = NULL; // globally accessable input device
@@ -245,7 +245,7 @@ BOOL CALLBACK EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance,
&pInput->m_pJoystick[i++],
NULL );
if( FAILED( hr ) )
FatalErrorHr( hr, "Error in CreateDevice() for joystick %d.", i );
throw RageException( hr, "Error in CreateDevice() for joystick %d.", i );
return DIENUM_CONTINUE;
}
@@ -322,7 +322,7 @@ HRESULT RageInput::Initialize()
////////////////////////////////
if( FAILED(hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION,
IID_IDirectInput8, (VOID**)&m_pDI, NULL ) ) )
FatalErrorHr( hr, "DirectInput8Create failed." );
throw RageException( hr, "DirectInput8Create failed." );
/////////////////////////////
// Create the keyboard device
@@ -330,21 +330,21 @@ HRESULT RageInput::Initialize()
// Create our DirectInput Object for the Keyboard
if( FAILED( hr = m_pDI->CreateDevice( GUID_SysKeyboard, &m_pKeyboard, NULL ) ) )
FatalErrorHr( hr, "CreateDevice keyboard failed." );
throw RageException( hr, "CreateDevice keyboard failed." );
// Set our Cooperation Level with each Device
if( FAILED( hr = m_pKeyboard->SetCooperativeLevel(m_hWnd, DISCL_FOREGROUND |
DISCL_NOWINKEY |
DISCL_NONEXCLUSIVE) ) )
FatalErrorHr( hr, "m_pKeyboard->SetCooperativeLevel failed." );
throw RageException( hr, "m_pKeyboard->SetCooperativeLevel failed." );
// Set the Data Format of each device
if( FAILED( hr = m_pKeyboard->SetDataFormat(&c_dfDIKeyboard) ) )
FatalErrorHr( hr, "m_pKeyboard->SetDataFormat failed." );
throw RageException( hr, "m_pKeyboard->SetDataFormat failed." );
// Acquire the Keyboard Device
//if( FAILED( hr = m_pKeyboard->Acquire() ) )
// FatalErrorHr( "m_pKeyboard->Acquire failed.", hr );
// throw RageException( "m_pKeyboard->Acquire failed.", hr );
@@ -354,13 +354,13 @@ HRESULT RageInput::Initialize()
// Obtain an interface to the system mouse device.
if( FAILED( hr = m_pDI->CreateDevice( GUID_SysMouse, &m_pMouse, NULL ) ) )
FatalErrorHr( hr, "CreateDevice mouse failed." );
throw RageException( hr, "CreateDevice mouse failed." );
if( FAILED( hr = m_pMouse->SetCooperativeLevel( m_hWnd, DISCL_NONEXCLUSIVE|DISCL_FOREGROUND ) ) )
FatalErrorHr( hr, "m_pMouse->SetCooperativeLevel failed." );
throw RageException( hr, "m_pMouse->SetCooperativeLevel failed." );
if( FAILED( hr = m_pMouse->SetDataFormat( &c_dfDIMouse2 ) ) )
FatalErrorHr( hr, "m_pMouse->SetDataFormat failed." );
throw RageException( hr, "m_pMouse->SetDataFormat failed." );
/*
DIPROPDWORD dipdw;
@@ -373,7 +373,7 @@ HRESULT RageInput::Initialize()
if( FAILED( m_pMouse->SetProperty( DIPROP_AXISMODE, &dipdw.diph ) ) )
return E_FAIL;*/
//if( FAILED( hr = m_pMouse->Acquire()))
// FatalErrorHr( "m_pMouse->Acquire failed.", hr );
// throw RageException( "m_pMouse->Acquire failed.", hr );
m_RelPosition_x = 0;
m_RelPosition_y = 0;
@@ -390,7 +390,7 @@ HRESULT RageInput::Initialize()
EnumJoysticksCallback,
(VOID*)this,
DIEDFL_ATTACHEDONLY ) ) )
FatalErrorHr( hr, "m_pDI->EnumDevices failed." );
throw RageException( hr, "m_pDI->EnumDevices failed." );
for( int i=0; i<NUM_JOYSTICKS; i++ )
{
@@ -401,14 +401,14 @@ HRESULT RageInput::Initialize()
// passing a DIJOYSTATE2 structure to IDirectInputDevice::GetDeviceState().
if( m_pJoystick[i] )
if( FAILED( hr = m_pJoystick[i]->SetDataFormat( &c_dfDIJoystick2 ) ) )
FatalErrorHr( hr, "m_pJoystick[i]->SetDataFormat failed." );
throw RageException( hr, "m_pJoystick[i]->SetDataFormat failed." );
// Set the cooperative level to let DInput know how this device should
// interact with the system and with other DInput applications.
if( m_pJoystick[i] )
if( FAILED( hr = m_pJoystick[i]->SetCooperativeLevel( m_hWnd, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND ) ) )
FatalErrorHr( hr, "m_pJoystick[i]->SetCooperativeLevel failed." );
throw RageException( hr, "m_pJoystick[i]->SetCooperativeLevel failed." );
/*
@@ -426,12 +426,12 @@ HRESULT RageInput::Initialize()
// of enumerating device objects (axes, buttons, etc.).
if( m_pJoystick[i] )
if ( FAILED( hr = m_pJoystick[i]->EnumObjects( EnumAxesCallback, (VOID*)m_pJoystick[i], DIDFT_AXIS ) ) )
FatalErrorHr( hr, "m_pJoystick[i]->EnumObjects failed." );
throw RageException( hr, "m_pJoystick[i]->EnumObjects failed." );
// Acquire the newly created devices
if( m_pJoystick[i] )
if( FAILED( hr = m_pJoystick[i]->Acquire() ) )
FatalErrorHr( hr, "m_pJoystick[i]->Acquire failed." );
throw RageException( hr, "m_pJoystick[i]->Acquire failed." );
}
return S_OK;
+1 -1
View File
@@ -13,7 +13,7 @@
#include "RageLog.h"
#include "RageUtil.h"
#include <fstream>
#include "ErrorCatcher/ErrorCatcher.h"
#include "dxerr8.h"
#pragma comment(lib, "DxErr8.lib")
+18 -18
View File
@@ -32,7 +32,7 @@
#include "DXUtil.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
#include <stdio.h>
@@ -318,26 +318,26 @@ VOID RageMovieTexture::Create()
// Initialize the filter graph find and get information about the
// video (dimensions, color depth, etc.)
if( FAILED( hr = InitDShowTextureRenderer() ) )
FatalErrorHr( hr, "Could not initialize the DirectShow Texture Renderer!" );
throw RageException( hr, "Could not initialize the DirectShow Texture Renderer!" );
if( FAILED( hr = CreateD3DTexture() ) )
FatalErrorHr( hr, "Could not create the D3D Texture!" );
throw RageException( hr, "Could not create the D3D Texture!" );
// Pass the D3D texture to our TextureRenderer so it knows
// where to render new movie frames to.
if( FAILED( hr = m_pCTR->SetRenderTarget( this ) ) )
FatalErrorHr( hr, "RageMovieTexture: SetRenderTarget failed." );
throw RageException( hr, "RageMovieTexture: SetRenderTarget failed." );
// Start the graph running
if( FAILED( hr = PlayMovie() ) )
FatalErrorHr( hr, "Could not run the DirectShow graph." );
throw RageException( hr, "Could not run the DirectShow graph." );
}
void HandleDivXError()
{
FatalError(
throw RageException(
"Could not locate the DivX video codec.\n"
"DivX is required to movie textures and must\n"
"be installed before running the application.\n\n"
@@ -359,17 +359,17 @@ HRESULT RageMovieTexture::InitDShowTextureRenderer()
// Create the filter graph
if( FAILED( m_pGB.CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC) ) )
FatalErrorHr( hr, "Could not create CLSID_FilterGraph!" );
throw RageException( hr, "Could not create CLSID_FilterGraph!" );
// Create the Texture Renderer object
m_pCTR = new CTextureRenderer(NULL, &hr);
if( FAILED(hr) )
FatalErrorHr( hr, "Could not create texture renderer object!" );
throw RageException( hr, "Could not create texture renderer object!" );
// Get a pointer to the IBaseFilter on the TextureRenderer, add it to graph
pFTR = m_pCTR;
if( FAILED( hr = m_pGB->AddFilter(pFTR, L"TEXTURERENDERER" ) ) )
FatalErrorHr( hr, "Could not add renderer filter to graph!" );
throw RageException( hr, "Could not add renderer filter to graph!" );
// convert movie file path to wide char string
WCHAR wFileName[MAX_PATH];
@@ -385,21 +385,21 @@ HRESULT RageMovieTexture::InitDShowTextureRenderer()
if( FAILED( hr = m_pGB->AddSourceFilter( wFileName, L"SOURCE", &pFSrc ) ) ) // if this fails, it's probably because the user doesn't have DivX installed
{
HandleDivXError();
FatalErrorHr( hr, "Could not create source filter to graph!" );
throw RageException( hr, "Could not create source filter to graph!" );
}
// Find the source's output and the renderer's input
if( FAILED( hr = pFTR->FindPin( L"In", &pFTRPinIn ) ) )
FatalErrorHr( hr, "Could not find input pin!" );
throw RageException( hr, "Could not find input pin!" );
if( FAILED( hr = pFSrc->FindPin( L"Output", &pFSrcPinOut ) ) )
FatalErrorHr( hr, "Could not find output pin!" );
throw RageException( hr, "Could not find output pin!" );
// Connect these two filters
if( FAILED( hr = m_pGB->Connect( pFSrcPinOut, pFTRPinIn ) ) )
{
HandleDivXError();
FatalErrorHr( hr, "Could not connect pins!" );
throw RageException( hr, "Could not connect pins!" );
}
// Get the graph's media control, event & position interfaces
@@ -429,25 +429,25 @@ HRESULT RageMovieTexture::CreateD3DTexture()
m_iSourceHeight, m_iSourceHeight,
1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &m_pd3dTexture[0] ) ) )
FatalErrorHr( hr, "Could not create the D3DX texture!" );
throw RageException( hr, "Could not create the D3DX texture!" );
if( FAILED( hr = D3DXCreateTexture(m_pd3dDevice,
m_iSourceHeight, m_iSourceHeight,
1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &m_pd3dTexture[1] ) ) )
FatalErrorHr( hr, "Could not create the D3DX texture!" );
throw RageException( hr, "Could not create the D3DX texture!" );
// D3DXCreateTexture can silently change the parameters on us
D3DSURFACE_DESC ddsd;
if ( FAILED( hr = m_pd3dTexture[0]->GetLevelDesc( 0, &ddsd ) ) )
FatalErrorHr( hr, "Could not get level Description of D3DX texture!" );
throw RageException( hr, "Could not get level Description of D3DX texture!" );
m_iTextureWidth = ddsd.Width;
m_iTextureHeight = ddsd.Height;
m_TextureFormat = ddsd.Format;
if( m_TextureFormat != D3DFMT_A8R8G8B8 &&
m_TextureFormat != D3DFMT_A1R5G5B5 )
FatalError( "Texture is format we can't handle! Format = 0x%x!", m_TextureFormat );
throw RageException( "Texture is format we can't handle! Format = 0x%x!", m_TextureFormat );
return S_OK;
@@ -459,7 +459,7 @@ HRESULT RageMovieTexture::PlayMovie()
// Start the graph running;
if( FAILED( hr = m_pMC->Run() ) )
FatalErrorHr( hr, "Could not run the DirectShow graph." );
throw RageException( hr, "Could not run the DirectShow graph." );
return S_OK;
}
+11 -8
View File
@@ -13,7 +13,7 @@
#include "RageSound.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
#include "bass/bass.h"
#pragma comment(lib, "bass/bass.lib")
@@ -27,15 +27,15 @@ RageSound::RageSound( HWND hWnd )
LOG->WriteLine( "RageSound::RageSound()" );
// save the HWND
if( !hWnd )
FatalError( "RageSound called with NULL hWnd." );
throw RageException( "RageSound called with NULL hWnd." );
m_hWndApp = hWnd;
if( BASS_GetVersion() != MAKELONG(1,5) )
FatalError( "BASS version 1.5 DLL could not be loaded. Verify that Bass.dll exists in the program directory.");
throw RageException( "BASS version 1.5 DLL could not be loaded. Verify that Bass.dll exists in the program directory.");
if( !BASS_Init( -1, 44100, BASS_DEVICE_LEAVEVOL|BASS_DEVICE_LATENCY, m_hWndApp ) )
{
FatalError(
throw RageException(
"There was an error while initializing your sound card.\n\n"
"The most likely cause of this problem is that you do not have a sound card\n"
"installed, or that you have not yet installed a driver for your sound card.\n"
@@ -80,10 +80,10 @@ void RageSound::PlayOnceStreamed( CString sPath )
{
HSTREAM hStream = BASS_StreamCreateFile( FALSE, (void*)((LPCTSTR)sPath), 0, 0, BASS_STREAM_AUTOFREE );
if( hStream == NULL )
FatalError( "RageSound: Error creating stream." );
throw RageException( "RageSound: Error creating stream." );
if( FALSE == BASS_StreamPlay( hStream, FALSE, 0 ) )
FatalError( "RageSound: Error playing a sound stream." );
throw RageException( "RageSound: Error playing a sound stream." );
// this stream will free itself when stopped
}
@@ -99,6 +99,9 @@ void RageSound::PlayOnceStreamedFromDir( CString sDir )
GetDirListing( sDir + "*.wav", arraySoundFiles );
GetDirListing( sDir + "*.ogg", arraySoundFiles );
int index = rand() % arraySoundFiles.GetSize();
PlayOnceStreamed( sDir + arraySoundFiles[index] );
if( arraySoundFiles.GetSize() != 0 )
{
int index = rand() % arraySoundFiles.GetSize();
PlayOnceStreamed( sDir + arraySoundFiles[index] );
}
}
+2 -2
View File
@@ -19,7 +19,7 @@
#include "RageMovieTexture.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
RageTextureManager* TEXTUREMAN = NULL;
@@ -140,7 +140,7 @@ void RageTextureManager::UnloadTexture( CString sTexturePath )
}
else // texture not found
{
FatalError( "Tried to Unload texture '%s' that wasn't loaded.", sTexturePath );
throw RageException( "Tried to Unload texture '%s' that wasn't loaded.", sTexturePath );
}
}
+54
View File
@@ -0,0 +1,54 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
File: RageTimer.cpp
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "RageTimer.h"
#include "RageLog.h"
#include "DXUtil.h"
RageTimer* TIMER = NULL;
const float SECS_IN_DAY = 60*60*24;
RageTimer::RageTimer()
{
m_fTimeSinceStart = m_fLastDeltaTime = 0;
DXUtil_Timer( TIMER_START ); // Start the accurate timer
}
RageTimer::~RageTimer()
{
DXUtil_Timer( TIMER_STOP );
}
float RageTimer::GetDeltaTime()
{
m_fLastDeltaTime = DXUtil_Timer( TIMER_GETELAPSEDTIME );
m_fTimeSinceStart += m_fLastDeltaTime;
if( m_fTimeSinceStart > SECS_IN_DAY )
m_fTimeSinceStart = SECS_IN_DAY;
return m_fLastDeltaTime;
}
float RageTimer::PeekDeltaTime()
{
return m_fLastDeltaTime;
}
float RageTimer::GetTimeSinceStart()
{
return m_fTimeSinceStart;
}
+29
View File
@@ -0,0 +1,29 @@
#pragma once
/*
-----------------------------------------------------------------------------
File: RageTimer.h
Desc: Timer services.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
class RageTimer
{
public:
RageTimer();
~RageTimer();
float GetDeltaTime(); // time between last call to GetDeltaTime()
float PeekDeltaTime();
float GetTimeSinceStart(); // seconds since the program was started
private:
float m_fLastDeltaTime;
float m_fTimeSinceStart; // seconds since the program was started
};
extern RageTimer* TIMER; // global and accessable from anywhere in our program
+1 -1
View File
@@ -14,7 +14,7 @@
#include "RandomSample.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
RandomSample::RandomSample()
+54 -81
View File
@@ -6,6 +6,7 @@
Desc: A graphic displayed in the ScoreDisplayRolling during Dancing.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
@@ -32,24 +33,27 @@ ScoreDisplayRolling::ScoreDisplayRolling()
}
void ScoreDisplayRolling::SetScore( int iNewScore )
{
SetScore( (float)iNewScore );
void ScoreDisplayRolling::Init( PlayerNumber pn, PlayerOptions po, int iTotalTapNotes, int iNotesMeter )
{
m_PlayerNumber = pn;
m_PlayerOptions = po;
m_iTotalTapNotes = iTotalTapNotes;
m_iNotesMeter = iNotesMeter;
}
void ScoreDisplayRolling::SetScore( float fNewScore )
void ScoreDisplayRolling::SetScore( int iNewScore )
{
m_fScore = fNewScore;
m_iScore = iNewScore;
float fDelta = m_fScore - m_fTrailingScore;
float fDelta = m_iScore - m_fTrailingScore;
m_fScoreVelocity = fDelta / SCORE_TWEEN_TIME; // in score units per second
}
float ScoreDisplayRolling::GetScore()
int ScoreDisplayRolling::GetScore()
{
return m_fScore;
return m_iScore;
}
@@ -57,13 +61,13 @@ void ScoreDisplayRolling::Update( float fDeltaTime )
{
BitmapText::Update( fDeltaTime );
float fDeltaBefore = m_fScore - m_fTrailingScore;
float fDeltaBefore = m_iScore - m_fTrailingScore;
m_fTrailingScore += m_fScoreVelocity * fDeltaTime;
float fDeltaAfter = m_fScore - m_fTrailingScore;
float fDeltaAfter = m_iScore - m_fTrailingScore;
if( fDeltaBefore * fDeltaAfter < 0 ) // the sign changed
{
m_fTrailingScore = m_fScore;
m_fTrailingScore = (float)m_iScore;
m_fScoreVelocity = 0;
}
@@ -71,7 +75,7 @@ void ScoreDisplayRolling::Update( float fDeltaTime )
void ScoreDisplayRolling::Draw()
{
if( m_fScore == 0 )
if( m_iScore == 0 )
{
CString sFormat = ssprintf( "%%%d.0d", NUM_SCORE_DIGITS );
SetText( ssprintf(sFormat, 0) );
@@ -89,81 +93,50 @@ void ScoreDisplayRolling::Draw()
void ScoreDisplayRolling::AddToScore( TapNoteScore score, int iCurCombo )
{
// The scoring system for DDR versions 1 and 2 (including the Plus remixes) is as follows:
// For every step:
//
// Multiplier (M) = (# of Notes 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
//A single step's points are calculated as follows:
//
//Let p = score multiplier (Perfect = 10, Great = 5, other = 0)
//N = total number of steps and freeze steps
//n = number of the current step or freeze step (varies from 1 to N)
//B = Base value of the song (1,000,000 X the number of feet difficulty) - All edit data is rated as 5 feet
//So, the score for one step is:
//one_step_score = p * (B/S) * n
//Where S = The sum of all integers from 1 to N (the total number of steps/freeze steps)
//
//*IMPORTANT* : Double steps (U+L, D+R, etc.) count as two steps instead of one, so if you get a double L+R on the 112th step of a song, you score is calculated with a Perfect/Great/whatever for both the 112th and 113th steps. Got it? Now, through simple algebraic manipulation
//S = 1+...+N = (1+N)*N/2 (1 through N added together)
//Okay, time for an example:
//
//So, for example, suppose we wanted to calculate the step score of a "Great" on the 57th step of a 441 step, 8-foot difficulty song (I'm just making this one up):
//
//S = (1 + 441)*441 / 2
//= 194,222 / 2
//= 97,461
//StepScore = p * (B/S) * n
//= 5 * (8,000,000 / 97,461) * 57
//= 5 * (82) * 57 (The 82 is rounded down from 82.08411...)
//= 23,370
//Remember this is just the score for the step, not the cumulative score up to the 57th step. Also, please note that I am currently checking into rounding errors with the system and if there are any, how they are resolved in the system.
//
//Note: if you got all Perfect on this song, you would get (p=10)*B, which is 80,000,000. In fact, the maximum possible score for any song is the number of feet difficulty X 10,000,000.
float M = iCurCombo/4.0f;
float fScoreToAdd = 0;
int p; // score multiplier
switch( score )
{
case TNS_MISS: break;
case TNS_BOO: break;
case TNS_GOOD: fScoreToAdd = M * 100 + 100; break;
case TNS_GREAT: fScoreToAdd = M * M * 100 + 300; break;
case TNS_PERFECT: fScoreToAdd = M * M * 300 + 500; break;
case TNS_GREAT: p = 10; break;
case TNS_PERFECT: p = 5; break;
default: p = 0; break;
}
m_fScore += fScoreToAdd;
ASSERT( m_fScore >= 0 );
/* Score implementation by Chris Gomez, February 6th, 2002 The
scoring system for 5th mix is much more complicated than the original
scoring system. We don't have bonuses yet, so they're not included in
this code. Max score is (feet + 1) * 5,000,000. Scores are clamped
to integers; this is fixed on the last step (if it's perfect)
int N = m_iTotalTapNotes;
int n = iCurCombo;
int B = m_iNotesMeter * 1000000;
int S = (1+N)*N/2;
The base step value is the max score divided by 10, divided by
one-half of the max combo squared plus the max combo. This value is
multiplied by 10 for a perfect or 5 for a great, and further
multiplied by the number of Notes currently in the combo. */
/*
int iScoreToAdd = 0; int iBonus = 0;
int one_step_score = p * (B/S) * n;
Notes *pSteps = GAMEINFO->m_pStepsPlayer[m_PlayerNumber];
int iNumFeet = pSteps->m_iNumFeet;
int iMaxCombo = pSteps->GetNumSteps();
m_iScore += one_step_score;
ASSERT( m_iScore >= 0 );
int iScoreMax = (iNumFeet + 1) * 5000000; //magic numbers. int
iBaseScore = (iScoreMax / 10) / ((iMaxCombo * (iMaxCombo + 1)) / 2);
iCurCombo++; // looks like the current combo counter starts at 0 when
iCurCombo++it should start at 1
// this was messing with the scoring, so it had to be fixed.
switch (score)
{
case miss:
case boo:
case good:
break;
case great:
iScoreToAdd = 5 * iBaseScore * iCurCombo;
break;
case perfect:
iScoreToAdd = 10 * iBaseScore * iCurCombo;
if(BeatToStepIndex(pSteps->GetLastBeat()) == iMaxCombo)
for(int i = 1; i <= iMaxCombo; i++)
iBonus += 10 * iBaseScore * i;
iScoreToAdd += iBonus;
break;
}
*/
this->SetScore( m_fScore );
this->SetScore( m_iScore );
}
+9 -3
View File
@@ -24,16 +24,22 @@ class ScoreDisplayRolling : public BitmapText
public:
ScoreDisplayRolling();
void SetScore( float fNewScore );
void Init( PlayerNumber pn, PlayerOptions po, int iTotalTapNotes, int iNotesMeter );
void SetScore( int iNewScore );
float GetScore();
int GetScore();
void AddToScore( TapNoteScore score, int iCurCombo );
virtual void Update( float fDeltaTime );
virtual void Draw();
protected:
float m_fScore;
PlayerNumber m_PlayerNumber;
PlayerOptions m_PlayerOptions;
int m_iTotalTapNotes;
int m_iNotesMeter;
int m_iScore;
float m_fTrailingScore;
float m_fScoreVelocity;
+4
View File
@@ -11,6 +11,7 @@
*/
#include "Screen.h"
#include "GameManager.h"
Screen::Screen()
{
@@ -50,6 +51,9 @@ void Screen::Input( const DeviceInput& DeviceI, const InputEventType type, const
if( !MenuI.IsValid() )
return;
if( !GAMEMAN->IsPlayerEnabled(MenuI.player) )
return;
switch( MenuI.button )
{
case MENU_BUTTON_UP: this->MenuUp( MenuI.player, type ); return;
+1 -1
View File
@@ -370,7 +370,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
{
// allocate a new Notes
SONGMAN->GetCurrentSong()->m_arrayNotes.SetSize( SONGMAN->GetCurrentSong()->m_arrayNotes.GetSize() + 1 );
pNotes = &SONGMAN->GetCurrentSong()->m_arrayNotes[ SONGMAN->GetCurrentSong()->m_arrayNotes.GetSize()-1 ];
pNotes = SONGMAN->GetCurrentSong()->m_arrayNotes[ SONGMAN->GetCurrentSong()->m_arrayNotes.GetSize()-1 ];
pNotes->m_NotesType = GAMEMAN->m_CurNotesType;
pNotes->m_sDescription = "Untitled";
pNotes->m_iMeter = 1;
+13 -2
View File
@@ -89,14 +89,14 @@ ScreenEditMenu::ScreenEditMenu()
m_textExplanation.Load( THEME->GetPathTo(FONT_NORMAL) );
m_textExplanation.SetXY( EXPLANATION_X, EXPLANATION_Y );
m_textExplanation.SetText( ssprintf("This mode will allow you to\nedit an existing or\n create a new Notes Notes.") );
m_textExplanation.SetText( ssprintf("This mode will allow you to\nedit existing notes patterns,\n or create new ones from scratch.") );
m_textExplanation.SetZoom( 0.7f );
this->AddActor( &m_textExplanation );
m_Menu.Load(
THEME->GetPathTo(GRAPHIC_EDIT_BACKGROUND),
THEME->GetPathTo(GRAPHIC_EDIT_TOP_EDGE),
ssprintf("%s %s change music NEXT to continue", CString(char(1)), CString(char(2)) )
ssprintf("%s %s change music START to continue", CString(char(1)), CString(char(2)) )
);
this->AddActor( &m_Menu );
@@ -144,6 +144,17 @@ void ScreenEditMenu::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
break;
case SM_GoToNextState:
// set the current style based on the notes type
switch( GetSelectedNotesType() )
{
case NOTES_TYPE_DANCE_SINGLE: GAMEMAN->m_CurStyle = STYLE_DANCE_SINGLE; break;
case NOTES_TYPE_DANCE_DOUBLE: GAMEMAN->m_CurStyle = STYLE_DANCE_DOUBLE; break;
case NOTES_TYPE_DANCE_COUPLE: GAMEMAN->m_CurStyle = STYLE_DANCE_COUPLE; break;
case NOTES_TYPE_DANCE_SOLO: GAMEMAN->m_CurStyle = STYLE_DANCE_SOLO; break;
case NOTES_TYPE_PUMP_SINGLE: GAMEMAN->m_CurStyle = STYLE_PUMP_SINGLE; break;
case NOTES_TYPE_PUMP_DOUBLE: GAMEMAN->m_CurStyle = STYLE_PUMP_DOUBLE; break;
}
SCREENMAN->SetNewScreen( new ScreenEdit );
break;
}
+178 -73
View File
@@ -28,19 +28,22 @@
// Defines specific to GameScreenTitleMenu
//
const float LIFE_X[NUM_PLAYERS] = { CENTER_X-180, CENTER_X+180 };
const float LIFE_Y = SCREEN_TOP+28;
const float LIFE_LOCAL_X[NUM_PLAYERS] = { -180, +180 };
const float LIFE_LOCAL_Y[NUM_PLAYERS] = { -10, -10 };
const float SCORE_X[NUM_PLAYERS] = { CENTER_X-214, CENTER_X+214 };
const float SCORE_Y = SCREEN_BOTTOM-38;
const float STAGE_NUMBER_LOCAL_X = 0;
const float STAGE_NUMBER_LOCAL_Y = +20;
const float PLAYER_OPTIONS_X[NUM_PLAYERS] = { CENTER_X-214, CENTER_X+214 };
const float PLAYER_OPTIONS_Y[NUM_PLAYERS] = { SCREEN_BOTTOM-60, SCREEN_BOTTOM-40 };
const float SCORE_LOCAL_X[NUM_PLAYERS] = { -214, +214 };
const float SCORE_LOCAL_Y[NUM_PLAYERS] = { -6, -6 };
const float DIFFICULTY_X[NUM_PLAYERS] = { SCREEN_LEFT+70, SCREEN_RIGHT-70 };
const float DIFFICULTY_Y = SCREEN_BOTTOM-80;
const float PLAYER_OPTIONS_LOCAL_X[NUM_PLAYERS] = { -214, +214 };
const float PLAYER_OPTIONS_LOCAL_Y[NUM_PLAYERS] = { -10, +10 };
const float MAX_SECONDS_CAN_BE_OFF_BY = 0.20f;
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 MAX_SECONDS_CAN_BE_OFF_BY = 0.25f;
const float TIME_BETWEEN_DANCING_COMMENTS = 15;
@@ -67,86 +70,105 @@ ScreenGameplay::ScreenGameplay()
{
LOG->WriteLine( "ScreenGameplay::ScreenGameplay()" );
m_pCurSong = NULL;
switch( PREFSMAN->m_PlayMode )
{
case PLAY_MODE_ARCADE:
{
m_apSongQueue.Add( SONGMAN->GetCurrentSong() );
for( int p=0; p<NUM_PLAYERS; p++ )
m_apNotesQueue[p].Add( SONGMAN->GetCurrentNotes(PlayerNumber(p)) );
}
break;
case PLAY_MODE_ONI:
{
Course* pCourse = SONGMAN->m_pCurCourse;
ASSERT( pCourse != NULL );
for( int i=0; i<pCourse->m_iStages; i++ )
{
m_apSongQueue.Add( pCourse->m_apSongs[i] );
for( int p=0; p<NUM_PLAYERS; p++ )
m_apNotesQueue[p].Add( pCourse->m_apNotes[i] );
}
}
break;
}
m_DancingState = STATE_INTRO;
m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS;
m_bHasFailed = false;
m_pSong = SONGMAN->GetCurrentSong();
m_bBothHaveFailed = false;
m_Background.LoadFromSong( m_pSong );
m_Background.SetDiffuseColor( D3DXCOLOR(0.4f,0.4f,0.4f,1) );
this->AddActor( &m_Background );
// Get the current StyleDef definition (used below)
StyleDef* pStyleDef = GAMEMAN->GetCurrentStyleDef();
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMEMAN->IsPlayerEnabled(PlayerNumber(p)) )
continue;
float fDifficultyY = DIFFICULTY_Y;
if( PREFSMAN->m_PlayerOptions[p].m_bReverseScroll )
fDifficultyY = SCREEN_HEIGHT - DIFFICULTY_Y;
m_DifficultyBanner[p].SetXY( DIFFICULTY_X[p], fDifficultyY );
m_DifficultyBanner[p].SetFromNotes( SONGMAN->GetCurrentNotes((PlayerNumber)p) );
this->AddActor( &m_DifficultyBanner[p] );
NoteData* pOriginalNoteData = SONGMAN->GetCurrentNotes((PlayerNumber)p)->GetNoteData();
NoteData newNoteData;
GAMEMAN->GetCurrentStyleDef()->GetTransformedNoteDataForStyle( (PlayerNumber)p, pOriginalNoteData, newNoteData );
m_Player[p].SetX( (float) GAMEMAN->GetCurrentStyleDef()->m_iCenterX[p] );
m_Player[p].Load(
(PlayerNumber)p,
GAMEMAN->GetCurrentStyleDef(),
&newNoteData,
PREFSMAN->m_PlayerOptions[p],
&m_LifeMeter[p],
&m_ScoreDisplay[p]
);
this->AddActor( &m_Player[p] );
}
//////////////////////////////////
// Add all Actors to m_frameTop
//////////////////////////////////
this->AddActor( &m_frameTop );
// LifeMeter goes underneath top frame
for( p=0; p<NUM_PLAYERS; p++ )
{
m_quadLifeMeterBG[p].SetXY( LIFE_X[p], LIFE_Y );
m_quadLifeMeterBG[p].SetXY( LIFE_LOCAL_X[p], LIFE_LOCAL_Y[p] );
m_quadLifeMeterBG[p].SetDiffuseColor( D3DXCOLOR(0,0,0,1) );
m_quadLifeMeterBG[p].SetZoomX( 256 );
m_quadLifeMeterBG[p].SetZoomY( (p==PLAYER_1) ? 20.0f : -20.0f );
this->AddActor( &m_quadLifeMeterBG[p] );
m_frameTop.AddActor( &m_quadLifeMeterBG[p] );
if( !GAMEMAN->IsPlayerEnabled(PlayerNumber(p)) )
continue;
m_LifeMeter[p].SetPlayerOptions( PREFSMAN->m_PlayerOptions[p] );
m_LifeMeter[p].SetXY( LIFE_X[p], LIFE_Y );
m_LifeMeter[p].SetXY( LIFE_LOCAL_X[p], LIFE_LOCAL_Y[p] );
m_LifeMeter[p].SetZoomX( 256 );
m_LifeMeter[p].SetZoomY( (p==PLAYER_1) ? 20.0f : -20.0f );
this->AddActor( &m_LifeMeter[p] );
m_frameTop.AddActor( &m_LifeMeter[p] );
}
m_sprTopFrame.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_TOP_FRAME) );
m_sprTopFrame.SetXY( CENTER_X, SCREEN_TOP + m_sprTopFrame.GetZoomedHeight()/2 );
this->AddActor( &m_sprTopFrame );
// TopFrame goes above LifeMeter
m_sprTopFrame.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_TOP_FRAME_ARCADE) );
m_frameTop.AddActor( &m_sprTopFrame );
m_frameTop.SetXY( CENTER_X, SCREEN_TOP + m_sprTopFrame.GetZoomedHeight()/2 );
m_textStageNumber.Load( THEME->GetPathTo(FONT_HEADER2) );
m_textStageNumber.TurnShadowOff();
m_textStageNumber.SetXY( STAGE_NUMBER_LOCAL_X, STAGE_NUMBER_LOCAL_Y );
CString sStageText = PREFSMAN->GetStageText();
m_textStageNumber.SetText( sStageText );
if( stricmp(sStageText, "Final") == 0 )
m_textStageNumber.SetDiffuseColor( D3DXCOLOR(1,0.1f,0.1f,1) ); // red
else
m_textStageNumber.SetDiffuseColor( D3DXCOLOR(0.3f,1,0.3f,1) ); // green
m_frameTop.AddActor( &m_textStageNumber );
//////////////////////////////////
// Add all Actors to m_frameBottom
//////////////////////////////////
this->AddActor( &m_frameBottom );
m_sprBottomFrame.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_BOTTOM_FRAME) );
m_sprBottomFrame.SetXY( CENTER_X, SCREEN_BOTTOM - m_sprBottomFrame.GetZoomedHeight()/2 );
this->AddActor( &m_sprBottomFrame );
m_frameBottom.AddActor( &m_sprBottomFrame );
m_textStageNumber.Load( THEME->GetPathTo(FONT_HEADER1) );
m_textStageNumber.TurnShadowOff();
m_textStageNumber.SetXY( CENTER_X, 60 );
m_textStageNumber.SetDiffuseColor( D3DXCOLOR(0.3f,1,1,1) );
m_textStageNumber.SetText( PREFSMAN->GetStageText() );
this->AddActor( &m_textStageNumber );
m_frameBottom.SetXY( CENTER_X, SCREEN_BOTTOM - m_sprBottomFrame.GetZoomedHeight()/2 );
for( p=0; p<NUM_PLAYERS; p++ )
@@ -154,19 +176,38 @@ ScreenGameplay::ScreenGameplay()
if( !GAMEMAN->IsPlayerEnabled(PlayerNumber(p)) )
continue;
m_ScoreDisplay[p].SetXY( SCORE_X[p], SCORE_Y );
m_ScoreDisplay[p].SetXY( SCORE_LOCAL_X[p], SCORE_LOCAL_Y[p] );
m_ScoreDisplay[p].SetZoom( 0.8f );
this->AddActor( &m_ScoreDisplay[p] );
m_frameBottom.AddActor( &m_ScoreDisplay[p] );
m_textPlayerOptions[p].Load( THEME->GetPathTo(FONT_NORMAL) );
m_textPlayerOptions[p].TurnShadowOff();
m_textPlayerOptions[p].SetXY( PLAYER_OPTIONS_X[p], PLAYER_OPTIONS_Y[p] );
m_textPlayerOptions[p].SetXY( PLAYER_OPTIONS_LOCAL_X[p], PLAYER_OPTIONS_LOCAL_Y[p] );
m_textPlayerOptions[p].SetZoom( 0.5f );
m_textPlayerOptions[p].SetDiffuseColor( D3DXCOLOR(1,1,1,1) );
m_textPlayerOptions[p].SetText( PREFSMAN->m_PlayerOptions[p].GetString() );
this->AddActor( &m_textPlayerOptions[p] );
m_frameBottom.AddActor( &m_textPlayerOptions[p] );
}
// Get the current StyleDef definition (used below)
StyleDef* pStyleDef = GAMEMAN->GetCurrentStyleDef();
for( p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMEMAN->IsPlayerEnabled(PlayerNumber(p)) )
continue;
float fDifficultyY = DIFFICULTY_Y[p];
if( PREFSMAN->m_PlayerOptions[p].m_bReverseScroll )
fDifficultyY = SCREEN_HEIGHT - DIFFICULTY_Y[p];
m_DifficultyBanner[p].SetXY( DIFFICULTY_X[p], fDifficultyY );
this->AddActor( &m_DifficultyBanner[p] );
}
@@ -195,7 +236,6 @@ ScreenGameplay::ScreenGameplay()
this->AddActor( &m_sprFailed );
m_soundMusic.Load( m_pSong->GetMusicPath() );
m_soundFail.Load( THEME->GetPathTo(SOUND_GAMEPLAY_FAILED) );
m_announcerReady.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_READY) );
@@ -208,12 +248,11 @@ ScreenGameplay::ScreenGameplay()
m_soundAssistTick.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ASSIST_TICK) );
LoadNextSong();
// Send some messages every have second to we can get the introduction rolling
for( int i=0; i<30; i++ )
this->SendScreenMessage( ScreenMessage(SM_User+i), i/2.0f );
m_StarWipe.SetClosed();
}
ScreenGameplay::~ScreenGameplay()
@@ -223,6 +262,56 @@ ScreenGameplay::~ScreenGameplay()
}
void ScreenGameplay::LoadNextSong()
{
int p;
m_pCurSong = m_apSongQueue[m_apSongQueue.GetSize()-1];
m_apSongQueue.RemoveAt(m_apSongQueue.GetSize()-1);
Notes* pNotes[NUM_PLAYERS];
for( p=0; p<NUM_PLAYERS; p++ )
{
pNotes[p] = m_apNotesQueue[p][m_apNotesQueue[p].GetSize()-1];
m_apNotesQueue[p].RemoveAt(m_apNotesQueue[p].GetSize()-1);
}
// Get the current StyleDef definition (used below)
StyleDef* pStyleDef = GAMEMAN->GetCurrentStyleDef();
for( p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMEMAN->IsPlayerEnabled(PlayerNumber(p)) )
continue;
m_DifficultyBanner[p].SetFromNotes( PlayerNumber(p), pNotes[p] );
NoteData* pOriginalNoteData = pNotes[p]->GetNoteData();
NoteData newNoteData;
pStyleDef->GetTransformedNoteDataForStyle( (PlayerNumber)p, pOriginalNoteData, newNoteData );
m_Player[p].Load(
(PlayerNumber)p,
GAMEMAN->GetCurrentStyleDef(),
&newNoteData,
PREFSMAN->m_PlayerOptions[p],
&m_LifeMeter[p],
&m_ScoreDisplay[p]
);
}
m_soundMusic.Load( m_pCurSong->GetMusicPath() );
m_Background.LoadFromSong( m_pCurSong );
m_Background.SetDiffuseColor( D3DXCOLOR(0.5f,0.5f,0.5f,1) );
m_Background.BeginTweeningQueued( 2 );
m_Background.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
}
void ScreenGameplay::Update( float fDeltaTime )
{
//LOG->WriteLine( "ScreenGameplay::Update(%f)", fDeltaTime );
@@ -232,7 +321,7 @@ void ScreenGameplay::Update( float fDeltaTime )
float fSongBeat, fBPS;
float fPositionSeconds = m_soundMusic.GetPositionSeconds();
m_pSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS );
m_pCurSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS );
@@ -254,7 +343,7 @@ void ScreenGameplay::Update( float fDeltaTime )
case SongOptions::FAIL_ARCADE:
case SongOptions::FAIL_END_OF_SONG:
if( m_bHasFailed )
if( m_bBothHaveFailed )
break; // if they have already failed, don't bother checking again
{
@@ -282,7 +371,7 @@ void ScreenGameplay::Update( float fDeltaTime )
if( bAllFailed )
{
m_bHasFailed = true;
m_bBothHaveFailed = true;
SCREENMAN->SendMessageToTopScreen( SM_LifeIs0, 0 );
}
}
@@ -329,7 +418,7 @@ void ScreenGameplay::Update( float fDeltaTime )
// will start coming out the speaker. Compensate for this by boosting
// fPositionSeconds ahead
fPositionSeconds += (SOUND->GetPlayLatency()+0.06f) * m_soundMusic.GetPlaybackRate(); // HACK: Add 0.06 seconds to make them play a tiny bit earlier
m_pSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS );
m_pCurSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS );
int iIndexNow = BeatToNoteIndexNotRounded( fSongBeat );
static int iIndexLastCrossed = 0;
@@ -369,7 +458,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
//LOG->WriteLine( "ScreenGameplay::Input()" );
float fSongBeat, fBPS;
m_pSong->GetBeatAndBPSFromElapsedTime( m_soundMusic.GetPositionSeconds(), fSongBeat, fBPS );
m_pCurSong->GetBeatAndBPSFromElapsedTime( m_soundMusic.GetPositionSeconds(), fSongBeat, fBPS );
if( MenuI.IsValid() )
@@ -378,9 +467,9 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ
{
case MENU_BUTTON_BACK:
if( m_DancingState == STATE_DANCING
&& !m_bHasFailed )
&& !m_bBothHaveFailed )
{
m_bHasFailed = true;
m_bBothHaveFailed = true;
SCREENMAN->SendMessageToTopScreen( SM_BeginFailed, 0 );
}
else
@@ -450,7 +539,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
if( m_DancingState == STATE_OUTRO ) // gameplay already ended
return; // ignore
if( m_bHasFailed ) // fail them
if( m_bBothHaveFailed ) // fail them
{
this->SendScreenMessage( SM_BeginFailed, 0 );
}
@@ -473,10 +562,16 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SendMessageToTopScreen( SM_GoToResults, 1 );
break;
case SM_GoToResults:
// send score summaries to the PREFSMAN object so ScreenResults can grab it.
PREFSMAN->m_ScoreSummary[PLAYER_1][PREFSMAN->m_iNumArcadeStages-1] = m_Player[PLAYER_1].GetScoreSummary();
PREFSMAN->m_ScoreSummary[PLAYER_2][PREFSMAN->m_iNumArcadeStages-1] = m_Player[PLAYER_2].GetScoreSummary();
SCREENMAN->SetNewScreen( new ScreenResults(false) );
{
// send score summaries to the PREFSMAN object so ScreenResults can grab it.
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMEMAN->IsPlayerEnabled((PlayerNumber)p) )
continue; // skip
m_Player[p].GetGameplayStatistics( SONGMAN->m_GameplayStatistics[PREFSMAN->m_iNumArcadeStages-1][p] );
}
SCREENMAN->SetNewScreen( new ScreenResults(false) );
}
break;
@@ -526,6 +621,16 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SetNewScreen( new ScreenGameOver );
break;
}
}
void ScreenGameplay::TweenOnScreen()
{
}
void ScreenGameplay::TweenOffScreen()
{
}
+22 -13
View File
@@ -45,28 +45,37 @@ public:
private:
void TweenOnScreen();
void TweenOffScreen();
void LoadNextSong();
DancingState m_DancingState;
float m_fTimeLeftBeforeDancingComment; // this counter is only running while STATE_DANCING
DancingState m_DancingState;
Song* m_pSong;
bool m_bHasFailed;
Song* m_pCurSong; // nearest songs are on back of queue
CArray<Song*,Song*> m_apSongQueue; // nearest songs are on back of queue
CArray<Notes*,Notes*> m_apNotesQueue[NUM_PLAYERS]; // nearest notes are on back of queue
bool m_bBothHaveFailed;
Background m_Background;
float m_fTimeLeftBeforeDancingComment; // this counter is only running while STATE_DANCING
Quad m_quadLifeMeterBG[NUM_PLAYERS];
LifeMeterBar m_LifeMeter[NUM_PLAYERS];
Sprite m_sprTopFrame;
Sprite m_sprBottomFrame;
BitmapText m_textPlayerOptions[NUM_PLAYERS];
Background m_Background;
ActorFrame m_frameTop;
Sprite m_sprTopFrame;
Quad m_quadLifeMeterBG[NUM_PLAYERS]; // just a black quad to fill in hole for the life meter
LifeMeterBar m_LifeMeter[NUM_PLAYERS];
BitmapText m_textStageNumber;
ActorFrame m_frameBottom;
Sprite m_sprBottomFrame;
ScoreDisplayRolling m_ScoreDisplay[NUM_PLAYERS];
BitmapText m_textPlayerOptions[NUM_PLAYERS];
BitmapText m_textStageNumber;
TransitionStarWipe m_StarWipe;
FocusingSprite m_sprReady;
@@ -74,7 +83,7 @@ private:
FocusingSprite m_sprCleared;
MotionBlurSprite m_sprFailed;
Player m_Player[NUM_PLAYERS];
Player m_Player[NUM_PLAYERS];
DifficultyBanner m_DifficultyBanner[NUM_PLAYERS];
+15 -9
View File
@@ -42,8 +42,8 @@ const CString CREDIT_LINES[] =
"",
"GRAPHICS:",
"TofuBoy (Lucas Tang)",
"Brian 'Bork' Bugh",
"DJ McFox (Ryan McKanna)",
"SPiGuMuS",
"",
"",
"",
@@ -52,11 +52,16 @@ const CString CREDIT_LINES[] =
"",
"",
"",
"SOUND:",
"Kyle 'Keel' Ward",
"",
"",
"",
"PROGRAMMING:",
"Parasyte (Chris Gomez)",
"Lord Frieza (Andrew Livy)",
"Ben Nordstrom",
"Chris Danford",
"Lord Frieza (Andrew Livy)",
"Parasyte (Chris Gomez)",
"Ben Nordstrom",
"angedelamort (Sauleil Lamarre)",
"Edwin Evans",
"Brian 'Bork' Bugh",
@@ -77,14 +82,15 @@ const CString CREDIT_LINES[] =
"SPECIAL THANKS TO:",
"SimWolf",
"Dance With Intensity",
"The Melting Pot",
"Lagged",
"DDRJamz Global BBS",
"DDR Llama",
"DDRManiaX",
"Lagged",
"The Melting Pot",
"DDRJamz Global BBS",
"BemaniRuler",
"Brendan Walker",
"WaffleKing (Eric Webster)",
"Foobly (Mark Verrey)",
"Eric 'WaffleKing' Webster",
"Mark 'Foobly' Verrey",
"Mandarin Blue",
"Anne Kiel",
"BeMaNiFiNiNaTiC",
+6 -5
View File
@@ -29,6 +29,9 @@ const float HEADER_Y = 50;
const float HELP_X = CENTER_X;
const float HELP_Y = SCREEN_HEIGHT-35;
const float ITEM_GAP_X = 12;
const float LABELS_X = 80;
const float LINE_START_Y= 80;
const float LINE_GAP_Y = 36;
const ScreenMessage SM_PlaySample = ScreenMessage(SM_User-4);
@@ -48,7 +51,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sTopEdgePath )
m_Menu.Load(
sBackgroundPath,
sTopEdgePath,
ssprintf("%s %s to change line %s %s to select between options then press NEXT", CString(char(3)), CString(char(4)), CString(char(1)), CString(char(2)) )
ssprintf("%s %s to change line %s %s to select between options then press START", CString(char(3)), CString(char(4)), CString(char(1)), CString(char(2)) )
);
this->AddActor( &m_Menu );
m_Menu.TweenOnScreenFromBlack( SM_None );
@@ -135,13 +138,13 @@ void ScreenOptions::InitOptionsText()
{
OptionLineData &optline = m_OptionLineData[i];
float fY = 60.0f + 40*i;
float fY = LINE_START_Y + LINE_GAP_Y*i;
BitmapText &title = m_textOptionLineTitles[i];
title.Load( THEME->GetPathTo(FONT_HEADER2) );
title.SetText( optline.szTitle );
title.SetXY( 80, fY );
title.SetXY( LABELS_X, fY );
title.SetZoom( 0.7f );
title.SetVertAlign( Actor::align_middle );
this->AddActor( &title );
@@ -173,12 +176,10 @@ void ScreenOptions::InitOptionsText()
continue; // skip
Quad &highlight = m_SelectionHighlight[p];
this->AddActor( &highlight );
for( int i=0; i<m_iNumOptionLines; i++ ) // foreach options line
{
Quad &underline = m_OptionUnderline[p][i];
this->AddActor( &underline );
}
}
}
+3 -7
View File
@@ -105,7 +105,7 @@ void ScreenPlayerOptions::ImportOptions()
for( int s=0; i<m_OptionLineData[PO_SKIN].iNumOptions; s++ ) // foreach skin
if( m_OptionLineData[PO_SKIN].szOptionsText[s] == GAMEMAN->m_sCurrentSkin[p] )
{
m_iSelectedOption[p][PO_DRAIN] = s;
m_iSelectedOption[p][PO_SKIN] = s;
break;
}
}
@@ -137,12 +137,8 @@ void ScreenPlayerOptions::ExportOptions()
po.m_bHoldNotes = (m_iSelectedOption[p][PO_HOLD_NOTES] == 1);
po.m_DrainType = (PlayerOptions::DrainType)m_iSelectedOption[p][PO_DRAIN];
for( int s=0; s<m_OptionLineData[PO_SKIN].iNumOptions; s++ ) // foreach skin
if( m_OptionLineData[PO_SKIN].szOptionsText[s] == GAMEMAN->m_sCurrentSkin[p] )
{
m_iSelectedOption[p][PO_DRAIN] = s;
break;
}
int iSelectedSkin = m_iSelectedOption[p][PO_SKIN];
GAMEMAN->m_sCurrentSkin[p] = m_OptionLineData[PO_SKIN].szOptionsText[iSelectedSkin];
}
}
+254
View File
@@ -0,0 +1,254 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: ScreenSelectCourse
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ScreenSelectCourse.h"
#include "ScreenManager.h"
#include "PrefsManager.h"
#include "SongManager.h"
#include "GameManager.h"
#include "RageMusic.h"
#include "ScreenTitleMenu.h"
#include "GameConstantsAndTypes.h"
#include "ThemeManager.h"
#include "ScreenGameplay.h"
#include "ScreenPrompt.h"
#include "ScreenPlayerOptions.h"
#include "RageLog.h"
#include "InputMapper.h"
#include "InputQueue.h"
#include "ScreenStage.h"
#include "AnnouncerManager.h"
const float COURSE_INFO_FRAME_X = 160;
const float COURSE_INFO_FRAME_Y = SCREEN_TOP+118;
const float COURSE_CONTENTS_FRAME_X = 160;
const float COURSE_CONTENTS_FRAME_Y = CENTER_Y+100;
const float WHEEL_X = CENTER_X+160;
const float WHEEL_Y = CENTER_Y+8;
const float TWEEN_TIME = 0.5f;
const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User+1);
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User+2);
const ScreenMessage SM_ConfirmChange = ScreenMessage(SM_User+3);
ScreenSelectCourse::ScreenSelectCourse()
{
LOG->WriteLine( "ScreenSelectCourse::ScreenSelectCourse()" );
// for debugging
if( GAMEMAN->m_CurStyle == STYLE_NONE )
GAMEMAN->m_CurStyle = STYLE_DANCE_SINGLE;
m_Menu.Load(
THEME->GetPathTo(GRAPHIC_SELECT_COURSE_BACKGROUND),
THEME->GetPathTo(GRAPHIC_SELECT_COURSE_TOP_EDGE),
ssprintf("%c or %c change course then press START",
char(1), char(2), char(3), char(3), char(4), char(4), char(3), char(4), char(3), char(4) )
);
this->AddActor( &m_Menu );
m_CourseInfoFrame.SetXY( COURSE_INFO_FRAME_X, COURSE_INFO_FRAME_Y );
this->AddActor( &m_CourseInfoFrame );
m_CourseContentsFrame.SetXY( COURSE_CONTENTS_FRAME_X, COURSE_CONTENTS_FRAME_Y );
this->AddActor( &m_CourseContentsFrame );
m_MusicWheel.SetXY( WHEEL_X, WHEEL_Y );
this->AddActor( &m_MusicWheel );
m_textHoldForOptions.Load( THEME->GetPathTo(FONT_STAGE) );
m_textHoldForOptions.SetXY( CENTER_X, CENTER_Y );
m_textHoldForOptions.SetText( "hold START for options" );
m_textHoldForOptions.SetZoom( 1 );
m_textHoldForOptions.SetZoomY( 0 );
m_textHoldForOptions.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
m_textHoldForOptions.SetZ( -2 );
this->AddActor( &m_textHoldForOptions );
m_soundSelect.Load( THEME->GetPathTo(SOUND_MENU_START) );
m_soundChangeNotes.Load( THEME->GetPathTo(SOUND_SELECT_MUSIC_CHANGE_NOTES) );
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_COURSE_INTRO) );
AfterCourseChange();
TweenOnScreen();
m_Menu.TweenOnScreenFromMenu( SM_None );
}
ScreenSelectCourse::~ScreenSelectCourse()
{
LOG->WriteLine( "ScreenSelectCourse::~ScreenSelectCourse()" );
}
void ScreenSelectCourse::DrawPrimitives()
{
m_Menu.DrawBottomLayer();
Screen::DrawPrimitives();
m_Menu.DrawTopLayer();
}
void ScreenSelectCourse::TweenOnScreen()
{
m_CourseInfoFrame.SetXY( COURSE_INFO_FRAME_X - 400, COURSE_INFO_FRAME_Y );
m_CourseInfoFrame.BeginTweening( TWEEN_TIME, Actor::TWEEN_BIAS_END );
m_CourseInfoFrame.SetTweenXY( COURSE_INFO_FRAME_X, COURSE_INFO_FRAME_Y );
m_MusicWheel.TweenOnScreen();
}
void ScreenSelectCourse::TweenOffScreen()
{
m_CourseInfoFrame.BeginTweening( TWEEN_TIME, Actor::TWEEN_BOUNCE_END );
m_CourseInfoFrame.SetTweenXY( COURSE_INFO_FRAME_X - 400, COURSE_INFO_FRAME_Y );
m_MusicWheel.TweenOffScreen();
}
void ScreenSelectCourse::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
LOG->WriteLine( "ScreenSelectCourse::Input()" );
if( m_Menu.IsClosing() )
return; // ignore
if( MenuI.player == PLAYER_NONE )
return;
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler
}
void ScreenSelectCourse::HandleScreenMessage( const ScreenMessage SM )
{
Screen::HandleScreenMessage( SM );
switch( SM )
{
case SM_MenuTimer:
MenuStart(PLAYER_1);
break;
case SM_GoToPrevState:
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
break;
case SM_GoToNextState:
// find out if the Next button is being held down on any of the pads
bool bIsHoldingNext;
bIsHoldingNext = false;
int player;
for( player=0; player<NUM_PLAYERS; player++ )
{
MenuInput mi( (PlayerNumber)player, MENU_BUTTON_START );
if( INPUTMAPPER->IsButtonDown( mi ) )
bIsHoldingNext = true;
}
if( bIsHoldingNext )
{
SCREENMAN->SetNewScreen( new ScreenPlayerOptions );
}
else
{
MUSIC->Stop();
SCREENMAN->SetNewScreen( new ScreenStage(false) );
}
break;
}
}
void ScreenSelectCourse::MenuLeft( const PlayerNumber p, const InputEventType type )
{
m_MusicWheel.PrevMusic();
AfterCourseChange();
}
void ScreenSelectCourse::MenuRight( const PlayerNumber p, const InputEventType type )
{
m_MusicWheel.NextMusic();
AfterCourseChange();
}
void ScreenSelectCourse::MenuStart( const PlayerNumber p )
{
// this needs to check whether valid Notes are selected!
m_MusicWheel.Select();
switch( m_MusicWheel.GetSelectedType() )
{
case TYPE_COURSE:
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_MUSIC_COMMENT_GENERAL) );
TweenOffScreen();
m_soundSelect.PlayRandom();
// show "hold START for options"
m_textHoldForOptions.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
m_textHoldForOptions.BeginTweeningQueued( 0.25f ); // fade in
m_textHoldForOptions.SetTweenZoomY( 1 );
m_textHoldForOptions.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
m_textHoldForOptions.BeginTweeningQueued( 2.0f ); // sleep
m_textHoldForOptions.BeginTweeningQueued( 0.25f ); // fade out
m_textHoldForOptions.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
m_textHoldForOptions.SetTweenZoomY( 0 );
m_Menu.TweenOffScreenToBlack( SM_None, false );
this->SendScreenMessage( SM_GoToNextState, 2.5f );
break;
}
}
void ScreenSelectCourse::MenuBack( const PlayerNumber p )
{
MUSIC->Stop();
m_Menu.TweenOffScreenToBlack( SM_GoToPrevState, true );
}
void ScreenSelectCourse::AfterCourseChange()
{
switch( m_MusicWheel.GetSelectedType() )
{
case TYPE_COURSE:
{
Course* pCourse = m_MusicWheel.GetSelectedCourse();
m_CourseInfoFrame.SetFromCourse( pCourse );
m_CourseContentsFrame.SetFromCourse( pCourse );
}
break;
default:
ASSERT(0);
}
}
+57
View File
@@ -0,0 +1,57 @@
/*
-----------------------------------------------------------------------------
Class: ScreenSelectCourse
Desc: The screen in PLAY_MODE_ONI where you choose a Course.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Screen.h"
#include "Sprite.h"
#include "BitmapText.h"
#include "RandomStream.h"
#include "GameConstantsAndTypes.h"
#include "MusicWheel.h"
#include "CourseInfoFrame.h"
#include "CourseContentsFrame.h"
#include "MenuElements.h"
class ScreenSelectCourse : public Screen
{
public:
ScreenSelectCourse();
virtual ~ScreenSelectCourse();
virtual void DrawPrimitives();
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
void TweenOnScreen();
void TweenOffScreen();
void MenuLeft( const PlayerNumber p, const InputEventType type );
void MenuRight( const PlayerNumber p, const InputEventType type );
void MenuStart( const PlayerNumber p );
void MenuBack( const PlayerNumber p );
protected:
void AfterCourseChange();
MenuElements m_Menu;
CourseInfoFrame m_CourseInfoFrame;
CourseContentsFrame m_CourseContentsFrame;
MusicWheel m_MusicWheel;
BitmapText m_textHoldForOptions;
RandomSample m_soundSelect;
RandomSample m_soundChangeNotes;
};
+211 -100
View File
@@ -20,34 +20,45 @@
#include "RageLog.h"
#include "GameConstantsAndTypes.h"
#include "AnnouncerManager.h"
#include "ScreenSelectCourse.h"
const float EXPLANATION_X = CENTER_X - 150;
const float EXPLANATION_Y = CENTER_Y - 170;
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_CLASS_X[NUM_DIFFICULTY_CLASSES] = {
CENTER_X-200,
CENTER_X,
CENTER_X+200
const float DIFFICULTY_ITEM_X[NUM_DIFFICULTY_ITEMS] = {
CENTER_X-200, // easy
CENTER_X, // medium
CENTER_X+200, // hard
SCREEN_WIDTH+CENTER_X, // Oni, page 2
};
// these sprites are bottom aligned!
const float DIFFICULTY_CLASS_Y[NUM_DIFFICULTY_CLASSES] = {
const float DIFFICULTY_ITEM_Y[NUM_DIFFICULTY_ITEMS] = {
CENTER_Y-40,
CENTER_Y-60,
CENTER_Y-40,
CENTER_Y-60,
CENTER_Y-40
};
const float DIFFICULTY_ARROW_Y[NUM_DIFFICULTY_CLASSES] = {
DIFFICULTY_CLASS_Y[0]+205,
DIFFICULTY_CLASS_Y[1]+205,
DIFFICULTY_CLASS_Y[2]+205
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,
};
const float DIFFICULTY_ARROW_X[NUM_DIFFICULTY_CLASSES][NUM_PLAYERS] = {
{ DIFFICULTY_CLASS_X[0]-40, DIFFICULTY_CLASS_X[0]+40 },
{ DIFFICULTY_CLASS_X[1]-40, DIFFICULTY_CLASS_X[1]+40 },
{ DIFFICULTY_CLASS_X[2]-40, DIFFICULTY_CLASS_X[2]+40 },
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 },
};
const float ARROW_SHADOW_OFFSET = 10;
@@ -61,20 +72,17 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
{
LOG->WriteLine( "ScreenSelectDifficulty::ScreenSelectDifficulty()" );
int p;
m_Menu.Load(
THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_BACKGROUND) ,
THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_TOP_EDGE),
ssprintf("Use %c %c to select, then press NEXT", char(1), char(2))
ssprintf("Use %c %c to select, then press START", char(1), char(2))
);
this->AddActor( &m_Menu );
m_sprExplanation.Load( THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_EXPLANATION) );
m_sprExplanation.SetXY( EXPLANATION_X, EXPLANATION_Y );
this->AddActor( &m_sprExplanation );
for( int d=0; d<NUM_DIFFICULTY_CLASSES; d++ )
for( int d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
{
ThemeElement te_header;
ThemeElement te_picture;
@@ -83,22 +91,37 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
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;
}
m_sprDifficultyPicture[d].Load( THEME->GetPathTo(te_picture) );
m_sprDifficultyPicture[d].SetXY( DIFFICULTY_CLASS_X[d], DIFFICULTY_CLASS_Y[d] );
m_sprDifficultyPicture[d].SetVertAlign( align_bottom );
m_sprDifficultyPicture[d].TurnShadowOff();
this->AddActor( &m_sprDifficultyPicture[d] );
m_sprDifficultyHeader[d].Load( THEME->GetPathTo(te_header) );
m_sprDifficultyHeader[d].SetXY( DIFFICULTY_CLASS_X[d], DIFFICULTY_CLASS_Y[d] );
m_sprDifficultyHeader[d].SetVertAlign( align_top );
m_sprDifficultyHeader[d].TurnShadowOff();
this->AddActor( &m_sprDifficultyHeader[d] );
m_sprPicture[d].Load( THEME->GetPathTo(te_picture) );
m_sprPicture[d].SetXY( DIFFICULTY_ITEM_X[d], DIFFICULTY_ITEM_Y[d] );
m_sprPicture[d].SetVertAlign( align_bottom );
m_sprPicture[d].TurnShadowOff();
m_framePages.AddActor( &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].SetVertAlign( align_top );
m_sprHeader[d].TurnShadowOff();
m_framePages.AddActor( &m_sprHeader[d] );
}
for( int p=0; p<NUM_PLAYERS; p++ )
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_framePages.AddActor( &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].StopAnimating();
m_sprExplanation[p].SetState( p );
m_framePages.AddActor( &m_sprExplanation[p] );
}
for( p=0; p<NUM_PLAYERS; p++ )
{
m_iSelection[p] = 0;
m_bChosen[p] = false;
@@ -106,32 +129,31 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
if( !GAMEMAN->IsPlayerEnabled((PlayerNumber)p) )
continue;
ThemeElement te;
switch( p )
{
case PLAYER_1: te = GRAPHIC_SELECT_DIFFICULTY_ARROW_P1; break;
case PLAYER_2: te = GRAPHIC_SELECT_DIFFICULTY_ARROW_P2; break;
default: ASSERT( false );
}
m_sprArrowShadow[p].Load( THEME->GetPathTo(te) );
m_sprArrowShadow[p].Load( THEME->GetPathTo(GRAPHIC_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) );
this->AddActor( &m_sprArrowShadow[p] );
m_framePages.AddActor( &m_sprArrowShadow[p] );
m_sprArrow[p].Load( THEME->GetPathTo(te) );
m_sprArrow[p].Load( THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_ARROWS) );
m_sprArrow[p].StopAnimating();
m_sprArrow[p].SetState( p );
m_sprArrow[p].TurnShadowOff();
m_sprArrow[p].SetDiffuseColor( PlayerToColor((PlayerNumber)p) );
m_sprArrow[p].SetEffectGlowing();
this->AddActor( &m_sprArrow[p] );
m_framePages.AddActor( &m_sprArrow[p] );
m_sprOK[p].Load( THEME->GetPathTo(GRAPHIC_SELECT_DIFFICULTY_OK) );
this->AddActor( &m_sprOK[p] );
m_framePages.AddActor( &m_sprOK[p] );
}
this->AddActor( &m_framePages );
m_soundChange.Load( THEME->GetPathTo(SOUND_SELECT_DIFFICULTY_CHANGE) );
m_soundSelect.Load( THEME->GetPathTo(SOUND_MENU_START) );
m_bPlayedChallengeSound = false;
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_INTRO) );
@@ -185,7 +207,21 @@ void ScreenSelectDifficulty::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
break;
case SM_GoToNextState:
SCREENMAN->SetNewScreen( new ScreenSelectGroup );
switch( m_iSelection[PLAYER_1] )
{
case 0:
case 1:
case 2: // something on page 1 was chosen
SCREENMAN->SetNewScreen( new ScreenSelectGroup );
break;
case 3:
case 4:
PREFSMAN->m_PlayMode = PLAY_MODE_ONI;
SCREENMAN->SetNewScreen( new ScreenSelectCourse );
break;
default:
ASSERT(0); // bad selection
}
break;
case SM_StartTweeningOffScreen:
TweenOffScreen();
@@ -204,36 +240,73 @@ void ScreenSelectDifficulty::MenuLeft( const PlayerNumber p )
if( m_bChosen[p] )
return;
m_iSelection[p]--;
m_sprArrow[p].BeginTweening( 0.2f, 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_sprArrowShadow[p].BeginTweening( 0.2f, 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_soundChange.PlayRandom();
ChangeTo( p, m_iSelection[p], m_iSelection[p]-1 );
}
void ScreenSelectDifficulty::MenuRight( const PlayerNumber p )
{
if( m_iSelection[p] == 2 ) // can't go right any more
if( m_iSelection[p] == NUM_DIFFICULTY_ITEMS-1 ) // can't go right any more
return;
if( m_bChosen[p] )
return;
m_iSelection[p]++;
m_sprArrow[p].BeginTweening( 0.2f, 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 );
ChangeTo( p, m_iSelection[p], m_iSelection[p]+1 );
}
m_sprArrowShadow[p].BeginTweening( 0.2f, TWEEN_BIAS_BEGIN );
m_sprArrowShadow[p].SetTweenX( DIFFICULTY_ARROW_X[m_iSelection[p]][p] );
m_sprArrowShadow[p].SetTweenY( DIFFICULTY_ARROW_Y[m_iSelection[p]] );
void ScreenSelectDifficulty::ChangeTo( const PlayerNumber pn, int iSelectionWas, int iSelectionIs )
{
bool bChangedPagesFrom1To2 = iSelectionWas < 3 && iSelectionIs >= 3;
bool bChangedPagesFrom2To1 = iSelectionWas >= 3 && iSelectionIs < 3;
bool bChangedPages = bChangedPagesFrom1To2 || bChangedPagesFrom2To1;
bool bSelectedSomethingOnPage1 = iSelectionIs < 3;
bool bSelectedSomethingOnPage2 = iSelectionIs >= 3;
if( bSelectedSomethingOnPage2 )
{
// change both players
for( int p=0; p<NUM_PLAYERS; p++ )
m_iSelection[p] = iSelectionIs;
}
else if( bChangedPagesFrom2To1 )
{
// change only the player who pressed the button
for( int p=0; p<NUM_PLAYERS; p++ )
m_iSelection[p] = 2;
}
else // moving around in page 1
{
// change only the player who pressed the button
m_iSelection[pn] = iSelectionIs;
}
if( !m_bPlayedChallengeSound && bChangedPagesFrom1To2 )
{
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_CHALLENGE) );
m_bPlayedChallengeSound = true;
}
if( bChangedPagesFrom1To2 || bChangedPagesFrom2To1 )
{
m_framePages.BeginTweening( 0.2f );
m_framePages.SetTweenX( bSelectedSomethingOnPage1 ? 0.0f : -SCREEN_WIDTH );
}
for( int p=0; p<NUM_PLAYERS; p++ )
{
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_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_soundChange.PlayRandom();
}
@@ -252,6 +325,19 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
case 0: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_COMMENT_EASY) ); break;
case 1: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_COMMENT_MEDIUM) ); break;
case 2: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_COMMENT_HARD) ); break;
case 3: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_COMMENT_ONI) ); break;
}
if( iSelection >= 3 ) // chose something on page 2
{
// choose this for all the other players too
for( int p=0; p<NUM_PLAYERS; p++ )
{
if( m_bChosen[p] )
continue;
MenuStart( (PlayerNumber)p );
}
}
m_sprArrow[pn].BeginTweeningQueued( 0.2f );
@@ -289,11 +375,19 @@ void ScreenSelectDifficulty::MenuBack( const PlayerNumber p )
void ScreenSelectDifficulty::TweenOffScreen()
{
m_sprExplanation.SetXY( EXPLANATION_X, EXPLANATION_Y );
m_sprExplanation.BeginTweening( 0.5, Actor::TWEEN_BOUNCE_BEGIN );
m_sprExplanation.SetTweenXY( EXPLANATION_X-400, EXPLANATION_Y );
int p;
for( int p=0; p<NUM_PLAYERS; p++ )
for( p=0; p<NUM_PAGES; 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_sprMoreArrows[p].BeginTweening( 0.5 );
m_sprMoreArrows[p].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
}
for( p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMEMAN->IsPlayerEnabled((PlayerNumber)p) )
continue;
@@ -308,39 +402,51 @@ void ScreenSelectDifficulty::TweenOffScreen()
m_sprArrowShadow[p].SetTweenDiffuseColor( D3DXCOLOR(0,0,0,0) );
}
for( int d=0; d<NUM_DIFFICULTY_CLASSES; d++ )
for( int d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
{
if( d >= 3 ) // this item is on page 2
continue; // don't tween
const float fPauseTime = d*0.2f;
// pause
m_sprDifficultyHeader[d].BeginTweeningQueued( fPauseTime );
m_sprHeader[d].BeginTweeningQueued( fPauseTime );
m_sprDifficultyPicture[d].BeginTweeningQueued( fPauseTime );
m_sprPicture[d].BeginTweeningQueued( fPauseTime );
// roll up
m_sprDifficultyHeader[d].BeginTweeningQueued( 0.3f, TWEEN_BOUNCE_BEGIN );
m_sprHeader[d].BeginTweeningQueued( 0.3f, TWEEN_BOUNCE_BEGIN );
m_sprDifficultyPicture[d].BeginTweeningQueued( 0.3f, TWEEN_BOUNCE_BEGIN );
m_sprDifficultyPicture[d].SetTweenZoomY( 0 );
m_sprPicture[d].BeginTweeningQueued( 0.3f, TWEEN_BOUNCE_BEGIN );
m_sprPicture[d].SetTweenZoomY( 0 );
// fly off
m_sprDifficultyHeader[d].BeginTweeningQueued( 0.4f, TWEEN_BIAS_END );
m_sprDifficultyHeader[d].SetTweenXY( DIFFICULTY_CLASS_X[d]-700, DIFFICULTY_CLASS_Y[d] );
m_sprHeader[d].BeginTweeningQueued( 0.4f, TWEEN_BIAS_END );
m_sprHeader[d].SetTweenXY( DIFFICULTY_ITEM_X[d]-700, DIFFICULTY_ITEM_Y[d] );
m_sprDifficultyPicture[d].BeginTweeningQueued( 0.4f, TWEEN_BIAS_END );
m_sprDifficultyPicture[d].SetTweenXY( DIFFICULTY_CLASS_X[d]-700, DIFFICULTY_CLASS_Y[d] );
m_sprPicture[d].BeginTweeningQueued( 0.4f, TWEEN_BIAS_END );
m_sprPicture[d].SetTweenXY( DIFFICULTY_ITEM_X[d]-700, DIFFICULTY_ITEM_Y[d] );
}
}
void ScreenSelectDifficulty::TweenOnScreen()
{
int p;
m_Menu.TweenOnScreenFromMenu( SM_None );
m_sprExplanation.SetXY( EXPLANATION_X-400, EXPLANATION_Y );
m_sprExplanation.BeginTweening( 0.3f, Actor::TWEEN_BOUNCE_END );
m_sprExplanation.SetTweenXY( EXPLANATION_X, EXPLANATION_Y );
for( p=0; p<NUM_PAGES; p++ )
{
m_sprExplanation[p].SetXY( EXPLANATION_OFF_SCREEN_X[p], EXPLANATION_OFF_SCREEN_Y[p] );
m_sprExplanation[p].BeginTweening( 0.3f, Actor::TWEEN_BOUNCE_END );
m_sprExplanation[p].SetTweenXY( EXPLANATION_X[p], EXPLANATION_Y[p] );
for( int p=0; p<NUM_PLAYERS; p++ )
m_sprMoreArrows[p].SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
m_sprMoreArrows[p].BeginTweening( 0.5 );
m_sprMoreArrows[p].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
}
for( p=0; p<NUM_PLAYERS; p++ )
{
if( !GAMEMAN->IsPlayerEnabled((PlayerNumber)p) )
continue;
@@ -365,33 +471,38 @@ void ScreenSelectDifficulty::TweenOnScreen()
m_sprArrowShadow[p].SetTweenDiffuseColor( colorOriginal );
}
for( int d=0; d<NUM_DIFFICULTY_CLASSES; d++ )
for( int d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
{
const float fPauseTime = d*0.2f;
bool bIsOnPage1 = m_iSelection[PLAYER_1] >= 3;
if( bIsOnPage1 && d >= 3 ) // they are on page 1, but this item is on page 2
continue; // don't tween
// set off screen
m_sprDifficultyHeader[d].SetXY( DIFFICULTY_CLASS_X[d]-700, DIFFICULTY_CLASS_Y[d] );
m_sprHeader[d].SetXY( DIFFICULTY_ITEM_X[d]-700, DIFFICULTY_ITEM_Y[d] );
m_sprDifficultyPicture[d].SetXY( DIFFICULTY_CLASS_X[d]-700, DIFFICULTY_CLASS_Y[d] );
m_sprDifficultyPicture[d].SetZoomY( 0 );
m_sprPicture[d].SetXY( DIFFICULTY_ITEM_X[d]-700, DIFFICULTY_ITEM_Y[d] );
m_sprPicture[d].SetZoomY( 0 );
// pause
m_sprDifficultyHeader[d].BeginTweeningQueued( fPauseTime );
m_sprHeader[d].BeginTweeningQueued( fPauseTime );
m_sprDifficultyPicture[d].BeginTweeningQueued( fPauseTime );
m_sprPicture[d].BeginTweeningQueued( fPauseTime );
// fly on
m_sprDifficultyHeader[d].BeginTweeningQueued( 0.5f, TWEEN_BIAS_BEGIN );
m_sprDifficultyHeader[d].SetTweenXY( DIFFICULTY_CLASS_X[d], DIFFICULTY_CLASS_Y[d] );
m_sprHeader[d].BeginTweeningQueued( 0.5f, TWEEN_BIAS_BEGIN );
m_sprHeader[d].SetTweenXY( DIFFICULTY_ITEM_X[d], DIFFICULTY_ITEM_Y[d] );
m_sprDifficultyPicture[d].BeginTweeningQueued( 0.5f, TWEEN_BIAS_BEGIN );
m_sprDifficultyPicture[d].SetTweenXY( DIFFICULTY_CLASS_X[d], DIFFICULTY_CLASS_Y[d] );
m_sprPicture[d].BeginTweeningQueued( 0.5f, TWEEN_BIAS_BEGIN );
m_sprPicture[d].SetTweenXY( DIFFICULTY_ITEM_X[d], DIFFICULTY_ITEM_Y[d] );
// roll down
m_sprDifficultyHeader[d].BeginTweeningQueued( 0.3f, TWEEN_BOUNCE_END );
m_sprHeader[d].BeginTweeningQueued( 0.3f, TWEEN_BOUNCE_END );
m_sprDifficultyPicture[d].BeginTweeningQueued( 0.3f, TWEEN_BOUNCE_END );
m_sprDifficultyPicture[d].SetTweenZoomY( 1 );
m_sprPicture[d].BeginTweeningQueued( 0.3f, TWEEN_BOUNCE_END );
m_sprPicture[d].SetTweenZoomY( 1 );
}
}
+13 -3
View File
@@ -5,6 +5,7 @@
Desc: Select the game mode (single, versus, double).
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
@@ -16,6 +17,8 @@
#include "MenuElements.h"
const int NUM_DIFFICULTY_ITEMS = NUM_DIFFICULTY_CLASSES + 1; // easy, medium, hard, Oni
const int NUM_PAGES = 2; // easy-medium-hard, Oni
class ScreenSelectDifficulty : public Screen
{
@@ -36,19 +39,26 @@ public:
void TweenOnScreen();
private:
void ChangeTo( const PlayerNumber pn, int iSelectionWas, int iSelectionIs );
MenuElements m_Menu;
Sprite m_sprDifficultyHeader[NUM_DIFFICULTY_CLASSES];
Sprite m_sprDifficultyPicture[NUM_DIFFICULTY_CLASSES];
ActorFrame m_framePages; // 2 pages
Sprite m_sprHeader[NUM_DIFFICULTY_ITEMS];
Sprite m_sprPicture[NUM_DIFFICULTY_ITEMS];
Sprite m_sprExplanation[NUM_PAGES];
Sprite m_sprMoreArrows[NUM_PAGES];
Sprite m_sprArrow[NUM_PLAYERS];
Sprite m_sprArrowShadow[NUM_PLAYERS];
Sprite m_sprOK[NUM_PLAYERS];
Sprite m_sprExplanation;
RandomSample m_soundChange;
RandomSample m_soundSelect;
bool m_bPlayedChallengeSound;
int m_iSelection[NUM_PLAYERS];
bool m_bChosen[NUM_PLAYERS];
};
+1 -1
View File
@@ -60,7 +60,7 @@ ScreenSelectGroup::ScreenSelectGroup()
m_Menu.Load(
THEME->GetPathTo(GRAPHIC_SELECT_GROUP_BACKGROUND) ,
THEME->GetPathTo(GRAPHIC_SELECT_GROUP_TOP_EDGE),
ssprintf("Use %c %c to select, then press NEXT", char(1), char(2))
ssprintf("Use %c %c to select, then press START", char(1), char(2))
);
this->AddActor( &m_Menu );
+25 -6
View File
@@ -1,11 +1,12 @@
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
File: ScreenSelectMusic.cpp
Class: ScreenSelectMusic
Desc: Testing the Screen class.
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
@@ -110,7 +111,7 @@ ScreenSelectMusic::ScreenSelectMusic()
m_textHoldForOptions.Load( THEME->GetPathTo(FONT_STAGE) );
m_textHoldForOptions.SetXY( CENTER_X, CENTER_Y );
m_textHoldForOptions.SetText( "hold NEXT for options" );
m_textHoldForOptions.SetText( "press START again for options" );
m_textHoldForOptions.SetZoom( 1 );
m_textHoldForOptions.SetZoomY( 0 );
m_textHoldForOptions.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
@@ -123,6 +124,8 @@ ScreenSelectMusic::ScreenSelectMusic()
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_MUSIC_INTRO) );
m_bMadeChoice = false;
m_bGoToOptions = false;
AfterMusicChange();
TweenOnScreen();
@@ -214,10 +217,21 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, const InputEventType
{
LOG->WriteLine( "ScreenSelectMusic::Input()" );
if( MenuI.player == PLAYER_NONE )
return;
if( m_Menu.IsClosing() )
return; // ignore
if( MenuI.player == PLAYER_NONE )
if( m_bMadeChoice && !m_bGoToOptions && MenuI.button == MENU_BUTTON_START )
{
m_bGoToOptions = true;
m_textHoldForOptions.SetText( "Entering Options..." );
SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_MENU_START) );
return;
}
if( m_bMadeChoice )
return;
if( INPUTQUEUE->MatchesPattern(MenuI.player, EASIER_DIFFICULTY_PATTERN, EASIER_DIFFICULTY_PATTERN_SIZE) )
@@ -301,7 +315,7 @@ void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
bIsHoldingNext = true;
}
if( bIsHoldingNext )
if( bIsHoldingNext || m_bGoToOptions )
{
SCREENMAN->SetNewScreen( new ScreenPlayerOptions );
}
@@ -368,9 +382,11 @@ void ScreenSelectMusic::MenuStart( const PlayerNumber p )
TweenOffScreen();
m_bMadeChoice = true;
m_soundSelect.PlayRandom();
// show "hold NEXT for options"
// show "hold START for options"
m_textHoldForOptions.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
m_textHoldForOptions.BeginTweeningQueued( 0.25f ); // fade in
m_textHoldForOptions.SetTweenZoomY( 1 );
@@ -411,6 +427,9 @@ void ScreenSelectMusic::AfterNotesChange( const PlayerNumber p )
Notes* pNotes = m_arrayNotes.GetSize()>0 ? m_arrayNotes[m_iSelection[p]] : NULL;
if( pNotes )
PREFSMAN->m_PreferredDifficultyClass[p] = pNotes->m_DifficultyClass;
SONGMAN->SetCurrentNotes( p, pNotes );
m_DifficultyIcon[p].SetFromNotes( pNotes );
+5 -2
View File
@@ -1,10 +1,11 @@
/*
-----------------------------------------------------------------------------
File: ScreenSelectMusic.h
Class: ScreenSelectMusic
Desc: Select the game mode (single, versus, double).
Desc: The screen in PLAY_MODE_ARCADE where you choose a Song and Notes.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
@@ -62,6 +63,8 @@ protected:
FootMeter m_FootMeter[NUM_PLAYERS];
MusicWheel m_MusicWheel;
bool m_bMadeChoice;
bool m_bGoToOptions;
BitmapText m_textHoldForOptions;
RandomSample m_soundSelect;
+3 -4
View File
@@ -79,7 +79,7 @@ ScreenSelectStyle::ScreenSelectStyle()
m_Menu.Load(
THEME->GetPathTo(GRAPHIC_SELECT_STYLE_BACKGROUND),
THEME->GetPathTo(GRAPHIC_SELECT_STYLE_TOP_EDGE),
ssprintf("Use %c %c to select, then press NEXT", char(1), char(2) )
ssprintf("Use %c %c to select, then press START", char(1), char(2) )
);
this->AddActor( &m_Menu );
@@ -155,7 +155,7 @@ void ScreenSelectStyle::AfterChange()
ThemeElement te;
// Tween Preview
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_PREVIEW_0+GetSelectedStyle());
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0+GetSelectedStyle());
m_sprPreview.Load( THEME->GetPathTo(te) );
m_sprPreview.StopTweening();
@@ -177,7 +177,7 @@ void ScreenSelectStyle::AfterChange()
// Tween Info
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_INFO_0+GetSelectedStyle());
te = (ThemeElement)(GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_0+GetSelectedStyle());
m_sprInfo.Load( THEME->GetPathTo(te) );
m_sprInfo.StopTweening();
m_sprInfo.SetZoomY( 0 );
@@ -222,7 +222,6 @@ void ScreenSelectStyle::MenuStart( const PlayerNumber p )
case STYLE_DANCE_DOUBLE: ae = ANNOUNCER_SELECT_STYLE_COMMENT_DOUBLE; break;
case STYLE_DANCE_COUPLE: ae = ANNOUNCER_SELECT_STYLE_COMMENT_COUPLE; break;
case STYLE_DANCE_SOLO: ae = ANNOUNCER_SELECT_STYLE_COMMENT_SOLO; break;
case STYLE_DANCE_SOLO_VERSUS: ae = ANNOUNCER_SELECT_STYLE_COMMENT_VERSUS; break;
case STYLE_PUMP_SINGLE: ae = ANNOUNCER_SELECT_STYLE_COMMENT_SINGLE; break;
case STYLE_PUMP_VERSUS: ae = ANNOUNCER_SELECT_STYLE_COMMENT_VERSUS; break;
default: ASSERT(0); break; // invalid Style
+2 -2
View File
@@ -27,7 +27,7 @@
#include "RageLog.h"
#include "SongManager.h"
#include "AnnouncerManager.h"
#include "ErrorCatcher/ErrorCatcher.h"
#include "GameManager.h"
@@ -85,7 +85,7 @@ ScreenTitleMenu::ScreenTitleMenu()
this->AddActor( &m_sprLogo );
m_textHelp.Load( THEME->GetPathTo(FONT_NORMAL) );
m_textHelp.SetText( ssprintf("Use %c %c to select, then press NEXT", char(3), char(4)) );
m_textHelp.SetText( ssprintf("Use %c %c to select, then press START", char(3), char(4)) );
m_textHelp.SetXY( CENTER_X, SCREEN_BOTTOM - 30 );
m_textHelp.SetZoom( 0.5f );
m_textHelp.SetEffectBlinking();
+41 -33
View File
@@ -15,7 +15,7 @@
#include "Song.h"
#include <math.h> // for fmod
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
@@ -76,6 +76,14 @@ Song::Song()
m_fMusicLength = 0;
}
Song::~Song()
{
for( int i=0; i<m_arrayNotes.GetSize(); i++ )
SAFE_DELETE( m_arrayNotes[i] );
m_arrayNotes.RemoveAll();
}
void Song::GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut )
{
@@ -237,9 +245,9 @@ bool Song::LoadFromSongDir( CString sDir )
if( iNumSongFiles > 1 )
FatalError( "There is more than one .song file in '%s'. There should be only one!", sDir );
throw RageException( "There is more than one .song file in '%s'. There should be only one!", sDir );
else if( iNumDWIFiles > 1 )
FatalError( "There is more than one DWI file in '%s'. There should be only one!", sDir );
throw RageException( "There is more than one DWI file in '%s'. There should be only one!", sDir );
else if( iNumSongFiles == 1 )
LoadFromSMDir( sDir );
else if( iNumDWIFiles == 1 )
@@ -247,7 +255,7 @@ bool Song::LoadFromSongDir( CString sDir )
else if( iNumBMSFiles > 0 )
LoadFromBMSDir( sDir );
else
FatalError( "Couldn't find any .song, BMS, or DWI files in '%s'. This is not a valid song directory.", sDir );
throw RageException( "Couldn't find any .song, BMS, or DWI files in '%s'. This is not a valid song directory.", sDir );
TidyUpData();
@@ -284,7 +292,7 @@ bool Song::LoadFromBMSDir( CString sDir )
GetDirListing( sDir + CString("*.bms"), arrayBMSFileNames );
if( arrayBMSFileNames.GetSize() == 0 )
FatalError( ssprintf("Couldn't find any BMS files in '%s'", sDir) );
throw RageException( ssprintf("Couldn't find any BMS files in '%s'", sDir) );
// Load the Song info from the first BMS file. Silly BMS duplicates the song info in every
@@ -295,16 +303,16 @@ bool Song::LoadFromBMSDir( CString sDir )
// load the Notes from the rest of the BMS files
for( int i=0; i<arrayBMSFileNames.GetSize(); i++ )
{
m_arrayNotes.SetSize( m_arrayNotes.GetSize()+1 );
Notes &new_steps = m_arrayNotes[ m_arrayNotes.GetSize()-1 ];
new_steps.LoadFromBMSFile( m_sSongDir + arrayBMSFileNames[i] );
Notes* pNewNotes = new Notes;
pNewNotes->LoadFromBMSFile( m_sSongDir + arrayBMSFileNames[i] );
m_arrayNotes.Add( pNewNotes );
}
CStdioFile file;
if( !file.Open( m_sSongFilePath, CFile::modeRead|CFile::shareDenyNone ) )
{
FatalError( ssprintf("Failed to open %s.", m_sSongFilePath) );
throw RageException( ssprintf("Failed to open %s.", m_sSongFilePath) );
return false;
}
@@ -461,7 +469,7 @@ bool Song::LoadFromDWIFile( CString sPath )
CStdioFile file;
if( !file.Open( GetSongFilePath(), CFile::modeRead|CFile::shareDenyNone ) )
FatalError( ssprintf("Error opening DWI file '%s'.", GetSongFilePath()) );
throw RageException( ssprintf("Error opening DWI file '%s'.", GetSongFilePath()) );
// read the whole file into a sFileText
@@ -570,15 +578,15 @@ bool Song::LoadFromDWIFile( CString sPath )
else if( sValueName == "#SINGLE" || sValueName == "#DOUBLE" || sValueName == "#COUPLE" )
{
m_arrayNotes.SetSize( m_arrayNotes.GetSize()+1, 1 );
Notes &new_Notes = m_arrayNotes[ m_arrayNotes.GetSize()-1 ];
new_Notes.LoadFromDWITokens(
Notes* pNewNotes = new Notes;
pNewNotes->LoadFromDWITokens(
arrayValueTokens[0],
arrayValueTokens[1],
arrayValueTokens[2],
arrayValueTokens[3],
arrayValueTokens.GetSize() == 5 ? arrayValueTokens[4] : ""
);
m_arrayNotes.Add( pNewNotes );
}
else
// do nothing. We don't care about this value name
@@ -611,7 +619,7 @@ bool Song::LoadFromSMDir( CString sDir )
CStringArray arraySongFileNames;
GetDirListing( sDir + "*.song", arraySongFileNames );
if( arraySongFileNames.GetSize() == 0 )
FatalError( "Couldn't find any SM Song files in '%s'", sDir );
throw RageException( "Couldn't find any SM Song files in '%s'", sDir );
// Load the Song info from the first BMS file. Silly BMS duplicates the song info in every
@@ -626,15 +634,15 @@ bool Song::LoadFromSMDir( CString sDir )
// load the Notes from the rest of the BMS files
for( i=0; i<arrayNotesFileNames.GetSize(); i++ )
{
m_arrayNotes.SetSize( m_arrayNotes.GetSize()+1 );
Notes &new_steps = m_arrayNotes[ m_arrayNotes.GetSize()-1 ];
new_steps.LoadFromNotesFile( m_sSongDir + arrayNotesFileNames[i] );
Notes* pNewNotes = new Notes;
pNewNotes->LoadFromNotesFile( m_sSongDir + arrayNotesFileNames[i] );
m_arrayNotes.Add( pNewNotes );
}
CStdioFile file;
if( !file.Open( GetSongFilePath(), CFile::modeRead|CFile::shareDenyNone ) )
FatalError( "Error opening DWI file '%s'.", GetSongFilePath() );
throw RageException( "Error opening DWI file '%s'.", GetSongFilePath() );
// read the whole file into a sFileText
@@ -771,7 +779,7 @@ void Song::TidyUpData()
m_sSubTitle.TrimRight();
if( m_sArtist == "" ) m_sArtist = "Unknown artist";
if( m_BPMSegments.GetSize() == 0 )
FatalError( "No #BPM specified in '%s.'", GetSongFilePath() );
throw RageException( "No #BPM specified in '%s.'", GetSongFilePath() );
if( m_sMusicPath == "" || !DoesFileExist(GetMusicPath()) )
{
@@ -784,7 +792,7 @@ void Song::TidyUpData()
m_sMusicPath = m_sSongDir + arrayPossibleMusic[0];
else
m_sMusicPath = "";
// FatalError( ssprintf("Music could not be found. Please check the Song file '%s' and verify the specified #MUSIC exists.", GetSongFilePath()) );
// throw RageException( ssprintf("Music could not be found. Please check the Song file '%s' and verify the specified #MUSIC exists.", GetSongFilePath()) );
}
// Save length of music
@@ -823,7 +831,7 @@ void Song::TidyUpData()
else
m_sBannerPath = "";
//FatalError( ssprintf("Banner could not be found. Please check the Song file '%s' and verify the specified #BANNER exists.", GetSongFilePath()) );
//throw RageException( ssprintf("Banner could not be found. Please check the Song file '%s' and verify the specified #BANNER exists.", GetSongFilePath()) );
}
if( !DoesFileExist(GetBackgroundPath()) )
@@ -873,7 +881,7 @@ void Song::TidyUpData()
for( int i=0; i<m_arrayNotes.GetSize(); i++ )
{
Notes* pNM = &m_arrayNotes[i];
Notes* pNM = m_arrayNotes[i];
float fMusicLength = m_fMusicLength;
if( fMusicLength == 0 )
@@ -891,8 +899,8 @@ void Song::TidyUpData()
void Song::GetNotesThatMatch( NotesType nt, CArray<Notes*, Notes*>& arrayAddTo )
{
for( int i=0; i<m_arrayNotes.GetSize(); i++ ) // for each of the Song's Notes
if( m_arrayNotes[i].m_NotesType == nt )
arrayAddTo.Add( &m_arrayNotes[i] );
if( m_arrayNotes[i]->m_NotesType == nt )
arrayAddTo.Add( m_arrayNotes[i] );
}
@@ -942,7 +950,7 @@ void Song::SaveToCacheFile()
fprintf( file, "%d\n", m_arrayNotes.GetSize() );
for( i=0; i<m_arrayNotes.GetSize(); i++ )
m_arrayNotes[i].WriteToCacheFile( file );
m_arrayNotes[i]->WriteToCacheFile( file );
fclose( file );
}
@@ -1015,7 +1023,7 @@ bool Song::LoadFromCacheFile( bool bLoadNoteData )
fscanf( file, "%d\n", &iNumNotes );
m_arrayNotes.SetSize( iNumNotes );
for( i=0; i<iNumNotes; i++ )
m_arrayNotes[i].ReadFromCacheFile( file, bLoadNoteData );
m_arrayNotes[i]->ReadFromCacheFile( file, bLoadNoteData );
fclose( file );
return true;
@@ -1052,7 +1060,7 @@ void Song::SaveToSMDir()
CStdioFile file;
if( !file.Open( m_sSongFilePath, CFile::modeWrite | CFile::modeCreate ) )
FatalError( "Error opening song file '%s' for writing.", m_sSongFilePath );
throw RageException( "Error opening song file '%s' for writing.", m_sSongFilePath );
file.WriteString( ssprintf("#MAINTITLE:%s;\n", m_sMainTitle) );
file.WriteString( ssprintf("#SUBTITLE:%s;\n", m_sSubTitle) );
@@ -1134,20 +1142,20 @@ void Song::SaveToSMDir()
//
for( i=0; i<m_arrayNotes.GetSize(); i++ )
{
m_arrayNotes[i].SaveToSMDir( m_sSongDir );
m_arrayNotes[i]->SaveToSMDir( m_sSongDir );
}
}
Grade Song::GetGradeForDifficultyClass( NotesType nt, DifficultyClass dc )
{
CArray<Notes*, Notes*> arrayNotess;
this->GetNotesThatMatch( nt, arrayNotess );
SortNotesArrayByDifficultyClass( arrayNotess );
CArray<Notes*, Notes*> aNotes;
this->GetNotesThatMatch( nt, aNotes );
SortNotesArrayByDifficultyClass( aNotes );
for( int i=0; i<arrayNotess.GetSize(); i++ )
for( int i=0; i<aNotes.GetSize(); i++ )
{
Notes* pNotes = arrayNotess[i];
Notes* pNotes = aNotes[i];
if( pNotes->m_DifficultyClass == dc )
return pNotes->m_TopGrade;
}
+85 -23
View File
@@ -14,7 +14,7 @@
#include "SongManager.h"
#include "IniFile.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
#include "PrefsManager.h"
SongManager* SONGMAN = NULL; // global and accessable from anywhere in our program
@@ -36,44 +36,48 @@ const int NUM_GROUP_COLORS = sizeof(GROUP_COLORS) / sizeof(D3DXCOLOR);
SongManager::SongManager()
{
for( int i=0; i<MAX_SONG_QUEUE_SIZE; i++ )
{
m_pCurSong[i] = NULL;
for( int p=0; p<NUM_PLAYERS; p++ )
m_pCurNotes[i][p] = NULL;
}
m_pCurSong = NULL;
for( int p=0; p<NUM_PLAYERS; p++ )
m_pCurNotes[p] = NULL;
m_pCurCourse = NULL;
InitSongArrayFromDisk();
ReadStatisticsFromDisk();
InitCoursesFromDisk();
}
SongManager::~SongManager()
{
SaveStatisticsToDisk();
CleanUpSongArray();
m_arrayGroupNames.RemoveAll();
FreeSongArray();
}
Song* SongManager::GetCurrentSong()
{
return m_pCurSong[ PREFSMAN->GetStageIndex() ];
return m_pCurSong;
}
Notes* SongManager::GetCurrentNotes( PlayerNumber p )
{
return m_pCurNotes[ PREFSMAN->GetStageIndex() ][p];
return m_pCurNotes[p];
}
void SongManager::SetCurrentSong( Song* pSong )
{
m_pCurSong[ PREFSMAN->GetStageIndex() ] = pSong;
m_pCurSong = pSong;
}
void SongManager::SetCurrentNotes( PlayerNumber p, Notes* pNotes )
{
m_pCurNotes[ PREFSMAN->GetStageIndex() ][p] = pNotes;
m_pCurNotes[p] = pNotes;
}
GameplayStatistics SongManager::GetLatestGameplayStatistics( PlayerNumber p )
{
return m_GameplayStatistics[ PREFSMAN->GetStageIndex() ][p];
}
@@ -82,7 +86,7 @@ void SongManager::InitSongArrayFromDisk()
LoadStepManiaSongDir( "Songs" );
//LoadDWISongDir( "DWI Support" );
// computer group names
// compute group names
CArray<Song*, Song*> arraySongs;
arraySongs.Copy( m_pSongs );
SortSongPointerArrayByGroup( arraySongs );
@@ -122,7 +126,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir )
GetDirListing( ssprintf("%s\\%s\\*.ogg", sDir, sGroupDirName), arrayFiles );
GetDirListing( ssprintf("%s\\%s\\*.wav", sDir, sGroupDirName), arrayFiles );
if( arrayFiles.GetSize() > 0 )
FatalError(
throw RageException(
ssprintf( "The song folder '%s' must be placed inside of a group folder.\n\n"
"All song folders must be placed below a group folder. For example, 'Songs\\DDR 4th Mix\\B4U'. See the StepMania readme for more info.",
ssprintf("%s\\%s", sDir, sGroupDirName ) )
@@ -215,14 +219,12 @@ void SongManager::LoadDWISongDir( CString DWIHome )
*/
void SongManager::CleanUpSongArray()
void SongManager::FreeSongArray()
{
for( int i=0; i<m_pSongs.GetSize(); i++ )
{
SAFE_DELETE( m_pSongs[i] );
}
m_pSongs.RemoveAll();
m_mapGroupToBannerPath.RemoveAll();
}
@@ -230,7 +232,7 @@ void SongManager::CleanUpSongArray()
void SongManager::ReloadSongArray()
{
InitSongArrayFromDisk();
CleanUpSongArray();
FreeSongArray();
}
@@ -286,9 +288,9 @@ void SongManager::ReadStatisticsFromDisk()
Notes* pNotes = NULL;
for( i=0; i<pSong->m_arrayNotes.GetSize(); i++ )
{
if( pSong->m_arrayNotes[i].m_sDescription == szStepsName ) // match!
if( pSong->m_arrayNotes[i]->m_sDescription == szStepsName ) // match!
{
pNotes = &pSong->m_arrayNotes[i];
pNotes = pSong->m_arrayNotes[i];
break;
}
}
@@ -327,7 +329,7 @@ void SongManager::SaveStatisticsToDisk()
for( int j=0; j<pSong->m_arrayNotes.GetSize(); j++ ) // for each Notes
{
Notes* pNotes = &pSong->m_arrayNotes[j];
Notes* pNotes = pSong->m_arrayNotes[j];
if( pNotes->m_TopGrade == GRADE_NO_DATA )
continue; // skip
@@ -398,3 +400,63 @@ CString SongManager::ShortenGroupName( const CString &sOrigGroupName )
sShortName.Replace( "DANCE DANCE REVOLUTION", "DDR" );
return sShortName;
}
void SongManager::InitCoursesFromDisk()
{
CStringArray saGroupNames;
this->GetGroupNames( saGroupNames );
for( int g=0; g<saGroupNames.GetSize(); g++ ) // foreach Group
{
CString sGroupName = saGroupNames[g];
CString sShortGroupName = this->ShortenGroupName( sGroupName );
CArray<Song*, Song*> apSongs;
this->GetSongsInGroup( sGroupName, apSongs );
for( NotesType nt=NotesType(0); nt<NUM_NOTES_TYPES; nt=NotesType(nt+1) ) // foreach NotesType
{
for( DifficultyClass dc=CLASS_MEDIUM; dc<=CLASS_HARD; dc=DifficultyClass(dc+1) ) // foreach DifficultyClass
{
Course course;
course.m_sName = sShortGroupName + " ";
switch( dc )
{
case CLASS_EASY: course.m_sName += "Easy"; break;
case CLASS_MEDIUM: course.m_sName += "Medium"; break;
case CLASS_HARD: course.m_sName += "Hard"; break;
}
course.m_NotesType = nt;
for( int s=0; s<apSongs.GetSize(); s++ )
{
Song* pSong = apSongs[s];
CArray<Notes*, Notes*> apNotes;
pSong->GetNotesThatMatch( course.m_NotesType, apNotes );
// search for first Notes matching this DifficultyClass
for( int n=0; n<apNotes.GetSize(); n++ )
{
Notes* pNotes = apNotes[n];
if( pNotes->m_DifficultyClass == dc )
{
course.AddStage( pSong, pNotes );
break;
}
}
}
if( course.m_iStages > 0 )
m_aCourses.Add( course );
}
}
}
}
void SongManager::ReloadCourses()
{
}
+21 -7
View File
@@ -13,9 +13,13 @@
#include "Song.h"
#include "Course.h"
#include "GamePlayStatistics.h"
//#include <d3dxmath.h> // for D3DXCOLOR
const int MAX_SONG_QUEUE_SIZE = 30;
const int MAX_SONG_QUEUE_SIZE = 400; // this has to be gigantic to fit an "endless" number of songs
const int MAX_NUM_STAGES = 10; // the max number of stages that can be played in arcade mode
class SongManager
{
@@ -23,23 +27,26 @@ public:
SongManager();
~SongManager();
Song* m_pCurSong[MAX_SONG_QUEUE_SIZE];
Notes* m_pCurNotes[MAX_SONG_QUEUE_SIZE][NUM_PLAYERS];
Song* m_pCurSong;
Notes* m_pCurNotes[NUM_PLAYERS];
Course* m_pCurCourse;
CString m_sPreferredGroup;
GameplayStatistics m_GameplayStatistics[MAX_NUM_STAGES][NUM_PLAYERS]; // for passing from Dancing to Results
CArray<Song*, Song*> m_pSongs; // all songs that can be played
void InitSongArrayFromDisk();
void FreeSongArray();
void ReloadSongArray();
Song* GetCurrentSong();
Notes* GetCurrentNotes( PlayerNumber p );
void SetCurrentSong( Song* pSong );
void SetCurrentNotes( PlayerNumber p, Notes* pNotes );
void CleanUpSongArray();
void ReloadSongArray();
GameplayStatistics GetLatestGameplayStatistics( PlayerNumber p );
void ReadStatisticsFromDisk();
@@ -55,6 +62,13 @@ public:
void GetSongsInGroup( const CString sGroupName, CArray<Song*,Song*> &AddTo );
// for Courses
CArray<Course, Course> m_aCourses;
void InitCoursesFromDisk();
void ReloadCourses();
protected:
void LoadStepManiaSongDir( CString sDir );
void LoadDWISongDir( CString sDir );
+4 -7
View File
@@ -15,7 +15,7 @@
#include "IniFile.h"
#include <math.h>
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
#include "PrefsManager.h"
@@ -75,12 +75,12 @@ bool Sprite::LoadFromSpriteFile( CString sSpritePath, bool bForceReload, int iMi
IniFile ini;
ini.SetPath( m_sSpritePath );
if( !ini.ReadFile() )
FatalError( ssprintf("Error opening Sprite file '%s'.", m_sSpritePath) );
throw RageException( ssprintf("Error opening Sprite file '%s'.", m_sSpritePath) );
CString sTextureFile;
ini.GetValue( "Sprite", "Texture", sTextureFile );
if( sTextureFile == "" )
FatalError( ssprintf("Error reading value 'Texture' from %s.", m_sSpritePath) );
throw RageException( ssprintf("Error reading value 'Texture' from %s.", m_sSpritePath) );
CString sTexturePath = sFontDir + sTextureFile; // save the path of the new texture
@@ -103,7 +103,7 @@ bool Sprite::LoadFromSpriteFile( CString sSpritePath, bool bForceReload, int iMi
if( !ini.GetValueI( "Sprite", sFrameKey, m_iStateToFrame[i] ) )
break;
if( m_iStateToFrame[i] >= m_pTexture->GetNumFrames() )
FatalError( "In '%s', %s is %d, but the texture %s only has %d frames.",
throw RageException( "In '%s', %s is %d, but the texture %s only has %d frames.",
m_sSpritePath, sFrameKey, m_iStateToFrame[i], sTexturePath, m_pTexture->GetNumFrames() );
m_fDelay[i] = 0.2f;
if( !ini.GetValueF( "Sprite", sDelayKey, m_fDelay[i] ) )
@@ -260,8 +260,6 @@ void Sprite::DrawPrimitives()
pVB->Unlock();
// Set the stage...
LPDIRECT3DDEVICE8 pd3dDevice = DISPLAY->GetDevice();
pd3dDevice->SetTexture( 0, m_pTexture->GetD3DTexture() );
@@ -349,7 +347,6 @@ void Sprite::DrawPrimitives()
pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 2 );
}
}
+2
View File
@@ -34,6 +34,8 @@
#include "RageSound.h"
#include "RageMusic.h"
#include "RageInput.h"
#include "RageTimer.h"
#include "RageException.h"
+147 -161
View File
@@ -48,19 +48,10 @@
#include "ScreenMusicScroll.h"
#include "ScreenSelectMusic.h"
#include "ScreenGameplay.h"
// error catcher stuff
#include "ErrorCatcher/ErrorCatcher.h"
#pragma comment(lib, "ErrorCatcher/dbghelp.lib")
#if defined(DEBUG) | defined(_DEBUG)
#pragma comment(lib, "ErrorCatcher/ErrorCatcherD.lib")
#else
#pragma comment(lib, "ErrorCatcher/ErrorCatcher.lib")
#endif
#include "ScreenSelectDifficulty.h"
#include "dxerr8.h"
#include "DXUtil.h"
#include <Afxdisp.h>
//-----------------------------------------------------------------------------
@@ -107,6 +98,7 @@ VOID DestroyObjects(); // deallocate game objects when we're done with them
void ApplyGraphicOptions(); // Set the display mode according to the user's preferences
CString g_sErrorString;
//-----------------------------------------------------------------------------
// Name: WinMain()
@@ -114,98 +106,140 @@ void ApplyGraphicOptions(); // Set the display mode according to the user's pref
//-----------------------------------------------------------------------------
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
{
// Initialize ActiveX for Flash
//AfxEnableControlContainer();
//
// Check to see if the app is already running.
//
g_hMutex = CreateMutex( NULL, TRUE, g_sAppName );
if( GetLastError() == ERROR_ALREADY_EXISTS )
{
CloseHandle( g_hMutex );
}
//
// Make sure the current directory is the root program directory
//
if( !DoesFileExist("Songs") )
{
// change dir to path of the execuctable
TCHAR szFullAppPath[MAX_PATH];
GetModuleFileName(NULL, szFullAppPath, MAX_PATH);
// strip off executable name
LPSTR pLastBackslash = strrchr(szFullAppPath, '\\');
*pLastBackslash = '\0'; // terminate the string
SetCurrentDirectory( szFullAppPath );
}
CoInitialize (NULL); // Initialize COM
// Register the window class
WNDCLASS wndClass = {
0,
WndProc, // callback handler
0, // cbClsExtra;
0, // cbWndExtra;
hInstance,
LoadIcon( hInstance, MAKEINTRESOURCE(IDI_ICON) ),
LoadCursor( hInstance, IDC_ARROW),
(HBRUSH)GetStockObject( BLACK_BRUSH ),
NULL, // lpszMenuName;
g_sAppClassName // lpszClassName;
};
RegisterClass( &wndClass );
// Set the window's initial width
RECT rcWnd;
SetRect( &rcWnd, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
AdjustWindowRect( &rcWnd, g_dwWindowStyle, FALSE );
// Create our main window
g_hWndMain = CreateWindow(
g_sAppClassName,// pointer to registered class name
g_sAppName, // pointer to window name
g_dwWindowStyle, // window StyleDef
CW_USEDEFAULT, // horizontal position of window
CW_USEDEFAULT, // vertical position of window
RECTWIDTH(rcWnd), // window width
RECTHEIGHT(rcWnd),// window height
NULL, // handle to parent or owner window
NULL, // handle to menu, or child-window identifier
hInstance, // handle to application instance
NULL // pointer to window-creation data
);
if( NULL == g_hWndMain )
exit(1);
ShowWindow( g_hWndMain, SW_HIDE );
// Don't catch errors if we're running in the debugger. This way, the debugger
// will give us a nice stack trace.
#ifdef _DEBUG
#define bCatchErrors false
#else
#define bCatchErrors true
#ifdef RELEASE
try
#endif
{
// Initialize ActiveX for Flash
//AfxEnableControlContainer();
bool bSuccess = RunAndCatchErrors( MainLoop, bCatchErrors );
//
// Check to see if the app is already running.
//
g_hMutex = CreateMutex( NULL, TRUE, g_sAppName );
if( GetLastError() == ERROR_ALREADY_EXISTS )
{
CloseHandle( g_hMutex );
}
//
// Make sure the current directory is the root program directory
//
if( !DoesFileExist("Songs") )
{
// change dir to path of the execuctable
TCHAR szFullAppPath[MAX_PATH];
GetModuleFileName(NULL, szFullAppPath, MAX_PATH);
// strip off executable name
LPSTR pLastBackslash = strrchr(szFullAppPath, '\\');
*pLastBackslash = '\0'; // terminate the string
// clean up after a normal exit
DestroyObjects(); // deallocate our game objects and leave fullscreen
ShowWindow( g_hWndMain, SW_HIDE );
SetCurrentDirectory( szFullAppPath );
}
if( !bSuccess )
CoInitialize (NULL); // Initialize COM
// Register the window class
WNDCLASS wndClass = {
0,
WndProc, // callback handler
0, // cbClsExtra;
0, // cbWndExtra;
hInstance,
LoadIcon( hInstance, MAKEINTRESOURCE(IDI_ICON) ),
LoadCursor( hInstance, IDC_ARROW),
(HBRUSH)GetStockObject( BLACK_BRUSH ),
NULL, // lpszMenuName;
g_sAppClassName // lpszClassName;
};
RegisterClass( &wndClass );
// Set the window's initial width
RECT rcWnd;
SetRect( &rcWnd, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
AdjustWindowRect( &rcWnd, g_dwWindowStyle, FALSE );
// Create our main window
g_hWndMain = CreateWindow(
g_sAppClassName,// pointer to registered class name
g_sAppName, // pointer to window name
g_dwWindowStyle, // window StyleDef
CW_USEDEFAULT, // horizontal position of window
CW_USEDEFAULT, // vertical position of window
RECTWIDTH(rcWnd), // window width
RECTHEIGHT(rcWnd),// window height
NULL, // handle to parent or owner window
NULL, // handle to menu, or child-window identifier
hInstance, // handle to application instance
NULL // pointer to window-creation data
);
if( NULL == g_hWndMain )
exit(1);
ShowWindow( g_hWndMain, SW_HIDE );
// Load keyboard accelerators
HACCEL hAccel = LoadAccelerators( NULL, MAKEINTRESOURCE(IDR_MAIN_ACCEL) );
// run the game
CreateObjects( g_hWndMain ); // Create the game objects
ShowWindow( g_hWndMain, SW_SHOW );
#ifdef RELEASE
LOG->HideConsole();
#endif
// Now we're ready to recieve and process Windows messages.
MSG msg;
ZeroMemory( &msg, sizeof(msg) );
while( WM_QUIT != msg.message )
{
// Look for messages, if none are found then
// update the state and display it
if( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
{
GetMessage(&msg, NULL, 0, 0 );
// Translate and dispatch the message
if( 0 == TranslateAccelerator( g_hWndMain, hAccel, &msg ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
else // No messages are waiting. Render a frame during idle time.
{
Update();
Render();
if( DISPLAY && DISPLAY->IsWindowed() )
::Sleep( 1 ); // give some time to other processes
}
} // end while( WM_QUIT != msg.message )
// clean up after a normal exit
DestroyObjects(); // deallocate our game objects and leave fullscreen
ShowWindow( g_hWndMain, SW_HIDE );
}
#ifdef _RELEASE
catch( RageException e )
{
g_sErrorString = e.GetError();
}
catch( ... )
{
g_sErrorString = "access violation or other run-time error.";
}
if( g_sErrorString != "" )
{
// throw up a pretty error dialog
DialogBox(
@@ -215,6 +249,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
ErrorWndProc
);
}
#endif
DestroyWindow( g_hWndMain );
UnregisterClass( g_sAppClassName, hInstance );
@@ -224,49 +259,6 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
return 0L;
}
void MainLoop()
{
// Load keyboard accelerators
HACCEL hAccel = LoadAccelerators( NULL, MAKEINTRESOURCE(IDR_MAIN_ACCEL) );
// run the game
CreateObjects( g_hWndMain ); // Create the game objects
ShowWindow( g_hWndMain, SW_SHOW );
#ifdef RELEASE
LOG->HideConsole();
#endif
// Now we're ready to recieve and process Windows messages.
MSG msg;
ZeroMemory( &msg, sizeof(msg) );
while( WM_QUIT != msg.message )
{
// Look for messages, if none are found then
// update the state and display it
if( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
{
GetMessage(&msg, NULL, 0, 0 );
// Translate and dispatch the message
if( 0 == TranslateAccelerator( g_hWndMain, hAccel, &msg ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
else // No messages are waiting. Render a frame during idle time.
{
Update();
Render();
if( DISPLAY && DISPLAY->IsWindowed() )
::Sleep( 1 ); // give some time to other processes
}
} // end while( WM_QUIT != msg.message )
}
//-----------------------------------------------------------------------------
// Name: ErrorWndProc()
@@ -278,11 +270,7 @@ BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
case WM_INITDIALOG:
{
CString sMessage = ssprintf("%s", GetError() );
if( GetErrorHr() != 0 )
sMessage += ssprintf(" ('%d - %s)'", GetErrorHr(), DXGetErrorString8(GetErrorHr()) );
sMessage += ssprintf("\n\nStack Trace: (PDB file required for function names)", GetStackTrace() );
sMessage += ssprintf("\n\n%s", GetStackTrace() );
CString sMessage = g_sErrorString;
sMessage.Replace( "\n", "\r\n" );
SendDlgItemMessage(
hWnd,
@@ -492,15 +480,16 @@ HRESULT CreateObjects( HWND hWnd )
//
srand( (unsigned)time(NULL) ); // seed number generator
LOG = new RageLog();
SOUND = new RageSound( hWnd );
MUSIC = new RageSoundStream;
INPUTMAN= new RageInput( hWnd );
LOG = new RageLog();
TIMER = new RageTimer;
SOUND = new RageSound( hWnd );
MUSIC = new RageSoundStream;
INPUTMAN = new RageInput( hWnd );
PREFSMAN = new PrefsManager;
DISPLAY = new RageDisplay( hWnd );
SONGMAN = new SongManager; // this takes a long time to load
GAMEMAN = new GameManager;
THEME = new ThemeManager;
DISPLAY = new RageDisplay( hWnd );
SONGMAN = new SongManager; // this takes a long time to load
GAMEMAN = new GameManager;
THEME = new ThemeManager;
ANNOUNCER = new AnnouncerManager;
INPUTFILTER = new InputFilter();
INPUTMAPPER = new InputMapper();
@@ -524,17 +513,15 @@ HRESULT CreateObjects( HWND hWnd )
//SCREENMAN->SetNewScreen( new ScreenLoading );
//SCREENMAN->SetNewScreen( new ScreenSandbox );
//SCREENMAN->SetNewScreen( new ScreenResults(false) );
//SCREENMAN->SetNewScreen( new ScreenSelectDifficulty );
//SCREENMAN->SetNewScreen( new ScreenPlayerOptions );
//SCREENMAN->SetNewScreen( new ScreenTitleMenu );
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
//SCREENMAN->SetNewScreen( new ScreenGameplay );
//SCREENMAN->SetNewScreen( new ScreenMusicScroll );
SCREENMAN->SetNewScreen( new ScreenSelectMusic );
//SCREENMAN->SetNewScreen( new ScreenSelectMusic );
//SCREENMAN->SetNewScreen( new ScreenSelectGroup );
DXUtil_Timer( TIMER_START ); // Start the accurate timer
return S_OK;
}
@@ -544,8 +531,6 @@ HRESULT CreateObjects( HWND hWnd )
//-----------------------------------------------------------------------------
void DestroyObjects()
{
DXUtil_Timer( TIMER_STOP );
SAFE_DELETE( SCREENMAN );
SAFE_DELETE( FONT );
SAFE_DELETE( TEXTUREMAN );
@@ -561,6 +546,7 @@ void DestroyObjects()
SAFE_DELETE( INPUTMAN );
SAFE_DELETE( MUSIC );
SAFE_DELETE( SOUND );
SAFE_DELETE( TIMER );
SAFE_DELETE( LOG );
}
@@ -627,7 +613,7 @@ HRESULT InvalidateObjects()
//-----------------------------------------------------------------------------
void Update()
{
float fDeltaTime = DXUtil_Timer( TIMER_GETELAPSEDTIME );
float fDeltaTime = TIMER->GetDeltaTime();
// This was a hack to fix timing issues with the old ScreenSelectSong
//
@@ -702,7 +688,7 @@ void Render()
}
else
{
FatalErrorHr( hr, "Failed to DISPLAY->Reset()" );
throw RageException( hr, "Failed to DISPLAY->Reset()" );
}
break;
@@ -789,7 +775,7 @@ void ApplyGraphicOptions()
dwHeight = 240;
if( !DISPLAY->SwitchDisplayMode(bWindowed, dwWidth, dwHeight, dwDisplayBPP) )
{
FatalError( "Tried every possible display mode, and couldn't find one that works." );
throw RageException( "Tried every possible display mode, and couldn't find one that works." );
}
}
}
+61 -21
View File
@@ -39,7 +39,7 @@ RSC=rc.exe
# PROP Use_MFC 1
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../"
# PROP Intermediate_Dir "../Release-VC6"
# PROP Intermediate_Dir "../Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo /o"../StepMania-StackTrace.bsc"
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"../StepMania-VC6.exe"
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386
!ELSEIF "$(CFG)" == "StepMania - Win32 Debug"
@@ -65,7 +65,7 @@ LINK32=link.exe
# PROP Use_MFC 1
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../"
# PROP Intermediate_Dir "../Debug-VC6"
# PROP Intermediate_Dir "../Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
@@ -79,7 +79,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"../StepMania-debug-VC6.exe" /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"../StepMania-debug.exe" /pdbtype:sept
!ENDIF
@@ -108,6 +108,14 @@ SOURCE=.\RageDisplay.h
# End Source File
# Begin Source File
SOURCE=.\RageException.cpp
# End Source File
# Begin Source File
SOURCE=.\RageException.h
# End Source File
# Begin Source File
SOURCE=.\RageInput.cpp
# End Source File
# Begin Source File
@@ -180,6 +188,14 @@ SOURCE=.\RageTextureManager.h
# End Source File
# Begin Source File
SOURCE=.\RageTimer.cpp
# End Source File
# Begin Source File
SOURCE=.\RageTimer.h
# End Source File
# Begin Source File
SOURCE=.\RageUtil.cpp
# End Source File
# Begin Source File
@@ -216,6 +232,14 @@ SOURCE=.\GameInput.h
# End Source File
# Begin Source File
SOURCE=.\GameplayStatistics.cpp
# End Source File
# Begin Source File
SOURCE=.\GameplayStatistics.h
# End Source File
# Begin Source File
SOURCE=.\GameTypes.h
# End Source File
# Begin Source File
@@ -488,6 +512,22 @@ SOURCE=.\BPMDisplay.h
# End Source File
# Begin Source File
SOURCE=.\CourseContentsFrame.cpp
# End Source File
# Begin Source File
SOURCE=.\CourseContentsFrame.h
# End Source File
# Begin Source File
SOURCE=.\CourseInfoFrame.cpp
# End Source File
# Begin Source File
SOURCE=.\CourseInfoFrame.h
# End Source File
# Begin Source File
SOURCE=.\CroppedSprite.cpp
# End Source File
# Begin Source File
@@ -496,14 +536,6 @@ SOURCE=.\CroppedSprite.h
# End Source File
# Begin Source File
SOURCE=.\DifficultyBanner.cpp
# End Source File
# Begin Source File
SOURCE=.\DifficultyBanner.h
# End Source File
# Begin Source File
SOURCE=.\DifficultyIcon.cpp
# End Source File
# Begin Source File
@@ -623,7 +655,7 @@ SOURCE=.\TipDisplay.cpp
SOURCE=.\TipDisplay.h
# End Source File
# End Group
# Begin Group "Actors used in Dancing"
# Begin Group "Actors used in Gameplay"
# PROP Default_Filter ""
# Begin Source File
@@ -660,6 +692,14 @@ SOURCE=.\Combo.h
# End Source File
# Begin Source File
SOURCE=.\DifficultyBanner.cpp
# End Source File
# Begin Source File
SOURCE=.\DifficultyBanner.h
# End Source File
# Begin Source File
SOURCE=.\FocusingSprite.cpp
# End Source File
# Begin Source File
@@ -770,14 +810,6 @@ SOURCE=.\ScoreDisplayRolling.cpp
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 Group "Screens"
@@ -908,6 +940,14 @@ SOURCE=.\ScreenSandbox.h
# End Source File
# Begin Source File
SOURCE=.\ScreenSelectCourse.cpp
# End Source File
# Begin Source File
SOURCE=.\ScreenSelectCourse.h
# End Source File
# Begin Source File
SOURCE=.\ScreenSelectDifficulty.cpp
# End Source File
# Begin Source File
-15
View File
@@ -3,18 +3,6 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
###############################################################################
Project: "ErrorCatcher"=.\ErrorCatcher\ErrorCatcher.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "StepMania"=.\StepMania.dsp - Package Owner=<4>
Package=<5>
@@ -23,9 +11,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name ErrorCatcher
End Project Dependency
}}}
###############################################################################
-7
View File
@@ -5,15 +5,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZipArchive", "smpackage\Zip
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smpackage", "smpackage\smpackage.vcproj", "{775C9F19-F852-43AC-8563-D869C027722D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ErrorCatcher", "ErrorCatcher\ErrorCatcher.vcproj", "{88A45E4A-2CEB-404C-88AB-EE07B1844DB0}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
{670745A6-106B-420D-A2A9-D4F89A23986E}.0 = {88A45E4A-2CEB-404C-88AB-EE07B1844DB0}
{775C9F19-F852-43AC-8563-D869C027722D}.0 = {2AF0D4D5-0984-4AD4-A2BD-402D4BE285CE}
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
@@ -25,10 +22,6 @@ Global
{2AF0D4D5-0984-4AD4-A2BD-402D4BE285CE}.Release.ActiveCfg = Release|Win32
{775C9F19-F852-43AC-8563-D869C027722D}.Debug.ActiveCfg = Debug|Win32
{775C9F19-F852-43AC-8563-D869C027722D}.Release.ActiveCfg = Release|Win32
{88A45E4A-2CEB-404C-88AB-EE07B1844DB0}.Debug.ActiveCfg = Debug|Win32
{88A45E4A-2CEB-404C-88AB-EE07B1844DB0}.Debug.Build.0 = Debug|Win32
{88A45E4A-2CEB-404C-88AB-EE07B1844DB0}.Release.ActiveCfg = Release|Win32
{88A45E4A-2CEB-404C-88AB-EE07B1844DB0}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
+42 -1
View File
@@ -21,7 +21,6 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/EHa"
Optimization="0"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,DEBUG"
BasicRuntimeChecks="3"
@@ -236,6 +235,12 @@
<File
RelativePath="ScreenSandbox.h">
</File>
<File
RelativePath="ScreenSelectCourse.cpp">
</File>
<File
RelativePath="ScreenSelectCourse.h">
</File>
<File
RelativePath="ScreenSelectDifficulty.cpp">
</File>
@@ -306,6 +311,12 @@
<Filter
Name="Data Structures"
Filter="">
<File
RelativePath="Course.cpp">
</File>
<File
RelativePath="Course.h">
</File>
<File
RelativePath=".\Font.cpp">
</File>
@@ -327,6 +338,12 @@
<File
RelativePath=".\GameTypes.h">
</File>
<File
RelativePath="GameplayStatistics.cpp">
</File>
<File
RelativePath="GameplayStatistics.h">
</File>
<File
RelativePath=".\Grade.cpp">
</File>
@@ -499,6 +516,18 @@
<File
RelativePath="BonusInfoFrame.h">
</File>
<File
RelativePath="CourseContentsFrame.cpp">
</File>
<File
RelativePath="CourseContentsFrame.h">
</File>
<File
RelativePath="CourseInfoFrame.cpp">
</File>
<File
RelativePath="CourseInfoFrame.h">
</File>
<File
RelativePath="CroppedSprite.cpp">
</File>
@@ -735,6 +764,12 @@
<File
RelativePath="RageDisplay.h">
</File>
<File
RelativePath="RageException.cpp">
</File>
<File
RelativePath="RageException.h">
</File>
<File
RelativePath=".\RageInput.cpp">
</File>
@@ -789,6 +824,12 @@
<File
RelativePath=".\RageTextureManager.h">
</File>
<File
RelativePath="RageTimer.cpp">
</File>
<File
RelativePath="RageTimer.h">
</File>
<File
RelativePath=".\RageUtil.cpp">
</File>
+1 -1
View File
@@ -12,7 +12,7 @@
#include "StyleDef.h"
#include "RageLog.h"
#include "RageUtil.h"
#include "ErrorCatcher/ErrorCatcher.h"
#include "GameDef.h"
#include "IniFile.h"
+37 -27
View File
@@ -12,7 +12,7 @@
#include "ThemeManager.h"
#include "RageLog.h"
#include "ErrorCatcher/ErrorCatcher.h"
ThemeManager* THEME = NULL; // global object accessable from anywhere in the program
@@ -48,7 +48,7 @@ void ThemeManager::SwitchTheme( CString sThemeName )
m_sCurThemeName = sThemeName;
CString sThemeDir = GetThemeDirFromName(m_sCurThemeName);
if( !DoesFileExist( sThemeDir ) )
FatalError( "Error loading the theme in diretory '%s'.", sThemeDir );
throw RageException( "Error loading the theme in diretory '%s'.", sThemeDir );
}
@@ -88,7 +88,6 @@ CString ThemeManager::GetPathTo( ThemeElement te )
case GRAPHIC_CAUTION: sAssetPrefix = "Graphics\\Caution"; break;
case GRAPHIC_DANCER_P1: sAssetPrefix = "Graphics\\dancer p1"; break;
case GRAPHIC_DANCER_P2: sAssetPrefix = "Graphics\\dancer p2"; break;
case GRAPHIC_DIFFICULTY_ICONS: sAssetPrefix = "Graphics\\select music difficulty icons"; break;
case GRAPHIC_EDIT_BACKGROUND: sAssetPrefix = "Graphics\\edit background"; break;
case GRAPHIC_EDIT_TOP_EDGE: sAssetPrefix = "Graphics\\edit top edge"; break;
case GRAPHIC_EDIT_SNAP_INDICATOR: sAssetPrefix = "Graphics\\edit snap indicator"; break;
@@ -104,16 +103,17 @@ CString ThemeManager::GetPathTo( ThemeElement te )
case GRAPHIC_GAMEPLAY_COMBO: sAssetPrefix = "Graphics\\gameplay combo"; break;
case GRAPHIC_GAMEPLAY_DANGER_BACKGROUND: sAssetPrefix = "Graphics\\gameplay danger background"; break;
case GRAPHIC_GAMEPLAY_DANGER_TEXT: sAssetPrefix = "Graphics\\gameplay danger text"; break;
case GRAPHIC_GAMEPLAY_DIFFICULTY_FRAME: sAssetPrefix = "Graphics\\gameplay difficulty frame"; break;
case GRAPHIC_GAMEPLAY_DIFFICULTY_BANNER_ICONS: sAssetPrefix = "Graphics\\gameplay difficulty banner icons";break;
case GRAPHIC_GAMEPLAY_DIFFICULTY_BANNER_FRAME: sAssetPrefix = "Graphics\\gameplay difficulty banner frame";break;
case GRAPHIC_GAMEPLAY_FAILED: sAssetPrefix = "Graphics\\gameplay failed"; break;
case GRAPHIC_GAMEPLAY_HERE_WE_GO: sAssetPrefix = "Graphics\\gameplay here we go"; break;
case GRAPHIC_GAMEPLAY_JUDGEMENT: sAssetPrefix = "Graphics\\gameplay judgement 1x9"; break;
case GRAPHIC_GAMEPLAY_OPENING_STAR: sAssetPrefix = "Graphics\\gameplay opening star"; break;
case GRAPHIC_GAMEPLAY_READY: sAssetPrefix = "Graphics\\gameplay Ready"; break;
case GRAPHIC_GAMEPLAY_TOP_FRAME: sAssetPrefix = "Graphics\\gameplay top frame"; break;
case GRAPHIC_GAMEPLAY_TOP_FRAME_ARCADE: sAssetPrefix = "Graphics\\gameplay top frame arcade"; break;
case GRAPHIC_GAMEPLAY_TOP_FRAME_ONI: sAssetPrefix = "Graphics\\gameplay top frame oni"; break;
case GRAPHIC_GAMEPLAY_ONI_BATTERY: sAssetPrefix = "Graphics\\gameplay oni battery"; break;
case GRAPHIC_KEEP_ALIVE: sAssetPrefix = "Graphics\\keep alive"; break;
case GRAPHIC_LIFEMETER_FRAME: sAssetPrefix = "Graphics\\Life Meter Frame"; break;
case GRAPHIC_LIFEMETER_PILLS: sAssetPrefix = "Graphics\\life meter pills 17x1"; break;
case GRAPHIC_MENU_BOTTOM_EDGE: sAssetPrefix = "Graphics\\menu bottom edge"; break;
case GRAPHIC_MENU_STYLE_ICONS: sAssetPrefix = "Graphics\\menu style icons"; break;
case GRAPHIC_MUSIC_SCROLL_BACKGROUND: sAssetPrefix = "Graphics\\music scroll background"; break;
@@ -132,10 +132,12 @@ CString ThemeManager::GetPathTo( ThemeElement te )
case GRAPHIC_RESULTS_GRADES: sAssetPrefix = "Graphics\\results grades 1x7"; break;
case GRAPHIC_RESULTS_JUDGE_LABELS: sAssetPrefix = "Graphics\\results judge labels 1x6"; break;
case GRAPHIC_RESULTS_SCORE_LABELS: sAssetPrefix = "Graphics\\results score labels 1x2"; break;
case GRAPHIC_RESULTS_SUMMARY_TOP_EDGE: sAssetPrefix = "Graphics\\results summary top edge"; break;
case GRAPHIC_RESULTS_SUMMARY_TOP_EDGE: sAssetPrefix = "Graphics\\results summary top edge"; break;
case GRAPHIC_RESULTS_TOP_EDGE: sAssetPrefix = "Graphics\\results top edge"; break;
case GRAPHIC_SELECT_DIFFICULTY_ARROW_P1: sAssetPrefix = "Graphics\\select difficulty arrow p1"; break;
case GRAPHIC_SELECT_DIFFICULTY_ARROW_P2: sAssetPrefix = "Graphics\\select difficulty arrow p2"; break;
case GRAPHIC_SELECT_COURSE_INFO_FRAME: sAssetPrefix = "Graphics\\select course info frame"; break;
case GRAPHIC_SELECT_COURSE_TOP_EDGE: sAssetPrefix = "Graphics\\select course top edge"; break;
case GRAPHIC_SELECT_COURSE_BACKGROUND: sAssetPrefix = "Graphics\\select course background"; break;
case GRAPHIC_SELECT_DIFFICULTY_ARROWS: sAssetPrefix = "Graphics\\select difficulty arrows 1x2"; break;
case GRAPHIC_SELECT_DIFFICULTY_BACKGROUND: sAssetPrefix = "Graphics\\select difficulty background"; break;
case GRAPHIC_SELECT_DIFFICULTY_EASY_HEADER: sAssetPrefix = "Graphics\\select difficulty easy header"; break;
case GRAPHIC_SELECT_DIFFICULTY_EASY_PICTURE: sAssetPrefix = "Graphics\\select difficulty easy picture"; break;
@@ -144,6 +146,10 @@ CString ThemeManager::GetPathTo( ThemeElement te )
case GRAPHIC_SELECT_DIFFICULTY_HARD_PICTURE: sAssetPrefix = "Graphics\\select difficulty hard picture"; break;
case GRAPHIC_SELECT_DIFFICULTY_MEDIUM_HEADER: sAssetPrefix = "Graphics\\select difficulty medium header"; break;
case GRAPHIC_SELECT_DIFFICULTY_MEDIUM_PICTURE: sAssetPrefix = "Graphics\\select difficulty medium picture";break;
case GRAPHIC_SELECT_DIFFICULTY_ONI_HEADER: sAssetPrefix = "Graphics\\select difficulty oni header"; break;
case GRAPHIC_SELECT_DIFFICULTY_ONI_PICTURE: sAssetPrefix = "Graphics\\select difficulty oni picture"; break;
case GRAPHIC_SELECT_DIFFICULTY_ENDLESS_HEADER: sAssetPrefix = "Graphics\\select difficulty endless header"; break;
case GRAPHIC_SELECT_DIFFICULTY_ENDLESS_PICTURE: sAssetPrefix = "Graphics\\select difficulty endless picture"; break;
case GRAPHIC_SELECT_DIFFICULTY_OK: sAssetPrefix = "Graphics\\select difficulty ok"; break;
case GRAPHIC_SELECT_DIFFICULTY_TOP_EDGE: sAssetPrefix = "Graphics\\select difficulty top edge"; break;
case GRAPHIC_SELECT_GAME_BACKGROUND: sAssetPrefix = "Graphics\\select game background"; break;
@@ -155,6 +161,7 @@ CString ThemeManager::GetPathTo( ThemeElement te )
case GRAPHIC_SELECT_GROUP_INFO_FRAME: sAssetPrefix = "Graphics\\select group info frame"; break;
case GRAPHIC_SELECT_GROUP_TOP_EDGE: sAssetPrefix = "Graphics\\select group top edge"; break;
case GRAPHIC_SELECT_MUSIC_BACKGROUND: sAssetPrefix = "Graphics\\select music background"; break;
case GRAPHIC_SELECT_MUSIC_DIFFICULTY_ICONS: sAssetPrefix = "Graphics\\select music difficulty icons"; break;
case GRAPHIC_SELECT_MUSIC_DIFFICULTY_FRAME: sAssetPrefix = "Graphics\\select music difficulty frame"; break;
case GRAPHIC_SELECT_MUSIC_INFO_FRAME: sAssetPrefix = "Graphics\\select music info frame"; break;
case GRAPHIC_SELECT_MUSIC_METER_FRAME: sAssetPrefix = "Graphics\\select music meter frame"; break;
@@ -174,22 +181,22 @@ CString ThemeManager::GetPathTo( ThemeElement te )
case GRAPHIC_SELECT_STYLE_EXPLANATION: sAssetPrefix = "Graphics\\select Style explanation"; break;
case GRAPHIC_SELECT_STYLE_TOP_EDGE: sAssetPrefix = "Graphics\\select Style top edge"; break;
case GRAPHIC_SELECT_STYLE_ICONS: sAssetPrefix = "Graphics\\select Style icons"; break;
case GRAPHIC_SELECT_STYLE_INFO_0: sAssetPrefix = "Graphics\\select style info 0"; break;
case GRAPHIC_SELECT_STYLE_INFO_1: sAssetPrefix = "Graphics\\select style info 1"; break;
case GRAPHIC_SELECT_STYLE_INFO_2: sAssetPrefix = "Graphics\\select style info 2"; break;
case GRAPHIC_SELECT_STYLE_INFO_3: sAssetPrefix = "Graphics\\select style info 3"; break;
case GRAPHIC_SELECT_STYLE_INFO_4: sAssetPrefix = "Graphics\\select style info 4"; break;
case GRAPHIC_SELECT_STYLE_INFO_5: sAssetPrefix = "Graphics\\select style info 5"; break;
case GRAPHIC_SELECT_STYLE_INFO_6: sAssetPrefix = "Graphics\\select style info 6"; break;
case GRAPHIC_SELECT_STYLE_INFO_7: sAssetPrefix = "Graphics\\select style info 7"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_0: sAssetPrefix = "Graphics\\select style preview 0"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_1: sAssetPrefix = "Graphics\\select style preview 1"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_2: sAssetPrefix = "Graphics\\select style preview 2"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_3: sAssetPrefix = "Graphics\\select style preview 3"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_4: sAssetPrefix = "Graphics\\select style preview 4"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_5: sAssetPrefix = "Graphics\\select style preview 5"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_6: sAssetPrefix = "Graphics\\select style preview 6"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_7: sAssetPrefix = "Graphics\\select style preview 7"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_0: sAssetPrefix = "Graphics\\select style info game 0 style 0"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_1: sAssetPrefix = "Graphics\\select style info game 0 style 1"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_2: sAssetPrefix = "Graphics\\select style info game 0 style 2"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_3: sAssetPrefix = "Graphics\\select style info game 0 style 3"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_4: sAssetPrefix = "Graphics\\select style info game 0 style 4"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_0: sAssetPrefix = "Graphics\\select style info game 1 style 0"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_1: sAssetPrefix = "Graphics\\select style info game 1 style 1"; break;
case GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_2: sAssetPrefix = "Graphics\\select style info game 1 style 2"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0: sAssetPrefix = "Graphics\\select style preview game 0 style 0"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_1: sAssetPrefix = "Graphics\\select style preview game 0 style 1"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_2: sAssetPrefix = "Graphics\\select style preview game 0 style 2"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_3: sAssetPrefix = "Graphics\\select style preview game 0 style 3"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_4: sAssetPrefix = "Graphics\\select style preview game 0 style 4"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_0: sAssetPrefix = "Graphics\\select style preview game 1 style 0"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_1: sAssetPrefix = "Graphics\\select style preview game 1 style 1"; break;
case GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_2: sAssetPrefix = "Graphics\\select style preview game 1 style 2"; break;
case GRAPHIC_SONG_OPTIONS_BACKGROUND: sAssetPrefix = "Graphics\\song options background"; break;
case GRAPHIC_SONG_OPTIONS_TOP_EDGE: sAssetPrefix = "Graphics\\song options top edge"; break;
case GRAPHIC_STAGE_UNDERSCORE: sAssetPrefix = "Graphics\\stage underscore"; break;
@@ -216,18 +223,21 @@ CString ThemeManager::GetPathTo( ThemeElement te )
case SOUND_OPTION_CHANGE_ROW: sAssetPrefix = "Sounds\\option change row"; break;
case SOUND_RESULTS_FLY_OFF: sAssetPrefix = "Sounds\\results fly off"; break;
case SOUND_RESULTS_SCORE_TICK: sAssetPrefix = "Sounds\\results score tick"; break;
case SOUND_RESULTS_EXTRA_STAGE: sAssetPrefix = "Sounds\\results extra stage"; break;
case SOUND_SELECT_DIFFICULTY_CHANGE: sAssetPrefix = "Sounds\\select difficulty change"; break;
case SOUND_SELECT_GROUP_CHANGE: sAssetPrefix = "Sounds\\select group change"; break;
case SOUND_SELECT_MUSIC_SECTION_EXPAND: sAssetPrefix = "Sounds\\select music section expand"; break;
case SOUND_SELECT_MUSIC_CHANGE_MUSIC: sAssetPrefix = "Sounds\\select music change music"; break;
case SOUND_SELECT_MUSIC_CHANGE_SORT: sAssetPrefix = "Sounds\\select music change sort"; break;
case SOUND_SELECT_MUSIC_CHANGE_NOTES: sAssetPrefix = "Sounds\\select music change notes"; break;
case SOUND_SELECT_MUSIC_WHEEL_LOCKED: sAssetPrefix = "Sounds\\select music wheel locked"; break;
case SOUND_SELECT_STYLE_CHANGE: sAssetPrefix = "Sounds\\select style change"; break;
case SOUND_TITLE_MENU_CHANGE: sAssetPrefix = "Sounds\\title menu change"; break;
case FONT_HEADER1: sAssetPrefix = "Fonts\\Header1"; break;
case FONT_HEADER2: sAssetPrefix = "Fonts\\Header2"; break;
case FONT_NORMAL: sAssetPrefix = "Fonts\\Normal"; break;
case FONT_ITALIC: sAssetPrefix = "Fonts\\Italic"; break;
case FONT_COMBO_NUMBERS: sAssetPrefix = "Fonts\\Combo Numbers"; break;
case FONT_METER: sAssetPrefix = "Fonts\\Meter"; break;
case FONT_SCORE_NUMBERS: sAssetPrefix = "Fonts\\Score Numbers"; break;
@@ -284,7 +294,7 @@ CString ThemeManager::GetPathTo( ThemeElement te )
if( asPossibleElementFilePaths.GetSize() > 0 )
return asPossibleElementFilePaths[0];
else
FatalError( "Theme element '%s' could not be found in '%s' or '%s'.",
throw RageException( "Theme element '%s' could not be found in '%s' or '%s'.",
sDefaultThemeDir + sAssetPrefix,
GetThemeDirFromName(m_sCurThemeName),
GetThemeDirFromName(DEFAULT_THEME_NAME) );
+34 -24
View File
@@ -22,10 +22,6 @@ enum ThemeElement {
GRAPHIC_GAMEPLAY_CLOSING_STAR,
GRAPHIC_DANCER_P1,
GRAPHIC_DANCER_P2,
GRAPHIC_GAMEPLAY_BOTTOM_FRAME,
GRAPHIC_GAMEPLAY_DIFFICULTY_FRAME,
GRAPHIC_GAMEPLAY_TOP_FRAME,
GRAPHIC_DIFFICULTY_ICONS,
GRAPHIC_EDIT_BACKGROUND,
GRAPHIC_EDIT_TOP_EDGE,
GRAPHIC_EDIT_SNAP_INDICATOR,
@@ -44,9 +40,13 @@ enum ThemeElement {
GRAPHIC_GAMEPLAY_JUDGEMENT,
GRAPHIC_GAMEPLAY_READY,
GRAPHIC_GAMEPLAY_HERE_WE_GO,
GRAPHIC_GAMEPLAY_BOTTOM_FRAME,
GRAPHIC_GAMEPLAY_DIFFICULTY_BANNER_ICONS,
GRAPHIC_GAMEPLAY_DIFFICULTY_BANNER_FRAME,
GRAPHIC_GAMEPLAY_TOP_FRAME_ARCADE,
GRAPHIC_GAMEPLAY_TOP_FRAME_ONI,
GRAPHIC_GAMEPLAY_ONI_BATTERY,
GRAPHIC_KEEP_ALIVE,
GRAPHIC_LIFEMETER_FRAME,
GRAPHIC_LIFEMETER_PILLS,
GRAPHIC_MENU_BOTTOM_EDGE,
GRAPHIC_MENU_STYLE_ICONS,
GRAPHIC_MUSIC_SORT_ICONS,
@@ -67,8 +67,10 @@ enum ThemeElement {
GRAPHIC_RESULTS_SCORE_LABELS,
GRAPHIC_RESULTS_SUMMARY_TOP_EDGE,
GRAPHIC_RESULTS_TOP_EDGE,
GRAPHIC_SELECT_DIFFICULTY_ARROW_P1,
GRAPHIC_SELECT_DIFFICULTY_ARROW_P2,
GRAPHIC_SELECT_COURSE_INFO_FRAME,
GRAPHIC_SELECT_COURSE_TOP_EDGE,
GRAPHIC_SELECT_COURSE_BACKGROUND,
GRAPHIC_SELECT_DIFFICULTY_ARROWS,
GRAPHIC_SELECT_DIFFICULTY_BACKGROUND,
GRAPHIC_SELECT_DIFFICULTY_EASY_HEADER,
GRAPHIC_SELECT_DIFFICULTY_EASY_PICTURE,
@@ -77,6 +79,10 @@ enum ThemeElement {
GRAPHIC_SELECT_DIFFICULTY_HARD_PICTURE,
GRAPHIC_SELECT_DIFFICULTY_MEDIUM_HEADER,
GRAPHIC_SELECT_DIFFICULTY_MEDIUM_PICTURE,
GRAPHIC_SELECT_DIFFICULTY_ONI_HEADER,
GRAPHIC_SELECT_DIFFICULTY_ONI_PICTURE,
GRAPHIC_SELECT_DIFFICULTY_ENDLESS_HEADER,
GRAPHIC_SELECT_DIFFICULTY_ENDLESS_PICTURE,
GRAPHIC_SELECT_DIFFICULTY_OK,
GRAPHIC_SELECT_DIFFICULTY_TOP_EDGE,
GRAPHIC_SELECT_GAME_BACKGROUND,
@@ -89,6 +95,7 @@ enum ThemeElement {
GRAPHIC_SELECT_GROUP_TOP_EDGE,
GRAPHIC_SELECT_MUSIC_BACKGROUND,
GRAPHIC_SELECT_MUSIC_DIFFICULTY_FRAME,
GRAPHIC_SELECT_MUSIC_DIFFICULTY_ICONS,
GRAPHIC_SELECT_MUSIC_INFO_FRAME,
GRAPHIC_SELECT_MUSIC_METER_FRAME,
GRAPHIC_SELECT_MUSIC_OPTION_ICONS,
@@ -107,22 +114,22 @@ enum ThemeElement {
GRAPHIC_SELECT_STYLE_TOP_EDGE,
GRAPHIC_SELECT_STYLE_EXPLANATION,
GRAPHIC_SELECT_STYLE_ICONS,
GRAPHIC_SELECT_STYLE_INFO_0,
GRAPHIC_SELECT_STYLE_INFO_1,
GRAPHIC_SELECT_STYLE_INFO_2,
GRAPHIC_SELECT_STYLE_INFO_3,
GRAPHIC_SELECT_STYLE_INFO_4,
GRAPHIC_SELECT_STYLE_INFO_5,
GRAPHIC_SELECT_STYLE_INFO_6,
GRAPHIC_SELECT_STYLE_INFO_7,
GRAPHIC_SELECT_STYLE_PREVIEW_0,
GRAPHIC_SELECT_STYLE_PREVIEW_1,
GRAPHIC_SELECT_STYLE_PREVIEW_2,
GRAPHIC_SELECT_STYLE_PREVIEW_3,
GRAPHIC_SELECT_STYLE_PREVIEW_4,
GRAPHIC_SELECT_STYLE_PREVIEW_5,
GRAPHIC_SELECT_STYLE_PREVIEW_6,
GRAPHIC_SELECT_STYLE_PREVIEW_7,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_0,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_1,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_2,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_3,
GRAPHIC_SELECT_STYLE_INFO_GAME_0_STYLE_4,
GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_0,
GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_1,
GRAPHIC_SELECT_STYLE_INFO_GAME_1_STYLE_2,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_0,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_1,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_2,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_3,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_0_STYLE_4,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_0,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_1,
GRAPHIC_SELECT_STYLE_PREVIEW_GAME_1_STYLE_2,
GRAPHIC_SONG_OPTIONS_BACKGROUND,
GRAPHIC_SONG_OPTIONS_TOP_EDGE,
GRAPHIC_STAGE_UNDERSCORE,
@@ -149,18 +156,21 @@ enum ThemeElement {
SOUND_OPTION_CHANGE_ROW,
SOUND_RESULTS_FLY_OFF,
SOUND_RESULTS_SCORE_TICK,
SOUND_RESULTS_EXTRA_STAGE,
SOUND_SELECT_DIFFICULTY_CHANGE,
SOUND_SELECT_GROUP_CHANGE,
SOUND_SELECT_MUSIC_SECTION_EXPAND,
SOUND_SELECT_MUSIC_CHANGE_MUSIC,
SOUND_SELECT_MUSIC_CHANGE_SORT,
SOUND_SELECT_MUSIC_CHANGE_NOTES,
SOUND_SELECT_MUSIC_WHEEL_LOCKED,
SOUND_SELECT_STYLE_CHANGE,
SOUND_TITLE_MENU_CHANGE,
FONT_HEADER1,
FONT_HEADER2,
FONT_NORMAL,
FONT_ITALIC,
FONT_COMBO_NUMBERS,
FONT_METER,
FONT_SCORE_NUMBERS,
+4 -2
View File
@@ -39,6 +39,7 @@ class Song
{
public:
Song();
~Song();
bool LoadFromSongDir( CString sDir ); // calls one of the loads below
void Save() { SaveToSMDir(); SaveToCacheFile(); };
@@ -62,6 +63,7 @@ public:
CString GetSongFileDir() {return m_sSongDir; };
CString GetGroupName() {return m_sGroupName; };
CString GetMusicPath() {return m_sMusicPath; };
float GetMusicLengthSeconds() {return m_fMusicLength; };
void GetMusicSampleRange( float &fStartSec, float &fEndSec ) { fStartSec = m_fMusicSampleStartSeconds; fEndSec = m_fMusicSampleStartSeconds + m_fMusicSampleLengthSeconds; };
CString GetBannerPath() {return m_sBannerPath; };
CString GetBackgroundPath() {return m_sBackgroundPath; };
@@ -105,7 +107,7 @@ public:
int iTotalNumTimesPlayed = 0;
for( int i=0; i<m_arrayNotes.GetSize(); i++ )
{
iTotalNumTimesPlayed += m_arrayNotes[i].m_iNumTimesPlayed;
iTotalNumTimesPlayed += m_arrayNotes[i]->m_iNumTimesPlayed;
}
return iTotalNumTimesPlayed;
}
@@ -142,7 +144,7 @@ private:
CArray<FreezeSegment, FreezeSegment&> m_FreezeSegments; // this must be sorted before gameplay
public:
CArray<Notes, Notes&> m_arrayNotes;
CArray<Notes*, Notes*> m_arrayNotes;
};