diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index de16e4a8a8..e0deaa6132 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -40,6 +40,7 @@ Actor::Actor() if( PREFS ) m_bShadow = PREFS->m_GraphicOptions.m_bShadows; else m_bShadow = true; + m_fShadowLength = 5; m_bBlendAdd = false; } diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index f8d57141cc..b4a844f72d 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -160,6 +160,7 @@ public: // other properties void TurnShadowOn() { m_bShadow = true; }; void TurnShadowOff() { m_bShadow = false; }; + void SetShadowLength( const float fLength ) { m_fShadowLength = fLength; }; void SetBlendModeAdd() { m_bBlendAdd = true; }; void SetBlendModeNormal() { m_bBlendAdd = false; }; @@ -268,6 +269,7 @@ protected: // other properties // bool m_bShadow; + float m_fShadowLength; bool m_bBlendAdd; }; diff --git a/stepmania/src/BPMDisplay.cpp b/stepmania/src/BPMDisplay.cpp index e33173649c..f507c5c02c 100644 --- a/stepmania/src/BPMDisplay.cpp +++ b/stepmania/src/BPMDisplay.cpp @@ -26,17 +26,21 @@ BPMDisplay::BPMDisplay() m_rectFrame.SetZoomX( 120 ); m_rectFrame.SetZoomY( 40 ); - m_textBPM.Load( THEME->GetPathTo(FONT_LCD_NUMBERS) ); + m_textBPM.Load( THEME->GetPathTo(FONT_BOLD) ); + m_textBPM.TurnShadowOff(); m_textBPM.SetXY( CENTER_X, SCREEN_HEIGHT - 50 ); //m_textBPM.SetSequence( ssprintf("999") ); - m_textBPM.SetXY( -30, 0 ); - m_textBPM.SetZoom( 0.7f ); + m_textBPM.SetXY( -23, 0 ); + m_textBPM.SetZoom( 1.0f ); m_textBPM.SetDiffuseColorTopEdge( D3DXCOLOR(1,1,0,1) ); // yellow m_textBPM.SetDiffuseColorBottomEdge( D3DXCOLOR(1,0.5f,0,1) ); // orange - m_textLabel.Load( THEME->GetPathTo(FONT_FUTURISTIC) ); - m_textLabel.SetXY( 54, 10 ); + m_textLabel.Load( THEME->GetPathTo(FONT_BOLD) ); + m_textLabel.TurnShadowOff(); + m_textLabel.SetXY( 34, 2 ); m_textLabel.SetText( "BPM" ); + m_textLabel.SetZoom( 0.7f ); + m_textLabel.SetZoomX( 0.5f ); m_textLabel.SetDiffuseColorTopEdge( D3DXCOLOR(1,1,0,1) ); // yellow m_textLabel.SetDiffuseColorBottomEdge( D3DXCOLOR(1,0.5f,0,1) ); // orange diff --git a/stepmania/src/Banner.cpp b/stepmania/src/Banner.cpp index 1c139f9bb2..e970099592 100644 --- a/stepmania/src/Banner.cpp +++ b/stepmania/src/Banner.cpp @@ -19,6 +19,8 @@ bool Banner::LoadFromSong( Song* pSong ) // NULL means no song { + Sprite::TurnShadowOff(); + if( pSong == NULL ) Banner::Load( THEME->GetPathTo(GRAPHIC_FALLBACK_BANNER), TEXTURE_HINT_NOMIPMAPS ); else if( pSong->HasBanner() ) Banner::Load( pSong->GetBannerPath(), TEXTURE_HINT_NOMIPMAPS ); else if( pSong->HasBackground() ) Banner::Load( pSong->GetBackgroundPath(), TEXTURE_HINT_NOMIPMAPS ); @@ -37,9 +39,7 @@ bool Banner::Load( const CString &sFilePath, DWORD dwHints, bool bForceReload ) void Banner::CropToRightSize() { - Sprite::TurnShadowOff(); - - int iSourceWidth = m_pTexture->GetSourceWidth(); + int iSourceWidth = m_pTexture->GetSourceWidth(); int iSourceHeight = m_pTexture->GetSourceHeight(); // save the original X&Y. We're going to resore them later. @@ -54,14 +54,23 @@ void Banner::CropToRightSize() 0.98f, 0.22f, // bottom right 0.78f, 0.02f, // top right }; - SetCustomImageCoords( fCustomImageCoords ); + Sprite::SetCustomImageCoords( fCustomImageCoords ); SetWidth( BANNER_WIDTH ); SetHeight( BANNER_HEIGHT ); SetZoom( 1 ); } - else // this is a normal sized banner + else if( iSourceWidth * 2 > iSourceHeight ) { + Sprite::StopUsingCustomCoords(); + Sprite::StretchTo( CRect(0, 0, + (int)BANNER_WIDTH, + (int)BANNER_HEIGHT ) + ); + } + else // this is probably a background graphic or something not intended to be a banner + { + Sprite::StopUsingCustomCoords(); // first find the correct zoom Sprite::ScaleToCover( CRect(0, 0, diff --git a/stepmania/src/Banner.h b/stepmania/src/Banner.h index e4e57bc6d9..6772720d49 100644 --- a/stepmania/src/Banner.h +++ b/stepmania/src/Banner.h @@ -16,8 +16,8 @@ #include "Song.h" -const float BANNER_WIDTH = 250; -const float BANNER_HEIGHT = 100; +const float BANNER_WIDTH = 253; +const float BANNER_HEIGHT = 94; class Banner : public Sprite diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index cb73a2f918..bcf7fa553c 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -54,8 +54,11 @@ bool BitmapText::Load( const CString &sFontFilePath ) -void BitmapText::SetText( const CString &sText ) +void BitmapText::SetText( CString sText ) { + if( m_pFont->m_bCapitalsOnly ) + sText.MakeUpper(); + // // save the string and crop if necessary // @@ -258,7 +261,7 @@ void BitmapText::RenderPrimitives() if( m_bShadow ) { SCREEN->PushMatrix(); - SCREEN->Translate( 5, 5, 0 ); // shift by 5 units + SCREEN->TranslateLocal( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units pVB->Lock( 0, 0, (BYTE**)&v, 0 ); diff --git a/stepmania/src/BitmapText.h b/stepmania/src/BitmapText.h index e9dc88b695..f584615791 100644 --- a/stepmania/src/BitmapText.h +++ b/stepmania/src/BitmapText.h @@ -30,7 +30,7 @@ public: bool Load( const CString &sFontName ); - void SetText( const CString &sText ); + void SetText( CString sText ); int GetWidestLineWidthInSourcePixels() { return m_iWidestLineWidth; }; diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index 85934a5efb..27fa2ab318 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -90,6 +90,8 @@ Font::Font( const CString &sFontFilePath ) m_iCharToFrameNo[i] = i; } + m_bCapitalsOnly = ("1" == ini.GetValue("Font", "CapitalsOnly")); + // // load character widths diff --git a/stepmania/src/Font.h b/stepmania/src/Font.h index 76a504db44..e0db8576fd 100644 --- a/stepmania/src/Font.h +++ b/stepmania/src/Font.h @@ -34,9 +34,13 @@ public: CString m_sTexturePath; RageTexture* m_pTexture; + bool m_bCapitalsOnly; int m_iCharToFrameNo[MAX_FONT_CHARS]; int m_iFrameNoToWidth[MAX_FONT_CHARS]; // in soure coordinate space + +protected: + }; diff --git a/stepmania/src/GrooveRadar.cpp b/stepmania/src/GrooveRadar.cpp new file mode 100644 index 0000000000..e21caac6c1 --- /dev/null +++ b/stepmania/src/GrooveRadar.cpp @@ -0,0 +1,28 @@ +#include "stdafx.h" +/* +----------------------------------------------------------------------------- + Class: GrooveRadar + + Desc: See header. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + +#include "RageUtil.h" + +#include "GrooveRadar.h" +#include "ThemeManager.h" +#include "RageBitmapTexture.h" + + +GrooveRadar::GrooveRadar() +{ + m_sprRadar.Load( THEME->GetPathTo(GRAPHIC_SELECT_MUSIC_RADAR) ); + this->AddActor( &m_sprRadar ); +} + +void GrooveRadar::LoadFromSong( Song* pSong ) // NULL means no song +{ + +} diff --git a/stepmania/src/GrooveRadar.h b/stepmania/src/GrooveRadar.h new file mode 100644 index 0000000000..4d9d70cc09 --- /dev/null +++ b/stepmania/src/GrooveRadar.h @@ -0,0 +1,34 @@ +/* +----------------------------------------------------------------------------- + Class: GrooveRadar + + Desc: The song's GrooveRadar displayed in SelectSong. + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + +#ifndef _GrooveRadar_H_ +#define _GrooveRadar_H_ + + +#include "ActorFrame.h" +#include "Sprite.h" +#include "Song.h" + + +class GrooveRadar : public ActorFrame +{ +public: + GrooveRadar::GrooveRadar(); + + void LoadFromSong( Song* pSong ); // NULL means no Song + +protected: + Sprite m_sprRadar; +}; + + + + +#endif \ No newline at end of file diff --git a/stepmania/src/MenuElements.cpp b/stepmania/src/MenuElements.cpp index a9056e454d..52df1432fe 100644 --- a/stepmania/src/MenuElements.cpp +++ b/stepmania/src/MenuElements.cpp @@ -55,6 +55,7 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString m_textHelp.SetText( sHelpText ); m_textHelp.SetZoom( 0.5f ); m_textHelp.SetEffectBlinking(); + m_textHelp.SetShadowLength( 2 ); m_soundSwoosh.Load( THEME->GetPathTo(SOUND_MENU_SWOOSH) ); diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 59310883fd..68e4d2318a 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -89,12 +89,12 @@ WheelItemDisplay::WheelItemDisplay() m_sprSectionBackground.Load( THEME->GetPathTo(GRAPHIC_SECTION_BACKGROUND) ); m_sprSectionBackground.SetXY( -30, 0 ); - m_textSectionName.Load( THEME->GetPathTo(FONT_OUTLINE) ); + m_textSectionName.Load( THEME->GetPathTo(FONT_BOLD) ); m_textSectionName.TurnShadowOff(); - m_textSectionName.SetHorizAlign( align_center ); + m_textSectionName.SetHorizAlign( align_left ); m_textSectionName.SetVertAlign( align_middle ); - m_textSectionName.SetXY( m_sprSectionBackground.GetX(), 0 ); - m_textSectionName.SetZoom( 1.5f ); + m_textSectionName.SetXY( m_sprSectionBackground.GetX() - m_sprSectionBackground.GetUnzoomedWidth()/2 + 10, 0 ); + m_textSectionName.SetZoom( 1.2f ); m_textSectionName.SetDiffuseColor( COLOR_SECTION_LETTER ); } @@ -123,14 +123,19 @@ void WheelItemDisplay::LoadFromWheelItemData( WheelItemData* pWID ) int iIndexSplit = m_sSectionName.Find( ' ', m_sSectionName.GetLength()/3 ); m_sSectionName.SetAt( iIndexSplit, '\n' ); - m_textSectionName.SetZoom( 0.75f ); + m_textSectionName.SetZoom( 0.6f ); m_textSectionName.SetText( m_sSectionName ); } else // this is a short name { - m_textSectionName.SetZoom( 1.5f ); + m_textSectionName.SetZoom( 1.2f ); m_textSectionName.SetText( m_sSectionName ); } + float fTextWidth, fSpriteWidth; + fTextWidth = m_textSectionName.GetWidestLineWidthInSourcePixels() * m_textSectionName.GetZoom(); + fSpriteWidth = m_sprSectionBackground.GetUnzoomedWidth() * m_sprSectionBackground.GetZoom() - 20; + if( fTextWidth > fSpriteWidth ) + m_textSectionName.SetZoomX( m_textSectionName.GetZoom() * fSpriteWidth / fTextWidth ); m_sprSectionBackground.SetDiffuseColor( m_colorTint ); break; case TYPE_MUSIC: diff --git a/stepmania/src/MusicWheel.h b/stepmania/src/MusicWheel.h index 37dd12bfad..703c2c1792 100644 --- a/stepmania/src/MusicWheel.h +++ b/stepmania/src/MusicWheel.h @@ -27,7 +27,7 @@ #include "MusicStatusDisplay.h" #include "Window.h" // for WindowMessage -const int NUM_WHEEL_ITEMS_TO_DRAW = 13; +const int NUM_WHEEL_ITEMS_TO_DRAW = 11; const float FADE_TIME = 0.5f; diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 23fef08fc2..bbc98587b8 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -103,6 +103,7 @@ void PrefsManager::ReadPrefsFromDisk() if( name_string == "TextureColor" ) m_GraphicOptions.m_iTextureColor = atoi( value_string ); if( name_string == "Shadows" ) m_GraphicOptions.m_bShadows = ( value_string == "1" ); if( name_string == "30fpsLock" ) m_GraphicOptions.m_b30fpsLock = ( value_string == "1" ); + if( name_string == "Backgrounds" ) m_GraphicOptions.m_bBackgrounds = ( value_string == "1" ); } } @@ -140,6 +141,7 @@ void PrefsManager::SavePrefsToDisk() ini.SetValue( "GraphicOptions", "TextureColor", ssprintf("%d", m_GraphicOptions.m_iTextureColor) ); ini.SetValue( "GraphicOptions", "Shadows", m_GraphicOptions.m_bShadows ? "1":"0" ); ini.SetValue( "GraphicOptions", "30fpsLock", m_GraphicOptions.m_b30fpsLock ? "1":"0" ); + ini.SetValue( "GraphicOptions", "Backgrounds", m_GraphicOptions.m_bBackgrounds ? "1":"0" ); ini.SetValue( "GameOptions", "IgnoreJoyAxes", m_GameOptions.m_bIgnoreJoyAxes ? "1":"0" ); @@ -417,4 +419,29 @@ bool PrefsManager::IsButtonDown( PlayerInput PlayerI ) } +CString PrefsManager::GetStageText() +{ + if( m_iCurrentStage == 3 ) + return "Final"; + + CString sNumberSuffix; + if( ( (m_iCurrentStage/10) % 10 ) == 1 ) // in the teens (e.g. 19, 213) + { + sNumberSuffix = "th"; + } + else // not in the teens + { + const int iLastDigit = m_iCurrentStage%10; + switch( iLastDigit ) + { + case 1: sNumberSuffix = "st"; break; + case 2: sNumberSuffix = "nd"; break; + case 3: sNumberSuffix = "rd"; break; + default:sNumberSuffix = "th"; break; + } + } + return ssprintf( "%d%s", PREFS->m_iCurrentStage, sNumberSuffix ); +} + + diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index 53950dd12b..afa61e57fb 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -38,6 +38,7 @@ public: ScoreSummary m_ScoreSummary[NUM_PLAYERS]; // for passing from Dancing to Results SongSortOrder m_SongSortOrder; // used by MusicWheel and should be saved until the app exits int m_iCurrentStage; // number of stages played +1 + CString GetStageText(); GameOptions m_GameOptions; GraphicOptions m_GraphicOptions; diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index c6fdd0d5d2..09cc1644a0 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -178,7 +178,7 @@ void Sprite::Update( float fDeltaTime ) void Sprite::RenderPrimitives() { - SCREEN->Translate( -0.5f, -0.5f, 0 ); // offset so that pixels are aligned to texels + SCREEN->TranslateLocal( -0.5f, -0.5f, 0 ); // offset so that pixels are aligned to texels if( m_pTexture == NULL ) return; @@ -264,7 +264,7 @@ void Sprite::RenderPrimitives() if( m_bShadow ) { SCREEN->PushMatrix(); - SCREEN->Translate( 5, 5, 0 ); // shift by 5 units + SCREEN->TranslateLocal( m_fShadowLength, m_fShadowLength, 0 ); // shift by 5 units pVB->Lock( 0, 0, (BYTE**)&v, 0 ); @@ -383,3 +383,8 @@ void Sprite::SetCustomImageCoords( float fImageCoords[8] ) // order: bottom left SetCustomTextureCoords( fImageCoords ); } +void Sprite::StopUsingCustomCoords() +{ + m_bUsingCustomTexCoords = false; +} + diff --git a/stepmania/src/Sprite.h b/stepmania/src/Sprite.h index 631b8796d1..f55f2bdf6c 100644 --- a/stepmania/src/Sprite.h +++ b/stepmania/src/Sprite.h @@ -30,6 +30,7 @@ public: virtual bool Load( CString sFilePath, DWORD dwHints = 0, bool bForceReload = false ) { + ASSERT( sFilePath != "" ); if( sFilePath.Right(7) == ".sprite" ) return LoadFromSpriteFile( sFilePath, dwHints, bForceReload ); else @@ -52,6 +53,7 @@ public: void SetCustomSourceRect( FRECT rectSourceCoords ); // in source pixel space void SetCustomImageRect( FRECT rectImageCoords ); // in image pixel space void SetCustomImageCoords( float fImageCoords[8] ); + void StopUsingCustomCoords(); protected: diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 3d6d8b1483..505d5572a2 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -29,7 +29,7 @@ #include "FontManager.h" #include "WindowSandbox.h" -#include "WindowMenuResults.h" +#include "WindowResults.h" #include "WindowTitleMenu.h" #include "WindowPlayerOptions.h" @@ -488,7 +488,7 @@ HRESULT CreateObjects( HWND hWnd ) //WM->SetNewWindow( new WindowLoading ); //WM->SetNewWindow( new WindowSandbox ); - //WM->SetNewWindow( new WindowMenuResults ); + //WM->SetNewWindow( new WindowResults ); //WM->SetNewWindow( new WindowPlayerOptions ); WM->SetNewWindow( new WindowTitleMenu ); diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 5021e8c5e1..0cef567492 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -144,6 +144,12 @@ + + + + @@ -204,12 +210,6 @@ - - - - @@ -231,6 +231,12 @@ + + + + @@ -546,6 +552,18 @@ + + + + + + + + diff --git a/stepmania/src/TextBanner.cpp b/stepmania/src/TextBanner.cpp index c1522799e0..c5c572154c 100644 --- a/stepmania/src/TextBanner.cpp +++ b/stepmania/src/TextBanner.cpp @@ -18,9 +18,9 @@ TextBanner::TextBanner() { - m_textTitle.Load( THEME->GetPathTo(FONT_FUTURISTIC) ); - m_textSubTitle.Load( THEME->GetPathTo(FONT_FUTURISTIC) ); - m_textArtist.Load( THEME->GetPathTo(FONT_FUTURISTIC) ); + m_textTitle.Load( THEME->GetPathTo(FONT_TEXT_BANNER) ); + m_textSubTitle.Load( THEME->GetPathTo(FONT_TEXT_BANNER) ); + m_textArtist.Load( THEME->GetPathTo(FONT_TEXT_BANNER) ); m_textTitle.SetX( -TEXT_BANNER_WIDTH/2 ); m_textSubTitle.SetX( -TEXT_BANNER_WIDTH/2 ); diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index b88ddc51dc..5cff2e322c 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -173,15 +173,12 @@ CString ThemeManager::ElementToAssetPath( ThemeElement te ) case SOUND_EDIT_CHANGE_LINE: sAssetPath = "Sounds\\edit change line"; break; case SOUND_EDIT_CHANGE_SNAP: sAssetPath = "Sounds\\edit change snap"; break; - case FONT_OUTLINE: sAssetPath = "Fonts\\Outline"; break; - case FONT_CAPITALS: sAssetPath = "Fonts\\Capitals"; break; - case FONT_NORMAL: sAssetPath = "Fonts\\Normal"; break; - case FONT_FUTURISTIC: sAssetPath = "Fonts\\Futuristic"; break; - case FONT_BOLD_NUMBERS: sAssetPath = "Fonts\\Bold Numbers"; break; - case FONT_LCD_NUMBERS: sAssetPath = "Fonts\\LCD Numbers"; break; + case FONT_BOLD: sAssetPath = "Fonts\\Bold"; break; + case FONT_COMBO_NUMBERS: sAssetPath = "Fonts\\Combo Numbers"; break; case FONT_FEET: sAssetPath = "Fonts\\Feet"; break; - case FONT_COMBO_NUMBERS: sAssetPath = "Fonts\\MAX Numbers"; break; - case FONT_SCORE_NUMBERS: sAssetPath = "Fonts\\Bold Numbers"; break; + case FONT_NORMAL: sAssetPath = "Fonts\\Normal"; break; + case FONT_SCORE_NUMBERS: sAssetPath = "Fonts\\Score Numbers"; break; + case FONT_TEXT_BANNER: sAssetPath = "Fonts\\Text Banner"; break; case ANNOUNCER_ATTRACT: sAssetPath = "Announcer\\attract"; break; case ANNOUNCER_BAD_COMMENT: sAssetPath = "Announcer\\bad comment"; break; diff --git a/stepmania/src/ThemeManager.h b/stepmania/src/ThemeManager.h index 958ddcca24..256120d02b 100644 --- a/stepmania/src/ThemeManager.h +++ b/stepmania/src/ThemeManager.h @@ -105,15 +105,12 @@ enum ThemeElement { SOUND_EDIT_CHANGE_LINE, SOUND_EDIT_CHANGE_SNAP, - FONT_OUTLINE, - FONT_CAPITALS, - FONT_NORMAL, - FONT_FUTURISTIC, - FONT_BOLD_NUMBERS, - FONT_LCD_NUMBERS, - FONT_FEET, + FONT_BOLD, FONT_COMBO_NUMBERS, + FONT_FEET, + FONT_NORMAL, FONT_SCORE_NUMBERS, + FONT_TEXT_BANNER, ANNOUNCER_ATTRACT, ANNOUNCER_BAD_COMMENT, diff --git a/stepmania/src/TransitionStarWipe.cpp b/stepmania/src/TransitionStarWipe.cpp index 03b5aedc6e..0d097787c9 100644 --- a/stepmania/src/TransitionStarWipe.cpp +++ b/stepmania/src/TransitionStarWipe.cpp @@ -37,7 +37,7 @@ void TransitionStarWipe::RenderPrimitives() return; } - float fPercentOpen = GetPercentageOpen(); + float fPercentOpen = 1-GetPercentageOpen(); /* switch( m_TransitionState ) {