From 597977ca6889c9f7f5c6c49b335fdf9ed9778dd1 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 16 Jan 2011 11:20:46 -0600 Subject: [PATCH] preparing for new song graphics to make nearly any game's SSMusic possible (DanceManiaX is still going to be very tricky) --- src/Song.cpp | 42 +++++++++++++++++++++++++++++++++++++++++- src/Song.h | 13 ++++++++++--- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/Song.cpp b/src/Song.cpp index 3b67382842..91d189176a 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -381,7 +381,7 @@ void Song::TidyUpData() if( !m_sInstrumentTrackFile[i].empty() ) FixupPath( m_sInstrumentTrackFile[i], m_sSongDir ); FixupPath( m_sBannerFile, m_sSongDir ); - //FixupPath( m_sAlbumArtFile, m_sSongDir ); + //FixupPath( m_sJacketFile, m_sSongDir ); //FixupPath( m_sDiscFile, m_sSongDir ); FixupPath( m_sLyricsFile, m_sSongDir ); FixupPath( m_sBackgroundFile, m_sSongDir ); @@ -534,6 +534,39 @@ void Song::TidyUpData() m_sBackgroundFile = arrayPossibleBGs[0]; } + /* + if( !HasJacket() ) + { + // find an image with "jacket" or "albumart" in the filename. + vector arrayPossibleJackets; + GetImageDirListing( m_sSongDir + "jk_*", arrayPossibleJackets ); + //GetImageDirListing( m_sSongDir + "*_jk", arrayPossibleJackets ); + GetImageDirListing( m_sSongDir + "*jacket*", arrayPossibleJackets ); + GetImageDirListing( m_sSongDir + "*albumart*", arrayPossibleJackets ); + if( !arrayPossibleJackets.empty() ) + m_sBackgroundFile = arrayPossibleJackets[0]; + } + */ + + /* + if( !HasDisc() ) + { + // disc means the rectangular-style graphic. + } + */ + + /* + if( !HasCDImage() ) + { + // CD image, a la ddr 1st-3rd + // find an image with "cd" at the end of the filename. + vector arrayPossibleCDImages; + GetImageDirListing( m_sSongDir + "* CD", arrayPossibleCDImages ); + if( !arrayPossibleCDImages.empty() ) + m_sCDTFile = arrayPossibleCDImages[0]; + } + */ + if( !HasCDTitle() ) { // find an image with "cdtitle" in the file name @@ -578,6 +611,8 @@ void Song::TidyUpData() if( HasCDTitle() && stricmp(m_sCDTitleFile, arrayImages[i])==0 ) continue; // skip + // todo: add checks for Jacket, Disc, and CDImage -aj + RString sPath = m_sSongDir + arrayImages[i]; // We only care about the dimensions. @@ -639,6 +674,8 @@ void Song::TidyUpData() m_sCDTitleFile = arrayImages[i]; continue; } + + // todo: add checks for Jacket, Disc, and CDImage -aj } // These will be written to cache, for Song::LoadFromSongDir to use later. @@ -1101,6 +1138,7 @@ bool Song::HasBGChanges() const return false; } bool Song::HasAttacks() const {return !m_Attacks.empty(); } +// todo: add checks for Jacket, Disc, and CDImage -aj const vector &Song::GetBackgroundChanges( BackgroundLayer bl ) const { @@ -1180,6 +1218,8 @@ RString Song::GetBackgroundPath() const return GetSongAssetPath( m_sBackgroundFile, m_sSongDir ); } +// todo: add checks for Jacket, Disc, and CDImage -aj + RString Song::GetDisplayMainTitle() const { if(!PREFSMAN->m_bShowNativeLanguage) return GetTranslitMainTitle(); diff --git a/src/Song.h b/src/Song.h index ae28f9cac1..9293a2217f 100644 --- a/src/Song.h +++ b/src/Song.h @@ -141,9 +141,10 @@ public: float m_fSpecifiedBPMMin; float m_fSpecifiedBPMMax; // if a range, then Min != Max - RString m_sBannerFile; // typically a 16:5 ratio graphic (e.g. 256x80) - //RString m_sAlbumArtFile; // typically square (e.g. 256x256) - //RString m_sDiscFile; // typically rectangular (e.g. 256x192) + RString m_sBannerFile; // typically a 16:5 ratio graphic (e.g. 256x80) + //RString m_sJacketFile; // typically square (e.g. 192x192, 256x256) + //RString m_sDiscFile; // rectangular (e.g. 256x192 [Pump], 200x150 [MGD3]) + //RString m_sCDFile; // square (e.g. 128x128 [DDR 3rd]) RString m_sLyricsFile; RString m_sBackgroundFile; RString m_sCDTitleFile; @@ -154,6 +155,9 @@ public: RString GetMusicPath() const; RString GetInstrumentTrackPath( InstrumentTrack it ) const; RString GetBannerPath() const; + //RString GetJacketPath() const; + //RString GetDiscPath() const; + //RString GetCDImagePath() const; RString GetLyricsPath() const; RString GetBackgroundPath() const; RString GetCDTitlePath() const; @@ -165,6 +169,9 @@ public: bool HasInstrumentTrack( InstrumentTrack it ) const; bool HasBanner() const; bool HasBackground() const; + //bool HasJacket() const; + //bool HasDisc() const; + //bool HasCDImage() const; bool HasCDTitle() const; bool HasMovieBackground() const; bool HasBGChanges() const;