From 5028fab1bc832bf3487c3f4f37354970b9507e05 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 17 Feb 2003 02:45:30 +0000 Subject: [PATCH] fixed interaction between arrow brightness and boomerang fixing more course problems --- stepmania/Courses/AllChallenge.crs | 7 + stepmania/Courses/StaminaTester.crs | 7 + stepmania/Courses/TortiseAndHare.crs | 5 + ...ickyRandomNonstop.crs => TrickyRandom.crs} | 2 +- stepmania/Courses/TrickyRandomOni.crs | 6 - stepmania/Themes/default/metrics.ini | 16 +- stepmania/src/ArrowEffects.cpp | 7 +- stepmania/src/ArrowEffects.h | 4 +- stepmania/src/Course.cpp | 38 ++- stepmania/src/CourseContentsFrame.cpp | 236 ------------------ stepmania/src/CourseContentsList.cpp | 148 +++++++++++ ...seContentsFrame.h => CourseContentsList.h} | 31 +-- stepmania/src/CourseEntryDisplay.cpp | 136 ++++++++++ stepmania/src/CourseEntryDisplay.h | 43 ++++ stepmania/src/NoteDisplay.cpp | 2 +- stepmania/src/ScreenEvaluation.cpp | 30 +-- stepmania/src/ScreenSelectCourse.h | 4 +- stepmania/src/Song.cpp | 4 +- stepmania/src/StageStats.cpp | 3 +- stepmania/src/StepMania.cpp | 5 +- stepmania/src/StepMania.dsp | 28 ++- stepmania/src/StepMania.vcproj | 22 +- 22 files changed, 442 insertions(+), 342 deletions(-) create mode 100644 stepmania/Courses/AllChallenge.crs create mode 100644 stepmania/Courses/StaminaTester.crs create mode 100644 stepmania/Courses/TortiseAndHare.crs rename stepmania/Courses/{TrickyRandomNonstop.crs => TrickyRandom.crs} (77%) delete mode 100644 stepmania/Courses/TrickyRandomOni.crs delete mode 100644 stepmania/src/CourseContentsFrame.cpp create mode 100644 stepmania/src/CourseContentsList.cpp rename stepmania/src/{CourseContentsFrame.h => CourseContentsList.h} (58%) create mode 100644 stepmania/src/CourseEntryDisplay.cpp create mode 100644 stepmania/src/CourseEntryDisplay.h diff --git a/stepmania/Courses/AllChallenge.crs b/stepmania/Courses/AllChallenge.crs new file mode 100644 index 0000000000..57c88f51b9 --- /dev/null +++ b/stepmania/Courses/AllChallenge.crs @@ -0,0 +1,7 @@ +#COURSE:All Challenge; +#LIVES:4; +#SONG:*:CHALLENGE; +#SONG:*:CHALLENGE; +#SONG:*:CHALLENGE; +#SONG:*:CHALLENGE; +#SONG:*:CHALLENGE; \ No newline at end of file diff --git a/stepmania/Courses/StaminaTester.crs b/stepmania/Courses/StaminaTester.crs new file mode 100644 index 0000000000..e593395834 --- /dev/null +++ b/stepmania/Courses/StaminaTester.crs @@ -0,0 +1,7 @@ +#COURSE:Stamina Tester Random; +#LIVES:4; +#SONG:*:9..10; +#SONG:*:9..10; +#SONG:*:9..10; +#SONG:*:9..10; +#SONG:*:9..10; diff --git a/stepmania/Courses/TortiseAndHare.crs b/stepmania/Courses/TortiseAndHare.crs new file mode 100644 index 0000000000..5b521eedaf --- /dev/null +++ b/stepmania/Courses/TortiseAndHare.crs @@ -0,0 +1,5 @@ +#COURSE:Tortise And the Hare; +#SONG:*:TRICK:0.7xmusic; +#SONG:*:TRICK:0.9xmusic; +#SONG:*:TRICK:1.2xmusic; +#SONG:*:TRICK:1.5xmusic; diff --git a/stepmania/Courses/TrickyRandomNonstop.crs b/stepmania/Courses/TrickyRandom.crs similarity index 77% rename from stepmania/Courses/TrickyRandomNonstop.crs rename to stepmania/Courses/TrickyRandom.crs index c1815b759a..0f167e2086 100644 --- a/stepmania/Courses/TrickyRandomNonstop.crs +++ b/stepmania/Courses/TrickyRandom.crs @@ -2,4 +2,4 @@ #SONG:*:TRICK:1.5x,reverse; #SONG:*:TRICK:expand; #SONG:*:TRICK:0.25x,dark; -#SONG:*:TRICK:sudden,boost; +#SONG:*:TRICK:sudden,land; diff --git a/stepmania/Courses/TrickyRandomOni.crs b/stepmania/Courses/TrickyRandomOni.crs deleted file mode 100644 index 76dfc84c3f..0000000000 --- a/stepmania/Courses/TrickyRandomOni.crs +++ /dev/null @@ -1,6 +0,0 @@ -#COURSE:Tricky Random; -#LIVES:4; -#SONG:*:TRICK:1.5x,reverse; -#SONG:*:TRICK:expand; -#SONG:*:TRICK:0.25x,dark; -#SONG:*:TRICK:sudden,boost; diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index c516099f0d..8d33f98767 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -934,12 +934,20 @@ ThreeLinesTitleY=-10 ThreeLinesSubTitleY=0 ThreeLinesArtistY=10 -[CourseContentDisplay] +[CourseEntryDisplay] TextBannerX=0 TextBannerY=0 +TextBannerZoom=1.0 NumberX=-118 NumberY=0 -FootX=102 -FootY=8 +NumberZoom=1.0 +FootX=98 +FootY=-8 +FootZoom=1.0 DifficultyX=120 -DifficultyY=8 +DifficultyY=-8 +DifficultyZoom=0.7 +ModifiersX=128 +ModifiersY=10 +ModifiersZoom=0.5 +ModifiersHorizAlign=2 \ No newline at end of file diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index c850895d05..1e97f3afcc 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -182,9 +182,12 @@ float ArrowGetGlow( PlayerNumber pn, float fYPos, float fPercentFadeToFail ) return SCALE( fDistFromHalf, 0, 0.5f, 1.3f, 0 ); } -float ArrowGetBrightness( PlayerNumber pn, float fYOffset ) +float ArrowGetBrightness( PlayerNumber pn, float fNoteBeat ) { - float fBrightness = SCALE( fYOffset, 0, -ARROW_SIZE, 1.f, 0.f ); + float fSongBeat = GAMESTATE->m_fSongBeat; + float fBeatsUntilStep = fNoteBeat - fSongBeat; + + float fBrightness = SCALE( fBeatsUntilStep, 0, -1, 1.f, 0.f ); CLAMP( fBrightness, 0, 1 ); // noisy printf( "fBrightness = %f\n", fBrightness ); return fBrightness; diff --git a/stepmania/src/ArrowEffects.h b/stepmania/src/ArrowEffects.h index 99d8ef8abe..1a8fc84353 100644 --- a/stepmania/src/ArrowEffects.h +++ b/stepmania/src/ArrowEffects.h @@ -55,8 +55,8 @@ float ArrowGetAlpha( PlayerNumber pn, float fYPos, float fPercentFadeToFail ); float ArrowGetGlow( PlayerNumber pn, float fYPos, float fPercentFadeToFail ); -// Depends on fYPos. -float ArrowGetBrightness( PlayerNumber pn, float fYOffset ); +// Depends on fYOffset. +float ArrowGetBrightness( PlayerNumber pn, float fNoteBeat ); #endif diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index eb4fcbf23e..be150a2bfd 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -282,7 +282,8 @@ bool Course::HasDifficult() const bool Course::IsPlayableIn( NotesType nt ) const { - return true; + // TODO: something smarter here + return m_entries.size() > 0; } @@ -296,12 +297,25 @@ void Course::GetStageInfo( if( bDifficult ) ASSERT( HasDifficult() ); - vector entries = m_entries; if( m_bRandomize ) random_shuffle( entries.begin(), entries.end() ); + + // Sorting is slow, so do this outside the for loop. + vector vSongsByMostPlayed = SONGMAN->GetAllSongs(); + SortSongPointerArrayByMostPlayed( vSongsByMostPlayed ); + + // filter out songs that don't have both medium and hard steps + for( int j=vSongsByMostPlayed.size()-1; j>=0; j-- ) + { + Song* pSong = vSongsByMostPlayed[j]; + if( !pSong->GetNotes(nt, DIFFICULTY_MEDIUM) || !pSong->GetNotes(nt, DIFFICULTY_HARD) ) + vSongsByMostPlayed.erase( vSongsByMostPlayed.begin()+j ); + } + + for( unsigned i=0; i vSongsByMostPlayed = SONGMAN->GetAllSongs(); - SortSongPointerArrayByMostPlayed( vSongsByMostPlayed ); - - // filter out songs that don't have both medium and hard steps - for( int j=vSongsByMostPlayed.size()-1; j>=0; j-- ) - { - Song* pSong = vSongsByMostPlayed[j]; - if( !pSong->GetNotes(nt, DIFFICULTY_MEDIUM) || !pSong->GetNotes(nt, DIFFICULTY_HARD) ) - vSongsByMostPlayed.erase( vSongsByMostPlayed.begin()+j ); - } switch( e.type ) { @@ -336,7 +340,15 @@ void Course::GetStageInfo( case Entry::random_within_group: { vector vSongs; - SONGMAN->GetSongs( vSongs, e.group_name ); + switch( e.type ) + { + case Entry::random: + vSongs = SONGMAN->GetAllSongs(); + break; + case Entry::random_within_group: + SONGMAN->GetSongs( vSongs, e.group_name ); + break; + } if( vSongs.size() == 0 ) break; diff --git a/stepmania/src/CourseContentsFrame.cpp b/stepmania/src/CourseContentsFrame.cpp deleted file mode 100644 index d248ea051d..0000000000 --- a/stepmania/src/CourseContentsFrame.cpp +++ /dev/null @@ -1,236 +0,0 @@ -#include "global.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 "PrefsManager.h" -#include "RageLog.h" -#include "PrefsManager.h" -#include "Course.h" -#include "SongManager.h" -#include -#include "RageDisplay.h" -#include "ThemeManager.h" -#include "Notes.h" -#include "GameState.h" -#include "StyleDef.h" - - -#define TEXT_BANNER_X THEME->GetMetricF("CourseContentDisplay","TextBannerX") -#define TEXT_BANNER_Y THEME->GetMetricF("CourseContentDisplay","TextBannerY") -#define NUMBER_X THEME->GetMetricF("CourseContentDisplay","NumberX") -#define NUMBER_Y THEME->GetMetricF("CourseContentDisplay","NumberY") -#define FOOT_X THEME->GetMetricF("CourseContentDisplay","FootX") -#define FOOT_Y THEME->GetMetricF("CourseContentDisplay","FootY") -#define DIFFICULTY_X THEME->GetMetricF("CourseContentDisplay","DifficultyX") -#define DIFFICULTY_Y THEME->GetMetricF("CourseContentDisplay","DifficultyY") - - -CourseContentDisplay::CourseContentDisplay() -{ - m_sprFrame.Load( THEME->GetPathTo("Graphics","select course content bar") ); - this->AddChild( &m_sprFrame ); - - m_textNumber.LoadFromFont( THEME->GetPathTo("Fonts","Header2") ); - m_textNumber.SetXY( NUMBER_X, NUMBER_Y ); - m_textNumber.TurnShadowOff(); - this->AddChild( &m_textNumber ); - - m_TextBanner.SetXY( TEXT_BANNER_X, TEXT_BANNER_Y ); - this->AddChild( &m_TextBanner ); - - m_textFoot.LoadFromTextureAndChars( THEME->GetPathTo("Graphics","select music meter 2x1"),"10" ); - m_textFoot.SetXY( FOOT_X, FOOT_Y ); - m_textFoot.TurnShadowOff(); - this->AddChild( &m_textFoot ); - - m_textDifficultyNumber.LoadFromFont( THEME->GetPathTo("Fonts","normal") ); - m_textDifficultyNumber.SetXY( DIFFICULTY_X, DIFFICULTY_Y ); - m_textDifficultyNumber.SetZoom( 0.8f ); - m_textDifficultyNumber.TurnShadowOff(); - this->AddChild( &m_textDifficultyNumber ); -} - - -void CourseContentDisplay::LoadFromSongAndNotes( int iNum, Song* pSong, Notes* pNotes ) -{ - m_textNumber.SetText( ssprintf("%d", iNum) ); - - RageColor colorGroup = SONGMAN->GetSongColor( pSong ); - RageColor colorNotes = SONGMAN->GetDifficultyColor( pNotes->GetDifficulty() ); - - m_TextBanner.LoadFromSong( pSong ); - m_TextBanner.SetDiffuse( colorGroup ); - - m_textFoot.SetText( "1" ); - m_textFoot.SetDiffuse( colorNotes ); - - m_textDifficultyNumber.SetText( ssprintf("%d", pNotes->GetMeter()) ); - m_textDifficultyNumber.SetDiffuse( colorNotes ); -} - -void CourseContentDisplay::LoadFromDifficulty( int iNum, Difficulty dc ) -{ - m_textNumber.SetText( ssprintf("%d", iNum) ); - - RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be? - RageColor colorNotes = SONGMAN->GetDifficultyColor( dc ); - - m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" ); - m_TextBanner.SetDiffuse( colorGroup ); - - m_textFoot.SetText( "1" ); - m_textFoot.SetDiffuse( colorNotes ); - - m_textDifficultyNumber.SetText( "?" ); - m_textDifficultyNumber.SetDiffuse( colorNotes ); -} - -void CourseContentDisplay::LoadFromMeterRange( int iNum, int iLow, int iHigh ) -{ - m_textNumber.SetText( ssprintf("%d", iNum) ); - - RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be? - RageColor colorNotes = RageColor(1,1,1,1); - - m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" ); - m_TextBanner.SetDiffuse( colorGroup ); - - m_textFoot.SetText( "1" ); - m_textFoot.SetDiffuse( colorNotes ); - - m_textDifficultyNumber.SetText( ssprintf("%d-%d", iLow, iHigh) ); - m_textDifficultyNumber.SetDiffuse( colorNotes ); -} - -CourseContentsFrame::CourseContentsFrame() -{ - m_iNumContents = 0; - m_quad.SetDiffuse( RageColor(0,0,0,0) ); // invisible, since we want to write only to the Zbuffer - - m_fTimeUntilScroll = 0; - m_fItemAtTopOfList = 0; - - /* These are all the same; grab the dimensions. */ - ContentsBarHeight = m_CourseContentDisplays[0].m_sprFrame.GetTexture()->GetSourceFrameHeight(); - ContentsBarWidth = m_CourseContentDisplays[0].m_sprFrame.GetTexture()->GetSourceFrameWidth(); -} - -void CourseContentsFrame::TweenInAfterChangedCourse() -{ - m_fItemAtTopOfList = 0; - m_fTimeUntilScroll = 3; - - for( int i=0; i vSongs; - vector vNotes; - vector vsModifiers; - pCourse->GetStageInfo( vSongs, vNotes, vsModifiers, GAMESTATE->GetCurrentStyleDef()->m_NotesType, false ); - - for( int i=0; iIsMysterySong(i) ) - { - Difficulty dc = pCourse->GetDifficulty(i); - int iMeterLow, iMeterHigh; - pCourse->GetMeterRange(i, iMeterLow, iMeterHigh); - - if( dc == DIFFICULTY_INVALID ) - display.LoadFromMeterRange( m_iNumContents+1, iMeterLow, iMeterHigh ); - else - display.LoadFromDifficulty( m_iNumContents+1, pCourse->GetDifficulty(i) ); - } - else - { - Song* pSong = vSongs[i]; - Notes* pNotes = vNotes[i]; - CString sModifiers = vsModifiers[i]; - display.LoadFromSongAndNotes( m_iNumContents+1, pSong, pNotes ); - } - - m_iNumContents ++; - } - - m_fItemAtTopOfList = fmodf(m_fItemAtTopOfList, float(m_iNumContents)); -} - -void CourseContentsFrame::Update( float fDeltaTime ) -{ - ActorFrame::Update( fDeltaTime ); - - if( m_fTimeUntilScroll > 0 && m_iNumContents > MAX_VISIBLE_CONTENTS) - m_fTimeUntilScroll -= fDeltaTime; - if( m_fTimeUntilScroll <= 0 ) { - m_fItemAtTopOfList += fDeltaTime; - m_fItemAtTopOfList = fmodf(m_fItemAtTopOfList, float(m_iNumContents)); - } - - for( int i=0; iEnableZBuffer(); - - // write to z buffer so that top and bottom are clipped - m_quad.SetZ( 1 ); - - RectI rectBarSize(-ContentsBarWidth/2, -ContentsBarHeight/2, - ContentsBarWidth/2, ContentsBarHeight/2); - m_quad.StretchTo( rectBarSize ); - - m_quad.SetY( (-(MAX_VISIBLE_CONTENTS-1)/2 - 1) * float(ContentsBarHeight) ); - m_quad.Draw(); - - m_quad.SetY( ((MAX_VISIBLE_CONTENTS-1)/2 + 1) * float(ContentsBarHeight) ); - m_quad.Draw(); - - int iItemToDraw = (int)m_fItemAtTopOfList; - - // HACK: Insert a little pause as a new item appears on the screen - float fRemainder = m_fItemAtTopOfList - (int)m_fItemAtTopOfList; - fRemainder = min( fRemainder*1.5f, 1 ); - - const float fY = (-fRemainder-(MAX_VISIBLE_CONTENTS-1)/2) * ContentsBarHeight; - - for( int i=0; iDisableZBuffer(); -} diff --git a/stepmania/src/CourseContentsList.cpp b/stepmania/src/CourseContentsList.cpp new file mode 100644 index 0000000000..88e58a09d3 --- /dev/null +++ b/stepmania/src/CourseContentsList.cpp @@ -0,0 +1,148 @@ +#include "global.h" +/* +----------------------------------------------------------------------------- + Class: CourseContentsList + + Desc: See header. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#include "CourseContentsList.h" +#include "RageUtil.h" +#include "GameConstantsAndTypes.h" +#include "PrefsManager.h" +#include "RageLog.h" +#include "PrefsManager.h" +#include "Course.h" +#include "SongManager.h" +#include +#include "RageDisplay.h" +#include "ThemeManager.h" +#include "Notes.h" +#include "GameState.h" +#include "StyleDef.h" + + +CourseContentsList::CourseContentsList() +{ + m_iNumContents = 0; + m_quad.SetDiffuse( RageColor(0,0,0,0) ); // invisible, since we want to write only to the Zbuffer + + m_fTimeUntilScroll = 0; + m_fItemAtTopOfList = 0; + + /* These are all the same; grab the dimensions. */ + ContentsBarHeight = m_CourseContentDisplays[0].m_sprFrame.GetTexture()->GetSourceFrameHeight(); + ContentsBarWidth = m_CourseContentDisplays[0].m_sprFrame.GetTexture()->GetSourceFrameWidth(); +} + + +void CourseContentsList::SetFromCourse( Course* pCourse ) +{ + ASSERT( pCourse != NULL ); + + m_iNumContents = 0; + + vector vSongs; + vector vNotes; + vector vsModifiers; + pCourse->GetStageInfo( vSongs, vNotes, vsModifiers, GAMESTATE->GetCurrentStyleDef()->m_NotesType, false ); + + for( int i=0; iIsMysterySong(i) ) + { + Difficulty dc = pCourse->GetDifficulty(i); + int iMeterLow, iMeterHigh; + pCourse->GetMeterRange(i, iMeterLow, iMeterHigh); + + if( dc == DIFFICULTY_INVALID ) + display.LoadFromMeterRange( m_iNumContents+1, iMeterLow, iMeterHigh, vsModifiers[i] ); + else + display.LoadFromDifficulty( m_iNumContents+1, dc, vsModifiers[i] ); + } + else + { + Song* pSong = vSongs[i]; + Notes* pNotes = vNotes[i]; + CString sModifiers = vsModifiers[i]; + display.LoadFromSongAndNotes( m_iNumContents+1, pSong, pNotes, vsModifiers[i] ); + } + + m_iNumContents ++; + } +} + +void CourseContentsList::Update( float fDeltaTime ) +{ + ActorFrame::Update( fDeltaTime ); + + if( m_fTimeUntilScroll > 0 && m_iNumContents > MAX_VISIBLE_CONTENTS) + m_fTimeUntilScroll -= fDeltaTime; + if( m_fTimeUntilScroll <= 0 ) { + m_fItemAtTopOfList += fDeltaTime; + m_fItemAtTopOfList = fmodf(m_fItemAtTopOfList, float(m_iNumContents)); + } + + for( int i=0; iEnableZBuffer(); + + // write to z buffer so that top and bottom are clipped + m_quad.SetZ( 1 ); + + RectI rectBarSize(-ContentsBarWidth/2, -ContentsBarHeight/2, + ContentsBarWidth/2, ContentsBarHeight/2); + m_quad.StretchTo( rectBarSize ); + + m_quad.SetY( (-(MAX_VISIBLE_CONTENTS-1)/2 - 1) * float(ContentsBarHeight) ); + m_quad.Draw(); + + m_quad.SetY( ((MAX_VISIBLE_CONTENTS-1)/2 + 1) * float(ContentsBarHeight) ); + m_quad.Draw(); + + int iItemToDraw = (int)m_fItemAtTopOfList; + + // HACK: Insert a little pause as a new item appears on the screen + float fRemainder = m_fItemAtTopOfList - (int)m_fItemAtTopOfList; + fRemainder = min( fRemainder*1.5f, 1 ); + + const float fY = (-fRemainder-(MAX_VISIBLE_CONTENTS-1)/2) * ContentsBarHeight; + + for( int i=0; iDisableZBuffer(); +} + +void CourseContentsList::TweenInAfterChangedCourse() +{ + m_fItemAtTopOfList = 0; + m_fTimeUntilScroll = 3; + + for( int i=0; i +#include "RageDisplay.h" +#include "ThemeManager.h" +#include "Notes.h" +#include "GameState.h" +#include "StyleDef.h" + + +#define TEXT_BANNER_X THEME->GetMetricF("CourseEntryDisplay","TextBannerX") +#define TEXT_BANNER_Y THEME->GetMetricF("CourseEntryDisplay","TextBannerY") +#define TEXT_BANNER_ZOOM THEME->GetMetricF("CourseEntryDisplay","TextBannerZoom") +#define NUMBER_X THEME->GetMetricF("CourseEntryDisplay","NumberX") +#define NUMBER_Y THEME->GetMetricF("CourseEntryDisplay","NumberY") +#define NUMBER_ZOOM THEME->GetMetricF("CourseEntryDisplay","NumberZoom") +#define FOOT_X THEME->GetMetricF("CourseEntryDisplay","FootX") +#define FOOT_Y THEME->GetMetricF("CourseEntryDisplay","FootY") +#define FOOT_ZOOM THEME->GetMetricF("CourseEntryDisplay","FootZoom") +#define DIFFICULTY_X THEME->GetMetricF("CourseEntryDisplay","DifficultyX") +#define DIFFICULTY_Y THEME->GetMetricF("CourseEntryDisplay","DifficultyY") +#define DIFFICULTY_ZOOM THEME->GetMetricF("CourseEntryDisplay","DifficultyZoom") +#define MODIFIERS_X THEME->GetMetricF("CourseEntryDisplay","ModifiersX") +#define MODIFIERS_Y THEME->GetMetricF("CourseEntryDisplay","ModifiersY") +#define MODIFIERS_ZOOM THEME->GetMetricF("CourseEntryDisplay","ModifiersZoom") +#define MODIFIERS_HORIZ_ALIGN THEME->GetMetricI("CourseEntryDisplay","ModifiersHorizAlign") + + +CourseEntryDisplay::CourseEntryDisplay() +{ + m_sprFrame.Load( THEME->GetPathTo("Graphics","select course content bar") ); + this->AddChild( &m_sprFrame ); + + m_textNumber.LoadFromFont( THEME->GetPathTo("Fonts","Header2") ); + m_textNumber.SetXY( NUMBER_X, NUMBER_Y ); + m_textNumber.TurnShadowOff(); + this->AddChild( &m_textNumber ); + + m_TextBanner.SetXY( TEXT_BANNER_X, TEXT_BANNER_Y ); + this->AddChild( &m_TextBanner ); + + m_textFoot.LoadFromTextureAndChars( THEME->GetPathTo("Graphics","select music meter 2x1"),"10" ); + m_textFoot.SetXY( FOOT_X, FOOT_Y ); + m_textFoot.TurnShadowOff(); + this->AddChild( &m_textFoot ); + + m_textDifficultyNumber.LoadFromFont( THEME->GetPathTo("Fonts","normal") ); + m_textDifficultyNumber.SetXY( DIFFICULTY_X, DIFFICULTY_Y ); + m_textDifficultyNumber.SetZoom( DIFFICULTY_ZOOM ); + m_textDifficultyNumber.TurnShadowOff(); + this->AddChild( &m_textDifficultyNumber ); + + m_textModifiers.LoadFromFont( THEME->GetPathTo("Fonts","normal") ); + m_textModifiers.SetXY( MODIFIERS_X, MODIFIERS_Y ); + m_textModifiers.SetZoom( MODIFIERS_ZOOM ); + m_textModifiers.SetHorizAlign( (Actor::HorizAlign)MODIFIERS_HORIZ_ALIGN ); + m_textModifiers.TurnShadowOff(); + this->AddChild( &m_textModifiers ); +} + + +void CourseEntryDisplay::LoadFromSongAndNotes( int iNum, Song* pSong, Notes* pNotes, CString sModifiers ) +{ + m_textNumber.SetText( ssprintf("%d", iNum) ); + + RageColor colorGroup = SONGMAN->GetSongColor( pSong ); + RageColor colorNotes = SONGMAN->GetDifficultyColor( pNotes->GetDifficulty() ); + + m_TextBanner.LoadFromSong( pSong ); + m_TextBanner.SetDiffuse( colorGroup ); + + m_textFoot.SetText( "1" ); + m_textFoot.SetDiffuse( colorNotes ); + + m_textDifficultyNumber.SetText( ssprintf("%d", pNotes->GetMeter()) ); + m_textDifficultyNumber.SetDiffuse( colorNotes ); + + m_textModifiers.SetText( sModifiers ); +} + +void CourseEntryDisplay::LoadFromDifficulty( int iNum, Difficulty dc, CString sModifiers ) +{ + m_textNumber.SetText( ssprintf("%d", iNum) ); + + RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be? + RageColor colorNotes = SONGMAN->GetDifficultyColor( dc ); + + m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" ); + m_TextBanner.SetDiffuse( colorGroup ); + + m_textFoot.SetText( "1" ); + m_textFoot.SetDiffuse( colorNotes ); + + m_textDifficultyNumber.SetText( "?" ); + m_textDifficultyNumber.SetDiffuse( colorNotes ); + + m_textModifiers.SetText( sModifiers ); +} + +void CourseEntryDisplay::LoadFromMeterRange( int iNum, int iLow, int iHigh, CString sModifiers ) +{ + m_textNumber.SetText( ssprintf("%d", iNum) ); + + RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be? + RageColor colorNotes = RageColor(1,1,1,1); + + m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" ); + m_TextBanner.SetDiffuse( colorGroup ); + + m_textFoot.SetText( "1" ); + m_textFoot.SetDiffuse( colorNotes ); + + m_textDifficultyNumber.SetText( ssprintf(iLow==iHigh?"%d":"%d-%d", iLow, iHigh) ); + m_textDifficultyNumber.SetDiffuse( colorNotes ); + + m_textModifiers.SetText( sModifiers ); +} + diff --git a/stepmania/src/CourseEntryDisplay.h b/stepmania/src/CourseEntryDisplay.h new file mode 100644 index 0000000000..9dbdf66c57 --- /dev/null +++ b/stepmania/src/CourseEntryDisplay.h @@ -0,0 +1,43 @@ +#ifndef CourseEntryDisplay_H +#define CourseEntryDisplay_H +/* +----------------------------------------------------------------------------- + Class: CourseEntryDisplay + + 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 "TextBanner.h" +#include "ActorFrame.h" +#include "Sprite.h" +#include "Quad.h" +class Course; +class Song; +struct Notes; + + +class CourseEntryDisplay : public ActorFrame +{ +public: + CourseEntryDisplay(); + + void LoadFromSongAndNotes( int iNum, Song* pSong, Notes* pNotes, CString sModifiers ); + void LoadFromDifficulty( int iNum, Difficulty dc, CString sModifiers ); + void LoadFromMeterRange( int iNum, int iLow, int iHigh, CString sModifiers ); + + Sprite m_sprFrame; + BitmapText m_textNumber; + TextBanner m_TextBanner; + BitmapText m_textFoot; + BitmapText m_textDifficultyNumber; + BitmapText m_textModifiers; +}; + + +#endif diff --git a/stepmania/src/NoteDisplay.cpp b/stepmania/src/NoteDisplay.cpp index 048756eaec..0419de158c 100644 --- a/stepmania/src/NoteDisplay.cpp +++ b/stepmania/src/NoteDisplay.cpp @@ -650,7 +650,7 @@ void NoteDisplay::DrawTap( const int iCol, const float fBeat, const bool bOnSame const float fXPos = ArrowGetXPos( m_PlayerNumber, iCol, fYPos ); const float fAlpha = ArrowGetAlpha( m_PlayerNumber, fYPos, fPercentFadeToFail ); const float fGlow = ArrowGetGlow( m_PlayerNumber, fYPos, fPercentFadeToFail ); - const float fColorScale = ArrowGetBrightness( m_PlayerNumber, fYOffset ) * SCALE(fLife,0,1,0.2f,1); + const float fColorScale = ArrowGetBrightness( m_PlayerNumber, fBeat ) * SCALE(fLife,0,1,0.2f,1); RageColor diffuse = RageColor(fColorScale,fColorScale,fColorScale,fAlpha); RageColor glow = RageColor(1,1,1,fGlow); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index d018c4d553..62ca42f189 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -522,37 +522,11 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) switch( m_ResultMode ) { case RM_ARCADE_STAGE: - switch( max_grade ) - { - case GRADE_E: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation e") ); break; - case GRADE_D: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation d") ); break; - case GRADE_C: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation c") ); break; - case GRADE_B: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation b") ); break; - case GRADE_A: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation a") ); break; - case GRADE_AA: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation aa") ); break; - case GRADE_AAA: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation aaa") ); break; - case GRADE_AAAA: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation aaaa") ); break; - case GRADE_NO_DATA: - default: - ASSERT(0); // invalid grade - } + SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation "+GradeToString(max_grade)) ); break; case RM_COURSE: case RM_ARCADE_SUMMARY: - switch( max_grade ) - { - case GRADE_E: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final e") ); break; - case GRADE_D: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final d") ); break; - case GRADE_C: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final c") ); break; - case GRADE_B: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final b") ); break; - case GRADE_A: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final a") ); break; - case GRADE_AA: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final aa") ); break; - case GRADE_AAA: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final aaa") ); break; - case GRADE_AAAA: SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final aaaa") ); break; - case GRADE_NO_DATA: - default: - ASSERT(0); // invalid grade - } + SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation final "+GradeToString(max_grade)) ); break; default: ASSERT(0); diff --git a/stepmania/src/ScreenSelectCourse.h b/stepmania/src/ScreenSelectCourse.h index a1e16edc5f..7704a2f438 100644 --- a/stepmania/src/ScreenSelectCourse.h +++ b/stepmania/src/ScreenSelectCourse.h @@ -15,7 +15,7 @@ #include "RageSound.h" #include "GameConstantsAndTypes.h" #include "MusicWheel.h" -#include "CourseContentsFrame.h" +#include "CourseContentsList.h" #include "MenuElements.h" #include "FadingBanner.h" @@ -49,7 +49,7 @@ protected: FadingBanner m_Banner; BitmapText m_textNumSongs; BitmapText m_textTime; - CourseContentsFrame m_CourseContentsFrame; + CourseContentsList m_CourseContentsFrame; Sprite m_sprHighScoreFrame[NUM_PLAYERS]; ScoreDisplayNormal m_HighScore[NUM_PLAYERS]; BitmapText m_textPlayerOptions[NUM_PLAYERS]; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 7d6024ec31..165a7d1ca5 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -635,8 +635,8 @@ void Song::GetNotes( vector& arrayAddTo, NotesType nt, Difficulty dc, in for( unsigned i=0; im_NotesType == nt ) if( dc==DIFFICULTY_INVALID || dc==m_apNotes[i]->GetDifficulty() ) - if( iMeterLow==-1 || iMeterLow>=m_apNotes[i]->GetMeter() ) - if( iMeterHigh==-1 || iMeterHigh<=m_apNotes[i]->GetMeter() ) + if( iMeterLow==-1 || iMeterLow<=m_apNotes[i]->GetMeter() ) + if( iMeterHigh==-1 || iMeterHigh>=m_apNotes[i]->GetMeter() ) if( sDescription=="" || sDescription==m_apNotes[i]->GetDescription() ) if( bIncludeAutoGen || !m_apNotes[i]->IsAutogen() ) arrayAddTo.push_back( m_apNotes[i] ); diff --git a/stepmania/src/StageStats.cpp b/stepmania/src/StageStats.cpp index 4f88024748..c80061dc64 100644 --- a/stepmania/src/StageStats.cpp +++ b/stepmania/src/StageStats.cpp @@ -74,8 +74,7 @@ Grade StageStats::GetGrade( PlayerNumber pn ) LOG->Trace( "fPercentDancePoints: %f", fPercentDancePoints ); // check for "AAAA" - if( fPercentDancePoints == 1.00f && - iTapNoteScores[pn][TNS_MARVELOUS] > 0 && + if( iTapNoteScores[pn][TNS_MARVELOUS] > 0 && iTapNoteScores[pn][TNS_PERFECT] == 0 && iTapNoteScores[pn][TNS_GREAT] == 0 && iTapNoteScores[pn][TNS_GOOD] == 0 && diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 8479866bcf..c61f14f756 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -565,12 +565,13 @@ static void GameLoop() TEXTUREMAN->Update( fDeltaTime ); - /* Important: Process input before updaing game logic, or else game logic will lag for one frame */ - HandleInputEvents( fDeltaTime ); SCREENMAN->Update( fDeltaTime ); SOUNDMAN->Update( fDeltaTime ); + /* Important: Process input AFTER updaing game logic, or input will be acting on song beat from last frame */ + HandleInputEvents( fDeltaTime ); + /* * Render */ diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index cfe4dffbb7..d8992397d7 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -57,10 +57,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /pdb:none # Begin Special Build Tool IntDir=.\../Release6 -TargetDir=\temp\stepmania +TargetDir=\stepmania\stepmania TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -92,10 +92,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # Begin Special Build Tool IntDir=.\../Debug6 -TargetDir=\temp\stepmania +TargetDir=\stepmania\stepmania TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -791,10 +791,6 @@ SOURCE=.\StepMania.RC # End Group # Begin Source File -SOURCE=.\ScreenDimensions.h -# End Source File -# Begin Source File - SOURCE=.\global.cpp !IF "$(CFG)" == "StepMania - Win32 Release" @@ -812,6 +808,10 @@ SOURCE=.\global.h # End Source File # Begin Source File +SOURCE=.\ScreenDimensions.h +# End Source File +# Begin Source File + SOURCE=.\StdString.h # End Source File # Begin Source File @@ -968,11 +968,19 @@ SOURCE=.\BPMDisplay.h # End Source File # Begin Source File -SOURCE=.\CourseContentsFrame.cpp +SOURCE=.\CourseContentsList.cpp # End Source File # Begin Source File -SOURCE=.\CourseContentsFrame.h +SOURCE=.\CourseContentsList.h +# End Source File +# Begin Source File + +SOURCE=.\CourseEntryDisplay.cpp +# End Source File +# Begin Source File + +SOURCE=.\CourseEntryDisplay.h # End Source File # Begin Source File diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 0b9c17a80a..71eef1052e 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -687,12 +687,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ - - - - @@ -702,6 +696,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ + + + + @@ -962,10 +962,16 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ RelativePath="BannerWithFrame.h"> + RelativePath="CourseContentsList.cpp"> + RelativePath="CourseContentsList.h"> + + + +